| 1 | # |
| 2 | # Makefile for PJRC Teensy |
| 3 | # |
| 4 | |
| 5 | |
| 6 | # Target file name (without extension). |
| 7 | TARGET = x68k_usb |
| 8 | |
| 9 | # Directory common source filess exist |
| 10 | TMK_DIR = ../../tmk_core |
| 11 | |
| 12 | # Directory keyboard dependent files exist |
| 13 | TARGET_DIR = . |
| 14 | |
| 15 | # keyboard dependent files |
| 16 | SRC = keymap.c \ |
| 17 | matrix.c \ |
| 18 | led.c \ |
| 19 | protocol/serial_uart.c |
| 20 | |
| 21 | CONFIG_H = config.h |
| 22 | |
| 23 | |
| 24 | # MCU name, you MUST set this to match the board you are using |
| 25 | # type "make clean" after changing this, so all files will be rebuilt |
| 26 | #MCU = at90usb162 # Teensy 1.0 |
| 27 | #MCU = atmega32u4 # Teensy 2.0 |
| 28 | #MCU = at90usb646 # Teensy++ 1.0 |
| 29 | #MCU = at90usb1286 # Teensy++ 2.0 |
| 30 | MCU = atmega32u2 # Teensy 2.0 |
| 31 | |
| 32 | |
| 33 | # Processor frequency. |
| 34 | # Normally the first thing your program should do is set the clock prescaler, |
| 35 | # so your program will run at the correct speed. You should also set this |
| 36 | # variable to same clock speed. The _delay_ms() macro uses this, and many |
| 37 | # examples use this variable to calculate timings. Do not add a "UL" here. |
| 38 | F_CPU = 16000000 |
| 39 | |
| 40 | |
| 41 | # |
| 42 | # LUFA specific |
| 43 | # |
| 44 | # Target architecture (see library "Board Types" documentation). |
| 45 | ARCH = AVR8 |
| 46 | |
| 47 | # Input clock frequency. |
| 48 | # This will define a symbol, F_USB, in all source code files equal to the |
| 49 | # input clock frequency (before any prescaling is performed) in Hz. This value may |
| 50 | # differ from F_CPU if prescaling is used on the latter, and is required as the |
| 51 | # raw input clock is fed directly to the PLL sections of the AVR for high speed |
| 52 | # clock generation for the USB and other AVR subsections. Do NOT tack on a 'UL' |
| 53 | # at the end, this will be done automatically to create a 32-bit value in your |
| 54 | # source code. |
| 55 | # |
| 56 | # If no clock division is performed on the input clock inside the AVR (via the |
| 57 | # CPU clock adjust registers or the clock division fuses), this will be equal to F_CPU. |
| 58 | F_USB = $(F_CPU) |
| 59 | |
| 60 | # Interrupt driven control endpoint task(+60) |
| 61 | #OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT |
| 62 | |
| 63 | |
| 64 | # Boot Section Size in bytes |
| 65 | # Teensy halfKay 512 |
| 66 | # Atmel DFU loader 4096 |
| 67 | # LUFA bootloader 4096 |
| 68 | OPT_DEFS += -DBOOTLOADER_SIZE=4096 |
| 69 | |
| 70 | |
| 71 | # Build Options |
| 72 | # *Comment out* to disable the options. |
| 73 | # |
| 74 | BOOTMAGIC_ENABLE = yes # Virtual DIP switch configuration(+1000) |
| 75 | MOUSEKEY_ENABLE = yes # Mouse keys(+4700) |
| 76 | EXTRAKEY_ENABLE = yes # Audio control and System control(+450) |
| 77 | CONSOLE_ENABLE = yes # Console for debug(+400) |
| 78 | COMMAND_ENABLE = yes # Commands for debug and configuration |
| 79 | #SLEEP_LED_ENABLE = yes # Breathing sleep LED during USB suspend |
| 80 | #NKRO_ENABLE = yes # USB Nkey Rollover |
| 81 | |
| 82 | |
| 83 | |
| 84 | #---------------- Programming Options -------------------------- |
| 85 | AVRDUDE = avrdude |
| 86 | # Type: avrdude -c ? to get a full listing. |
| 87 | AVRDUDE_PROGRAMMER = avr109 |
| 88 | AVRDUDE_PORT = /dev/ttyACM0 |
| 89 | AVRDUDE_WRITE_FLASH = -U flash:w:$(TARGET).hex |
| 90 | #AVRDUDE_WRITE_EEPROM = -U eeprom:w:$(TARGET).eep |
| 91 | |
| 92 | # Uncomment the following if you want avrdude's erase cycle counter. |
| 93 | # Note that this counter needs to be initialized first using -Yn, |
| 94 | # see avrdude manual. |
| 95 | #AVRDUDE_ERASE_COUNTER = -y |
| 96 | |
| 97 | # Uncomment the following if you do /not/ wish a verification to be |
| 98 | # performed after programming the device. |
| 99 | #AVRDUDE_NO_VERIFY = -V |
| 100 | |
| 101 | # Increase verbosity level. Please use this when submitting bug |
| 102 | # reports about avrdude. See <http://savannah.nongnu.org/projects/avrdude> |
| 103 | # to submit bug reports. |
| 104 | #AVRDUDE_VERBOSE = -v -v |
| 105 | |
| 106 | AVRDUDE_FLAGS = -p $(MCU) -P $(AVRDUDE_PORT) -c $(AVRDUDE_PROGRAMMER) |
| 107 | #AVRDUDE_FLAGS = -p $(MCU) -c $(AVRDUDE_PROGRAMMER) |
| 108 | AVRDUDE_FLAGS += $(AVRDUDE_NO_VERIFY) |
| 109 | AVRDUDE_FLAGS += $(AVRDUDE_VERBOSE) |
| 110 | AVRDUDE_FLAGS += $(AVRDUDE_ERASE_COUNTER) |
| 111 | |
| 112 | PROGRAM_CMD = $(AVRDUDE) $(AVRDUDE_FLAGS) $(AVRDUDE_WRITE_FLASH) $(AVRDUDE_WRITE_EEPROM) |
| 113 | |
| 114 | |
| 115 | # Search Path |
| 116 | VPATH += $(TARGET_DIR) |
| 117 | VPATH += $(TMK_DIR) |
| 118 | |
| 119 | |
| 120 | include $(TMK_DIR)/protocol.mk |
| 121 | include $(TMK_DIR)/protocol/lufa.mk |
| 122 | include $(TMK_DIR)/common.mk |
| 123 | include $(TMK_DIR)/rules.mk |