Arduino
Arduino copied to clipboard
void yield(void) __attribute__ ((weak, alias("__empty")));
It's not a good idea to declare void yield(void) __attribute__ ((weak, alias("__empty")));
in file ...\packages\arduino\hardware\avr\1.8.2\cores\arduino\hooks.c
with the alias function named "__empty" because: I've written jm_Scheduler - a cooperative scheduler. With AVR achitecture, the weak function is named __empty
, OK but with other architectures like ESP8266, it's not same, it's __yield
which is really better. Why: Because if it's named __yield
, jm_Scheduler can simply implement a yield()
which calls __yield()
to start the imbricated realtime, if one is implemented in architecture. It's the case for ESP8266 (not for ESP32 which is a strange implementation!!! The list is non exhaustive). The problem is same with SAM architecture (verified).
I met the same question