Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions cores/esp32/Esp.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,9 @@

#include <Arduino.h>
#include <esp_partition.h>
#ifndef CONFIG_IDF_TARGET_ESP32 // Broken in IDF 20210417
#include <hal/systimer_hal.h>
#endif

/**
* AVR macros for WDT managment
Expand Down Expand Up @@ -111,7 +114,11 @@ class EspClass
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;
}

Expand Down