From 359b68d35f0763ab0cafa2fb800e0a3497291f95 Mon Sep 17 00:00:00 2001 From: tmk Date: Thu, 7 Mar 2013 03:30:08 +0900 Subject: Add eeconfig.c - eeprom stored paramerters --- keyboard/gh60/config.h | 3 +++ 1 file changed, 3 insertions(+) (limited to 'keyboard') diff --git a/keyboard/gh60/config.h b/keyboard/gh60/config.h index ef0c9a1735..3a7a3f97fb 100644 --- a/keyboard/gh60/config.h +++ b/keyboard/gh60/config.h @@ -56,10 +56,13 @@ along with this program. If not, see . /* key position on matrix(ROW:COL) */ #define KEY_FN 0x4A #define KEY_D 0x23 +#define KEY_ESC 0x00 #define KEY_IS_ON(key) matrix_is_on((key)>>4, (key)&0xF) /* kick up bootloader */ #define IS_BOOTMAGIC_BOOTLOADER() KEY_IS_ON(KEY_FN) /* debug on */ #define IS_BOOTMAGIC_DEBUG() KEY_IS_ON(KEY_D) +/* eeprom clear */ +#define IS_BOOTMAGIC_EEPROM_CLEAR() KEY_IS_ON(KEY_ESC) #endif -- cgit v1.2.3 From 4d64fd8faa8b1a0ceb9019446ba6915aaf1812ea Mon Sep 17 00:00:00 2001 From: tmk Date: Sat, 9 Mar 2013 11:22:27 +0900 Subject: Add bootmagic.c and fix bootloader_jump --- keyboard/gh60/keymap.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'keyboard') diff --git a/keyboard/gh60/keymap.c b/keyboard/gh60/keymap.c index 1f5344d4c6..d6af16961c 100644 --- a/keyboard/gh60/keymap.c +++ b/keyboard/gh60/keymap.c @@ -231,7 +231,8 @@ uint8_t keymap_key_to_keycode(uint8_t layer, key_t key) if (layer < OVERLAYS_SIZE) { return pgm_read_byte(&overlays[(layer)][(key.row)][(key.col)]); } else { - debug("key_to_keycode: overlay "); debug_dec(layer); debug(" is invalid.\n"); + // XXX: this may cuaes bootlaoder_jump incositent fail. + //debug("key_to_keycode: overlay "); debug_dec(layer); debug(" is invalid.\n"); return KC_TRANSPARENT; } } @@ -240,8 +241,9 @@ uint8_t keymap_key_to_keycode(uint8_t layer, key_t key) if (layer < KEYMAPS_SIZE) { return pgm_read_byte(&keymaps[(layer)][(key.row)][(key.col)]); } else { + // XXX: this may cuaes bootlaoder_jump incositent fail. + //debug("key_to_keycode: base "); debug_dec(layer); debug(" is invalid.\n"); // fall back to layer 0 - debug("key_to_keycode: base "); debug_dec(layer); debug(" is invalid.\n"); return pgm_read_byte(&keymaps[0][(key.row)][(key.col)]); } } -- cgit v1.2.3 From 1385058fc21f80347c7afd2b818e38795ce9d55a Mon Sep 17 00:00:00 2001 From: tmk Date: Sat, 9 Mar 2013 22:23:32 +0900 Subject: Fix gh60/matrix.c and Makefile --- keyboard/gh60/Makefile.lufa | 9 ++++++--- keyboard/gh60/Makefile.pjrc | 13 +++++++++---- keyboard/gh60/matrix.c | 2 +- 3 files changed, 16 insertions(+), 8 deletions(-) (limited to 'keyboard') diff --git a/keyboard/gh60/Makefile.lufa b/keyboard/gh60/Makefile.lufa index 7a83032969..65b6240efc 100644 --- a/keyboard/gh60/Makefile.lufa +++ b/keyboard/gh60/Makefile.lufa @@ -93,13 +93,16 @@ ARCH = AVR8 # CPU clock adjust registers or the clock division fuses), this will be equal to F_CPU. F_USB = $(F_CPU) +# Interrupt driven control endpoint task(+60) +#OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT + # Build Options # comment out to disable the options. # -MOUSEKEY_ENABLE = yes # Mouse keys -EXTRAKEY_ENABLE = yes # Audio control and System control -CONSOLE_ENABLE = yes # Console for debug +MOUSEKEY_ENABLE = yes # Mouse keys(+4700) +EXTRAKEY_ENABLE = yes # Audio control and System control(+450) +CONSOLE_ENABLE = yes # Console for debug(+400) #NKRO_ENABLE = yes # USB Nkey Rollover - not yet supported in LUFA #PS2_MOUSE_ENABLE = yes # PS/2 mouse(TrackPoint) support diff --git a/keyboard/gh60/Makefile.pjrc b/keyboard/gh60/Makefile.pjrc index af6ef63ec4..2538c0c6bb 100644 --- a/keyboard/gh60/Makefile.pjrc +++ b/keyboard/gh60/Makefile.pjrc @@ -70,15 +70,20 @@ MCU = atmega32u4 # Teensy 2.0 # examples use this variable to calculate timings. Do not add a "UL" here. F_CPU = 16000000 +# Boot Section Size in bytes +# Teensy halfKay 512 +# Atmel DFU loader 4096 +# LUFA bootloader 4096 +OPT_DEFS += -DBOOT_SIZE=4096 # Build Options # comment out to disable the options. # -MOUSEKEY_ENABLE = yes # Mouse keys -#PS2_MOUSE_ENABLE = yes # PS/2 mouse(TrackPoint) support -EXTRAKEY_ENABLE = yes # Audio control and System control -NKRO_ENABLE = yes # USB Nkey Rollover +MOUSEKEY_ENABLE = yes # Mouse keys(+5000) +EXTRAKEY_ENABLE = yes # Audio control and System control(+600) +NKRO_ENABLE = yes # USB Nkey Rollover(+500) CONSOLE_ENABLE = yes # Console for debug +#PS2_MOUSE_ENABLE = yes # PS/2 mouse(TrackPoint) support # Search Path diff --git a/keyboard/gh60/matrix.c b/keyboard/gh60/matrix.c index 85e58fe361..09a051aa66 100644 --- a/keyboard/gh60/matrix.c +++ b/keyboard/gh60/matrix.c @@ -120,7 +120,7 @@ bool matrix_has_ghost(void) inline bool matrix_is_on(uint8_t row, uint8_t col) { - return (matrix[row] & (1< Date: Sun, 10 Mar 2013 15:05:28 +0900 Subject: Fix watchdog in bootloader jump - disable watchdog after watchdog reset - clear WDRF after watchdog reset --- keyboard/hhkb/Makefile.iwrap | 9 +++++++++ keyboard/hhkb/Makefile.lufa | 11 ++++++----- 2 files changed, 15 insertions(+), 5 deletions(-) (limited to 'keyboard') diff --git a/keyboard/hhkb/Makefile.iwrap b/keyboard/hhkb/Makefile.iwrap index f87df0d2bb..3ec1a31645 100644 --- a/keyboard/hhkb/Makefile.iwrap +++ b/keyboard/hhkb/Makefile.iwrap @@ -49,6 +49,15 @@ EXTRAKEY_ENABLE = yes # Audio control and System control #NKRO_ENABLE = yes # USB Nkey Rollover +# Boot Section Size in *BYTEs* +# Teensy halfKay 512 +# Teensy++ halfKay 1024 +# Atmel DFU loader 4096 +# LUFA bootloader 4096 +# USBaspLoader 2048 +OPT_DEFS += -DBOOT_SIZE=2048 + + #---------------- Programming Options -------------------------- AVRDUDE = avrdude diff --git a/keyboard/hhkb/Makefile.lufa b/keyboard/hhkb/Makefile.lufa index afd413d019..75c0310d6e 100644 --- a/keyboard/hhkb/Makefile.lufa +++ b/keyboard/hhkb/Makefile.lufa @@ -107,11 +107,12 @@ CONSOLE_ENABLE = yes # Console for debug #PS2_MOUSE_ENABLE = yes # PS/2 mouse(TrackPoint) support -# Boot Section Size in bytes -# Teensy halfKay 512 -# Atmel DFU loader 4096 -# LUFA bootloader 4096 -#OPT_DEFS += -DBOOT_SIZE=4096 +# Boot Section Size in *BYTEs* +# Teensy halfKay 512 +# Teensy++ halfKay 1024 +# Atmel DFU loader 4096 +# LUFA bootloader 4096 +OPT_DEFS += -DBOOT_SIZE=1024 # Search Path -- cgit v1.2.3 From 51050875b7f1dd5216ba46298f95cf3030a36211 Mon Sep 17 00:00:00 2001 From: tmk Date: Sun, 10 Mar 2013 15:36:07 +0900 Subject: Add BOOTLOADER_SIZE and remove BOOT_SIZE - define BOOTLOADER_SIZE in config.h instead of Makefile --- keyboard/gh60/Makefile.lufa | 7 ------- keyboard/gh60/config.h | 12 ++++++++++-- keyboard/hhkb/Makefile.iwrap | 9 --------- keyboard/hhkb/Makefile.lufa | 8 -------- keyboard/hhkb/config.h | 10 +++++++++- keyboard/hhkb/config_iwrap.h | 10 ++++++++++ 6 files changed, 29 insertions(+), 27 deletions(-) (limited to 'keyboard') diff --git a/keyboard/gh60/Makefile.lufa b/keyboard/gh60/Makefile.lufa index 65b6240efc..2076c919ca 100644 --- a/keyboard/gh60/Makefile.lufa +++ b/keyboard/gh60/Makefile.lufa @@ -107,13 +107,6 @@ CONSOLE_ENABLE = yes # Console for debug(+400) #PS2_MOUSE_ENABLE = yes # PS/2 mouse(TrackPoint) support -# Boot Section Size in bytes -# Teensy halfKay 512 -# Atmel DFU loader 4096 -# LUFA bootloader 4096 -OPT_DEFS += -DBOOT_SIZE=4096 - - # Search Path VPATH += $(TARGET_DIR) VPATH += $(TOP_DIR) diff --git a/keyboard/gh60/config.h b/keyboard/gh60/config.h index 3a7a3f97fb..be4d72384e 100644 --- a/keyboard/gh60/config.h +++ b/keyboard/gh60/config.h @@ -25,12 +25,20 @@ along with this program. If not, see . #define DEVICE_VER 0x0001 #define MANUFACTURER geekhack #define PRODUCT GH60 - - /* message strings */ #define DESCRIPTION t.m.k. keyboard firmware for GH60 +/* Boot Section Size in *BYTEs* + * Teensy halfKay 512 + * Teensy++ halfKay 1024 + * Atmel DFU loader 4096 + * LUFA bootloader 4096 + * USBaspLoader 2048 + */ +#define BOOTLOADER_SIZE 4096 + + /* matrix size */ #define MATRIX_ROWS 5 #define MATRIX_COLS 14 diff --git a/keyboard/hhkb/Makefile.iwrap b/keyboard/hhkb/Makefile.iwrap index 3ec1a31645..f87df0d2bb 100644 --- a/keyboard/hhkb/Makefile.iwrap +++ b/keyboard/hhkb/Makefile.iwrap @@ -49,15 +49,6 @@ EXTRAKEY_ENABLE = yes # Audio control and System control #NKRO_ENABLE = yes # USB Nkey Rollover -# Boot Section Size in *BYTEs* -# Teensy halfKay 512 -# Teensy++ halfKay 1024 -# Atmel DFU loader 4096 -# LUFA bootloader 4096 -# USBaspLoader 2048 -OPT_DEFS += -DBOOT_SIZE=2048 - - #---------------- Programming Options -------------------------- AVRDUDE = avrdude diff --git a/keyboard/hhkb/Makefile.lufa b/keyboard/hhkb/Makefile.lufa index 75c0310d6e..e8b2414d39 100644 --- a/keyboard/hhkb/Makefile.lufa +++ b/keyboard/hhkb/Makefile.lufa @@ -107,14 +107,6 @@ CONSOLE_ENABLE = yes # Console for debug #PS2_MOUSE_ENABLE = yes # PS/2 mouse(TrackPoint) support -# Boot Section Size in *BYTEs* -# Teensy halfKay 512 -# Teensy++ halfKay 1024 -# Atmel DFU loader 4096 -# LUFA bootloader 4096 -OPT_DEFS += -DBOOT_SIZE=1024 - - # Search Path VPATH += $(TARGET_DIR) VPATH += $(TOP_DIR) diff --git a/keyboard/hhkb/config.h b/keyboard/hhkb/config.h index 72e4d26e92..3bfeb45ed4 100644 --- a/keyboard/hhkb/config.h +++ b/keyboard/hhkb/config.h @@ -27,9 +27,17 @@ along with this program. If not, see . #define DEVICE_VER 0x0103 #define MANUFACTURER t.m.k. #define PRODUCT HHKB mod +#define DESCRIPTION t.m.k. keyboard firmware for HHKB mod -#define DESCRIPTION t.m.k. keyboard firmware for HHKB mod +/* Boot Section Size in *BYTEs* + * Teensy halfKay 512 + * Teensy++ halfKay 1024 + * Atmel DFU loader 4096 + * LUFA bootloader 4096 + * USBaspLoader 2048 + */ +#define BOOTLOADER_SIZE 1024 /* matrix size */ diff --git a/keyboard/hhkb/config_iwrap.h b/keyboard/hhkb/config_iwrap.h index d50b704d72..2c18cd817a 100644 --- a/keyboard/hhkb/config_iwrap.h +++ b/keyboard/hhkb/config_iwrap.h @@ -27,6 +27,16 @@ along with this program. If not, see . #define DESCRIPTION t.m.k. keyboard firmware for HHKB mod +/* Boot Section Size in *BYTEs* + * Teensy halfKay 512 + * Teensy++ halfKay 1024 + * Atmel DFU loader 4096 + * LUFA bootloader 4096 + * USBaspLoader 2048 + */ +#define BOOTLOADER_SIZE 2048 + + /* matrix size */ #define MATRIX_ROWS 8 #define MATRIX_COLS 8 -- cgit v1.2.3 From db024b6b1803eb752070422e7240b1ffe52d39f6 Mon Sep 17 00:00:00 2001 From: tmk Date: Mon, 11 Mar 2013 00:05:35 +0900 Subject: Add --relax for size optimization to gh60 --- keyboard/gh60/Makefile.lufa | 3 +++ 1 file changed, 3 insertions(+) (limited to 'keyboard') diff --git a/keyboard/gh60/Makefile.lufa b/keyboard/gh60/Makefile.lufa index 2076c919ca..b885b7dfa1 100644 --- a/keyboard/gh60/Makefile.lufa +++ b/keyboard/gh60/Makefile.lufa @@ -107,6 +107,9 @@ CONSOLE_ENABLE = yes # Console for debug(+400) #PS2_MOUSE_ENABLE = yes # PS/2 mouse(TrackPoint) support +# Optimize size but this may cause error "relocation truncated to fit" +EXTRALDFLAGS = -Wl,--relax + # Search Path VPATH += $(TARGET_DIR) VPATH += $(TOP_DIR) -- cgit v1.2.3 From 1d5bbb55f28eb2e9eff0543753b8cb85f3b94282 Mon Sep 17 00:00:00 2001 From: tmk Date: Mon, 11 Mar 2013 14:39:06 +0900 Subject: Fix legacy keymap support - need to define USE_LEGACY_KEYMAP to use legacy keymap --- keyboard/gh60/config.h | 24 +++++++++--------------- keyboard/hhkb/config.h | 3 --- keyboard/hhkb/config_iwrap.h | 3 --- 3 files changed, 9 insertions(+), 21 deletions(-) (limited to 'keyboard') diff --git a/keyboard/gh60/config.h b/keyboard/gh60/config.h index be4d72384e..cd98395eb5 100644 --- a/keyboard/gh60/config.h +++ b/keyboard/gh60/config.h @@ -25,20 +25,8 @@ along with this program. If not, see . #define DEVICE_VER 0x0001 #define MANUFACTURER geekhack #define PRODUCT GH60 -/* message strings */ #define DESCRIPTION t.m.k. keyboard firmware for GH60 - -/* Boot Section Size in *BYTEs* - * Teensy halfKay 512 - * Teensy++ halfKay 1024 - * Atmel DFU loader 4096 - * LUFA bootloader 4096 - * USBaspLoader 2048 - */ -#define BOOTLOADER_SIZE 4096 - - /* matrix size */ #define MATRIX_ROWS 5 #define MATRIX_COLS 14 @@ -49,14 +37,20 @@ along with this program. If not, see . /* Set 0 if need no debouncing */ #define DEBOUNCE 5 -/* To use new keymap framework */ -#define USE_KEYMAP_V2 - /* key combination for command */ #define IS_COMMAND() ( \ keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)) \ ) +/* Boot Section Size in *BYTEs* + * Teensy halfKay 512 + * Teensy++ halfKay 1024 + * Atmel DFU loader 4096 + * LUFA bootloader 4096 + * USBaspLoader 2048 + */ +#define BOOTLOADER_SIZE 4096 + /* * Boot magic keys * call some function by pressing key when pluging cable or powering on. diff --git a/keyboard/hhkb/config.h b/keyboard/hhkb/config.h index 3bfeb45ed4..ef2958981c 100644 --- a/keyboard/hhkb/config.h +++ b/keyboard/hhkb/config.h @@ -44,9 +44,6 @@ along with this program. If not, see . #define MATRIX_ROWS 8 #define MATRIX_COLS 8 -/* To use new keymap framework */ -#define USE_KEYMAP_V2 - /* * Boot magic keys * call some function by pressing key when pluging cable or powering on. diff --git a/keyboard/hhkb/config_iwrap.h b/keyboard/hhkb/config_iwrap.h index 2c18cd817a..7a4ec37118 100644 --- a/keyboard/hhkb/config_iwrap.h +++ b/keyboard/hhkb/config_iwrap.h @@ -41,9 +41,6 @@ along with this program. If not, see . #define MATRIX_ROWS 8 #define MATRIX_COLS 8 -/* To use new keymap framework */ -#define USE_KEYMAP_V2 - /* key combination for command */ #define IS_COMMAND() (keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT))) -- cgit v1.2.3 From ef8439bddb2d7fe5fd95faf2b6bebd8235acf160 Mon Sep 17 00:00:00 2001 From: tmk Date: Mon, 11 Mar 2013 15:28:14 +0900 Subject: Add build option BOOTMAGIC_ENABLE --- keyboard/gh60/Makefile.lufa | 4 ++-- keyboard/gh60/Makefile.pjrc | 9 ++++----- 2 files changed, 6 insertions(+), 7 deletions(-) (limited to 'keyboard') diff --git a/keyboard/gh60/Makefile.lufa b/keyboard/gh60/Makefile.lufa index b885b7dfa1..a5ff609a77 100644 --- a/keyboard/gh60/Makefile.lufa +++ b/keyboard/gh60/Makefile.lufa @@ -47,8 +47,7 @@ TOP_DIR = ../.. # Directory keyboard dependent files exist TARGET_DIR = . - -# List C source files here. (C dependencies are automatically generated.) +# project specific files SRC += keymap.c \ matrix.c \ led.c @@ -100,6 +99,7 @@ F_USB = $(F_CPU) # Build Options # comment out to disable the options. # +BOOTMAGIC_ENABLE = yes # Virtual DIP switch configuration(+1000) MOUSEKEY_ENABLE = yes # Mouse keys(+4700) EXTRAKEY_ENABLE = yes # Audio control and System control(+450) CONSOLE_ENABLE = yes # Console for debug(+400) diff --git a/keyboard/gh60/Makefile.pjrc b/keyboard/gh60/Makefile.pjrc index 2538c0c6bb..f03ca9416d 100644 --- a/keyboard/gh60/Makefile.pjrc +++ b/keyboard/gh60/Makefile.pjrc @@ -47,7 +47,7 @@ TOP_DIR = ../.. # Directory keyboard dependent files exist TARGET_DIR = . -# keyboard dependent files +# project specific files SRC = keymap.c \ matrix.c \ led.c @@ -57,10 +57,8 @@ CONFIG_H = config.h # MCU name, you MUST set this to match the board you are using # type "make clean" after changing this, so all files will be rebuilt -#MCU = at90usb162 # Teensy 1.0 -MCU = atmega32u4 # Teensy 2.0 -#MCU = at90usb646 # Teensy++ 1.0 -#MCU = at90usb1286 # Teensy++ 2.0 +MCU = atmega32u4 +#MCU = at90usb1286 # Processor frequency. @@ -79,6 +77,7 @@ OPT_DEFS += -DBOOT_SIZE=4096 # Build Options # comment out to disable the options. # +BOOTMAGIC_ENABLE = yes # Virtual DIP switch configuration(+1000) MOUSEKEY_ENABLE = yes # Mouse keys(+5000) EXTRAKEY_ENABLE = yes # Audio control and System control(+600) NKRO_ENABLE = yes # USB Nkey Rollover(+500) -- cgit v1.2.3