mirror of
https://github.com/esp8266/Arduino.git
synced 2025-04-19 23:22:16 +03:00
Force gcc inlining, use same style for getCycleCount as for getCpuFreqMHz.
This commit is contained in:
parent
400632f818
commit
c74dcc924c
@ -124,7 +124,7 @@ class EspClass {
|
||||
#if defined(F_CPU) || defined(CORE_MOCK)
|
||||
constexpr
|
||||
#endif
|
||||
uint8_t getCpuFreqMHz() const
|
||||
inline uint8_t getCpuFreqMHz() const __attribute__((always_inline))
|
||||
{
|
||||
return esp_get_cpu_freq_mhz();
|
||||
}
|
||||
@ -166,21 +166,15 @@ class EspClass {
|
||||
uint8_t *random(uint8_t *resultArray, const size_t outputSizeBytes) const;
|
||||
uint32_t random() const;
|
||||
|
||||
#ifndef CORE_MOCK
|
||||
inline uint32_t getCycleCount() __attribute__((always_inline));
|
||||
#if !defined(CORE_MOCK)
|
||||
inline uint32_t getCycleCount() __attribute__((always_inline))
|
||||
{
|
||||
return esp_get_cycle_count();
|
||||
}
|
||||
#else
|
||||
uint32_t getCycleCount();
|
||||
#endif
|
||||
};
|
||||
|
||||
#ifndef CORE_MOCK
|
||||
|
||||
uint32_t EspClass::getCycleCount()
|
||||
{
|
||||
return esp_get_cycle_count();
|
||||
}
|
||||
|
||||
#endif // !defined(CORE_MOCK)
|
||||
};
|
||||
|
||||
extern EspClass ESP;
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user