aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--common/bootloader.c23
-rw-r--r--keyboard/hhkb/Makefile.iwrap9
-rw-r--r--keyboard/hhkb/Makefile.lufa11
3 files changed, 28 insertions, 15 deletions
diff --git a/common/bootloader.c b/common/bootloader.c
index 77fa1b30a..023220414 100644
--- a/common/bootloader.c
+++ b/common/bootloader.c
@@ -11,15 +11,16 @@
11#endif 11#endif
12 12
13 13
14/* Boot Section Size in bytes 14/* Boot Section Size in *BYTEs*
15 * Teensy halfKay 512 15 * Teensy halfKay 512
16 * Atmel DFU loader 4096 16 * Teensy++ halfKay 1024
17 * LUFA bootloader 4096 17 * Atmel DFU loader 4096
18 * LUFA bootloader 4096
18 */ 19 */
19#ifndef BOOT_SIZE 20#ifndef BOOT_SIZE
20#define BOOT_SIZE 512 21#define BOOT_SIZE 512
21#endif 22#endif
22#define FLASH_SIZE (FLASHEND + 1) 23#define FLASH_SIZE (FLASHEND + 1L)
23#define BOOTLOADER_START (FLASH_SIZE - BOOT_SIZE) 24#define BOOTLOADER_START (FLASH_SIZE - BOOT_SIZE)
24 25
25 26
@@ -58,13 +59,15 @@ void bootloader_jump_after_watchdog_reset(void) __attribute__ ((used, naked, sec
58void bootloader_jump_after_watchdog_reset(void) 59void bootloader_jump_after_watchdog_reset(void)
59{ 60{
60 if ((MCUSR & (1<<WDRF)) && reset_key == BOOTLOADER_RESET_KEY) { 61 if ((MCUSR & (1<<WDRF)) && reset_key == BOOTLOADER_RESET_KEY) {
62 reset_key = 0;
61 63
62 #if defined(__AVR_ATmega168__) || defined(__AVR_ATmega168P__) || defined(__AVR_ATmega328P__) 64 // My custom USBasploader requires this to come up.
63 // This makes custom USBasploader come up.
64 MCUSR = 0; 65 MCUSR = 0;
65 #endif
66 66
67 reset_key = 0; 67 // Seems like Teensy halfkay loader requires clearing WDRF and disabling watchdog.
68 MCUSR &= ~(1<<WDRF);
69 wdt_disable();
70
68 ((void (*)(void))BOOTLOADER_START)(); 71 ((void (*)(void))BOOTLOADER_START)();
69 } 72 }
70} 73}
@@ -138,4 +141,4 @@ void bootloader_jump(void) {
138 // start Bootloader 141 // start Bootloader
139 ((void (*)(void))BOOTLOADER_START)(); 142 ((void (*)(void))BOOTLOADER_START)();
140} 143}
141#endif 144#endif
diff --git a/keyboard/hhkb/Makefile.iwrap b/keyboard/hhkb/Makefile.iwrap
index f87df0d2b..3ec1a3164 100644
--- a/keyboard/hhkb/Makefile.iwrap
+++ b/keyboard/hhkb/Makefile.iwrap
@@ -49,6 +49,15 @@ EXTRAKEY_ENABLE = yes # Audio control and System control
49#NKRO_ENABLE = yes # USB Nkey Rollover 49#NKRO_ENABLE = yes # USB Nkey Rollover
50 50
51 51
52# Boot Section Size in *BYTEs*
53# Teensy halfKay 512
54# Teensy++ halfKay 1024
55# Atmel DFU loader 4096
56# LUFA bootloader 4096
57# USBaspLoader 2048
58OPT_DEFS += -DBOOT_SIZE=2048
59
60
52 61
53#---------------- Programming Options -------------------------- 62#---------------- Programming Options --------------------------
54AVRDUDE = avrdude 63AVRDUDE = avrdude
diff --git a/keyboard/hhkb/Makefile.lufa b/keyboard/hhkb/Makefile.lufa
index afd413d01..75c0310d6 100644
--- a/keyboard/hhkb/Makefile.lufa
+++ b/keyboard/hhkb/Makefile.lufa
@@ -107,11 +107,12 @@ CONSOLE_ENABLE = yes # Console for debug
107#PS2_MOUSE_ENABLE = yes # PS/2 mouse(TrackPoint) support 107#PS2_MOUSE_ENABLE = yes # PS/2 mouse(TrackPoint) support
108 108
109 109
110# Boot Section Size in bytes 110# Boot Section Size in *BYTEs*
111# Teensy halfKay 512 111# Teensy halfKay 512
112# Atmel DFU loader 4096 112# Teensy++ halfKay 1024
113# LUFA bootloader 4096 113# Atmel DFU loader 4096
114#OPT_DEFS += -DBOOT_SIZE=4096 114# LUFA bootloader 4096
115OPT_DEFS += -DBOOT_SIZE=1024
115 116
116 117
117# Search Path 118# Search Path