summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--dali_ctl.c15
1 files changed, 6 insertions, 9 deletions
diff --git a/dali_ctl.c b/dali_ctl.c
index 50dc77c..b1502d4 100644
--- a/dali_ctl.c
+++ b/dali_ctl.c
@@ -28,19 +28,11 @@ static void dali_search_byte(uint16_t cmd)
dali_s_byte = 0xff;
uint8_t bit = 0x80;
- uart_puthex(cmd >> 8);
- uart_puts("dali byte\n");
while (bit) {
- uart_puts("dali sb ");
- uart_puthex(dali_s_byte & ~bit);
- uart_puts("\n");
-
dali_twice(cmd | (dali_s_byte & ~bit));
if (dali_compare()) {
- uart_puts("cx1\n");
dali_s_byte &= ~bit;
} else if (dali_compare()) {
- uart_puts("cx2\n");
dali_s_byte &= ~bit;
}
bit >>= 1;
@@ -85,8 +77,13 @@ static void dali_search(void)
uart_puthex(dali_sh);
uart_puthex(dali_sm);
uart_puthex(dali_sl);
- uart_puts("\n");
dali_send(DALI_C_QURYSHORT);
+ if (dali_rx_avail) {
+ uart_puts(" short: ");
+ uart_puthex(dali_rx);
+ uart_puts("\n");
+ } else
+ uart_puts(" noshort\n");
dali_send(DALI_C_WITHDRAW);
}
} while (!dali_s_notfound);