diff --git a/code/espurna/button.h b/code/espurna/button.h index 2703f203..73a896d6 100644 --- a/code/espurna/button.h +++ b/code/espurna/button.h @@ -16,6 +16,8 @@ Copyright (C) 2016-2019 by Xose PĂ©rez constexpr size_t ButtonsPresetMax = 8; constexpr size_t ButtonsMax = 32; +using button_action_t = uint8_t; + enum class button_event_t { None = 0, Pressed = 1, @@ -27,12 +29,12 @@ enum class button_event_t { }; struct button_actions_t { - uint16_t pressed; - uint16_t click; - uint16_t dblclick; - uint16_t lngclick; - uint16_t lnglngclick; - uint16_t trplclick; + button_action_t pressed; + button_action_t click; + button_action_t dblclick; + button_action_t lngclick; + button_action_t lnglngclick; + button_action_t trplclick; }; struct button_event_delays_t { @@ -64,7 +66,7 @@ struct button_t { }; bool buttonState(unsigned char id); -uint16_t buttonAction(unsigned char id, const button_event_t event); +button_action_t buttonAction(unsigned char id, const button_event_t event); void buttonMQTT(unsigned char id, button_event_t event); void buttonEvent(unsigned char id, button_event_t event); diff --git a/code/espurna/button.ino b/code/espurna/button.ino index ec549436..f60bd660 100644 --- a/code/espurna/button.ino +++ b/code/espurna/button.ino @@ -330,7 +330,7 @@ bool buttonState(unsigned char id) { return _buttons[id].state(); } -uint16_t buttonAction(unsigned char id, const button_event_t event) { +button_action_t buttonAction(unsigned char id, const button_event_t event) { if (id >= _buttons.size()) return 0; return _buttonDecodeEventAction(_buttons[id].actions, event); }