/* * Created on: Jul 31, 2024 */ #include <stdint.h> #include "hsv2rgb.h" #include "led.h" #include "rand.h" static uint16_t rgb_rnd; static uint16_t rgb_work[4]; /* * */ static void rgb_0_nothing(uint8_t tick) { rgb[0] = rgb[1] = rgb[2] = 0; } /* * rainbow puke */ static void rgb_1_rainbow(uint8_t tick) { } /* * static color with bright flickers */ static void rgb_2_candle(uint8_t tick) { } /* * alternate between two colors */ static void rgb_3_alternate(uint8_t tick) { } void (*ledprog_rgb[4])(uint8_t) = { rgb_0_nothing, rgb_1_rainbow, rgb_2_candle, rgb_3_alternate }; void ledprog_rgb_init() { uint8_t i; rgb_rnd = prng_get16(); // global program initialization for (i = 0; i < 4; i++) { rgb_work[i] = 0; } }