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.

199 lines
5.5 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. ifeq ($(strip $(API_SYSEX_ENABLE)), yes)
  22. OPT_DEFS += -DAPI_SYSEX_ENABLE
  23. SRC += $(QUANTUM_DIR)/api/api_sysex.c
  24. OPT_DEFS += -DAPI_ENABLE
  25. SRC += $(QUANTUM_DIR)/api.c
  26. MIDI_ENABLE=yes
  27. endif
  28. MUSIC_ENABLE := 0
  29. ifeq ($(strip $(AUDIO_ENABLE)), yes)
  30. OPT_DEFS += -DAUDIO_ENABLE
  31. MUSIC_ENABLE := 1
  32. SRC += $(QUANTUM_DIR)/process_keycode/process_audio.c
  33. SRC += $(QUANTUM_DIR)/process_keycode/process_clicky.c
  34. ifeq ($(PLATFORM),AVR)
  35. SRC += $(QUANTUM_DIR)/audio/audio.c
  36. else
  37. SRC += $(QUANTUM_DIR)/audio/audio_arm.c
  38. endif
  39. SRC += $(QUANTUM_DIR)/audio/voices.c
  40. SRC += $(QUANTUM_DIR)/audio/luts.c
  41. endif
  42. ifeq ($(strip $(MIDI_ENABLE)), yes)
  43. OPT_DEFS += -DMIDI_ENABLE
  44. MUSIC_ENABLE := 1
  45. SRC += $(QUANTUM_DIR)/process_keycode/process_midi.c
  46. endif
  47. ifeq ($(MUSIC_ENABLE), 1)
  48. SRC += $(QUANTUM_DIR)/process_keycode/process_music.c
  49. endif
  50. ifeq ($(strip $(COMBO_ENABLE)), yes)
  51. OPT_DEFS += -DCOMBO_ENABLE
  52. SRC += $(QUANTUM_DIR)/process_keycode/process_combo.c
  53. endif
  54. ifeq ($(strip $(STENO_ENABLE)), yes)
  55. OPT_DEFS += -DSTENO_ENABLE
  56. VIRTSER_ENABLE := yes
  57. SRC += $(QUANTUM_DIR)/process_keycode/process_steno.c
  58. endif
  59. ifeq ($(strip $(VIRTSER_ENABLE)), yes)
  60. OPT_DEFS += -DVIRTSER_ENABLE
  61. endif
  62. ifeq ($(strip $(FAUXCLICKY_ENABLE)), yes)
  63. OPT_DEFS += -DFAUXCLICKY_ENABLE
  64. SRC += $(QUANTUM_DIR)/fauxclicky.c
  65. endif
  66. ifeq ($(strip $(POINTING_DEVICE_ENABLE)), yes)
  67. OPT_DEFS += -DPOINTING_DEVICE_ENABLE
  68. OPT_DEFS += -DMOUSE_ENABLE
  69. SRC += $(QUANTUM_DIR)/pointing_device.c
  70. endif
  71. ifeq ($(strip $(UCIS_ENABLE)), yes)
  72. OPT_DEFS += -DUCIS_ENABLE
  73. UNICODE_COMMON = yes
  74. SRC += $(QUANTUM_DIR)/process_keycode/process_ucis.c
  75. endif
  76. ifeq ($(strip $(UNICODEMAP_ENABLE)), yes)
  77. OPT_DEFS += -DUNICODEMAP_ENABLE
  78. UNICODE_COMMON = yes
  79. SRC += $(QUANTUM_DIR)/process_keycode/process_unicodemap.c
  80. endif
  81. ifeq ($(strip $(UNICODE_ENABLE)), yes)
  82. OPT_DEFS += -DUNICODE_ENABLE
  83. UNICODE_COMMON = yes
  84. SRC += $(QUANTUM_DIR)/process_keycode/process_unicode.c
  85. endif
  86. ifeq ($(strip $(UNICODE_COMMON)), yes)
  87. SRC += $(QUANTUM_DIR)/process_keycode/process_unicode_common.c
  88. endif
  89. ifeq ($(strip $(RGBLIGHT_ENABLE)), yes)
  90. OPT_DEFS += -DRGBLIGHT_ENABLE
  91. SRC += $(QUANTUM_DIR)/rgblight.c
  92. CIE1931_CURVE = yes
  93. LED_BREATHING_TABLE = yes
  94. ifeq ($(strip $(RGBLIGHT_CUSTOM_DRIVER)), yes)
  95. OPT_DEFS += -DRGBLIGHT_CUSTOM_DRIVER
  96. else
  97. SRC += ws2812.c
  98. endif
  99. endif
  100. ifeq ($(strip $(TAP_DANCE_ENABLE)), yes)
  101. OPT_DEFS += -DTAP_DANCE_ENABLE
  102. SRC += $(QUANTUM_DIR)/process_keycode/process_tap_dance.c
  103. endif
  104. ifeq ($(strip $(KEY_LOCK_ENABLE)), yes)
  105. OPT_DEFS += -DKEY_LOCK_ENABLE
  106. SRC += $(QUANTUM_DIR)/process_keycode/process_key_lock.c
  107. endif
  108. ifeq ($(strip $(PRINTING_ENABLE)), yes)
  109. OPT_DEFS += -DPRINTING_ENABLE
  110. SRC += $(QUANTUM_DIR)/process_keycode/process_printer.c
  111. SRC += $(TMK_DIR)/protocol/serial_uart.c
  112. endif
  113. ifeq ($(strip $(AUTO_SHIFT_ENABLE)), yes)
  114. OPT_DEFS += -DAUTO_SHIFT_ENABLE
  115. SRC += $(QUANTUM_DIR)/process_keycode/process_auto_shift.c
  116. ifeq ($(strip $(AUTO_SHIFT_MODIFIERS)), yes)
  117. OPT_DEFS += -DAUTO_SHIFT_MODIFIERS
  118. endif
  119. endif
  120. ifeq ($(strip $(SERIAL_LINK_ENABLE)), yes)
  121. SRC += $(patsubst $(QUANTUM_PATH)/%,%,$(SERIAL_SRC))
  122. OPT_DEFS += $(SERIAL_DEFS)
  123. VAPTH += $(SERIAL_PATH)
  124. endif
  125. ifneq ($(strip $(VARIABLE_TRACE)),)
  126. SRC += $(QUANTUM_DIR)/variable_trace.c
  127. OPT_DEFS += -DNUM_TRACED_VARIABLES=$(strip $(VARIABLE_TRACE))
  128. ifneq ($(strip $(MAX_VARIABLE_TRACE_SIZE)),)
  129. OPT_DEFS += -DMAX_VARIABLE_TRACE_SIZE=$(strip $(MAX_VARIABLE_TRACE_SIZE))
  130. endif
  131. endif
  132. ifeq ($(strip $(LCD_ENABLE)), yes)
  133. CIE1931_CURVE = yes
  134. endif
  135. ifeq ($(strip $(BACKLIGHT_ENABLE)), yes)
  136. ifeq ($(strip $(VISUALIZER_ENABLE)), yes)
  137. CIE1931_CURVE = yes
  138. endif
  139. ifeq ($(strip $(BACKLIGHT_CUSTOM_DRIVER)), yes)
  140. OPT_DEFS += -DBACKLIGHT_CUSTOM_DRIVER
  141. endif
  142. endif
  143. ifeq ($(strip $(CIE1931_CURVE)), yes)
  144. OPT_DEFS += -DUSE_CIE1931_CURVE
  145. LED_TABLES = yes
  146. endif
  147. ifeq ($(strip $(LED_BREATHING_TABLE)), yes)
  148. OPT_DEFS += -DUSE_LED_BREATHING_TABLE
  149. LED_TABLES = yes
  150. endif
  151. ifeq ($(strip $(LED_TABLES)), yes)
  152. SRC += $(QUANTUM_DIR)/led_tables.c
  153. endif
  154. ifeq ($(strip $(TERMINAL_ENABLE)), yes)
  155. SRC += $(QUANTUM_DIR)/process_keycode/process_terminal.c
  156. OPT_DEFS += -DTERMINAL_ENABLE
  157. endif
  158. ifeq ($(strip $(USB_HID_ENABLE)), yes)
  159. include $(TMK_DIR)/protocol/usb_hid.mk
  160. endif
  161. QUANTUM_SRC:= \
  162. $(QUANTUM_DIR)/quantum.c \
  163. $(QUANTUM_DIR)/keymap_common.c \
  164. $(QUANTUM_DIR)/keycode_config.c \
  165. $(QUANTUM_DIR)/process_keycode/process_leader.c
  166. ifndef CUSTOM_MATRIX
  167. QUANTUM_SRC += $(QUANTUM_DIR)/matrix.c
  168. endif