From f55c677ba46a8243f077195ef4f39cde1babf560 Mon Sep 17 00:00:00 2001 From: tmk Date: Sun, 10 Mar 2013 15:05:28 +0900 Subject: [PATCH] Fix watchdog in bootloader jump - disable watchdog after watchdog reset - clear WDRF after watchdog reset --- common/bootloader.c | 27 +++++++++++++++------------ keyboard/hhkb/Makefile.iwrap | 9 +++++++++ keyboard/hhkb/Makefile.lufa | 11 ++++++----- 3 files changed, 30 insertions(+), 17 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 @@ #endif -/* Boot Section Size in bytes - * Teensy halfKay 512 - * Atmel DFU loader 4096 - * LUFA bootloader 4096 +/* Boot Section Size in *BYTEs* + * Teensy halfKay 512 + * Teensy++ halfKay 1024 + * Atmel DFU loader 4096 + * LUFA bootloader 4096 */ #ifndef BOOT_SIZE #define BOOT_SIZE 512 #endif -#define FLASH_SIZE (FLASHEND + 1) +#define FLASH_SIZE (FLASHEND + 1L) #define BOOTLOADER_START (FLASH_SIZE - BOOT_SIZE) @@ -58,13 +59,15 @@ void bootloader_jump_after_watchdog_reset(void) __attribute__ ((used, naked, sec void bootloader_jump_after_watchdog_reset(void) { if ((MCUSR & (1<