Skip to content

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

Open
@jmparatte

Description

@jmparatte

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    Component: CoreRelated to the code for the standard Arduino APIfeature requestA request to make an enhancement (not a bug fix)

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions