local_features.mk 3.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126
  1. #
  2. # local_features.mk contains post-processing rules for the Helix keyboard.
  3. #
  4. # Post-processing rules convert keyboard-specific shortcuts (that represent
  5. # combinations of standard options) into QMK standard options.
  6. #
  7. define HELIX_CUSTOMISE_MSG
  8. $(info Helix Spacific Build Options)
  9. $(info - OLED_ENABLE = $(OLED_ENABLE))
  10. $(info - LED_BACK_ENABLE = $(LED_BACK_ENABLE))
  11. $(info - LED_UNDERGLOW_ENABLE = $(LED_UNDERGLOW_ENABLE))
  12. $(info - LED_ANIMATIONS = $(LED_ANIMATIONS))
  13. $(info - IOS_DEVICE_ENABLE = $(IOS_DEVICE_ENABLE))
  14. $(info )
  15. endef
  16. ifneq ($(strip $(HELIX)),)
  17. ### Helix keyboard keymap: convenient command line option
  18. ## make HELIX=<options> helix/pico:<keymap>
  19. ## option= oled | back | under | no_ani | na | ios | verbose
  20. ## ex.
  21. ## make HELIX=oled helix/pico:<keymap>
  22. ## make HELIX=oled,back helix/pico:<keymap>
  23. ## make HELIX=oled,under helix/pico:<keymap>
  24. ## make HELIX=oled,back,na helix/pico:<keymap>
  25. ## make HELIX=oled,back,ios helix/pico:<keymap>
  26. ##
  27. ifeq ($(findstring oled,$(HELIX)), oled)
  28. OLED_ENABLE = yes
  29. endif
  30. ifeq ($(findstring back,$(HELIX)), back)
  31. LED_BACK_ENABLE = yes
  32. else ifeq ($(findstring under,$(HELIX)), under)
  33. LED_UNDERGLOW_ENABLE = yes
  34. endif
  35. ifeq ($(findstring na,$(HELIX)), na)
  36. LED_ANIMATIONS = no
  37. endif
  38. ifeq ($(findstring no_ani,$(HELIX)), no_ani)
  39. LED_ANIMATIONS = no
  40. endif
  41. ifeq ($(findstring ios,$(HELIX)), ios)
  42. IOS_DEVICE_ENABLE = yes
  43. endif
  44. ifeq ($(findstring scan,$(HELIX)), scan)
  45. # use DEBUG_MATRIX_SCAN_RATE
  46. # see docs/newbs_testing_debugging.md
  47. OPT_DEFS += -DDEBUG_MATRIX_SCAN_RATE
  48. CONSOLE_ENABLE = yes
  49. SHOW_VERBOSE_INFO = yes
  50. endif
  51. ifeq ($(findstring verbose,$(HELIX)), verbose)
  52. SHOW_VERBOSE_INFO = yes
  53. endif
  54. SHOW_HELIX_OPTIONS = yes
  55. endif
  56. ifneq ($(strip $(SPLIT_KEYBOARD)), yes)
  57. SRC += local_drivers/serial.c
  58. KEYBOARD_PATHS += $(HELIX_TOP_DIR)/local_drivers
  59. # A workaround until #7089 is merged.
  60. # serial.c must not be compiled with the -lto option.
  61. # The current LIB_SRC has a side effect with the -fno-lto option, so use it.
  62. LIB_SRC += local_drivers/serial.c
  63. CUSTOM_MATRIX = yes
  64. SRC += pico/matrix.c
  65. SRC += pico/split_util.c
  66. endif
  67. ########
  68. # convert Helix-specific options (that represent combinations of standard options)
  69. # into QMK standard options.
  70. ifeq ($(strip $(LED_BACK_ENABLE)), yes)
  71. RGBLIGHT_ENABLE = yes
  72. OPT_DEFS += -DRGBLED_BACK
  73. ifeq ($(strip $(LED_UNDERGLOW_ENABLE)), yes)
  74. $(eval $(call HELIX_CUSTOMISE_MSG))
  75. $(error LED_BACK_ENABLE and LED_UNDERGLOW_ENABLE both 'yes')
  76. endif
  77. else ifeq ($(strip $(LED_UNDERGLOW_ENABLE)), yes)
  78. RGBLIGHT_ENABLE = yes
  79. endif
  80. ifeq ($(strip $(IOS_DEVICE_ENABLE)), yes)
  81. OPT_DEFS += -DIOS_DEVICE_ENABLE
  82. endif
  83. ifeq ($(strip $(LED_ANIMATIONS)), yes)
  84. OPT_DEFS += -DLED_ANIMATIONS
  85. endif
  86. ifeq ($(strip $(OLED_ENABLE)), yes)
  87. SRC += local_drivers/i2c.c
  88. SRC += local_drivers/ssd1306.c
  89. KEYBOARD_PATHS += $(HELIX_TOP_DIR)/local_drivers
  90. OPT_DEFS += -DOLED_ENABLE
  91. ifeq ($(strip $(LOCAL_GLCDFONT)), yes)
  92. OPT_DEFS += -DLOCAL_GLCDFONT
  93. endif
  94. endif
  95. ifeq ($(strip $(AUDIO_ENABLE)),yes)
  96. ifeq ($(strip $(RGBLIGHT_ENABLE)),yes)
  97. LINK_TIME_OPTIMIZATION_ENABLE = yes
  98. endif
  99. ifeq ($(strip $(OLED_ENABLE)),yes)
  100. LINK_TIME_OPTIMIZATION_ENABLE = yes
  101. endif
  102. endif
  103. ifneq ($(strip $(SHOW_HELIX_OPTIONS)),)
  104. $(eval $(call HELIX_CUSTOMISE_MSG))
  105. ifneq ($(strip $(SHOW_VERBOSE_INFO)),)
  106. $(info -- RGBLIGHT_ENABLE = $(RGBLIGHT_ENABLE))
  107. $(info -- OLED_DRIVER_ENABLE = $(OLED_DRIVER_ENABLE))
  108. $(info -- CONSOLE_ENABLE = $(CONSOLE_ENABLE))
  109. $(info -- OPT_DEFS = $(OPT_DEFS))
  110. $(info -- LINK_TIME_OPTIMIZATION_ENABLE = $(LINK_TIME_OPTIMIZATION_ENABLE))
  111. $(info )
  112. endif
  113. endif