arduino / arduino/Arduino

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

Open
#8,440 1 comment 0 reactions 0 assignees View on GitHub
Component: Core feature request
Dominant language
Java
Stars
14.6k
Forks
7k
PR merge metrics
No merged PRs in 30d

Description

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);`
https://github.com/damellis/attiny/issues/127

Contributor guide

Open the contributing guide

Research direction

Start by tracing how Arduino sketches receive the hardware-specific headers and how the abstract API is exposed by default. Check the sketch entry point and header inclusion path; done means hardware-specific names such as PORTB and PB3 are no longer available by default, while advanced users can still include the headers explicitly.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp
Domain
embedded-iot
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.