summaryrefslogtreecommitdiffstats
path: root/firmware
diff options
context:
space:
mode:
authorcpldcpu <cpldcpu@gmail.com>2014-03-13 09:50:37 +0100
committercpldcpu <cpldcpu@gmail.com>2014-03-13 09:50:37 +0100
commit8bfc02c68ac25c42e64b7880132c1a19ef46f7da (patch)
tree289c73d9abf00a8a4fd9d1909fd84d90d12ca50a /firmware
parent37db25e1c902172be1abf883ec0aaa210a1e0f3d (diff)
downloadmicronucleus-8bfc02c68ac25c42e64b7880132c1a19ef46f7da.tar.gz
micronucleus-8bfc02c68ac25c42e64b7880132c1a19ef46f7da.tar.bz2
micronucleus-8bfc02c68ac25c42e64b7880132c1a19ef46f7da.zip
firmware: added WDR
Diffstat (limited to 'firmware')
-rw-r--r--firmware/main.c5
1 files changed, 4 insertions, 1 deletions
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();