Adafruit-GFX-Library icon indicating copy to clipboard operation
Adafruit-GFX-Library copied to clipboard

Add yield hook as a weak definition.

Open BillyDonahue opened this issue 4 years ago • 3 comments

We could leave the yield() behavior customizable to handle edge cases like #285. Most ESP8266 users need to call yield() inside expensive drawing operations to keep the watchdog from firing. However, some sophisticated users who are using a different scheduling regime like Ticker must not call yield(), so we provide an opt-out.

I like the weak symbol for this, over other hook techniques, because the linker can remove the replaced symbol, there's no init-order race, and it doesn't bring any of this drama into the header. :)

Fixes #285

BillyDonahue avatar May 22 '20 08:05 BillyDonahue