File tree 2 files changed +13
-7
lines changed
2 files changed +13
-7
lines changed Original file line number Diff line number Diff line change @@ -212,16 +212,11 @@ extern "C" uint8 system_get_cpu_freq(void);
212
212
213
213
void __optimistic_yield (uint32_t intvl_cycles);
214
214
215
- void inline optimistic_yield (uint32_t interval_us) __attribute__((always_inline));
216
- void inline optimistic_yield (uint32_t interval_us) {
217
- __optimistic_yield (interval_us *
218
215
#if defined(F_CPU)
219
- clockCyclesPerMicrosecond ()
216
+ # define optimistic_yield ( interval_us ) (__optimistic_yield(interval_us * clockCyclesPerMicrosecond ()) )
220
217
#else
221
- getCpuFreqMHz ()
218
+ # define optimistic_yield ( interval_us ) (__optimistic_yield(interval_us * getCpuFreqMHz ()) )
222
219
#endif
223
- );
224
- }
225
220
226
221
#define _PORT_GPIO16 1
227
222
#define digitalPinToPort (pin ) (((pin)==16 )?(_PORT_GPIO16):(0 ))
Original file line number Diff line number Diff line change @@ -133,6 +133,17 @@ extern "C" void __optimistic_yield(uint32_t intvl_cycles) {
133
133
}
134
134
}
135
135
136
+ #undef optimistic_yield
137
+ extern " C" void optimistic_yield (uint32_t interval_us) {
138
+ __optimistic_yield (interval_us *
139
+ #if defined(F_CPU)
140
+ clockCyclesPerMicrosecond ()
141
+ #else
142
+ getCpuFreqMHz ()
143
+ #endif
144
+ );
145
+ }
146
+
136
147
// Replace ets_intr_(un)lock with nestable versions
137
148
extern " C" void IRAM_ATTR ets_intr_lock () {
138
149
if (ets_intr_lock_stack_ptr < ETS_INTR_LOCK_NEST_MAX)
You can’t perform that action at this time.
0 commit comments