From 5b9c2a7e472313bed6638c262448c45934a44492 Mon Sep 17 00:00:00 2001 From: Mike Date: Tue, 9 Jan 2024 13:27:33 +0000 Subject: [PATCH] Fix hw_timer1_read() (#2701) SDK >= 5 requies additional call --- Sming/Arch/Esp32/Components/driver/hw_timer.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Sming/Arch/Esp32/Components/driver/hw_timer.cpp b/Sming/Arch/Esp32/Components/driver/hw_timer.cpp index 8ab470c5b0..5106e59c55 100644 --- a/Sming/Arch/Esp32/Components/driver/hw_timer.cpp +++ b/Sming/Arch/Esp32/Components/driver/hw_timer.cpp @@ -143,6 +143,7 @@ class TimerConfig timer_ll_get_counter_value(dev, index, &val); return val; #else + timer_ll_trigger_soft_capture(dev, index); return timer_ll_get_counter_value(dev, index); #endif } @@ -214,7 +215,7 @@ void IRAM_ATTR hw_timer1_disable(void) timer.enable_counter(false); } -uint32_t hw_timer1_read(void) +uint32_t IRAM_ATTR hw_timer1_read(void) { return timer.get_counter_value(); }