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.

74 lines
1.8 KiB

  1. #include "nsrev2.h"
  2. // TODO:
  3. #ifdef SWAP_HANDS_ENABLE
  4. const keypos_t hand_swap_config[MATRIX_ROWS][MATRIX_COLS] = {
  5. {{0, 4}, {1, 4}, {2, 4}, {3, 4}, {4, 4}, {5, 4}},
  6. {{0, 5}, {1, 5}, {2, 5}, {3, 5}, {4, 5}, {5, 5}},
  7. {{0, 6}, {1, 6}, {2, 6}, {3, 6}, {4, 6}, {5, 6}},
  8. {{0, 7}, {1, 7}, {2, 7}, {3, 7}, {4, 7}, {5, 7}},
  9. {{0, 0}, {1, 0}, {2, 0}, {3, 0}, {4, 0}, {5, 0}},
  10. {{0, 1}, {1, 1}, {2, 1}, {3, 1}, {4, 1}, {5, 1}},
  11. {{0, 2}, {1, 2}, {2, 2}, {3, 2}, {4, 2}, {5, 2}},
  12. {{0, 3}, {1, 3}, {2, 3}, {3, 3}, {4, 3}, {5, 3}},
  13. };
  14. #endif
  15. static bool backlight_was_toggled = false;
  16. void suspend_power_down_kb(void) {
  17. if (is_backlight_enabled()) {
  18. backlight_disable();
  19. backlight_was_toggled = true;
  20. }
  21. }
  22. void suspend_wakeup_init_kb(void) {
  23. if (backlight_was_toggled) {
  24. backlight_enable();
  25. backlight_was_toggled = false;
  26. }
  27. }
  28. #ifdef PHYSICAL_LEDS_ENABLE
  29. void led_init_kb(void)
  30. {
  31. #ifdef NUM_LOCK_LED_PIN
  32. setPinOutput(NUM_LOCK_LED_PIN);
  33. RESET_NUM_LOCK_LED();
  34. #endif // NUM_LOCK_LED_PIN
  35. #ifdef CAPS_LOCK_LED_PIN
  36. setPinOutput(CAPS_LOCK_LED_PIN);
  37. RESET_CAPS_LOCK_LED();
  38. #endif // CAPS_LOCK_LED_PIN
  39. #ifdef SCROLL_LOCK_LED_PIN
  40. setPinOutput(SCROLL_LOCK_LED_PIN);
  41. RESET_SCROLL_LOCK_LED();
  42. #endif // SCROLL_LOCK_LED_PIN
  43. }
  44. #endif // PHYSICAL_LEDS_ENABLE
  45. void matrix_init_kb(void) {
  46. #ifdef PHYSICAL_LEDS_ENABLE
  47. led_init_kb();
  48. #endif // PHYSICAL_LEDS_ENABLE
  49. matrix_init_user();
  50. };
  51. #ifdef PHYSICAL_LEDS_ENABLE
  52. bool led_update_kb(led_t led_state) {
  53. bool res = led_update_user(led_state);
  54. if(res) {
  55. #ifdef NUM_LOCK_LED_PIN
  56. UPDATE_NUM_LOCK_LED();
  57. #endif // NUM_LOCK_LED_PIN
  58. #ifdef CAPS_LOCK_LED_PIN
  59. UPDATE_CAPS_LOCK_LED();
  60. #endif // CAPS_LOCK_LED_PIN
  61. #ifdef SCROLL_LOCK_LED_PIN
  62. UPDATE_SCROLL_LOCK_LED();
  63. #endif // SCROLL_LOCK_LED_PIN
  64. }
  65. return res;
  66. }
  67. #endif // PHYSICAL_LEDS_ENABLE