File tree 2 files changed +5
-3
lines changed
2 files changed +5
-3
lines changed Original file line number Diff line number Diff line change @@ -76,7 +76,7 @@ struct TimeSourceCycles
76
76
77
77
using timeType = decltype(ESP.getCycleCount());
78
78
static timeType time () {return ESP.getCycleCount ();}
79
- static constexpr timeType ticksPerSecond = F_CPU ; // 80'000'000 or 160'000'000 Hz
79
+ static constexpr timeType ticksPerSecond = ESP.getCpuFreqMHz() * 1000000UL ; // 80'000'000 or 160'000'000 Hz
80
80
static constexpr timeType ticksPerSecondMax = 160000000 ; // 160MHz
81
81
};
82
82
Original file line number Diff line number Diff line change @@ -84,9 +84,11 @@ void initVariant() {
84
84
extern " C" void __preloop_update_frequency () {
85
85
#if defined(F_CPU) && (F_CPU == 160000000L)
86
86
ets_update_cpu_frequency (160 );
87
- REG_SET_BIT ( 0x3ff00014 , BIT ( 0 )) ;
87
+ CPU2X |= 1 ;
88
88
#elif !defined(F_CPU)
89
- if (system_get_cpu_freq () == 160 ) REG_SET_BIT (0x3ff00014 , BIT (0 ));
89
+ if (system_get_cpu_freq () == 160 ) {
90
+ CPU2X |= 1 ;
91
+ }
90
92
#endif
91
93
}
92
94
You can’t perform that action at this time.
0 commit comments