logo

qmk_firmware

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

rev1.c (2025B)


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