Skip to content

Commit 18ae8b9

Browse files
committed
Updates
1 parent 8bcf28b commit 18ae8b9

File tree

2 files changed

+25
-32
lines changed

2 files changed

+25
-32
lines changed

include/base.h

Lines changed: 24 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -31,11 +31,7 @@
3131
class Base
3232
{
3333
// LED strip number
34-
int ledsNumber = 0;
35-
// NeoPixelBusLibrary primary object
36-
LED_DRIVER* ledStrip1 = nullptr;
37-
// NeoPixelBusLibrary second object
38-
LED_DRIVER2* ledStrip2 = nullptr;
34+
int ledsNumber = 3;
3935
// frame is set and ready to render
4036
bool readyToRender = false;
4137

@@ -64,16 +60,6 @@ class Base
6460
return ledsNumber;
6561
}
6662

67-
inline LED_DRIVER* getLedStrip1()
68-
{
69-
return ledStrip1;
70-
}
71-
72-
inline LED_DRIVER2* getLedStrip2()
73-
{
74-
return ledStrip2;
75-
}
76-
7763
void initLedStrip(int count)
7864
{
7965
for (int i = 0; i < ledSegments; i++) {
@@ -109,14 +95,17 @@ class Base
10995
if (newFrame)
11096
readyToRender = true;
11197

112-
if (readyToRender &&
113-
(ledStrip1 != nullptr && ledStrip1->isReadyBlocking()))
98+
if (readyToRender)
11499
{
115100
statistics.increaseShow();
116101
readyToRender = false;
117102

118103
for (int i = 0; i < ledSegments; i++) {
119104
if (ledStrips[i] != nullptr) {
105+
if (!ledStrips[i]->isReadyBlocking()) {
106+
return;
107+
}
108+
120109
ledStrips[i]->renderAllLanes();
121110
}
122111
}
@@ -127,20 +116,24 @@ class Base
127116
{
128117
if (pix < ledsNumber)
129118
{
130-
#if defined(SECOND_SEGMENT_START_INDEX)
131-
if (pix < SECOND_SEGMENT_START_INDEX)
132-
ledStrip1->SetPixel(pix, inputColor);
133-
else
134-
{
135-
#if defined(SECOND_SEGMENT_REVERSED)
136-
ledStrip2->SetPixel(ledsNumber - pix - 1, inputColor);
137-
#else
138-
ledStrip2->SetPixel(pix - SECOND_SEGMENT_START_INDEX, inputColor);
139-
#endif
140-
}
141-
#else
142-
ledStrip1->SetPixel(pix, inputColor);
143-
#endif
119+
ledStrips[pix]->SetPixel(0, inputColor);
120+
121+
// TODO: Figure out which strip to set
122+
123+
// #if defined(SECOND_SEGMENT_START_INDEX)
124+
// if (pix < SECOND_SEGMENT_START_INDEX)
125+
// ledStrip1->SetPixel(pix, inputColor);
126+
// else
127+
// {
128+
// #if defined(SECOND_SEGMENT_REVERSED)
129+
// ledStrip2->SetPixel(ledsNumber - pix - 1, inputColor);
130+
// #else
131+
// ledStrip2->SetPixel(pix - SECOND_SEGMENT_START_INDEX, inputColor);
132+
// #endif
133+
// }
134+
// #else
135+
// ledStrip1->SetPixel(pix, inputColor);
136+
// #endif
144137
}
145138

146139
return (pix + 1 < ledsNumber);

include/leds.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -556,6 +556,6 @@ volatile bool DmaClient::isDmaBusy = false;
556556
// API classes
557557
// typedef NeopixelType<NeopixelSubtype::ws2812b, 650, ColorGrb32> ws2812;
558558
// typedef NeopixelType<NeopixelSubtype::sk6812, 450, ColorGrbw> sk6812;
559-
typedef NeopixelParallelType<NeopixelSubtype::ws2812b, 300, ColorGrb> ws2812p;
559+
// typedef NeopixelParallelType<NeopixelSubtype::ws2812b, 300, ColorGrb> ws2812p;
560560
typedef NeopixelParallelType<NeopixelSubtype::sk6812, 80, ColorGrbw> sk6812p;
561561
typedef DotstarType<100, ColorDotstartBgr> apa102;

0 commit comments

Comments
 (0)