mirror of
https://github.com/arwidcool/Solder-Plate.git
synced 2024-11-13 18:00:51 +01:00
fixe compile error
This commit is contained in:
parent
27593e1916
commit
18929e46f8
@ -21,7 +21,7 @@ Pair<ButtonKind, StateChangeEvent<ButtonState>>* Buttons::handleButtons()
|
||||
{
|
||||
StateChangeEvent<ButtonState> *change = __buttons[i]->lastChange();
|
||||
|
||||
Serial.println(STATECHANGE_STR((*change)));
|
||||
Serial.println(String("ButtonStateChange: kind=") + KIND_STR(__buttons[i]->kind) + ", " + STATECHANGE_STR((*change)));
|
||||
return new Pair<ButtonKind, StateChangeEvent<ButtonState>>(__buttons[i]->kind, *change);
|
||||
}
|
||||
}
|
||||
|
@ -1,7 +1,6 @@
|
||||
#ifndef __enums_h__
|
||||
#define __enums_h__
|
||||
|
||||
|
||||
enum ButtonState
|
||||
{
|
||||
IDLE,
|
||||
@ -18,8 +17,12 @@ enum ButtonKind
|
||||
NONE
|
||||
};
|
||||
|
||||
#define KIND_STR(kind) (kind == ButtonKind::UP ? "UP" : kind == ButtonKind::DOWN ? "DOWN" : kind == ButtonKind::BACK ? "BACK" : kind == ButtonKind::SELECT ? "SELECT" : "NONE")
|
||||
#define STATE_STR(state) (state == ButtonState::IDLE ? "IDLE" : state == ButtonState::PRESSED ? "PRESSED" : "RELEASED")
|
||||
#define STATECHANGE_STR(change) (String("ButtonStateChange: kind=") + KIND_STR(change.kind) + ", " + STATE_STR(change.from) + " -> " + STATE_STR(change.to))
|
||||
#define KIND_STR(kind) (kind == ButtonKind::UP ? "UP" : kind == ButtonKind::DOWN ? "DOWN" \
|
||||
: kind == ButtonKind::BACK ? "BACK" \
|
||||
: kind == ButtonKind::SELECT ? "SELECT" \
|
||||
: "NONE")
|
||||
#define STATE_STR(state) (state == ButtonState::IDLE ? "IDLE" : state == ButtonState::PRESSED ? "PRESSED" \
|
||||
: "RELEASED")
|
||||
#define STATECHANGE_STR(change) (String(STATE_STR(change.from)) + " -> " + STATE_STR(change.to))
|
||||
|
||||
#endif
|
Loading…
Reference in New Issue
Block a user