mirror of
https://github.com/esp8266/Arduino.git
synced 2025-04-27 21:16:50 +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 __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)
|
#if defined(F_CPU)
|
||||||
clockCyclesPerMicrosecond()
|
#define optimistic_yield(interval_us) (__optimistic_yield(interval_us * clockCyclesPerMicrosecond()))
|
||||||
#else
|
#else
|
||||||
getCpuFreqMHz()
|
#define optimistic_yield(interval_us) (__optimistic_yield(interval_us * getCpuFreqMHz()))
|
||||||
#endif
|
#endif
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
#define _PORT_GPIO16 1
|
#define _PORT_GPIO16 1
|
||||||
#define digitalPinToPort(pin) (((pin)==16)?(_PORT_GPIO16):(0))
|
#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
|
// Replace ets_intr_(un)lock with nestable versions
|
||||||
extern "C" void IRAM_ATTR ets_intr_lock() {
|
extern "C" void IRAM_ATTR ets_intr_lock() {
|
||||||
if (ets_intr_lock_stack_ptr < ETS_INTR_LOCK_NEST_MAX)
|
if (ets_intr_lock_stack_ptr < ETS_INTR_LOCK_NEST_MAX)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user