mirror of
https://github.com/arwidcool/Solder-Plate.git
synced 2024-11-14 10:17:40 +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();
|
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);
|
return new Pair<ButtonKind, StateChangeEvent<ButtonState>>(__buttons[i]->kind, *change);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1,7 +1,6 @@
|
|||||||
#ifndef __enums_h__
|
#ifndef __enums_h__
|
||||||
#define __enums_h__
|
#define __enums_h__
|
||||||
|
|
||||||
|
|
||||||
enum ButtonState
|
enum ButtonState
|
||||||
{
|
{
|
||||||
IDLE,
|
IDLE,
|
||||||
@ -18,8 +17,12 @@ enum ButtonKind
|
|||||||
NONE
|
NONE
|
||||||
};
|
};
|
||||||
|
|
||||||
#define KIND_STR(kind) (kind == ButtonKind::UP ? "UP" : kind == ButtonKind::DOWN ? "DOWN" : kind == ButtonKind::BACK ? "BACK" : kind == ButtonKind::SELECT ? "SELECT" : "NONE")
|
#define KIND_STR(kind) (kind == ButtonKind::UP ? "UP" : kind == ButtonKind::DOWN ? "DOWN" \
|
||||||
#define STATE_STR(state) (state == ButtonState::IDLE ? "IDLE" : state == ButtonState::PRESSED ? "PRESSED" : "RELEASED")
|
: kind == ButtonKind::BACK ? "BACK" \
|
||||||
#define STATECHANGE_STR(change) (String("ButtonStateChange: kind=") + KIND_STR(change.kind) + ", " + STATE_STR(change.from) + " -> " + STATE_STR(change.to))
|
: 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
|
#endif
|
Loading…
Reference in New Issue
Block a user