aboutsummaryrefslogtreecommitdiff
path: root/firmware
diff options
context:
space:
mode:
authorDimitri Sokolyuk <demon@dim13.org>2012-03-15 17:08:34 +0000
committerDimitri Sokolyuk <demon@dim13.org>2012-03-15 17:08:34 +0000
commit1e2fdb0ef861177a8e7be7d0102edc98dae8d456 (patch)
treeadf8c531f176043b89d4a42c267e83cfdeeac488 /firmware
parent7c6f6229a9bc7d818817436a99728d66f0f3bc76 (diff)
disable watchdog at boot
Diffstat (limited to 'firmware')
-rw-r--r--firmware/firmware.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/firmware/firmware.c b/firmware/firmware.c
index e6015fe..f423d70 100644
--- a/firmware/firmware.c
+++ b/firmware/firmware.c
@@ -17,6 +17,7 @@
#include <avr/io.h>
#include <avr/boot.h>
+#include <avr/wdt.h>
#include <util/setbaud.h> /* depends on BAUD & F_CPU env vars */
#define TIMEOUT (F_CPU >> 4) /* ~ 1 sec */
@@ -36,11 +37,14 @@ main(void)
{
uint32_t c = 0;
uint16_t off = 0;
- uint16_t n = 0;
+ uint8_t n = 0;
uint8_t ch = 0;
uint8_t sum = 0;
uint8_t state = INIT;
+ MCUSR = 0;
+ wdt_disable();
+
UCSR0B = _BV(RXEN0) | _BV(TXEN0);
UBRR0H = UBRRH_VALUE;
UBRR0L = UBRRL_VALUE;