Skip to content

Commit 82161be

Browse files
committed
Use cpu_hal_get_cycle_count for all chips
1 parent 55b8f67 commit 82161be

File tree

1 file changed

+2
-10
lines changed

1 file changed

+2
-10
lines changed

Diff for: cores/esp32/Esp.h

+2-10
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,7 @@
2222

2323
#include <Arduino.h>
2424
#include <esp_partition.h>
25-
#ifndef CONFIG_IDF_TARGET_ESP32 // Broken in IDF 20210417
26-
#include <hal/systimer_hal.h>
27-
#endif
25+
#include <hal/cpu_hal.h>
2826

2927
/**
3028
* AVR macros for WDT managment
@@ -113,13 +111,7 @@ class EspClass
113111

114112
uint32_t ARDUINO_ISR_ATTR EspClass::getCycleCount()
115113
{
116-
uint32_t ccount;
117-
#ifdef CONFIG_IDF_TARGET_ESP32
118-
__asm__ __volatile__("esync; rsr %0,ccount":"=a" (ccount));
119-
#else // This should work on ESP32 once the hal is complete
120-
ccount = systimer_hal_get_counter_value(SYSTIMER_COUNTER_0);
121-
#endif
122-
return ccount;
114+
return cpu_hal_get_cycle_count();
123115
}
124116

125117
extern EspClass ESP;

0 commit comments

Comments
 (0)