mirror of
https://github.com/esp8266/Arduino.git
synced 2025-04-19 23:22:16 +03:00
Merge pull request #7557 from dok-net/fixfix
Fixup #7554: Inline, fewer LOC, remove redundant definition in cpp.
This commit is contained in:
commit
885851a5ea
@ -264,13 +264,6 @@ uint8_t EspClass::getBootMode(void)
|
||||
return system_get_boot_mode();
|
||||
}
|
||||
|
||||
#ifndef F_CPU
|
||||
uint8_t EspClass::getCpuFreqMHz(void)
|
||||
{
|
||||
return system_get_cpu_freq();
|
||||
}
|
||||
#endif
|
||||
|
||||
uint32_t EspClass::getFlashChipId(void)
|
||||
{
|
||||
static uint32_t flash_chip_id = 0;
|
||||
|
@ -122,13 +122,12 @@ class EspClass {
|
||||
uint8_t getBootMode();
|
||||
|
||||
#if defined(F_CPU) || defined(CORE_MOCK)
|
||||
constexpr uint8_t getCpuFreqMHz() const
|
||||
constexpr
|
||||
#endif
|
||||
inline uint8_t getCpuFreqMHz() const __attribute__((always_inline))
|
||||
{
|
||||
return esp_get_cpu_freq_mhz();
|
||||
}
|
||||
#else
|
||||
uint8_t getCpuFreqMHz() const;
|
||||
#endif
|
||||
|
||||
uint32_t getFlashChipId();
|
||||
uint8_t getFlashChipVendorId();
|
||||
@ -167,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));
|
||||
#else
|
||||
uint32_t getCycleCount();
|
||||
#endif
|
||||
};
|
||||
|
||||
#ifndef CORE_MOCK
|
||||
|
||||
uint32_t EspClass::getCycleCount()
|
||||
#if !defined(CORE_MOCK)
|
||||
inline uint32_t getCycleCount() __attribute__((always_inline))
|
||||
{
|
||||
return esp_get_cycle_count();
|
||||
}
|
||||
|
||||
#else
|
||||
uint32_t getCycleCount();
|
||||
#endif // !defined(CORE_MOCK)
|
||||
};
|
||||
|
||||
extern EspClass ESP;
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user