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.

38 lines
943 B

  1. #include QMK_KEYBOARD_H
  2. #include "split_util.h"
  3. #include "keymap_xrows.h"
  4. #ifdef SSD1306OLED
  5. #include "oled.h"
  6. #endif
  7. // keymaps definitions are moved to keymap_Xrows.c.
  8. #ifdef SSD1306OLED
  9. void matrix_init_keymap(void) {
  10. //SSD1306 OLED init, make sure to add #define SSD1306OLED in config.h
  11. iota_gfx_init(!has_usb()); // turns on the display
  12. }
  13. void matrix_scan_user(void) {
  14. iota_gfx_task(); // this is what updates the display continuously
  15. }
  16. #endif
  17. #ifdef RGBLIGHT_ENABLE
  18. uint32_t layer_state_set_keymap(uint32_t state) {
  19. rgblight_mode_noeeprom(RGBLIGHT_MODE_STATIC_LIGHT);
  20. switch (biton32(state)) {
  21. case _LOWER:
  22. rgblight_sethsv_noeeprom_red();
  23. break;
  24. case _RAISE:
  25. rgblight_sethsv_noeeprom_blue();
  26. break;
  27. default: // for any other layers, or the default layer
  28. rgblight_mode(RGBLIGHT_MODE_STATIC_GRADIENT + 3);
  29. rgblight_sethsv_red();
  30. break;
  31. }
  32. return state;
  33. }
  34. #endif