Fixed main/first selected segments in IR.

Code optimization.
This commit is contained in:
Blaž Kristan
2022-02-25 10:24:00 +01:00
parent 053a1d34e5
commit c8f1297adb
6 changed files with 494 additions and 482 deletions

View File

@@ -3,9 +3,12 @@
/*
* LED methods
*/
void setValuesFromFirstSelectedSeg()
void setValuesFromMainSeg() { setValuesFromSegment(strip.getMainSegmentId()); }
void setValuesFromFirstSelectedSeg() { setValuesFromSegment(strip.getFirstSelectedSegId()); }
void setValuesFromSegment(uint8_t s)
{
WS2812FX::Segment& seg = strip.getFirstSelectedSeg();
WS2812FX::Segment& seg = strip.getSegment(s);
col[0] = R(seg.colors[0]);
col[1] = G(seg.colors[0]);
col[2] = B(seg.colors[0]);