led selection improvement 1
This commit is contained in:
parent
6685e9742e
commit
2a689371f0
@ -343,16 +343,19 @@ void SetSaturation_execute(int shift) {
|
||||
|
||||
void LightOn_execute(int shift) {
|
||||
uint16_t &ledOnCounter = ledRingState.ledRingColorState.ledOnCounter;
|
||||
static bool clockwise = true;
|
||||
|
||||
if (shift > 0) {
|
||||
if ((shift > 0) != !clockwise) {
|
||||
++ledOnCounter;
|
||||
if (ledOnCounter > LedCount) {
|
||||
ledOnCounter = 0;
|
||||
ledOnCounter = LedCount;
|
||||
clockwise = !clockwise;
|
||||
}
|
||||
} else {
|
||||
--ledOnCounter;
|
||||
if (ledOnCounter == UINT16_MAX) {
|
||||
ledOnCounter = LedCount;
|
||||
ledOnCounter = 0;
|
||||
clockwise = !clockwise;
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user