28 lines
521 B
C
28 lines
521 B
C
|
|
#include <stddef.h>
|
||
|
|
|
||
|
|
#include "led_effect.h"
|
||
|
|
|
||
|
|
extern struct led_effect led_effect_key_fade;
|
||
|
|
|
||
|
|
static struct led_effect *const effect_registry[LED_EFFECT_ID_COUNT] = {
|
||
|
|
[LED_EFFECT_ID_KEY_FADE] = &led_effect_key_fade,
|
||
|
|
};
|
||
|
|
|
||
|
|
const struct led_effect *led_effect_get(enum led_effect_id id)
|
||
|
|
{
|
||
|
|
if (id >= LED_EFFECT_ID_COUNT) {
|
||
|
|
return NULL;
|
||
|
|
}
|
||
|
|
|
||
|
|
return effect_registry[id];
|
||
|
|
}
|
||
|
|
|
||
|
|
struct led_effect *led_effect_get_mutable(enum led_effect_id id)
|
||
|
|
{
|
||
|
|
if (id >= LED_EFFECT_ID_COUNT) {
|
||
|
|
return NULL;
|
||
|
|
}
|
||
|
|
|
||
|
|
return effect_registry[id];
|
||
|
|
}
|