Skip to content

Commit

Permalink
Cycling bugfix.
Browse files Browse the repository at this point in the history
  • Loading branch information
blazoncek committed Oct 22, 2021
1 parent 00f1b48 commit 0acca2e
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions wled00/set.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -530,9 +530,9 @@ bool updateVal(const String* req, const char* key, byte* val, byte minv, byte ma
if (out == 0)
{
if (req->charAt(pos+4) == '-') {
*val = min((int)maxv, max((int)minv, (int)(*val -1)));
*val = (int)(*val -1) < (int)minv ? maxv : min((int)maxv,(*val -1));
} else {
*val = min((int)maxv, max((int)minv, (int)(*val +1)));
*val = (int)(*val +1) > (int)maxv ? minv : max((int)minv,(*val +1));
}
} else {
out += *val;
Expand Down

0 comments on commit 0acca2e

Please sign in to comment.