PFW-1404 Add more comments

pull/233/head
Guðni Már Gilbert 2022-10-29 08:47:43 +00:00
parent b7c8bbd41e
commit b17cfb10bf
2 changed files with 7 additions and 1 deletions

View File

@ -34,10 +34,14 @@ public:
/// Performs one step of the state machine - reads the ADC, processes debouncing, updates states of individual buttons
void Step();
/// @returns true if button at index is pressed
/// @brief Indicates whether or not a particular button was pressed
/// @param index of the button to check
/// @return true if button at index is pressed, false otherwise
inline bool ButtonPressed(uint8_t index) const { return buttons[index].Pressed(); }
/// @brief Indicates whether or not a particular button was released
/// @param index of the button to check
/// @return true if button at index is released, false otherwise
inline bool ButtonReleased(uint8_t index) const { return buttons[index].Released(); }
/// @returns true if any of the button is pressed

View File

@ -19,6 +19,8 @@ public:
/// @returns true if debounced value is currently considered as pressed
inline bool Pressed() const { return f.state == State::WaitForRelease; }
/// @returns true if debounced value is currently considered as released
inline bool Released() const { return f.state == State::Update; }
/// State machine stepping routine