Skip to content

Commit 0acca2e

Browse files
committed
Cycling bugfix.
1 parent 00f1b48 commit 0acca2e

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

wled00/set.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -530,9 +530,9 @@ bool updateVal(const String* req, const char* key, byte* val, byte minv, byte ma
530530
if (out == 0)
531531
{
532532
if (req->charAt(pos+4) == '-') {
533-
*val = min((int)maxv, max((int)minv, (int)(*val -1)));
533+
*val = (int)(*val -1) < (int)minv ? maxv : min((int)maxv,(*val -1));
534534
} else {
535-
*val = min((int)maxv, max((int)minv, (int)(*val +1)));
535+
*val = (int)(*val +1) > (int)maxv ? minv : max((int)minv,(*val +1));
536536
}
537537
} else {
538538
out += *val;

0 commit comments

Comments
 (0)