aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authortmk <nobody@nowhere>2012-06-30 13:26:09 +0900
committertmk <nobody@nowhere>2012-06-30 13:26:09 +0900
commit2c5d3ac76f0ef3c72aa0416aef8b775864b50eb1 (patch)
treeaf3e7bc1cdf3aaea222eff9685ae45bd12a4bd23
parentf427529a30487de45ebfbe6fbba9c290738878ab (diff)
downloadqmk_firmware-2c5d3ac76f0ef3c72aa0416aef8b775864b50eb1.tar.gz
qmk_firmware-2c5d3ac76f0ef3c72aa0416aef8b775864b50eb1.zip
Add Makefile.lufa to keyboard/hhkb and hbkb.
-rw-r--r--common/bootloader.c1
l---------[-rw-r--r--]keyboard/hbkb/Makefile57
-rw-r--r--keyboard/hbkb/Makefile.lufa119
-rw-r--r--keyboard/hbkb/Makefile.pjrc56
-rw-r--r--keyboard/hbkb/config.h3
-rw-r--r--keyboard/hhkb/Makefile.lufa119
-rw-r--r--keyboard/hhkb/Makefile.pjrc7
-rw-r--r--keyboard/hhkb/config.h (renamed from keyboard/hhkb/config_pjrc.h)5
-rw-r--r--keyboard/hhkb/matrix.c10
-rw-r--r--keyboard/macway/Makefile.lufa4
-rw-r--r--keyboard/macway/Makefile.pjrc3
-rw-r--r--protocol/pjrc.mk3
-rw-r--r--rules.mk6
13 files changed, 322 insertions, 71 deletions
diff --git a/common/bootloader.c b/common/bootloader.c
index cb971c704..e45295cd5 100644
--- a/common/bootloader.c
+++ b/common/bootloader.c
@@ -9,6 +9,7 @@
9 * http://www.fourwalledcubicle.com/files/LUFA/Doc/120219/html/_page__software_bootloader_start.html 9 * http://www.fourwalledcubicle.com/files/LUFA/Doc/120219/html/_page__software_bootloader_start.html
10 */ 10 */
11 11
12// TODO: support usbasp
12/* Boot Section Size in bytes 13/* Boot Section Size in bytes
13 * Teensy halfKay 512 14 * Teensy halfKay 512
14 * Atmel DFU loader 4096 15 * Atmel DFU loader 4096
diff --git a/keyboard/hbkb/Makefile b/keyboard/hbkb/Makefile
index 26be322e0..f00d036da 100644..120000
--- a/keyboard/hbkb/Makefile
+++ b/keyboard/hbkb/Makefile
@@ -1,56 +1 @@
1# Target file name (without extension). Makefile.lufa \ No newline at end of file
2TARGET = hbk
3
4# Directory common source filess exist
5TOP_DIR = ../..
6
7# Directory keyboard dependent files exist
8TARGET_DIR = .
9
10# keyboard dependent files
11SRC = main.c \
12 keymap.c \
13 matrix.c \
14 led.c
15
16CONFIG_H = config.h
17
18
19# MCU name, you MUST set this to match the board you are using
20# type "make clean" after changing this, so all files will be rebuilt
21#MCU = at90usb162 # Teensy 1.0
22MCU = atmega32u4 # Teensy 2.0
23#MCU = at90usb646 # Teensy++ 1.0
24#MCU = at90usb1286 # Teensy++ 2.0
25
26
27# Processor frequency.
28# Normally the first thing your program should do is set the clock prescaler,
29# so your program will run at the correct speed. You should also set this
30# variable to same clock speed. The _delay_ms() macro uses this, and many
31# examples use this variable to calculate timings. Do not add a "UL" here.
32F_CPU = 16000000
33
34
35# Build Options
36# comment out to disable the options.
37#
38MOUSEKEY_ENABLE = yes # Mouse keys
39#PS2_MOUSE_ENABLE = yes # PS/2 mouse(TrackPoint) support
40EXTRAKEY_ENABLE = yes # Audio control and System control
41#NKRO_ENABLE = yes # USB Nkey Rollover
42
43
44
45#---------------- Programming Options --------------------------
46#PROGRAM_CMD = teensy_loader_cli -mmcu=$(MCU) -w -v $(TARGET).hex
47PROGRAM_CMD = /opt/dfu-programmer-0.5.2/bin/dfu-programmer $(MCU) erase && \
48 /opt/dfu-programmer-0.5.2/bin/dfu-programmer $(MCU) flash $(TARGET).hex && \
49 /opt/dfu-programmer-0.5.2/bin/dfu-programmer $(MCU) start
50
51
52
53include $(TOP_DIR)/protocol/pjrc.mk
54include $(TOP_DIR)/protocol.mk
55include $(TOP_DIR)/common.mk
56include $(TOP_DIR)/rules.mk
diff --git a/keyboard/hbkb/Makefile.lufa b/keyboard/hbkb/Makefile.lufa
new file mode 100644
index 000000000..c73a0ca7d
--- /dev/null
+++ b/keyboard/hbkb/Makefile.lufa
@@ -0,0 +1,119 @@
1#----------------------------------------------------------------------------
2# On command line:
3#
4# make all = Make software.
5#
6# make clean = Clean out built project files.
7#
8# make coff = Convert ELF to AVR COFF.
9#
10# make extcoff = Convert ELF to AVR Extended COFF.
11#
12# make program = Download the hex file to the device.
13# Please customize your programmer settings(PROGRAM_CMD)
14#
15# make teensy = Download the hex file to the device, using teensy_loader_cli.
16# (must have teensy_loader_cli installed).
17#
18# make dfu = Download the hex file to the device, using dfu-programmer (must
19# have dfu-programmer installed).
20#
21# make flip = Download the hex file to the device, using Atmel FLIP (must
22# have Atmel FLIP installed).
23#
24# make dfu-ee = Download the eeprom file to the device, using dfu-programmer
25# (must have dfu-programmer installed).
26#
27# make flip-ee = Download the eeprom file to the device, using Atmel FLIP
28# (must have Atmel FLIP installed).
29#
30# make debug = Start either simulavr or avarice as specified for debugging,
31# with avr-gdb or avr-insight as the front end for debugging.
32#
33# make filename.s = Just compile filename.c into the assembler code only.
34#
35# make filename.i = Create a preprocessed source file for use in submitting
36# bug reports to the GCC project.
37#
38# To rebuild project do "make clean" then "make all".
39#----------------------------------------------------------------------------
40
41# Target file name (without extension).
42TARGET = hbkb_lufa
43
44# Directory common source filess exist
45TOP_DIR = ../..
46
47# Directory keyboard dependent files exist
48TARGET_DIR = .
49
50
51# List C source files here. (C dependencies are automatically generated.)
52SRC += keymap.c \
53 matrix.c \
54 led.c
55
56CONFIG_H = config.h
57
58
59# MCU name
60#MCU = at90usb1287
61MCU = atmega32u4
62
63# Processor frequency.
64# This will define a symbol, F_CPU, in all source code files equal to the
65# processor frequency in Hz. You can then use this symbol in your source code to
66# calculate timings. Do NOT tack on a 'UL' at the end, this will be done
67# automatically to create a 32-bit value in your source code.
68#
69# This will be an integer division of F_USB below, as it is sourced by
70# F_USB after it has run through any CPU prescalers. Note that this value
71# does not *change* the processor frequency - it should merely be updated to
72# reflect the processor speed set externally so that the code can use accurate
73# software delays.
74F_CPU = 16000000
75
76
77#
78# LUFA specific
79#
80# Target architecture (see library "Board Types" documentation).
81ARCH = AVR8
82
83# Input clock frequency.
84# This will define a symbol, F_USB, in all source code files equal to the
85# input clock frequency (before any prescaling is performed) in Hz. This value may
86# differ from F_CPU if prescaling is used on the latter, and is required as the
87# raw input clock is fed directly to the PLL sections of the AVR for high speed
88# clock generation for the USB and other AVR subsections. Do NOT tack on a 'UL'
89# at the end, this will be done automatically to create a 32-bit value in your
90# source code.
91#
92# If no clock division is performed on the input clock inside the AVR (via the
93# CPU clock adjust registers or the clock division fuses), this will be equal to F_CPU.
94F_USB = $(F_CPU)
95
96
97# Build Options
98# comment out to disable the options.
99#
100MOUSEKEY_ENABLE = yes # Mouse keys
101EXTRAKEY_ENABLE = yes # Audio control and System control
102#NKRO_ENABLE = yes # USB Nkey Rollover
103#PS2_MOUSE_ENABLE = yes # PS/2 mouse(TrackPoint) support
104
105
106# Boot Section Size in bytes
107# Teensy halfKay 512
108# Atmel DFU loader 4096
109# LUFA bootloader 4096
110OPT_DEFS += -DBOOT_SIZE=4096
111
112
113# Search Path
114VPATH += $(TARGET_DIR)
115VPATH += $(TOP_DIR)
116
117include $(TOP_DIR)/protocol/lufa.mk
118include $(TOP_DIR)/common.mk
119include $(TOP_DIR)/rules.mk
diff --git a/keyboard/hbkb/Makefile.pjrc b/keyboard/hbkb/Makefile.pjrc
new file mode 100644
index 000000000..159f56b44
--- /dev/null
+++ b/keyboard/hbkb/Makefile.pjrc
@@ -0,0 +1,56 @@
1# Target file name (without extension).
2TARGET = hbkb
3
4# Directory common source filess exist
5TOP_DIR = ../..
6
7# Directory keyboard dependent files exist
8TARGET_DIR = .
9
10# keyboard dependent files
11SRC = main.c \
12 keymap.c \
13 matrix.c \
14 led.c
15
16CONFIG_H = config.h
17
18
19# MCU name, you MUST set this to match the board you are using
20# type "make clean" after changing this, so all files will be rebuilt
21#MCU = at90usb162 # Teensy 1.0
22MCU = atmega32u4 # Teensy 2.0
23#MCU = at90usb646 # Teensy++ 1.0
24#MCU = at90usb1286 # Teensy++ 2.0
25
26
27# Processor frequency.
28# Normally the first thing your program should do is set the clock prescaler,
29# so your program will run at the correct speed. You should also set this
30# variable to same clock speed. The _delay_ms() macro uses this, and many
31# examples use this variable to calculate timings. Do not add a "UL" here.
32F_CPU = 16000000
33
34
35# Build Options
36# comment out to disable the options.
37#
38MOUSEKEY_ENABLE = yes # Mouse keys
39#PS2_MOUSE_ENABLE = yes # PS/2 mouse(TrackPoint) support
40EXTRAKEY_ENABLE = yes # Audio control and System control
41#NKRO_ENABLE = yes # USB Nkey Rollover
42
43
44
45#---------------- Programming Options --------------------------
46#PROGRAM_CMD = teensy_loader_cli -mmcu=$(MCU) -w -v $(TARGET).hex
47PROGRAM_CMD = /opt/dfu-programmer-0.5.2/bin/dfu-programmer $(MCU) erase && \
48 /opt/dfu-programmer-0.5.2/bin/dfu-programmer $(MCU) flash $(TARGET).hex && \
49 /opt/dfu-programmer-0.5.2/bin/dfu-programmer $(MCU) start
50
51
52
53include $(TOP_DIR)/protocol/pjrc.mk
54include $(TOP_DIR)/protocol.mk
55include $(TOP_DIR)/common.mk
56include $(TOP_DIR)/rules.mk
diff --git a/keyboard/hbkb/config.h b/keyboard/hbkb/config.h
index 5262399dc..deaabb249 100644
--- a/keyboard/hbkb/config.h
+++ b/keyboard/hbkb/config.h
@@ -24,7 +24,10 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
24#define VENDOR_ID 0xFEED 24#define VENDOR_ID 0xFEED
25#define PRODUCT_ID 0xBB00 25#define PRODUCT_ID 0xBB00
26#define MANUFACTURER t.m.k. 26#define MANUFACTURER t.m.k.
27#define DEVICE_VER 0x0100
27#define PRODUCT Happy Buckling Keyboard 28#define PRODUCT Happy Buckling Keyboard
29
30
28#define DESCRIPTION mod version of IBM Model M keyboard 31#define DESCRIPTION mod version of IBM Model M keyboard
29 32
30 33
diff --git a/keyboard/hhkb/Makefile.lufa b/keyboard/hhkb/Makefile.lufa
new file mode 100644
index 000000000..cdd68f40a
--- /dev/null
+++ b/keyboard/hhkb/Makefile.lufa
@@ -0,0 +1,119 @@
1#----------------------------------------------------------------------------
2# On command line:
3#
4# make all = Make software.
5#
6# make clean = Clean out built project files.
7#
8# make coff = Convert ELF to AVR COFF.
9#
10# make extcoff = Convert ELF to AVR Extended COFF.
11#
12# make program = Download the hex file to the device.
13# Please customize your programmer settings(PROGRAM_CMD)
14#
15# make teensy = Download the hex file to the device, using teensy_loader_cli.
16# (must have teensy_loader_cli installed).
17#
18# make dfu = Download the hex file to the device, using dfu-programmer (must
19# have dfu-programmer installed).
20#
21# make flip = Download the hex file to the device, using Atmel FLIP (must
22# have Atmel FLIP installed).
23#
24# make dfu-ee = Download the eeprom file to the device, using dfu-programmer
25# (must have dfu-programmer installed).
26#
27# make flip-ee = Download the eeprom file to the device, using Atmel FLIP
28# (must have Atmel FLIP installed).
29#
30# make debug = Start either simulavr or avarice as specified for debugging,
31# with avr-gdb or avr-insight as the front end for debugging.
32#
33# make filename.s = Just compile filename.c into the assembler code only.
34#
35# make filename.i = Create a preprocessed source file for use in submitting
36# bug reports to the GCC project.
37#
38# To rebuild project do "make clean" then "make all".
39#----------------------------------------------------------------------------
40
41# Target file name (without extension).
42TARGET = hhkb_lufa
43
44# Directory common source filess exist
45TOP_DIR = ../..
46
47# Directory keyboard dependent files exist
48TARGET_DIR = .
49
50
51# List C source files here. (C dependencies are automatically generated.)
52SRC += keymap.c \
53 matrix.c \
54 led.c
55
56CONFIG_H = config.h
57
58
59# MCU name
60MCU = at90usb1286
61#MCU = atmega32u4
62
63# Processor frequency.
64# This will define a symbol, F_CPU, in all source code files equal to the
65# processor frequency in Hz. You can then use this symbol in your source code to
66# calculate timings. Do NOT tack on a 'UL' at the end, this will be done
67# automatically to create a 32-bit value in your source code.
68#
69# This will be an integer division of F_USB below, as it is sourced by
70# F_USB after it has run through any CPU prescalers. Note that this value
71# does not *change* the processor frequency - it should merely be updated to
72# reflect the processor speed set externally so that the code can use accurate
73# software delays.
74F_CPU = 16000000
75
76
77#
78# LUFA specific
79#
80# Target architecture (see library "Board Types" documentation).
81ARCH = AVR8
82
83# Input clock frequency.
84# This will define a symbol, F_USB, in all source code files equal to the
85# input clock frequency (before any prescaling is performed) in Hz. This value may
86# differ from F_CPU if prescaling is used on the latter, and is required as the
87# raw input clock is fed directly to the PLL sections of the AVR for high speed
88# clock generation for the USB and other AVR subsections. Do NOT tack on a 'UL'
89# at the end, this will be done automatically to create a 32-bit value in your
90# source code.
91#
92# If no clock division is performed on the input clock inside the AVR (via the
93# CPU clock adjust registers or the clock division fuses), this will be equal to F_CPU.
94F_USB = $(F_CPU)
95
96
97# Build Options
98# comment out to disable the options.
99#
100MOUSEKEY_ENABLE = yes # Mouse keys
101EXTRAKEY_ENABLE = yes # Audio control and System control
102#NKRO_ENABLE = yes # USB Nkey Rollover
103#PS2_MOUSE_ENABLE = yes # PS/2 mouse(TrackPoint) support
104
105
106# Boot Section Size in bytes
107# Teensy halfKay 512
108# Atmel DFU loader 4096
109# LUFA bootloader 4096
110#OPT_DEFS += -DBOOT_SIZE=4096
111
112
113# Search Path
114VPATH += $(TARGET_DIR)
115VPATH += $(TOP_DIR)
116
117include $(TOP_DIR)/protocol/lufa.mk
118include $(TOP_DIR)/common.mk
119include $(TOP_DIR)/rules.mk
diff --git a/keyboard/hhkb/Makefile.pjrc b/keyboard/hhkb/Makefile.pjrc
index f6d133eae..f8836a2ca 100644
--- a/keyboard/hhkb/Makefile.pjrc
+++ b/keyboard/hhkb/Makefile.pjrc
@@ -13,12 +13,11 @@ TOP_DIR = ../..
13TARGET_DIR = . 13TARGET_DIR = .
14 14
15# keyboard dependent files 15# keyboard dependent files
16SRC = main.c \ 16SRC = keymap.c \
17 keymap.c \
18 matrix.c \ 17 matrix.c \
19 led.c 18 led.c
20 19
21CONFIG_H = config_pjrc.h 20CONFIG_H = config.h
22 21
23 22
24# MCU name, you MUST set this to match the board you are using 23# MCU name, you MUST set this to match the board you are using
@@ -53,8 +52,8 @@ PROGRAM_CMD = teensy_loader_cli -mmcu=$(MCU) -w -v $(TARGET).hex
53 52
54# Search Path 53# Search Path
55VPATH = $(TARGET_DIR) 54VPATH = $(TARGET_DIR)
55VPATH = $(TOP_DIR)
56 56
57include $(TOP_DIR)/protocol/pjrc.mk 57include $(TOP_DIR)/protocol/pjrc.mk
58include $(TOP_DIR)/protocol.mk
59include $(TOP_DIR)/common.mk 58include $(TOP_DIR)/common.mk
60include $(TOP_DIR)/rules.mk 59include $(TOP_DIR)/rules.mk
diff --git a/keyboard/hhkb/config_pjrc.h b/keyboard/hhkb/config.h
index fffe3522c..91446466f 100644
--- a/keyboard/hhkb/config_pjrc.h
+++ b/keyboard/hhkb/config.h
@@ -21,11 +21,14 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
21/* controller configuration */ 21/* controller configuration */
22#include "controller_teensy.h" 22#include "controller_teensy.h"
23 23
24
24#define VENDOR_ID 0xFEED 25#define VENDOR_ID 0xFEED
25#define PRODUCT_ID 0xCAFE 26#define PRODUCT_ID 0xCAFF
26#define DEVICE_VER 0x0101 27#define DEVICE_VER 0x0101
27#define MANUFACTURER t.m.k. 28#define MANUFACTURER t.m.k.
28#define PRODUCT HHKB mod 29#define PRODUCT HHKB mod
30
31
29#define DESCRIPTION t.m.k. keyboard firmware for HHKB mod 32#define DESCRIPTION t.m.k. keyboard firmware for HHKB mod
30 33
31 34
diff --git a/keyboard/hhkb/matrix.c b/keyboard/hhkb/matrix.c
index 350066b90..79d2d9873 100644
--- a/keyboard/hhkb/matrix.c
+++ b/keyboard/hhkb/matrix.c
@@ -68,8 +68,8 @@ static bool matrix_has_ghost_in_row(uint8_t row);
68// key: on: 0/off: 1 68// key: on: 0/off: 1
69// prev: unknown: output previous key state(negated)? 69// prev: unknown: output previous key state(negated)?
70 70
71#ifdef HOST_PJRC 71#if defined(__AVR_AT90USB1286__)
72// Ports for Teensy 72// Ports for Teensy++
73// row: PB0-2 73// row: PB0-2
74// col: PB3-5,6 74// col: PB3-5,6
75// key: PE6(pull-uped) 75// key: PE6(pull-uped)
@@ -90,7 +90,8 @@ static bool matrix_has_ghost_in_row(uint8_t row);
90#define KEY_PREV_OFF() (PORTE &= ~(1<<7)) 90#define KEY_PREV_OFF() (PORTE &= ~(1<<7))
91#define KEY_POWER_ON() 91#define KEY_POWER_ON()
92#define KEY_POWER_OFF() 92#define KEY_POWER_OFF()
93#else 93
94#elif defined(__AVR_ATmega328P__)
94// Ports for V-USB 95// Ports for V-USB
95// key: PB0(pull-uped) 96// key: PB0(pull-uped)
96// prev: PB1 97// prev: PB1
@@ -126,6 +127,9 @@ static bool matrix_has_ghost_in_row(uint8_t row);
126 DDRC &= ~0x0F; \ 127 DDRC &= ~0x0F; \
127 PORTC &= ~0x0F; \ 128 PORTC &= ~0x0F; \
128} while (0) 129} while (0)
130
131#else
132# error "define code for matrix scan"
129#endif 133#endif
130 134
131 135
diff --git a/keyboard/macway/Makefile.lufa b/keyboard/macway/Makefile.lufa
index 2f2b6401d..9c9388ee2 100644
--- a/keyboard/macway/Makefile.lufa
+++ b/keyboard/macway/Makefile.lufa
@@ -107,9 +107,7 @@ EXTRAKEY_ENABLE = yes # Audio control and System control
107# Teensy halfKay 512 107# Teensy halfKay 512
108# Atmel DFU loader 4096 108# Atmel DFU loader 4096
109# LUFA bootloader 4096 109# LUFA bootloader 4096
110#ifndef BOOT_SIZE 110#OPT_DEFS += -DBOOT_SIZE=4096
111#define BOOT_SIZE 512
112#endif
113 111
114 112
115# Search Path 113# Search Path
diff --git a/keyboard/macway/Makefile.pjrc b/keyboard/macway/Makefile.pjrc
index d2fb8ff2f..ecc236e3d 100644
--- a/keyboard/macway/Makefile.pjrc
+++ b/keyboard/macway/Makefile.pjrc
@@ -48,8 +48,7 @@ TOP_DIR = ../..
48TARGET_DIR = . 48TARGET_DIR = .
49 49
50# keyboard dependent files 50# keyboard dependent files
51SRC = protocol/pjrc/main.c \ 51SRC = keymap.c \
52 keymap.c \
53 matrix.c \ 52 matrix.c \
54 led.c 53 led.c
55 54
diff --git a/protocol/pjrc.mk b/protocol/pjrc.mk
index 8aff6f28b..cccdf6204 100644
--- a/protocol/pjrc.mk
+++ b/protocol/pjrc.mk
@@ -2,7 +2,8 @@ PJRC_DIR = protocol/pjrc
2 2
3OPT_DEFS += -DHOST_PJRC 3OPT_DEFS += -DHOST_PJRC
4 4
5SRC += $(PJRC_DIR)/pjrc.c \ 5SRC += $(PJRC_DIR)/main.c \
6 $(PJRC_DIR)/pjrc.c \
6 $(PJRC_DIR)/usb_keyboard.c \ 7 $(PJRC_DIR)/usb_keyboard.c \
7 $(PJRC_DIR)/usb_debug.c \ 8 $(PJRC_DIR)/usb_debug.c \
8 $(PJRC_DIR)/usb.c 9 $(PJRC_DIR)/usb.c
diff --git a/rules.mk b/rules.mk
index a58de2f11..e561eae63 100644
--- a/rules.mk
+++ b/rules.mk
@@ -416,6 +416,10 @@ dfu: $(TARGET).hex
416 dfu-programmer $(MCU) erase 416 dfu-programmer $(MCU) erase
417 dfu-programmer $(MCU) flash $(TARGET).hex 417 dfu-programmer $(MCU) flash $(TARGET).hex
418 dfu-programmer $(MCU) reset 418 dfu-programmer $(MCU) reset
419
420dfu-start:
421 dfu-programmer $(MCU) reset
422 dfu-programmer $(MCU) start
419 423
420flip-ee: $(TARGET).hex $(TARGET).eep 424flip-ee: $(TARGET).hex $(TARGET).eep
421 $(COPY) $(TARGET).eep $(TARGET)eep.hex 425 $(COPY) $(TARGET).eep $(TARGET)eep.hex
@@ -599,4 +603,4 @@ $(shell mkdir $(OBJDIR) 2>/dev/null)
599.PHONY : all begin finish end sizebefore sizeafter gccversion \ 603.PHONY : all begin finish end sizebefore sizeafter gccversion \
600build elf hex eep lss sym coff extcoff \ 604build elf hex eep lss sym coff extcoff \
601clean clean_list debug gdb-config show_path \ 605clean clean_list debug gdb-config show_path \
602program teensy dfu flip dfu-ee flip-ee 606program teensy dfu flip dfu-ee flip-ee dfu-start