Skip to content

Commit

Permalink
apply mode by binart bit match and not by equality
Browse files Browse the repository at this point in the history
  • Loading branch information
habazut committed May 9, 2024
1 parent 86310ae commit 91818ed
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions TrackManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@

#define APPLY_BY_MODE(findmode,function) \
FOR_EACH_TRACK(t) \
if (track[t]->getMode()==findmode) \
if (track[t]->getMode() & findmode) \
track[t]->function;

MotorDriver * TrackManager::track[MAX_TRACKS] = { NULL };
Expand Down Expand Up @@ -398,7 +398,7 @@ bool TrackManager::parseEqualSign(Print *stream, int16_t params, int16_t p[])
if (params==2 && p[1]=="AUTO"_hk) // <= id AUTO>
return setTrackMode(p[0], track[p[0]]->getMode() | TRACK_MODE_AUTOINV);

if (params==2 && p[1]=="INV"_hk) // <= id AUTO>
if (params==2 && p[1]=="INV"_hk) // <= id INV>
return setTrackMode(p[0], track[p[0]]->getMode() | TRACK_MODE_INV);

if (params==3 && p[1]=="DC"_hk && p[2]>0) // <= id DC cab>
Expand Down

0 comments on commit 91818ed

Please sign in to comment.