mirror of
https://github.com/esp8266/Arduino.git
synced 2025-04-25 20:02:37 +03:00
Due to 3rd party use of symbol optimistic_yield without #include <Arduino>, have to resort to preprocessor definition for inlining.
This commit is contained in:
parent
3767791fbc
commit
554435780b
@ -212,16 +212,11 @@ extern "C" uint8 system_get_cpu_freq(void);
|
||||
|
||||
void __optimistic_yield(uint32_t intvl_cycles);
|
||||
|
||||
void inline optimistic_yield(uint32_t interval_us) __attribute__((always_inline));
|
||||
void inline optimistic_yield(uint32_t interval_us) {
|
||||
__optimistic_yield(interval_us *
|
||||
#if defined(F_CPU)
|
||||
clockCyclesPerMicrosecond()
|
||||
#define optimistic_yield(interval_us) (__optimistic_yield(interval_us * clockCyclesPerMicrosecond()))
|
||||
#else
|
||||
getCpuFreqMHz()
|
||||
#define optimistic_yield(interval_us) (__optimistic_yield(interval_us * getCpuFreqMHz()))
|
||||
#endif
|
||||
);
|
||||
}
|
||||
|
||||
#define _PORT_GPIO16 1
|
||||
#define digitalPinToPort(pin) (((pin)==16)?(_PORT_GPIO16):(0))
|
||||
|
@ -133,6 +133,17 @@ extern "C" void __optimistic_yield(uint32_t intvl_cycles) {
|
||||
}
|
||||
}
|
||||
|
||||
#undef optimistic_yield
|
||||
extern "C" void optimistic_yield(uint32_t interval_us) {
|
||||
__optimistic_yield(interval_us *
|
||||
#if defined(F_CPU)
|
||||
clockCyclesPerMicrosecond()
|
||||
#else
|
||||
getCpuFreqMHz()
|
||||
#endif
|
||||
);
|
||||
}
|
||||
|
||||
// Replace ets_intr_(un)lock with nestable versions
|
||||
extern "C" void IRAM_ATTR ets_intr_lock() {
|
||||
if (ets_intr_lock_stack_ptr < ETS_INTR_LOCK_NEST_MAX)
|
||||
|
Loading…
x
Reference in New Issue
Block a user