From 82161bebe357b78d1343fa0878e17c1fc8c3b315 Mon Sep 17 00:00:00 2001 From: me-no-dev Date: Mon, 19 Apr 2021 14:25:09 +0300 Subject: [PATCH] Use cpu_hal_get_cycle_count for all chips --- cores/esp32/Esp.h | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) diff --git a/cores/esp32/Esp.h b/cores/esp32/Esp.h index 81684836..34ddb3bd 100644 --- a/cores/esp32/Esp.h +++ b/cores/esp32/Esp.h @@ -22,9 +22,7 @@ #include #include -#ifndef CONFIG_IDF_TARGET_ESP32 // Broken in IDF 20210417 -#include -#endif +#include /** * AVR macros for WDT managment @@ -113,13 +111,7 @@ public: uint32_t ARDUINO_ISR_ATTR EspClass::getCycleCount() { - uint32_t ccount; -#ifdef CONFIG_IDF_TARGET_ESP32 - __asm__ __volatile__("esync; rsr %0,ccount":"=a" (ccount)); -#else // This should work on ESP32 once the hal is complete - ccount = systimer_hal_get_counter_value(SYSTIMER_COUNTER_0); -#endif - return ccount; + return cpu_hal_get_cycle_count(); } extern EspClass ESP;