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.

Makefile 2.5KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788
  1. # Target file name (without extension).
  2. PROJECT = ch
  3. # Directory common source files exist
  4. TMK_DIR = ../../tmk_core
  5. # Directory keyboard dependent files exist
  6. TARGET_DIR = .
  7. # project specific files
  8. SRC = matrix.c \
  9. led.c
  10. ifdef KEYMAP
  11. SRC := keymap_$(KEYMAP).c $(SRC)
  12. else
  13. SRC := keymap_plain.c $(SRC)
  14. endif
  15. CONFIG_H = config.h
  16. ## chip/board settings
  17. # - the next two should match the directories in
  18. # <chibios>/os/hal/ports/$(MCU_FAMILY)/$(MCU_SERIES)
  19. # - For Teensies, FAMILY = KINETIS and SERIES is either
  20. # KL2x (LC) or K20x (3.0,3.1,3.2).
  21. # - For Infinity KB, SERIES = K20x
  22. MCU_FAMILY = KINETIS
  23. MCU_SERIES = K20x
  24. # Linker script to use
  25. # - it should exist either in <chibios>/os/common/ports/ARMCMx/compilers/GCC/ld/
  26. # or <this_dir>/ld/
  27. # - NOTE: a custom ld script is needed for EEPROM on Teensy LC
  28. # - LDSCRIPT =
  29. # - MKL26Z64 for Teensy LC
  30. # - MK20DX128 for Teensy 3.0
  31. # - MK20DX256 for Teensy 3.1 and 3.2
  32. # - MK20DX128BLDR4 for Infinity with Kiibohd bootloader
  33. MCU_LDSCRIPT = MK20DX128BLDR4
  34. # Startup code to use
  35. # - it should exist in <chibios>/os/common/ports/ARMCMx/compilers/GCC/mk/
  36. # - STARTUP =
  37. # - kl2x for Teensy LC
  38. # - k20x5 for Teensy 3.0 and Infinity KB
  39. # - k20x7 for Teensy 3.1 and 3.2
  40. MCU_STARTUP = k20x5
  41. # Board: it should exist either in <chibios>/os/hal/boards/
  42. # or <this_dir>/boards
  43. # - BOARD =
  44. # - PJRC_TEENSY_LC for Teensy LC
  45. # - PJRC_TEENSY_3 for Teensy 3.0
  46. # - PJRC_TEENSY_3_1 for Teensy 3.1 or 3.2
  47. # - MCHCK_K20 for Infinity KB
  48. BOARD = MCHCK_K20
  49. # Cortex version
  50. # Teensy LC is cortex-m0; Teensy 3.x are cortex-m4
  51. MCU = cortex-m4
  52. # ARM version, CORTEX-M0/M1 are 6, CORTEX-M3/M4/M7 are 7
  53. # I.e. 6 for Teensy LC; 7 for Teensy 3.x
  54. ARMV = 7
  55. # Vector table for application
  56. # 0x00000000-0x00001000 area is occupied by bootlaoder.*/
  57. # The CORTEX_VTOR... is needed only for MCHCK/Infinity KB
  58. OPT_DEFS = -DCORTEX_VTOR_INIT=0x00001000
  59. # Build Options
  60. # comment out to disable the options.
  61. #
  62. BOOTMAGIC_ENABLE = yes # Virtual DIP switch configuration
  63. ## (Note that for BOOTMAGIC on Teensy LC you have to use a custom .ld script.)
  64. MOUSEKEY_ENABLE = yes # Mouse keys
  65. EXTRAKEY_ENABLE = yes # Audio control and System control
  66. CONSOLE_ENABLE = yes # Console for debug
  67. COMMAND_ENABLE = yes # Commands for debug and configuration
  68. SLEEP_LED_ENABLE = yes # Breathing sleep LED during USB suspend
  69. NKRO_ENABLE = yes # USB Nkey Rollover
  70. include $(TMK_DIR)/tool/chibios/common.mk
  71. include $(TMK_DIR)/tool/chibios/chibios.mk
  72. program: $(BUILDDIR)/$(PROJECT).bin
  73. dfu-util -D $(BUILDDIR)/$(PROJECT).bin