Skip to content

Commit

Permalink
handle 2 leds being chained
Browse files Browse the repository at this point in the history
  • Loading branch information
andreas committed Sep 7, 2024
1 parent ee9da79 commit 9ae5533
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion lib/ledspitask/GwLedSpiTask.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@ void handleSpiLeds(GwApi *api){
(int)bus,ledPin,(int)err);
EXIT_TASK;
}
const int NUMLEDS=1;
const int NUMLEDS=2;
Color leds[NUMLEDS];
size_t bufferSize=NUMLEDS*3*3;
uint8_t *outbuffer=(uint8_t*) heap_caps_malloc(bufferSize,MALLOC_CAP_DMA);
Expand Down Expand Up @@ -227,6 +227,7 @@ void handleSpiLeds(GwApi *api){
{
first=false;
leds[0] = setBrightness(colorFromMode(newMode),brightness);
leds[1] = leds[0];
LOG_DEBUG(GwLog::DEBUG,"(%d) mode=%d,setting color g=%d,r=%d,b=%d",modeIndex,(int)newMode,leds[0].g,leds[0].r,leds[0].b);
ledsToBuffer(NUMLEDS,leds,outbuffer);
struct spi_transaction_t ta = {
Expand Down

0 comments on commit 9ae5533

Please sign in to comment.