From 4abd8abfaa9e5e48c6147c9156f02162db4e0d99 Mon Sep 17 00:00:00 2001 From: redfast00 Date: Fri, 18 Mar 2022 21:42:42 +0100 Subject: [PATCH] Add reset_press_count method to Debounced --- lib/obus_util.cpp | 4 ++++ lib/obus_util.h | 1 + 2 files changed, 5 insertions(+) diff --git a/lib/obus_util.cpp b/lib/obus_util.cpp index 4cc8a8e..27e4f51 100644 --- a/lib/obus_util.cpp +++ b/lib/obus_util.cpp @@ -50,3 +50,7 @@ bool Debounced::loop(bool currently_down) { uint16_t Debounced::get_press_count() { return press_count; } + +void Debounced::reset_press_count() { + press_count = 0; +} diff --git a/lib/obus_util.h b/lib/obus_util.h index 99bf555..91effeb 100644 --- a/lib/obus_util.h +++ b/lib/obus_util.h @@ -28,6 +28,7 @@ class Debounced { bool loop(bool currently_down); uint16_t get_press_count(); + void reset_press_count(); }; #endif /* end of include guard: OBUS_UTIL_H */