3131class 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);
0 commit comments