omit sending hat if direction is not changed
This commit is contained in:
@@ -36,6 +36,7 @@ struct arrow newestArrow;
|
||||
#define ButtonInfoTableSize 9
|
||||
struct ButtonInfo buttonInfoTable[ButtonInfoTableSize];
|
||||
|
||||
Hat last = Hat::CENTER;
|
||||
|
||||
void perms() {
|
||||
if(val == 0){
|
||||
@@ -103,7 +104,6 @@ void setup()
|
||||
oldestArrow.arrowSymbol = Hat::CENTER;
|
||||
newestArrow.older = &oldestArrow;
|
||||
newestArrow.newer = NULL;
|
||||
|
||||
}
|
||||
|
||||
void handleButtonInput(ButtonInfo *but){
|
||||
@@ -158,8 +158,10 @@ void loop()
|
||||
arrowTable[i].prev = arrowTable[i].current;
|
||||
}
|
||||
|
||||
|
||||
SwitchControlLibrary().MoveHat(static_cast<uint8_t>(newestArrow.older->arrowSymbol));
|
||||
if(newestArrow.older->arrowSymbol != last){
|
||||
last = newestArrow.older->arrowSymbol;
|
||||
SwitchControlLibrary().MoveHat(static_cast<uint8_t>(newestArrow.older->arrowSymbol));
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user