+/*
+ * (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];
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;
func_tab[handle].param = val;
return 1;
}
-
+
return 0;
}
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;
if (++current >= fcount)
current = 0;
}
-
-