logo

qmk_firmware

custom branch of QMK firmware git clone https://anongit.hacktivis.me/git/qmk_firmware.git

rgb_matrix_kb.inc (924B)


  1. // Step 1.
  2. // Declare custom effects using the RGB_MATRIX_EFFECT macro
  3. // (note the lack of semicolon after the macro!)
  4. RGB_MATRIX_EFFECT(test_mode)
  5. // Step 2.
  6. // Define effects inside the `RGB_MATRIX_CUSTOM_EFFECT_IMPLS` ifdef block
  7. #ifdef RGB_MATRIX_CUSTOM_EFFECT_IMPLS
  8. // e.g: A simple effect, self-contained within a single method
  9. static bool test_mode(effect_params_t* params) {
  10. uint8_t factor = 9;
  11. switch ((g_rgb_timer & (0b11 << factor)) >> factor) {
  12. case 0: {
  13. rgb_matrix_set_color_all(150, 0, 0);
  14. break;
  15. }
  16. case 1: {
  17. rgb_matrix_set_color_all(0, 150, 0);
  18. break;
  19. }
  20. case 2: {
  21. rgb_matrix_set_color_all(0, 0, 150);
  22. break;
  23. }
  24. case 3: {
  25. rgb_matrix_set_color_all(150, 150, 150);
  26. break;
  27. }
  28. }
  29. return false;
  30. }
  31. #endif // RGB_MATRIX_CUSTOM_EFFECT_IMPLS