diff options
| author | tmk <nobody@nowhere> | 2013-11-25 11:25:44 +0900 |
|---|---|---|
| committer | tmk <nobody@nowhere> | 2013-11-25 11:25:44 +0900 |
| commit | 04c950157407c32ef04a68a1b8180630cfb9d84c (patch) | |
| tree | 95a20a056188d07c90d5a8021de7ba0dfa55af8d | |
| parent | 4e36159be226e544dfebbe06b1955261951209a4 (diff) | |
| download | qmk_firmware-04c950157407c32ef04a68a1b8180630cfb9d84c.tar.gz qmk_firmware-04c950157407c32ef04a68a1b8180630cfb9d84c.zip | |
Fix Makfile and config.h for LUFA in ps2_usb
| -rw-r--r-- | converter/ps2_usb/Makefile | 111 | ||||
| -rw-r--r-- | converter/ps2_usb/config.h | 23 |
2 files changed, 79 insertions, 55 deletions
diff --git a/converter/ps2_usb/Makefile b/converter/ps2_usb/Makefile index 0c6442374..04bf28a00 100644 --- a/converter/ps2_usb/Makefile +++ b/converter/ps2_usb/Makefile | |||
| @@ -1,5 +1,5 @@ | |||
| 1 | # Target file name (without extension). | 1 | # Target file name (without extension). |
| 2 | TARGET = ps2_usb | 2 | TARGET = ps2_usb_lufa |
| 3 | 3 | ||
| 4 | # Directory common source filess exist | 4 | # Directory common source filess exist |
| 5 | TOP_DIR = ../.. | 5 | TOP_DIR = ../.. |
| @@ -7,69 +7,96 @@ TOP_DIR = ../.. | |||
| 7 | # Directory keyboard dependent files exist | 7 | # Directory keyboard dependent files exist |
| 8 | TARGET_DIR = . | 8 | TARGET_DIR = . |
| 9 | 9 | ||
| 10 | # project specific files | ||
| 11 | SRC = keymap_common.c \ | ||
| 12 | matrix.c \ | ||
| 13 | led.c | ||
| 14 | |||
| 15 | ifdef KEYMAP | ||
| 16 | SRC := keymap_$(KEYMAP).c $(SRC) | ||
| 17 | else | ||
| 18 | SRC := keymap_plain.c $(SRC) | ||
| 19 | endif | ||
| 20 | |||
| 21 | CONFIG_H = config.h | ||
| 10 | 22 | ||
| 11 | # MCU name, you MUST set this to match the board you are using | ||
| 12 | # type "make clean" after changing this, so all files will be rebuilt | ||
| 13 | #MCU = at90usb162 # Teensy 1.0 | ||
| 14 | MCU = atmega32u4 # Teensy 2.0 | ||
| 15 | #MCU = at90usb646 # Teensy++ 1.0 | ||
| 16 | #MCU = at90usb1286 # Teensy++ 2.0 | ||
| 17 | 23 | ||
| 24 | # MCU name | ||
| 25 | #MCU = at90usb1287 | ||
| 26 | MCU = atmega32u4 | ||
| 18 | 27 | ||
| 19 | # Processor frequency. | 28 | # Processor frequency. |
| 20 | # Normally the first thing your program should do is set the clock prescaler, | 29 | # This will define a symbol, F_CPU, in all source code files equal to the |
| 21 | # so your program will run at the correct speed. You should also set this | 30 | # processor frequency in Hz. You can then use this symbol in your source code to |
| 22 | # variable to same clock speed. The _delay_ms() macro uses this, and many | 31 | # calculate timings. Do NOT tack on a 'UL' at the end, this will be done |
| 23 | # examples use this variable to calculate timings. Do not add a "UL" here. | 32 | # automatically to create a 32-bit value in your source code. |
| 33 | # | ||
| 34 | # This will be an integer division of F_USB below, as it is sourced by | ||
| 35 | # F_USB after it has run through any CPU prescalers. Note that this value | ||
| 36 | # does not *change* the processor frequency - it should merely be updated to | ||
| 37 | # reflect the processor speed set externally so that the code can use accurate | ||
| 38 | # software delays. | ||
| 24 | F_CPU = 16000000 | 39 | F_CPU = 16000000 |
| 25 | 40 | ||
| 26 | 41 | ||
| 27 | # Build Options | ||
| 28 | # *Comment out* to disable the options. | ||
| 29 | # | 42 | # |
| 30 | MOUSEKEY_ENABLE = yes # Mouse keys | 43 | # LUFA specific |
| 31 | EXTRAKEY_ENABLE = yes # Audio control and System control | 44 | # |
| 32 | NKRO_ENABLE = yes # USB Nkey Rollover | 45 | # Target architecture (see library "Board Types" documentation). |
| 46 | ARCH = AVR8 | ||
| 47 | |||
| 48 | # Input clock frequency. | ||
| 49 | # This will define a symbol, F_USB, in all source code files equal to the | ||
| 50 | # input clock frequency (before any prescaling is performed) in Hz. This value may | ||
| 51 | # differ from F_CPU if prescaling is used on the latter, and is required as the | ||
| 52 | # raw input clock is fed directly to the PLL sections of the AVR for high speed | ||
| 53 | # clock generation for the USB and other AVR subsections. Do NOT tack on a 'UL' | ||
| 54 | # at the end, this will be done automatically to create a 32-bit value in your | ||
| 55 | # source code. | ||
| 56 | # | ||
| 57 | # If no clock division is performed on the input clock inside the AVR (via the | ||
| 58 | # CPU clock adjust registers or the clock division fuses), this will be equal to F_CPU. | ||
| 59 | F_USB = $(F_CPU) | ||
| 33 | 60 | ||
| 34 | PS2_USE_USART = yes # uses hardware USART engine for PS/2 signal receive(recomened) | 61 | # Interrupt driven control endpoint task(+60) |
| 35 | #PS2_USE_INT = yes # uses external interrupt for falling edge of PS/2 clock pin | 62 | OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT |
| 36 | #PS2_USE_BUSYWAIT = yes # uses primitive reference code | ||
| 37 | 63 | ||
| 38 | 64 | ||
| 39 | # keyboard dependent files | 65 | # Boot Section Size in *bytes* |
| 40 | SRC = keymap.c \ | 66 | # Teensy halfKay 512 |
| 41 | matrix.c \ | 67 | # Teensy++ halfKay 1024 |
| 42 | led.c | 68 | # Atmel DFU loader 4096 |
| 43 | 69 | # LUFA bootloader 4096 | |
| 70 | # USBaspLoader 2048 | ||
| 71 | OPT_DEFS += -DBOOTLOADER_SIZE=4096 | ||
| 44 | 72 | ||
| 45 | ifdef PS2_USE_USART | ||
| 46 | SRC += protocol/ps2_usart.c | ||
| 47 | OPT_DEFS += -DPS2_USE_USART | ||
| 48 | endif | ||
| 49 | ifdef PS2_USE_INT | ||
| 50 | SRC += protocol/ps2.c | ||
| 51 | OPT_DEFS += -DPS2_USE_INT | ||
| 52 | endif | ||
| 53 | ifdef PS2_USE_BUSYWAIT | ||
| 54 | SRC += protocol/ps2.c | ||
| 55 | OPT_DEFS += -DPS2_USE_BUSYWAIT | ||
| 56 | endif | ||
| 57 | 73 | ||
| 74 | # Build Options | ||
| 75 | # comment out to disable the options. | ||
| 76 | # | ||
| 77 | #BOOTMAGIC_ENABLE = yes # Virtual DIP switch configuration(+1000) | ||
| 78 | MOUSEKEY_ENABLE = yes # Mouse keys(+4700) | ||
| 79 | EXTRAKEY_ENABLE = yes # Audio control and System control(+450) | ||
| 80 | CONSOLE_ENABLE = yes # Console for debug(+400) | ||
| 81 | COMMAND_ENABLE = yes # Commands for debug and configuration | ||
| 82 | NKRO_ENABLE = yes # USB Nkey Rollover - not yet supported in LUFA | ||
| 58 | 83 | ||
| 59 | #CONFIG_H = config_pjrc_usart.h | ||
| 60 | CONFIG_H = config.h | ||
| 61 | 84 | ||
| 85 | # PS/2 Options | ||
| 86 | # | ||
| 87 | #PS2_USE_USART = yes # uses hardware USART engine for PS/2 signal receive(recomened) | ||
| 88 | #PS2_USE_INT = yes # uses external interrupt for falling edge of PS/2 clock pin | ||
| 89 | PS2_USE_BUSYWAIT = yes # uses primitive reference code | ||
| 62 | 90 | ||
| 63 | #---------------- Programming Options -------------------------- | ||
| 64 | PROGRAM_CMD = teensy_loader_cli -mmcu=$(MCU) -w -v $(TARGET).hex | ||
| 65 | 91 | ||
| 92 | # Optimize size but this may cause error "relocation truncated to fit" | ||
| 93 | #EXTRALDFLAGS = -Wl,--relax | ||
| 66 | 94 | ||
| 67 | # Search Path | 95 | # Search Path |
| 68 | VPATH += $(TARGET_DIR) | 96 | VPATH += $(TARGET_DIR) |
| 69 | VPATH += $(TOP_DIR) | 97 | VPATH += $(TOP_DIR) |
| 70 | 98 | ||
| 71 | |||
| 72 | include $(TOP_DIR)/protocol/pjrc.mk | ||
| 73 | include $(TOP_DIR)/protocol.mk | 99 | include $(TOP_DIR)/protocol.mk |
| 100 | include $(TOP_DIR)/protocol/lufa.mk | ||
| 74 | include $(TOP_DIR)/common.mk | 101 | include $(TOP_DIR)/common.mk |
| 75 | include $(TOP_DIR)/rules.mk | 102 | include $(TOP_DIR)/rules.mk |
diff --git a/converter/ps2_usb/config.h b/converter/ps2_usb/config.h index 51cd271d7..1ad2bd1b4 100644 --- a/converter/ps2_usb/config.h +++ b/converter/ps2_usb/config.h | |||
| @@ -22,6 +22,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. | |||
| 22 | 22 | ||
| 23 | #define VENDOR_ID 0xFEED | 23 | #define VENDOR_ID 0xFEED |
| 24 | #define PRODUCT_ID 0x6512 | 24 | #define PRODUCT_ID 0x6512 |
| 25 | #define DEVICE_VER 0x0001 | ||
| 25 | #define MANUFACTURER t.m.k. | 26 | #define MANUFACTURER t.m.k. |
| 26 | #define PRODUCT PS/2 keyboard converter | 27 | #define PRODUCT PS/2 keyboard converter |
| 27 | #define DESCRIPTION convert PS/2 keyboard to USB | 28 | #define DESCRIPTION convert PS/2 keyboard to USB |
| @@ -39,10 +40,6 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. | |||
| 39 | ) | 40 | ) |
| 40 | 41 | ||
| 41 | 42 | ||
| 42 | /* legacy keymap support */ | ||
| 43 | #define USE_LEGACY_KEYMAP | ||
| 44 | |||
| 45 | |||
| 46 | #ifdef PS2_USE_USART | 43 | #ifdef PS2_USE_USART |
| 47 | #if defined(__AVR_ATmega16U4__) || defined(__AVR_ATmega32U4__) | 44 | #if defined(__AVR_ATmega16U4__) || defined(__AVR_ATmega32U4__) |
| 48 | /* XCK for clock line and RXD for data line */ | 45 | /* XCK for clock line and RXD for data line */ |
| @@ -136,7 +133,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. | |||
| 136 | #define PS2_CLOCK_PORT PORTD | 133 | #define PS2_CLOCK_PORT PORTD |
| 137 | #define PS2_CLOCK_PIN PIND | 134 | #define PS2_CLOCK_PIN PIND |
| 138 | #define PS2_CLOCK_DDR DDRD | 135 | #define PS2_CLOCK_DDR DDRD |
| 139 | #define PS2_CLOCK_BIT 1 | 136 | #define PS2_CLOCK_BIT 5 |
| 140 | #define PS2_DATA_PORT PORTD | 137 | #define PS2_DATA_PORT PORTD |
| 141 | #define PS2_DATA_PIN PIND | 138 | #define PS2_DATA_PIN PIND |
| 142 | #define PS2_DATA_DDR DDRD | 139 | #define PS2_DATA_DDR DDRD |
| @@ -157,14 +154,14 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. | |||
| 157 | 154 | ||
| 158 | 155 | ||
| 159 | #ifdef PS2_USE_BUSYWAIT | 156 | #ifdef PS2_USE_BUSYWAIT |
| 160 | #define PS2_CLOCK_PORT PORTF | 157 | #define PS2_CLOCK_PORT PORTD |
| 161 | #define PS2_CLOCK_PIN PINF | 158 | #define PS2_CLOCK_PIN PIND |
| 162 | #define PS2_CLOCK_DDR DDRF | 159 | #define PS2_CLOCK_DDR DDRD |
| 163 | #define PS2_CLOCK_BIT 0 | 160 | #define PS2_CLOCK_BIT 5 |
| 164 | #define PS2_DATA_PORT PORTF | 161 | #define PS2_DATA_PORT PORTD |
| 165 | #define PS2_DATA_PIN PINF | 162 | #define PS2_DATA_PIN PIND |
| 166 | #define PS2_DATA_DDR DDRF | 163 | #define PS2_DATA_DDR DDRD |
| 167 | #define PS2_DATA_BIT 1 | 164 | #define PS2_DATA_BIT 2 |
| 168 | #endif | 165 | #endif |
| 169 | 166 | ||
| 170 | #endif | 167 | #endif |
