We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
espp::HighResolutionTimer
1 parent 4351fef commit 1804100Copy full SHA for 1804100
components/timer/include/high_resolution_timer.hpp
@@ -49,12 +49,7 @@ class HighResolutionTimer : public espp::BaseComponent {
49
}
50
51
/// Destructor
52
- ~HighResolutionTimer() {
53
- stop();
54
- if (timer_handle_) {
55
- esp_timer_delete(timer_handle_);
56
- }
57
+ ~HighResolutionTimer() { stop(); }
58
59
/// Start the timer
60
/// @param period_us Period of the timer in microseconds, or timeout if
@@ -111,6 +106,10 @@ class HighResolutionTimer : public espp::BaseComponent {
111
106
if (is_running()) {
112
107
esp_timer_stop(timer_handle_);
113
108
109
+ if (timer_handle_) {
110
+ esp_timer_delete(timer_handle_);
+ timer_handle_ = nullptr;
+ }
114
115
116
/// Check if the timer is running
0 commit comments