Keyboard firmwares for Atmel AVR and Cortex-M
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.

chibios.mk 6.7KB

Squashed 'tmk_core/' changes from 57d27a8..08ce4c3 08ce4c3 Add update for chibios in README 30cac1d Merge remote-tracking branch 'flabbergast-tmk_keyboard/chibios' f218a38 core: Remove unused warning. Fix tmk_keyboard/#293 3e68807 Chibios: add more guards for transmitting (fix a deadlock bug). cecc807 core: Speed up compilation d01d959 Merge remote-tracking branch 'upstream/master' into chibios 8ff12ae Merge pull request #230 from jerryen/master 3afb83d core: Add note about sudo and git 2525d5d Chibios: Update to new USB API. 2fc5cd6 Merge branch 'master' into chibios 6f5511a core: Fix variable initialize 02a15fa core: Fix variable init and header include 1833ca1 Merge pull request #292 from obones/command_warning bc9dc6f Merge pull request #294 from shayneholmes/fix-debug-message c1b891b Merge pull request #295 from doopai/master 1da837c core: Add macro commands SM(), RM() and CM() d9d5a93 Add support for storing, restoring and clearing modifiers in macros 4f371c0 core: Add dfu-programmer example to doc/build.md ba3792e core: Fix doc/build.md 4b99fed remove SERIAL_SOFT_DEBUG macro 984accb Fix typo in bootmagic debug message 67a7ea1 usb_usb: Fix for keymap editor 2fc9ae4 host_driver is only used if KEYBOARD_LOCK_ENABLE is defined a35cdea Chibios: add 'core/protocol' to the makefiles' search path. 5ed2fd6 Merge remote-tracking branch 'upstream/master' into chibios bbc4851 Do timeout when writing to CONSOLE EP queue. 2450559 Remove an errant comma trailing the KC_ERAS macro alias 8465747 Merge pull request #270 from jeffgran/single-tap-toggle a37339a Merge pull request #271 from jeffgran/default-layer-toggle 8e732f7 core: Update doc/build.md and remove other_projects.md e47dc15 Workaround for compiler warnings when console disabled. 4184c52 Add maple mini code. b555238 core: Fix rules.mk for dfu target 26dacf4 add ACTION_DEFAULT_LAYER_TOGGLE to toggle a default layer on/off 83607d9 enable TAPPING_TOGGLE=1 to work correctly bef3089 Merge branch 'master' into chibios f7a55fd core: Fix debug print of usb_hid 1402f7d core: Add keycode KC_JPY for JIS 8e3a460 Chibios: Remove the wait in the main loop. 7d41746 ChibiOS: prettify/document sleep_led code. 235cdee ChibiOS: Update infinity bootloader code to match updated ChibiOS. 807bf1e Chibios: Add breathing sleep LED on Kinetis MCUs. ba3bf7c ChibiOS: make reset request more CMSISy. bf2ffd4 Add correct chibios/bootloader_jump for infinity KB. f5e03fd Chibios/usb_main: rename a variable for clarity. 63a330c Fix drop key stroke d8f5b06 Fix report size of boot protocol. 38abb50 ChibiOS/STM32: send remote wakeup. 6725650 ChibiOS/kinetis: sending remote wakeup. 69f6e54 Chibios: use WFI in idle. WIP suspend stuff. 02f044b Move chibios/cortex selection to local Makefiles. fa59dfa Rename chibios example keyboard. 5c060de Add eeprom support for chibios/kinetis. efd0044 Move declaration of keymap_config. 7196b24 Make bootmagic.c code portable (_delay_ms -> wait_ms). 37b15b2 Add missing #include to keymap.c. 31316e3 Merge branch 'master' into chibios 166f312 Fix chibios/usb_main GET_REPORT handing. 57ac6c2 Add ARM Teensies bootloader code. 1758086 Move STM32 bootloader address config to separate .h file. 03bb026 Rename some Makefile defines. 76ba6ac NKRO fixes. 06498f8 Update chibios README. db0a4f5 Add basic sleep_led for chibios. c3f930e Move AVR specific sleep_led.c into avr. 4069494 Fix bootloader-jump compiling. 9117f7b Small updates. 269cb85 Implement jump-to-bootloader. 7e81b34 Move chibios to tool. 923a892 Make usb_main more USB_DRIVER #define independent. aa054f0 Add ChibiOS support (USB stack + support files). 1e3e282 Modularity and gcc warnings fixes. 2f60ce0 Add KEYBOARD_LOCK_ENABLE to makefile git-subtree-dir: tmk_core git-subtree-split: 08ce4c3021d2ecd446c5b9a137aded65423d241e
8 years ago
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231
  1. ##############################################################################
  2. # Build global options
  3. # NOTE: Can be overridden externally.
  4. #
  5. # Compiler options here.
  6. ifeq ($(USE_OPT),)
  7. USE_OPT = -O2 -ggdb -fomit-frame-pointer -falign-functions=16 -std=gnu99 -DPROTOCOL_CHIBIOS
  8. endif
  9. # C specific options here (added to USE_OPT).
  10. ifeq ($(USE_COPT),)
  11. USE_COPT =
  12. endif
  13. # include specific config.h?
  14. ifdef CONFIG_H
  15. USE_COPT += -include $(CONFIG_H)
  16. endif
  17. # C++ specific options here (added to USE_OPT).
  18. ifeq ($(USE_CPPOPT),)
  19. USE_CPPOPT = -fno-rtti
  20. endif
  21. # Enable this if you want the linker to remove unused code and data
  22. ifeq ($(USE_LINK_GC),)
  23. USE_LINK_GC = yes
  24. endif
  25. # Linker extra options here.
  26. ifeq ($(USE_LDOPT),)
  27. USE_LDOPT =
  28. endif
  29. # Enable this if you want link time optimizations (LTO)
  30. ifeq ($(USE_LTO),)
  31. USE_LTO = yes
  32. endif
  33. # If enabled, this option allows to compile the application in THUMB mode.
  34. ifeq ($(USE_THUMB),)
  35. USE_THUMB = yes
  36. endif
  37. # Enable this if you want to see the full log while compiling.
  38. ifeq ($(USE_VERBOSE_COMPILE),)
  39. USE_VERBOSE_COMPILE = no
  40. endif
  41. # If enabled, this option makes the build process faster by not compiling
  42. # modules not used in the current configuration.
  43. ifeq ($(USE_SMART_BUILD),)
  44. USE_SMART_BUILD = yes
  45. endif
  46. #
  47. # Build global options
  48. ##############################################################################
  49. ##############################################################################
  50. # Architecture or project specific options
  51. #
  52. # Stack size to be allocated to the Cortex-M process stack. This stack is
  53. # the stack used by the main() thread.
  54. ifeq ($(USE_PROCESS_STACKSIZE),)
  55. USE_PROCESS_STACKSIZE = 0x200
  56. endif
  57. # Stack size to the allocated to the Cortex-M main/exceptions stack. This
  58. # stack is used for processing interrupts and exceptions.
  59. ifeq ($(USE_EXCEPTIONS_STACKSIZE),)
  60. USE_EXCEPTIONS_STACKSIZE = 0x400
  61. endif
  62. #
  63. # Architecture or project specific options
  64. ##############################################################################
  65. ##############################################################################
  66. # Project, sources and paths
  67. #
  68. # Imported source files and paths
  69. CHIBIOS = $(TMK_DIR)/tool/chibios/chibios
  70. # Startup files.
  71. include $(CHIBIOS)/os/common/ports/ARMCMx/compilers/GCC/mk/startup_$(MCU_STARTUP).mk
  72. # HAL-OSAL files (optional).
  73. include $(CHIBIOS)/os/hal/hal.mk
  74. include $(CHIBIOS)/os/hal/ports/$(MCU_FAMILY)/$(MCU_SERIES)/platform.mk
  75. ifneq ("$(wildcard $(TARGET_DIR)/boards/$(BOARD))","")
  76. include $(TARGET_DIR)/boards/$(BOARD)/board.mk
  77. else
  78. include $(CHIBIOS)/os/hal/boards/$(BOARD)/board.mk
  79. endif
  80. include $(CHIBIOS)/os/hal/osal/rt/osal.mk
  81. # RTOS files (optional).
  82. include $(CHIBIOS)/os/rt/rt.mk
  83. include $(CHIBIOS)/os/rt/ports/ARMCMx/compilers/GCC/mk/port_v$(ARMV)m.mk
  84. # Other files (optional).
  85. # Define linker script file here
  86. ifneq ("$(wildcard $(TARGET_DIR)/ld/$(MCU_LDSCRIPT).ld)","")
  87. LDSCRIPT = $(TARGET_DIR)/ld/$(MCU_LDSCRIPT).ld
  88. else
  89. LDSCRIPT = $(STARTUPLD)/$(MCU_LDSCRIPT).ld
  90. endif
  91. # C sources that can be compiled in ARM or THUMB mode depending on the global
  92. # setting.
  93. CSRC = $(STARTUPSRC) \
  94. $(KERNSRC) \
  95. $(PORTSRC) \
  96. $(OSALSRC) \
  97. $(HALSRC) \
  98. $(PLATFORMSRC) \
  99. $(BOARDSRC) \
  100. $(CHIBIOS)/os/hal/lib/streams/chprintf.c \
  101. $(TMK_DIR)/protocol/chibios/usb_main.c \
  102. $(TMK_DIR)/protocol/chibios/main.c \
  103. $(SRC)
  104. # C++ sources that can be compiled in ARM or THUMB mode depending on the global
  105. # setting.
  106. CPPSRC =
  107. # C sources to be compiled in ARM mode regardless of the global setting.
  108. # NOTE: Mixing ARM and THUMB mode enables the -mthumb-interwork compiler
  109. # option that results in lower performance and larger code size.
  110. ACSRC =
  111. # C++ sources to be compiled in ARM mode regardless of the global setting.
  112. # NOTE: Mixing ARM and THUMB mode enables the -mthumb-interwork compiler
  113. # option that results in lower performance and larger code size.
  114. ACPPSRC =
  115. # C sources to be compiled in THUMB mode regardless of the global setting.
  116. # NOTE: Mixing ARM and THUMB mode enables the -mthumb-interwork compiler
  117. # option that results in lower performance and larger code size.
  118. TCSRC =
  119. # C sources to be compiled in THUMB mode regardless of the global setting.
  120. # NOTE: Mixing ARM and THUMB mode enables the -mthumb-interwork compiler
  121. # option that results in lower performance and larger code size.
  122. TCPPSRC =
  123. # List ASM source files here
  124. ASMSRC = $(STARTUPASM) $(PORTASM) $(OSALASM)
  125. INCDIR = $(STARTUPINC) $(KERNINC) $(PORTINC) $(OSALINC) \
  126. $(HALINC) $(PLATFORMINC) $(BOARDINC) $(TESTINC) \
  127. $(CHIBIOS)/os/hal/lib/streams $(CHIBIOS)/os/various \
  128. $(TMK_DIR) $(COMMON_DIR) $(TMK_DIR)/protocol/chibios \
  129. $(TMK_DIR)/protocol $(TARGET_DIR)
  130. #
  131. # Project, sources and paths
  132. ##############################################################################
  133. ##############################################################################
  134. # Compiler settings
  135. #
  136. #TRGT = arm-elf-
  137. TRGT = arm-none-eabi-
  138. CC = $(TRGT)gcc
  139. CPPC = $(TRGT)g++
  140. # Enable loading with g++ only if you need C++ runtime support.
  141. # NOTE: You can use C++ even without C++ support if you are careful. C++
  142. # runtime support makes code size explode.
  143. LD = $(TRGT)gcc
  144. #LD = $(TRGT)g++
  145. CP = $(TRGT)objcopy
  146. AS = $(TRGT)gcc -x assembler-with-cpp
  147. AR = $(TRGT)ar
  148. OD = $(TRGT)objdump
  149. SZ = $(TRGT)size
  150. HEX = $(CP) -O ihex
  151. BIN = $(CP) -O binary
  152. # ARM-specific options here
  153. AOPT =
  154. # THUMB-specific options here
  155. TOPT = -mthumb -DTHUMB
  156. # Define C warning options here
  157. CWARN = -Wall -Wextra -Wundef -Wstrict-prototypes -Wno-missing-field-initializers
  158. # Define C++ warning options here
  159. CPPWARN = -Wall -Wextra -Wundef
  160. #
  161. # Compiler settings
  162. ##############################################################################
  163. ##############################################################################
  164. # Start of user section
  165. #
  166. # List all user C define here, like -D_DEBUG=1
  167. ## Select which interfaces to include here!
  168. UDEFS = $(OPT_DEFS)
  169. # Define ASM defines here
  170. UADEFS = $(OPT_DEFS)
  171. # bootloader definitions may be used in the startup .s file
  172. ifneq ("$(wildcard $(TARGET_DIR)/bootloader_defs.h)","")
  173. UADEFS += -include $(TARGET_DIR)/bootloader_defs.h
  174. UDEFS += -include $(TARGET_DIR)/bootloader_defs.h
  175. else ifneq ("$(wildcard $(TARGET_DIR)/boards/$(BOARD)/bootloader_defs.h)","")
  176. UADEFS += -include $(TARGET_DIR)/boards/$(BOARD)/bootloader_defs.h
  177. UDEFS += -include $(TARGET_DIR)/boards/$(BOARD)/bootloader_defs.h
  178. endif
  179. # List all user directories here
  180. UINCDIR =
  181. # List the user directory to look for the libraries here
  182. ULIBDIR =
  183. # List all user libraries here
  184. ULIBS =
  185. #
  186. # End of user defines
  187. ##############################################################################
  188. RULESPATH = $(CHIBIOS)/os/common/ports/ARMCMx/compilers/GCC
  189. include $(RULESPATH)/rules.mk