summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas White <taw@physics.org>2019-06-11 22:48:31 +0200
committerThomas White <taw@physics.org>2019-06-11 23:21:03 +0200
commit8b48cbe1bf7dfd5cd7a1400357e9586c29b57aac (patch)
tree68088bbfe5bbd3448d4e6d2aae93e5acec512b2f
parent6ef035a2ad6ac9e3d9f5c2950a7ac2664919bd0b (diff)
Fix DMX addresses
-rw-r--r--src/scanout.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/scanout.c b/src/scanout.c
index 1c5823b..49c6b6b 100644
--- a/src/scanout.c
+++ b/src/scanout.c
@@ -43,7 +43,8 @@ int scanout_all(struct nanolight *nl)
int j;
struct fixture *fix = &nl->fixtures[i];
for ( j=0; j<fix->cls->n_attrs; j++ ) {
- int pos = fix->base_addr + fix->cls->attrs[j].addr_offset;
+ /* Minus one to convert DMX address to indexing in 'dmx' array */
+ int pos = fix->base_addr + fix->cls->attrs[j].addr_offset - 1;
if ( fix->cls->attrs[j].props & ATTR_16BIT ) {
dmx[pos] = (fix->attr_vals[j] & 0xff00) >> 8;
dmx[pos+1] = fix->attr_vals[j] & 0xff;