parent
7b9e707709
commit
62b90fde28
|
|
@ -186,20 +186,15 @@ const char * PrusaErrorButtonMore(){
|
||||||
return MSG_BTN_MORE;
|
return MSG_BTN_MORE;
|
||||||
}
|
}
|
||||||
|
|
||||||
struct ResetOnExit {
|
|
||||||
ResetOnExit() = default;
|
|
||||||
~ResetOnExit(){
|
|
||||||
buttonSelectedOperation = ButtonOperations::NoOperation;
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
Buttons ButtonPressed(ErrorCode ec) {
|
Buttons ButtonPressed(ErrorCode ec) {
|
||||||
if (buttonSelectedOperation == ButtonOperations::NoOperation) {
|
if (buttonSelectedOperation == ButtonOperations::NoOperation) {
|
||||||
return Buttons::NoButton; // no button
|
return Buttons::NoButton; // no button
|
||||||
}
|
}
|
||||||
|
|
||||||
ResetOnExit ros; // clear buttonSelectedOperation on exit from this call
|
const auto result = ButtonAvailable(ec);
|
||||||
return ButtonAvailable(ec);
|
buttonSelectedOperation = ButtonOperations::NoOperation; // Reset operation
|
||||||
|
|
||||||
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
Buttons ButtonAvailable(ErrorCode ec) {
|
Buttons ButtonAvailable(ErrorCode ec) {
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue