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