From 6dd830daa5b1402cc02d4e9ad76b6303f6fa4f16 Mon Sep 17 00:00:00 2001 From: kaqu Date: Wed, 30 Sep 2020 19:23:15 +0200 Subject: [PATCH] Finally! 1st LED ok (h/w # must match!) --- firmware/main.c | 2 +- neopixelar.py | 4 ++-- neopixelengine.py | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/firmware/main.c b/firmware/main.c index 7c595f7..6d7c77e 100644 --- a/firmware/main.c +++ b/firmware/main.c @@ -69,7 +69,7 @@ static void boot_sequence(void) } //------------------- Illumination demo -------------------------------- -extern void busy_wait(unsigned int ms); +extern void busy_wait(unsigned int ms); // Worx! #define MAXTABLES 3 // 1..16 MUST match h/w! #define MAXLEDS 27 // 1..256 MUST match h/w! static int32_t arLEDBuffer[MAXTABLES][MAXLEDS]; // GRB values diff --git a/neopixelar.py b/neopixelar.py index f6880e6..77588bd 100755 --- a/neopixelar.py +++ b/neopixelar.py @@ -333,8 +333,8 @@ class BaseSoC(SoCCore): platform.add_extension(_gpios) # General LED outputs - max_TABLES = 16 # 1..16 - max_LEDS_per_chain = 32 # 1..256 + max_TABLES = 3 # 1..16 + max_LEDS_per_chain = 27 # 1..256 self.submodules.npe = NeoPixelEngine(n_TABLES=max_TABLES, n_LEDs=max_LEDS_per_chain) self.add_csr("npe") for i in range(42,56+2): # Do output on J4 (14) & J5 (2) diff --git a/neopixelengine.py b/neopixelengine.py index cd669b8..350c86c 100644 --- a/neopixelengine.py +++ b/neopixelengine.py @@ -237,7 +237,7 @@ class NeoPixelEngine(Module, AutoCSR, AutoDoc, ModuleDoc): ) fsm.act("NEXTTABLE", - If(self.b4Table < 16, + If(self.b4Table < n_TABLES, NextValue(self.b8Offset, 0), # Start @ 1st 24-bit data NextState("IDLE1") ).Else(