void yield(void) __attribute__ ((weak, alias("__empty")));
- Dominant language
- Java
- Stars
- 14.6k
- Forks
- 7k
- PR merge metrics
- No merged PRs in 30d
Description
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).
Contributor guide
Research direction
Start by reading packages/arduino/hardware/avr/1.8.2/cores/arduino/hooks.c and inspect how yield hooks are named on the ESP8266 and SAM architectures. Determine whether the proposed naming can support the scheduler use case consistently across the mentioned architectures; done means the architecture-specific yield behavior remains usable without the AVR alias mismatch.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- arduino, c
- Domain
- embedded-iot
- Issue type
- Refactor
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100