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.

234 lines
6.3 KiB

Backlighting for JJ40 and underglow initialisation code (#2260) * Cleanup Mechmini keymap. Once the custom RGB function is defined, there is no need to manually handle RGB code. * Change default to KEYMAP_MIT, not KEYMAP_OFFSET * Add custom RGB code for JJ40 * Reset Mechmini advertised power draw to 500. Will have to test actual maximum power draw later. * RGB working on JJ40. * Fix: saturation increase/decrease flipped * Add new directory for my custom keymap with RGB keycodes * Swap LAlt and LGUI * Update JJ40 max power draw with measured value * Update: fun40 rules.mk to enable underglow; earlier failed Travis CI * Fix: init RGB LEDs on boot. Also added HHKB-like keymap for XD60. * Super rudimentary backlight test, init RGB LEDs on boot * Backlighting works - stays on for now * Toggling working * Now can override backlight.c functions. Problem was functions in backlight.c weren't called before due to a lack of matrix_scan_quantum() in matrix.c * Timers not working * Delete global.h * Cleanup * Compiles * Good sign: LEDs stop working again * Handle timer1 overflow * Progress: fix: forgot to init * Backlighting fully working now except breathing. * Revert keymap to original keycodes * Update XD60 keymap README * Update JJ40 keymap with backlight toggles * Breathing working just fine. * Update references * Add backlight_set() call * Cleanup code to disable backlight * Fix: does not compile * Fix: missing call to rgblight_task. * Testing with BACKLIGHT_BREATHING * Cleanup * Cleanup comments * More commenting cleanup. * Do not enable BACKLIGHT_BREATHING by default
6 years ago
  1. # Copyright 2017 Fred Sundvik
  2. #
  3. # This program is free software: you can redistribute it and/or modify
  4. # it under the terms of the GNU General Public License as published by
  5. # the Free Software Foundation, either version 2 of the License, or
  6. # (at your option) any later version.
  7. #
  8. # This program is distributed in the hope that it will be useful,
  9. # but WITHOUT ANY WARRANTY; without even the implied warranty of
  10. # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  11. # GNU General Public License for more details.
  12. #
  13. # You should have received a copy of the GNU General Public License
  14. # along with this program. If not, see <http://www.gnu.org/licenses/>.
  15. SERIAL_DIR := $(QUANTUM_DIR)/serial_link
  16. SERIAL_PATH := $(QUANTUM_PATH)/serial_link
  17. SERIAL_SRC := $(wildcard $(SERIAL_PATH)/protocol/*.c)
  18. SERIAL_SRC += $(wildcard $(SERIAL_PATH)/system/*.c)
  19. SERIAL_DEFS += -DSERIAL_LINK_ENABLE
  20. COMMON_VPATH += $(SERIAL_PATH)
  21. COMMON_VPATH += $(DRIVER_PATH)
  22. ifeq ($(PLATFORM),AVR)
  23. COMMON_VPATH += $(DRIVER_PATH)/avr
  24. else
  25. COMMON_VPATH += $(DRIVER_PATH)/arm
  26. endif
  27. ifeq ($(strip $(API_SYSEX_ENABLE)), yes)
  28. OPT_DEFS += -DAPI_SYSEX_ENABLE
  29. SRC += $(QUANTUM_DIR)/api/api_sysex.c
  30. OPT_DEFS += -DAPI_ENABLE
  31. SRC += $(QUANTUM_DIR)/api.c
  32. MIDI_ENABLE=yes
  33. endif
  34. MUSIC_ENABLE := 0
  35. ifeq ($(strip $(AUDIO_ENABLE)), yes)
  36. OPT_DEFS += -DAUDIO_ENABLE
  37. MUSIC_ENABLE := 1
  38. SRC += $(QUANTUM_DIR)/process_keycode/process_audio.c
  39. SRC += $(QUANTUM_DIR)/process_keycode/process_clicky.c
  40. ifeq ($(PLATFORM),AVR)
  41. SRC += $(QUANTUM_DIR)/audio/audio.c
  42. else
  43. SRC += $(QUANTUM_DIR)/audio/audio_arm.c
  44. endif
  45. SRC += $(QUANTUM_DIR)/audio/voices.c
  46. SRC += $(QUANTUM_DIR)/audio/luts.c
  47. endif
  48. ifeq ($(strip $(MIDI_ENABLE)), yes)
  49. OPT_DEFS += -DMIDI_ENABLE
  50. MUSIC_ENABLE := 1
  51. SRC += $(QUANTUM_DIR)/process_keycode/process_midi.c
  52. endif
  53. ifeq ($(MUSIC_ENABLE), 1)
  54. SRC += $(QUANTUM_DIR)/process_keycode/process_music.c
  55. endif
  56. ifeq ($(strip $(COMBO_ENABLE)), yes)
  57. OPT_DEFS += -DCOMBO_ENABLE
  58. SRC += $(QUANTUM_DIR)/process_keycode/process_combo.c
  59. endif
  60. ifeq ($(strip $(STENO_ENABLE)), yes)
  61. OPT_DEFS += -DSTENO_ENABLE
  62. VIRTSER_ENABLE := yes
  63. SRC += $(QUANTUM_DIR)/process_keycode/process_steno.c
  64. endif
  65. ifeq ($(strip $(VIRTSER_ENABLE)), yes)
  66. OPT_DEFS += -DVIRTSER_ENABLE
  67. endif
  68. ifeq ($(strip $(FAUXCLICKY_ENABLE)), yes)
  69. OPT_DEFS += -DFAUXCLICKY_ENABLE
  70. SRC += $(QUANTUM_DIR)/fauxclicky.c
  71. endif
  72. ifeq ($(strip $(POINTING_DEVICE_ENABLE)), yes)
  73. OPT_DEFS += -DPOINTING_DEVICE_ENABLE
  74. OPT_DEFS += -DMOUSE_ENABLE
  75. SRC += $(QUANTUM_DIR)/pointing_device.c
  76. endif
  77. ifeq ($(strip $(UCIS_ENABLE)), yes)
  78. OPT_DEFS += -DUCIS_ENABLE
  79. UNICODE_COMMON = yes
  80. SRC += $(QUANTUM_DIR)/process_keycode/process_ucis.c
  81. endif
  82. ifeq ($(strip $(UNICODEMAP_ENABLE)), yes)
  83. OPT_DEFS += -DUNICODEMAP_ENABLE
  84. UNICODE_COMMON = yes
  85. SRC += $(QUANTUM_DIR)/process_keycode/process_unicodemap.c
  86. endif
  87. ifeq ($(strip $(UNICODE_ENABLE)), yes)
  88. OPT_DEFS += -DUNICODE_ENABLE
  89. UNICODE_COMMON = yes
  90. SRC += $(QUANTUM_DIR)/process_keycode/process_unicode.c
  91. endif
  92. ifeq ($(strip $(UNICODE_COMMON)), yes)
  93. SRC += $(QUANTUM_DIR)/process_keycode/process_unicode_common.c
  94. endif
  95. ifeq ($(strip $(RGBLIGHT_ENABLE)), yes)
  96. OPT_DEFS += -DRGBLIGHT_ENABLE
  97. SRC += $(QUANTUM_DIR)/rgblight.c
  98. CIE1931_CURVE = yes
  99. LED_BREATHING_TABLE = yes
  100. ifeq ($(strip $(RGBLIGHT_CUSTOM_DRIVER)), yes)
  101. OPT_DEFS += -DRGBLIGHT_CUSTOM_DRIVER
  102. else
  103. SRC += ws2812.c
  104. endif
  105. endif
  106. ifeq ($(strip $(RGB_MATRIX_ENABLE)), yes)
  107. OPT_DEFS += -DRGB_MATRIX_ENABLE
  108. SRC += is31fl3731.c
  109. I2C_ENABLE = yes
  110. SRC += $(QUANTUM_DIR)/color.c
  111. SRC += $(QUANTUM_DIR)/rgb_matrix.c
  112. CIE1931_CURVE = yes
  113. endif
  114. ifeq ($(strip $(TAP_DANCE_ENABLE)), yes)
  115. OPT_DEFS += -DTAP_DANCE_ENABLE
  116. SRC += $(QUANTUM_DIR)/process_keycode/process_tap_dance.c
  117. endif
  118. ifeq ($(strip $(KEY_LOCK_ENABLE)), yes)
  119. OPT_DEFS += -DKEY_LOCK_ENABLE
  120. SRC += $(QUANTUM_DIR)/process_keycode/process_key_lock.c
  121. endif
  122. ifeq ($(strip $(PRINTING_ENABLE)), yes)
  123. OPT_DEFS += -DPRINTING_ENABLE
  124. SRC += $(QUANTUM_DIR)/process_keycode/process_printer.c
  125. SRC += $(TMK_DIR)/protocol/serial_uart.c
  126. endif
  127. ifeq ($(strip $(AUTO_SHIFT_ENABLE)), yes)
  128. OPT_DEFS += -DAUTO_SHIFT_ENABLE
  129. SRC += $(QUANTUM_DIR)/process_keycode/process_auto_shift.c
  130. ifeq ($(strip $(AUTO_SHIFT_MODIFIERS)), yes)
  131. OPT_DEFS += -DAUTO_SHIFT_MODIFIERS
  132. endif
  133. endif
  134. ifeq ($(strip $(SERIAL_LINK_ENABLE)), yes)
  135. SRC += $(patsubst $(QUANTUM_PATH)/%,%,$(SERIAL_SRC))
  136. OPT_DEFS += $(SERIAL_DEFS)
  137. VAPTH += $(SERIAL_PATH)
  138. endif
  139. ifneq ($(strip $(VARIABLE_TRACE)),)
  140. SRC += $(QUANTUM_DIR)/variable_trace.c
  141. OPT_DEFS += -DNUM_TRACED_VARIABLES=$(strip $(VARIABLE_TRACE))
  142. ifneq ($(strip $(MAX_VARIABLE_TRACE_SIZE)),)
  143. OPT_DEFS += -DMAX_VARIABLE_TRACE_SIZE=$(strip $(MAX_VARIABLE_TRACE_SIZE))
  144. endif
  145. endif
  146. ifeq ($(strip $(LCD_ENABLE)), yes)
  147. CIE1931_CURVE = yes
  148. endif
  149. ifeq ($(strip $(BACKLIGHT_ENABLE)), yes)
  150. ifeq ($(strip $(VISUALIZER_ENABLE)), yes)
  151. CIE1931_CURVE = yes
  152. endif
  153. ifeq ($(strip $(BACKLIGHT_CUSTOM_DRIVER)), yes)
  154. OPT_DEFS += -DBACKLIGHT_CUSTOM_DRIVER
  155. endif
  156. endif
  157. ifeq ($(strip $(CIE1931_CURVE)), yes)
  158. OPT_DEFS += -DUSE_CIE1931_CURVE
  159. LED_TABLES = yes
  160. endif
  161. ifeq ($(strip $(LED_BREATHING_TABLE)), yes)
  162. OPT_DEFS += -DUSE_LED_BREATHING_TABLE
  163. LED_TABLES = yes
  164. endif
  165. ifeq ($(strip $(LED_TABLES)), yes)
  166. SRC += $(QUANTUM_DIR)/led_tables.c
  167. endif
  168. ifeq ($(strip $(TERMINAL_ENABLE)), yes)
  169. SRC += $(QUANTUM_DIR)/process_keycode/process_terminal.c
  170. OPT_DEFS += -DTERMINAL_ENABLE
  171. endif
  172. ifeq ($(strip $(USB_HID_ENABLE)), yes)
  173. include $(TMK_DIR)/protocol/usb_hid.mk
  174. endif
  175. ifeq ($(strip $(I2C_SLAVE_ENABLE)), yes)
  176. I2C_ENABLE = yes
  177. OPT_DEFS += -DI2C_SLAVE_ENABLE
  178. endif
  179. ifeq ($(strip $(ENCODER_ENABLE)), yes)
  180. OPT_DEFS += -DENCODER_ENABLE
  181. SRC += $(QUANTUM_DIR)/encoder.c
  182. endif
  183. ifeq ($(strip $(QWIIC_KEYBOARD_ENABLE)), yes)
  184. SRC += qwiic/qwiic_keyboard.c
  185. OPT_DEFS += -DQWIIC_KEYBOARD_ENABLE
  186. endif
  187. ifeq ($(strip $(I2C_ENABLE)), yes)
  188. SRC += twi2c.c
  189. endif
  190. QUANTUM_SRC:= \
  191. $(QUANTUM_DIR)/quantum.c \
  192. $(QUANTUM_DIR)/keymap_common.c \
  193. $(QUANTUM_DIR)/keycode_config.c \
  194. $(QUANTUM_DIR)/process_keycode/process_leader.c
  195. ifndef CUSTOM_MATRIX
  196. QUANTUM_SRC += $(QUANTUM_DIR)/matrix.c
  197. endif