diff options
Diffstat (limited to 'lightctrl.c')
-rw-r--r-- | lightctrl.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/lightctrl.c b/lightctrl.c index 5b5e1c0..7c0f1e9 100644 --- a/lightctrl.c +++ b/lightctrl.c @@ -31,6 +31,11 @@ const uint8_t __signature[3] __attribute__((section (".signature"), used)) = static uint8_t target[0x40] = { 0 }; static uint8_t cooldown[0x40] = { 0 }; static void target_set(uint8_t dst, uint8_t val); +#define target_get(idx) target[idx] +/* [0] bit 0 => addr 0, [0] bit 1 => addr 1, etc. */ +static uint8_t dali_map[8]; +#define target_present(addr) (dali_map[(addr) >> 3] & (1 << ((addr) & 0x07))) +#define target_set_present(addr) dali_map[(addr) >> 3] |= 1 << ((addr) & 0x7) #include "uart.c" #include "tick.c" |