arduino / ArduinoCore-megaavr

Arduino Core for the ATMEGA4809 CPU
103 stars 62 forks source link

Compatibility: delay() should call yield() #57

Open dok-net opened 5 years ago

dok-net commented 5 years ago

In official AVR Arduino core, delay() is based on yield(), which is turn has weak binding and is overridable. I am asking that delay() on any Arduino platform must call yield() at least once, preferably at the end of delay(), for compatibility with libraries like Scheduler and similar implementations.

cmaglie commented 5 years ago

Good suggestion, but yield must be called inside the busy loop not at the end of delay (there is no point in blocking until the end of the delay).

dok-net commented 5 years ago

PR #58 gets serious on this issue :-)