Skip to content

Redesign the platform so that hardware-specific API is not visible by default #8440

Open
@vgheo

Description

@vgheo

At the moment, the hardware-specific API is visible in the arduino sketches by default.
( ie implementation details are bleeding into the Arduino abstract API).

Therefore users can write code like

PORTB &= ~(1 << PB3); // reset bit 3 of PORT B

and even

digitalWrite(PB1 , HIGH); //This doesnt work

This confusion can be eliminated if the hw-specific headers are not included in the sketch by default.
If advanced users really need these defines, they can include the headers explicitly.

Samples:
https://www.instructables.com/id/ATTiny-Port-Manipulation/
PORTB |= (1 << PB3); //replaces digitalWrite(PB3, HIGH);
damellis/attiny#127

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