diff options
author | David Lamparter <equinox@diac24.net> | 2012-06-20 20:47:17 +0200 |
---|---|---|
committer | David Lamparter <equinox@diac24.net> | 2012-06-20 20:47:17 +0200 |
commit | 1b6e0ae14c74b7763e6e7d6320212985ec86c77b (patch) | |
tree | 413a77dfff6f45c0138c424c541411d6274fec92 | |
parent | e76be747809cd78e8dafe6be0d76090295bcfb3f (diff) |
dali: clean up search
-rw-r--r-- | dali_ctl.c | 15 |
1 files changed, 6 insertions, 9 deletions
@@ -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); |