From 8bfc02c68ac25c42e64b7880132c1a19ef46f7da Mon Sep 17 00:00:00 2001 From: cpldcpu Date: Thu, 13 Mar 2014 09:50:37 +0100 Subject: firmware: added WDR --- firmware/main.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'firmware') diff --git a/firmware/main.c b/firmware/main.c index 7f200ee..486a26b 100644 --- a/firmware/main.c +++ b/firmware/main.c @@ -74,6 +74,7 @@ register uint8_t command asm("r3"); // bind command to r3 #define sei() asm volatile("sei") #define cli() asm volatile("cli") #define nop() asm volatile("nop") +#define wdr() asm volatile("wdr") // Use the old delay routines without NOP padding. This saves memory. #define __DELAY_BACKWARD_COMPATIBLE__ @@ -217,7 +218,7 @@ static inline void leaveBootloader(void) { void USB_INTR_VECTOR(void); int main(void) { bootLoaderInit(); - + if (bootLoaderStartCondition()||(pgm_read_byte(BOOTLOADER_ADDRESS - TINYVECTOR_RESET_OFFSET + 1)==0xff)) { initHardware(); @@ -258,6 +259,8 @@ int main(void) { } while(--fastctr); + wdr(); + // commands are only evaluated after next USB transmission or after 5 ms passed if (command==cmd_erase_application) eraseApplication(); -- cgit v1.2.3