Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit b45cf11

Browse filesBrowse files
authored
Fixed ESP::getCycleCount for S2/C3 (espressif#5075)
Fixes espressif#5071
1 parent fb0d63b commit b45cf11
Copy full SHA for b45cf11

File tree

Expand file treeCollapse file tree

1 file changed

+7
-0
lines changed
Filter options
Expand file treeCollapse file tree

1 file changed

+7
-0
lines changed

‎cores/esp32/Esp.h

Copy file name to clipboardExpand all lines: cores/esp32/Esp.h
+7Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,9 @@
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
2528

2629
/**
2730
* AVR macros for WDT managment
@@ -111,7 +114,11 @@ class EspClass
111114
uint32_t ARDUINO_ISR_ATTR EspClass::getCycleCount()
112115
{
113116
uint32_t ccount;
117+
#ifdef CONFIG_IDF_TARGET_ESP32
114118
__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
115122
return ccount;
116123
}
117124

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.