logo

qmk_firmware

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

v2.c (2885B)


  1. // Copyright 2022 IBNobody (@IBNobody)
  2. // SPDX-License-Identifier: GPL-2.0-or-later
  3. #include "quantum.h"
  4. #define __ NO_LED
  5. #ifdef RGB_MATRIX_ENABLE
  6. /* Under-, Per-key
  7. * ┌───┬───┬───┬───┬───┐
  8. * │ 4 │ 3 │ 2 │ 1 │ 0 │
  9. * ├───┼───┼───┼───┼───┤
  10. * │ 5 │ 6 │ 7 │ 8 │ 9 │
  11. * ├───┼───┼───┼───┼───┤
  12. * │14 │13 │12 │11 │ │
  13. * ├───┼───┼───┼───┤10 │
  14. * │15 │16 │17 │18 │ │
  15. * ├───┼───┼───┼───┼───┤
  16. * │23 │22 │21 │20 │ │
  17. * ├───┼───┴───┼───┤19 │
  18. * │24 │ 25 │26 │ │
  19. * └───┴───────┴───┴───┘
  20. *
  21. * Underglow (from top / [Esc] = top left)
  22. * ┌─────────┬─────────┐
  23. * │ │ │
  24. * │ │ │
  25. * │ 29 │ 30 │
  26. * │ │ │
  27. * │ │ │
  28. * ├─────────┼─────────┤
  29. * │ │ │
  30. * │ │ │
  31. * │ 28 │ 27 │
  32. * │ │ │
  33. * │ │ │
  34. * └─────────┴─────────┘
  35. */
  36. led_config_t g_led_config = { {
  37. // Key Matrix to LED Index
  38. // Montex v2 WS2812 are laid in a Z-shape with index 0 = top-right
  39. // Based on: https://xelus.netlify.app/guides/KLE_to_RGB_parser
  40. { 4, 3, 2, 1, 0},
  41. { 5, 6, 7, 8, 9},
  42. { 14, 13, 12, 11, 10},
  43. { 15, 16, 17, 18, __},
  44. { 23, 22, 21, 20, __},
  45. { 24, 25, 26, 19, __}
  46. }, {
  47. // LED Index to Physical Position
  48. // per-key
  49. // Based on: https://xelus.netlify.app/guides/KLE_to_RGB_parser
  50. {224,0 }, {168,0 }, {112,0 }, { 56,0 }, { 0,0 }, // top row
  51. { 0,17 }, { 56,17 }, {112,17 }, {168,17 }, {224,17 }, // num-lk & /*- (reversed)
  52. {224,35 }, {168,29 }, {112,29 }, { 56,29 }, { 0,29 }, // 789+
  53. { 0,41 }, { 56,41 }, {112,41 }, {168,41 }, // 456 (reversed)
  54. {224,58 }, {168,52 }, {112,52 }, { 56,52 }, // 123
  55. { 0,52 }, { 0,64 }, { 84,64 }, {168,64 } // 0. & enter (reversed)
  56. // underglow LEDs (positions pushed to nearest edge to match edge key colors)
  57. #ifndef ID27_DISABLE_UNDERGLOW
  58. , {224,64 }, { 0,64 },
  59. { 0,0 }, { 224,0 }
  60. #endif
  61. }, {
  62. // LED Index to Flag
  63. // LED_FLAG_MODIFIER 0x01, LED_FLAG_UNDERGLOW 0x02, LED_FLAG_KEYLIGHT 0x04, LED_FLAG_INDICATOR 0x08
  64. // per-key
  65. 1, 1, 1, 1, 1,
  66. 4, 4, 4, 4, 4,
  67. 4, 4, 4, 4, 4,
  68. 4, 4, 4, 4,
  69. 4, 4, 4, 4,
  70. 4, 4, 4, 4
  71. // underglow
  72. #ifndef ID27_DISABLE_UNDERGLOW
  73. , 2, 2, 2, 2
  74. #endif
  75. } };
  76. #endif