#define ADC_EXT1 LPC_ADC(1)
#define ADC_EXT2 LPC_ADC(2)
+#define WS2812_NB_LEDS 12
+uint8_t ws2812_leds_data[WS2812_NB_LEDS * 3];
+struct ws2812_conf ws2812_leds = {
+ .nb_leds = WS2812_NB_LEDS,
+ .led_data = ws2812_leds_data,
+ .inverted = 0,
+};
+
/***************************************************************************** */
void system_init()
{
uprintf(UART0, "Color(%d) : %d,%d,%d.\n", led, data[2], data[3], data[4]);
#endif
- ws2812_set_pixel(led++, data[2], data[3], data[4]);
- if (led > 4) {
+ ws2812_set_pixel(&ws2812_leds, led++, data[2], data[3], data[4]);
+ if (led > WS2812_NB_LEDS) {
led = 0;
}
msleep(5);
- ws2812_send_frame(0);
+ ws2812_send_frame(&ws2812_leds, 0);
}
rf_config();
/* Led strip configuration */
- ws2812_config(&ws2812_data_out_pin);
- ws2812_clear();
+ ws2812_config(&ws2812_leds, &ws2812_data_out_pin);
+ ws2812_clear(&ws2812_leds);
/* RTC */
set_rtc_callback(&rtc_toggle_led, 0, 2);