1
0
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:
Develo 2020-08-31 21:07:30 -04:00 committed by GitHub
commit 885851a5ea
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 9 additions and 23 deletions

View File

@ -264,13 +264,6 @@ uint8_t EspClass::getBootMode(void)
return system_get_boot_mode(); return system_get_boot_mode();
} }
#ifndef F_CPU
uint8_t EspClass::getCpuFreqMHz(void)
{
return system_get_cpu_freq();
}
#endif
uint32_t EspClass::getFlashChipId(void) uint32_t EspClass::getFlashChipId(void)
{ {
static uint32_t flash_chip_id = 0; static uint32_t flash_chip_id = 0;

View File

@ -122,13 +122,12 @@ class EspClass {
uint8_t getBootMode(); uint8_t getBootMode();
#if defined(F_CPU) || defined(CORE_MOCK) #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(); return esp_get_cpu_freq_mhz();
} }
#else
uint8_t getCpuFreqMHz() const;
#endif
uint32_t getFlashChipId(); uint32_t getFlashChipId();
uint8_t getFlashChipVendorId(); uint8_t getFlashChipVendorId();
@ -167,21 +166,15 @@ class EspClass {
uint8_t *random(uint8_t *resultArray, const size_t outputSizeBytes) const; uint8_t *random(uint8_t *resultArray, const size_t outputSizeBytes) const;
uint32_t random() const; uint32_t random() const;
#ifndef CORE_MOCK #if !defined(CORE_MOCK)
inline uint32_t getCycleCount() __attribute__((always_inline)); inline uint32_t getCycleCount() __attribute__((always_inline))
{
return esp_get_cycle_count();
}
#else #else
uint32_t getCycleCount(); uint32_t getCycleCount();
#endif
};
#ifndef CORE_MOCK
uint32_t EspClass::getCycleCount()
{
return esp_get_cycle_count();
}
#endif // !defined(CORE_MOCK) #endif // !defined(CORE_MOCK)
};
extern EspClass ESP; extern EspClass ESP;