Skip to content

Commit d2045ca

Browse files
authored
Enhance documentation for repeat function
Updated documentation for the repeat function to clarify its behavior and parameters.
1 parent f585a72 commit d2045ca

1 file changed

Lines changed: 6 additions & 1 deletion

File tree

src/PicoButtonAsync.h

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -164,7 +164,12 @@ class PicoButton {
164164
return false;
165165
}
166166

167-
/** @brief Repeated triggers while held. */
167+
/**
168+
* @brief Checks if the button is currently held down.
169+
* This is a non-blocking check of the last debounced state.
170+
* Simulates repeated triggers every interval_ms.
171+
* @return true if the button is pressed (logic low) for delay_ms amount of time.
172+
*/
168173
bool repeat(uint32_t delay_ms = 500, uint32_t interval_ms = 100) {
169174
bool current = isPressed();
170175
if (current && _pressStartTime > 0 && (_now() - _pressStartTime >= delay_ms)) {

0 commit comments

Comments
 (0)