Skip to content

Commit 1d09c77

Browse files
committed
Revert "Use sk6812p"
This reverts commit 4160d98.
1 parent dba89c5 commit 1d09c77

File tree

1 file changed

+7
-6
lines changed

1 file changed

+7
-6
lines changed

include/base.h

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,8 @@ class Base
3535
// LED strip number
3636
int ledsNumber = 0;
3737

38-
std::vector<sk6812p*> ledStrips;
38+
// Should I use sk6812p instead?
39+
std::vector<LED_DRIVER*> ledStrips;
3940
std::vector<int> ledCounts = {240, 129};
4041

4142
// frame is set and ready to render
@@ -66,13 +67,13 @@ class Base
6667

6768
void initializeLedStrips()
6869
{
69-
for (sk6812p* ledStrip : ledStrips) {
70+
for (LED_DRIVER* ledStrip : ledStrips) {
7071
delete ledStrip;
7172
}
7273
ledStrips.clear();
7374

7475
for (int ledCount : ledCounts) {
75-
sk6812p* ledStrip = new sk6812p(ledCount, DATA_PIN);
76+
LED_DRIVER* ledStrip = new LED_DRIVER(ledCount, DATA_PIN);
7677
ledStrips.push_back(ledStrip);
7778
}
7879
}
@@ -82,7 +83,7 @@ class Base
8283
return ledStrips.size();
8384
}
8485

85-
inline sk6812p* getLedStrip(int index)
86+
inline LED_DRIVER* getLedStrip(int index)
8687
{
8788
if (index < 0 || index >= ledStrips.size()) {
8889
return nullptr;
@@ -122,7 +123,7 @@ class Base
122123
if (newFrame)
123124
readyToRender = true;
124125

125-
sk6812p* firstLedStrip = getLedStrip(0);
126+
LED_DRIVER* firstLedStrip = getLedStrip(0);
126127

127128
if (readyToRender &&
128129
(firstLedStrip != nullptr && firstLedStrip->isReadyBlocking()))
@@ -151,7 +152,7 @@ class Base
151152
return false;
152153
}
153154

154-
sk6812p* ledStrip = getLedStrip(stripIndex);
155+
LED_DRIVER* ledStrip = getLedStrip(stripIndex);
155156
if (ledStrip == nullptr) {
156157
return false;
157158
}

0 commit comments

Comments
 (0)