+void rgblight_effect_rgbtest(void) {
+ static uint8_t pos = 0;
+ static uint16_t last_timer = 0;
+ static uint8_t maxval = 0;
+ uint8_t g; uint8_t r; uint8_t b;
+
+ if (timer_elapsed(last_timer) < pgm_read_word(&RGBLED_RGBTEST_INTERVALS[0])) {
+ return;
+ }
+
+ if( maxval == 0 ) {
+ LED_TYPE tmp_led;
+ sethsv(0, 255, RGBLIGHT_LIMIT_VAL, &tmp_led);
+ maxval = tmp_led.r;
+ }
+ last_timer = timer_read();
+ g = r = b = 0;
+ switch( pos ) {
+ case 0: r = maxval; break;
+ case 1: g = maxval; break;
+ case 2: b = maxval; break;
+ }
+ rgblight_setrgb(r, g, b);
+ pos = (pos + 1) % 3;
+}
+
+#endif /* RGBLIGHT_ANIMATIONS */