Arduino icon indicating copy to clipboard operation
Arduino copied to clipboard

void yield(void) __attribute__ ((weak, alias("__empty")));

Open jmparatte opened this issue 4 years ago • 1 comments

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).

jmparatte avatar May 11 '20 14:05 jmparatte

I met the same question

L1uTongwei avatar Aug 07 '22 12:08 L1uTongwei