summaryrefslogtreecommitdiff
path: root/dali_ctl.c
diff options
context:
space:
mode:
authorDavid Lamparter <equinox@diac24.net>2012-09-20 05:16:46 +0200
committerDavid Lamparter <equinox@diac24.net>2012-09-20 05:18:52 +0200
commit2bae1f8a73bdd5fca71fd3e60807d6b618e675d1 (patch)
tree435a2c9595cf12542c9ede44f77f95432b955c1d /dali_ctl.c
parentb42baac581ade81def3f40ab7256efdcba94ad5e (diff)
lightctrl: use WDT
the CPU seems to get stuck for no apparent reason, right in the middle of a line on the serial console... weird. let's enable the WDT as a temporary band-aid.
Diffstat (limited to 'dali_ctl.c')
-rw-r--r--dali_ctl.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/dali_ctl.c b/dali_ctl.c
index ed23ce1..b5eb66b 100644
--- a/dali_ctl.c
+++ b/dali_ctl.c
@@ -41,6 +41,8 @@ static void dali_search_byte(uint16_t cmd)
uint8_t bit = 0x80;
while (bit) {
+ wdt_reset();
+
dali_twice(cmd | (dali_s_byte & ~bit));
if (dali_compare()) {
_delay_ms(1);
@@ -92,6 +94,8 @@ static void dali_search(void)
do {
dali_search_single();
if (!dali_s_notfound) {
+ wdt_reset();
+
uart_puts("dali scan found\t\t");
uart_puthex(dali_sh);
uart_puthex(dali_sm);
@@ -130,10 +134,14 @@ static void dali_search(void)
dali_map[addr >> 3] |= 1 << (addr & 0x7);
} else
uart_puts(" error\n");
+
+ wdt_reset();
dali_send(DALI_C_WITHDRAW);
}
} while (!dali_s_notfound);
+ wdt_reset();
+
dali_twice(DALI_C_TERMINATE);
uart_puts("dali scan end\n");