File tree Expand file tree Collapse file tree 2 files changed +10
-3
lines changed Expand file tree Collapse file tree 2 files changed +10
-3
lines changed Original file line number Diff line number Diff line change @@ -209,7 +209,11 @@ class EspClass {
209
209
210
210
uint8_t EspClass::getCpuFreqMHz ()
211
211
{
212
+ #if defined(F_CPU)
212
213
return clockCyclesPerMicrosecond ();
214
+ #elif !defined(F_CPU)
215
+ return system_get_cpu_freq ();
216
+ #endif
213
217
}
214
218
215
219
uint32_t EspClass::getCycleCount ()
Original file line number Diff line number Diff line change @@ -81,14 +81,17 @@ void initVariant() __attribute__((weak));
81
81
void initVariant () {
82
82
}
83
83
84
- void preloop_update_frequency () __attribute__((weak));
85
- void preloop_update_frequency () {
84
+ extern " C" void __preloop_update_frequency () {
86
85
#if defined(F_CPU) && (F_CPU == 160000000L)
87
- REG_SET_BIT (0x3ff00014 , BIT (0 ));
88
86
ets_update_cpu_frequency (160 );
87
+ REG_SET_BIT (0x3ff00014 , BIT (0 ));
88
+ #elif !defined(F_CPU)
89
+ if (system_get_cpu_freq () == 160 ) REG_SET_BIT (0x3ff00014 , BIT (0 ));
89
90
#endif
90
91
}
91
92
93
+ extern " C" void preloop_update_frequency () __attribute__((weak, alias(" __preloop_update_frequency" )));
94
+
92
95
extern " C" bool can_yield () {
93
96
return cont_can_yield (g_pcont);
94
97
}
You can’t perform that action at this time.
0 commit comments