diff options
-rw-r--r-- | dali2.c | 9 | ||||
-rw-r--r-- | lightctrl.c | 3 | ||||
-rw-r--r-- | wdt.c | 2 |
3 files changed, 13 insertions, 1 deletions
@@ -280,3 +280,12 @@ static void dali_init(void) asm volatile ("" ::: "memory"); TCCR0B = (0 << CS02) | (1 << CS01) | (0 << CS00); // 8 MHz / 8 = 1MHz } + +static void dali_buscheck(void) +{ + while ((PIND >> D_DALII) & 1) { + uart_puttick(); + uart_puts("DALI bus stuck/not powered/active\n"); + _delay_ms(20); + } +} diff --git a/lightctrl.c b/lightctrl.c index e901714..bc5e67e 100644 --- a/lightctrl.c +++ b/lightctrl.c @@ -216,9 +216,12 @@ int main(void) wdt_reset(); uart_puts("\ninit done\n"); + dali_buscheck(); + can_init(); can_CANSTAT(); + wdt_reset(); dali_search(); while (1) { @@ -15,7 +15,7 @@ WDE = 3\n\ ldi %[temp], (1 << WDCE) | (1 << WDE) \n\ sts WDTCSR, %[temp] \n\ \n\ - ldi %[temp], (1 << WDE) | 0x07 \n\ + ldi %[temp], (1 << WDE) | 0x20 \n\ sts WDTCSR, %[temp] \n\ " : [temp] "=r" (temp) : : "memory"); |