diff options
author | Leo C | 2015-06-11 17:43:28 +0200 |
---|---|---|
committer | Leo C | 2015-06-11 17:43:28 +0200 |
commit | 1157e75889d3d6d23d1e2514f401cd5b354bd149 (patch) | |
tree | edad2bcaddaec49a18a1b4bac2b813ce9e5a36bf /avr/background.c | |
parent | 8506d791786eea8ee55db5418a8f646bb2dd3a6d (diff) | |
parent | 057817cb1dc71416bc798b5cd592acfcea87efaa (diff) | |
download | z180-stamp-1157e75889d3d6d23d1e2514f401cd5b354bd149.zip |
Merge branch 'master' into cmdline_edit
Diffstat (limited to 'avr/background.c')
-rw-r--r-- | avr/background.c | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/avr/background.c b/avr/background.c index 0e1ca40..9c8b5a6 100644 --- a/avr/background.c +++ b/avr/background.c @@ -1,10 +1,16 @@ +/* + * (C) Copyright 2014 Leo C. <erbl259-lmu@yahoo.de> + * + * SPDX-License-Identifier: GPL-2.0+ + */ + #include "common.h" #include "background.h" #define BG_FUNC_MAX 5 -static struct { +static struct { bg_func fct; int param; } func_tab[BG_FUNC_MAX]; @@ -13,7 +19,7 @@ static int_fast8_t fcount; int bg_register(bg_func f, int initval) { - if (fcount < BG_FUNC_MAX) { + if (fcount < BG_FUNC_MAX) { func_tab[fcount].fct = f; func_tab[fcount].param = initval; return ++fcount - 1; @@ -27,7 +33,7 @@ int bg_setstat(int handle, int val) func_tab[handle].param = val; return 1; } - + return 0; } @@ -44,7 +50,7 @@ int bg_getstat(int handle) void bg_shed(void) { static int_fast8_t current; - + if (func_tab[current].fct) { int v = func_tab[current].fct(func_tab[current].param); func_tab[current].param = v; @@ -52,5 +58,3 @@ void bg_shed(void) if (++current >= fcount) current = 0; } - - |