G.U.L.L.S. rebuilt to use PlatformIO

This commit is contained in:
2024-07-01 19:18:45 -04:00
commit f934849576
55 changed files with 4082 additions and 0 deletions

50
include/LEDHAL.h Normal file
View File

@@ -0,0 +1,50 @@
#ifndef LEDHAL_H
#define LEDHAL_H
#include "FastLED.h"
class LEDHAL {
public:
LEDHAL(char* _ledName, bool _isPhysical) :
ledName(_ledName), isPhysical(_isPhysical), showRequested(false) {}
virtual ~LEDHAL() { delete ledName; }
virtual char* getLEDName() { return ledName; }
virtual uint16_t getNumLEDs() = 0;
virtual bool getIsPhysical() { return isPhysical; }
virtual CRGB getColor(int16_t pixel) = 0;
virtual void setColor(int16_t pixel, CRGB color) = 0;
virtual void requestShow() { showRequested = true; }
//TODO UnifiedColor should have constants
virtual void clearLEDs() {
for(uint16_t i = 0; i < getNumLEDs(); i++) {
setColor(i, CRGB(0, 0, 0));
}
};
void show() {
if(showRequested) {
updateLEDs();
showRequested = false;
}
}
protected:
virtual void updateLEDs() {};
private:
char*
ledName;
bool
isPhysical,
showRequested;
};
#endif