diff options
author | David Lamparter <equinox@diac24.net> | 2012-09-20 05:16:46 +0200 |
---|---|---|
committer | David Lamparter <equinox@diac24.net> | 2012-09-20 05:18:52 +0200 |
commit | 2bae1f8a73bdd5fca71fd3e60807d6b618e675d1 (patch) | |
tree | 435a2c9595cf12542c9ede44f77f95432b955c1d /dali_ctl.c | |
parent | b42baac581ade81def3f40ab7256efdcba94ad5e (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.c | 8 |
1 files changed, 8 insertions, 0 deletions
@@ -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"); |