8000
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.
1 parent fb0d63b commit b45cf11Copy full SHA for b45cf11
cores/esp32/Esp.h
@@ -22,6 +22,9 @@
22
23
#include <Arduino.h>
24
#include <esp_partition.h>
25
+#ifndef CONFIG_IDF_TARGET_ESP32 // Broken in IDF 20210417
26
+#include <hal/systimer_hal.h>
27
+#endif
28
29
/**
30
* AVR macros for WDT managment
@@ -111,7 +114,11 @@ class EspClass
111
114
uint32_t ARDUINO_ISR_ATTR EspClass::getCycleCount()
112
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
122
return ccount;
123
}
124
0 commit comments