Skip to content

Overridable setup, loop and main #1138

@cipriancraciun

Description

@cipriancraciun

Following the same pattern as in the case of serialEvent, I'm proposing the following:

  • provide an empty implementation of the setup and loop functions;
  • mark all three functions (setup, loop and main) as __attribute__ (weak) so that the user is able to override them with customized versions;

P.S.: Granted that if the user overrides main he must manually call init.

P.P.S.: I'll provide in a minute the needed patch.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Component: CoreRelated to the code for the standard Arduino API

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions