local_features.mk 3.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798
  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. KEYBOARD_LOCAL_FEATURES_MK :=
  8. -include $(strip $(HELIX_TOP_DIR)/rev2/override_helix_options.mk) ## File dedicated to maintenance
  9. # Parse 'HELIX=xx,yy,zz' option
  10. ifneq ($(strip $(HELIX)),)
  11. # make HELIX=ios helix/pico:AKEYMAP
  12. # make HELIX=no-ani helix/pico:AKEYMAP
  13. # make HELIX=no-oled helix/pico:AKEYMAP
  14. # make HELIX=ios,no-ani,no-oled helix/pico:AKEYMAP
  15. define HELIX_OPTION_PARSE
  16. # parce 'no-ani' 'ios' 'no-oled'
  17. $(if $(SHOW_PARCE),$(info parse .$1.)) #debug
  18. $(if $(HELIX_OVERRIDE_PARSE),$(call HELIX_OVERRIDE_PARSE,$1))
  19. ifeq ($(strip $1),ios)
  20. IOS_DEVICE_ENABLE = yes
  21. endif
  22. ifneq ($(filter na no_ani no-ani,$(strip $1)),)
  23. LED_ANIMATIONS = no
  24. endif
  25. ifneq ($(filter nooled no-oled,$(strip $1)),)
  26. OLED_ENABLE = no
  27. endif
  28. ifeq ($(strip $1),oled)
  29. OLED_ENABLE = yes
  30. endif
  31. endef # end of HELIX_OPTION_PARSE
  32. COMMA=,
  33. $(eval $(foreach A_OPTION_NAME,$(subst $(COMMA), ,$(HELIX)), \
  34. $(call HELIX_OPTION_PARSE,$(A_OPTION_NAME))))
  35. SHOW_HELIX_OPTIONS = yes
  36. endif
  37. ########
  38. # convert Helix-specific options (that represent combinations of standard options)
  39. # into QMK standard options.
  40. ifneq ($(strip $(HELIX_ROWS)), 4)
  41. ifneq ($(strip $(HELIX_ROWS)), 5)
  42. $(error HELIX_ROWS = $(strip $(HELIX_ROWS)) is unexpected value)
  43. endif
  44. endif
  45. OPT_DEFS += -DHELIX_ROWS=$(strip $(HELIX_ROWS))
  46. ifeq ($(strip $(LED_BACK_ENABLE)), yes)
  47. RGBLIGHT_ENABLE = yes
  48. OPT_DEFS += -DRGBLED_BACK
  49. ifeq ($(strip $(LED_UNDERGLOW_ENABLE)), yes)
  50. $(error LED_BACK_ENABLE and LED_UNDERGLOW_ENABLE both 'yes')
  51. endif
  52. else ifeq ($(strip $(LED_UNDERGLOW_ENABLE)), yes)
  53. RGBLIGHT_ENABLE = yes
  54. endif
  55. ifeq ($(strip $(IOS_DEVICE_ENABLE)), yes)
  56. OPT_DEFS += -DIOS_DEVICE_ENABLE
  57. endif
  58. ifeq ($(strip $(LED_ANIMATIONS)), yes)
  59. OPT_DEFS += -DLED_ANIMATIONS
  60. endif
  61. ifeq ($(strip $(OLED_ENABLE)), yes)
  62. OLED_DRIVER = SSD1306
  63. ifeq ($(strip $(LOCAL_GLCDFONT)), yes)
  64. OPT_DEFS += -DOLED_FONT_H=\<helixfont.h\>
  65. else
  66. OPT_DEFS += -DOLED_FONT_H=\"common/glcdfont.c\"
  67. endif
  68. endif
  69. ifneq ($(strip $(SHOW_HELIX_OPTIONS)),)
  70. $(info Helix Spacific Build Options)
  71. $(info - OLED_ENABLE = $(OLED_ENABLE))
  72. $(info - LED_BACK_ENABLE = $(LED_BACK_ENABLE))
  73. $(info - LED_UNDERGLOW_ENABLE = $(LED_UNDERGLOW_ENABLE))
  74. $(info - LED_ANIMATIONS = $(LED_ANIMATIONS))
  75. $(info - IOS_DEVICE_ENABLE = $(IOS_DEVICE_ENABLE))
  76. $(info )
  77. $(info QMK Build Options)
  78. $(info -- SPLIT_KEYBOARD = $(SPLIT_KEYBOARD))
  79. $(info -- RGBLIGHT_ENABLE = $(RGBLIGHT_ENABLE))
  80. $(info -- OLED_DRIVER = $(OLED_DRIVER))
  81. $(info -- OLED_LOCAL_ENABLE = $(OLED_LOCAL_ENABLE))
  82. $(info -- CONSOLE_ENABLE = $(CONSOLE_ENABLE))
  83. $(info -- OPT_DEFS = $(OPT_DEFS))
  84. $(info -- LTO_ENABLE = $(LTO_ENABLE))
  85. $(info )
  86. endif