File tree Expand file tree Collapse file tree 2 files changed +11
-11
lines changed Expand file tree Collapse file tree 2 files changed +11
-11
lines changed Original file line number Diff line number Diff line change @@ -264,6 +264,12 @@ uint8_t EspClass::getBootMode(void)
264
264
return system_get_boot_mode ();
265
265
}
266
266
267
+ #ifndef F_CPU
268
+ uint8_t EspClass::getCpuFreqMHz (void )
269
+ {
270
+ return system_get_cpu_freq ();
271
+ }
272
+ #endif
267
273
268
274
uint32_t EspClass::getFlashChipId (void )
269
275
{
Original file line number Diff line number Diff line change @@ -157,8 +157,11 @@ class EspClass {
157
157
uint8_t getBootVersion ();
158
158
uint8_t getBootMode ();
159
159
160
- #ifndef CORE_MOCK
161
- inline uint8_t getCpuFreqMHz () __attribute__((always_inline));
160
+ #if !defined(CORE_MOCK) && defined(F_CPU)
161
+ constexpr uint8_t getCpuFreqMHz () const
162
+ {
163
+ return clockCyclesPerMicrosecond ();
164
+ }
162
165
#else
163
166
uint8_t getCpuFreqMHz ();
164
167
#endif
@@ -207,15 +210,6 @@ class EspClass {
207
210
208
211
#ifndef CORE_MOCK
209
212
210
- uint8_t EspClass::getCpuFreqMHz ()
211
- {
212
- #if defined(F_CPU)
213
- return clockCyclesPerMicrosecond ();
214
- #elif !defined(F_CPU)
215
- return system_get_cpu_freq ();
216
- #endif
217
- }
218
-
219
213
uint32_t EspClass::getCycleCount ()
220
214
{
221
215
return esp_get_cycle_count ();
You can’t perform that action at this time.
0 commit comments