1
0
mirror of https://github.com/esp8266/Arduino.git synced 2025-07-07 06:01:35 +03:00

No need for preprocessor undefinition of optimistic_yield, after all.

This commit is contained in:
Dirk O. Kaar
2019-12-24 23:43:04 +01:00
parent 8d2eca5684
commit 50fab5162f
2 changed files with 8 additions and 24 deletions

View File

@ -205,18 +205,7 @@ void loop(void);
void yield(void);
#ifndef F_CPU
// single function needed from SDK user_interface.h
extern "C" uint8 system_get_cpu_freq(void);
#endif
void __optimistic_yield(uint32_t intvl_cycles);
#if defined(F_CPU)
#define optimistic_yield(interval_us) (__optimistic_yield(interval_us * clockCyclesPerMicrosecond()))
#else
#define optimistic_yield(interval_us) (__optimistic_yield(interval_us * getCpuFreqMHz()))
#endif
void optimistic_yield(uint32_t interval_us);
#define _PORT_GPIO16 1
#define digitalPinToPort(pin) (((pin)==16)?(_PORT_GPIO16):(0))