You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

43 lines
1.2 KiB

  1. #include "stanrc85.h"
  2. static uint8_t top = 0;
  3. static uint8_t middle = 0;
  4. static uint8_t bottom = 0;
  5. static bool is_enabled = true;
  6. static bool is_rgblight_startup = true;
  7. static uint16_t rgblight_startup_loop_timer;
  8. void matrix_scan_user(void) {
  9. // Boot up "fanfare"
  10. if (is_rgblight_startup && is_keyboard_master()) {
  11. if (timer_elapsed(rgblight_startup_loop_timer) > 10) {
  12. static uint8_t counter;
  13. counter++;
  14. if (counter == 1) {
  15. top = 1;
  16. writePin(INDICATOR_PIN_0, top);
  17. wait_ms(300);
  18. top = 0;
  19. writePin(INDICATOR_PIN_0, top);
  20. }
  21. if (counter == 2) {
  22. middle = 1;
  23. writePin(INDICATOR_PIN_1, middle);
  24. wait_ms(300);
  25. middle = 0;
  26. writePin(INDICATOR_PIN_1, middle);
  27. }
  28. if (counter == 3) {
  29. bottom = 1;
  30. writePin(INDICATOR_PIN_2, bottom);
  31. wait_ms(300);
  32. bottom = 0;
  33. writePin(INDICATOR_PIN_2, bottom);
  34. }
  35. if (counter == 4) {
  36. is_enabled = is_rgblight_startup = false;
  37. }
  38. }
  39. }
  40. }