Skip to content

Commit 0399bb1

Browse files
dok-netdevyte
authored andcommitted
A port of ESP32 Arduino PR espressif/arduino-esp32#3165 (#6477)
1 parent b6e5830 commit 0399bb1

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

Diff for: cores/esp8266/Esp.h

+3-2
Original file line numberDiff line numberDiff line change
@@ -201,9 +201,10 @@ class EspClass {
201201
bool eraseConfig();
202202

203203
#ifndef CORE_MOCK
204-
inline
205-
#endif
204+
inline uint32_t getCycleCount() __attribute__((always_inline));
205+
#else
206206
uint32_t getCycleCount();
207+
#endif
207208
};
208209

209210
#ifndef CORE_MOCK

Diff for: cores/esp8266/core_esp8266_features.h

+2-1
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,8 @@ namespace arduino
8585
#define xt_rsil(level) (__extension__({uint32_t state; __asm__ __volatile__("rsil %0," __STRINGIFY(level) : "=a" (state) :: "memory"); state;}))
8686
#define xt_wsr_ps(state) __asm__ __volatile__("wsr %0,ps; isync" :: "a" (state) : "memory")
8787

88-
inline uint32_t esp_get_cycle_count() {
88+
inline uint32_t esp_get_cycle_count() __attribute__((always_inline));
89+
inline uint32_t esp_get_cycle_count() {
8990
uint32_t ccount;
9091
__asm__ __volatile__("rsr %0,ccount":"=a"(ccount));
9192
return ccount;

0 commit comments

Comments
 (0)