summaryrefslogtreecommitdiff
path: root/lightctrl_v2.c
diff options
context:
space:
mode:
Diffstat (limited to 'lightctrl_v2.c')
-rw-r--r--lightctrl_v2.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/lightctrl_v2.c b/lightctrl_v2.c
index 22dc0b2..f9ff43a 100644
--- a/lightctrl_v2.c
+++ b/lightctrl_v2.c
@@ -166,12 +166,17 @@ static void can_handle_light(uint16_t sublab_addr)
/* - 7 allows overlapping writes to a nonaligned address.
* "base" below will start out at 0xf9~0xff in that case */
- if (sublab_addr < CANA_DALI_BASE - 7)
+ if (sublab_addr < CANA_DALI_BASE - 8)
return;
uint8_t base = sublab_addr - CANA_DALI_BASE, len = can_rx_len(), pos;
for (pos = 0; pos < len; pos++) {
uint8_t dst = base + pos, val;
+ if (dst == 0xff) {
+ /* bus element 43f: hw switch disable */
+ sw.enabled = can_rx_data[pos] != 0;
+ continue;
+ }
if (dst >= 0x40)
continue;
val = can_rx_data[pos];