|
22 | 22 |
|
23 | 23 | #include <Arduino.h>
|
24 | 24 | #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> |
28 | 26 |
|
29 | 27 | /**
|
30 | 28 | * AVR macros for WDT managment
|
@@ -113,13 +111,7 @@ class EspClass
|
113 | 111 |
|
114 | 112 | uint32_t ARDUINO_ISR_ATTR EspClass::getCycleCount()
|
115 | 113 | {
|
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(); |
123 | 115 | }
|
124 | 116 |
|
125 | 117 | extern EspClass ESP;
|
|
0 commit comments