arduino / arduino/ArduinoCore-mbed

variants are missing SDA and SCL symbols

Open
#371 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
C
Stars
411
Forks
225
PR merge metrics
No merged PRs in 30d

Description

The variants are not creating the SDA and SCL symbols that all the other platform variants create.
These two symbols need to be created.

The history of these i2c signal name symbols over the past 10+ years is long and colored.
Due to a flipping (sometimes back and forth) between defines and static const int declarations of these symbols over time by various IDE versions and platforms, there is no portable and reliable way for a sketch to check for the existence of the SDA and SCL symbols.

And while the variant.h files do create PIN_WIRE_SDA and PIN_WIRE_SCL
for potability reasons a sketch must still depend on the symbols SDA and SCL to ensure maximum portability across all platforms as those symbols are also inconsistent across platforms.

i.e. given the variance of how the various i2c signal name symbols are declared and the various names used, there is no portable and reliable way for a sketch to compile time detect the existence of the various symbols to be able auto detect which one to use.
So unfortunately, the only portable "it just works" on all platforms way to handle this is to blindly assume the existence of SDA and SCL.

Which unfortunately also means that the platform must always create the SDA and SCL symbols.

Most variants create the SDA and SCL symbols in each of the variant.h files

Contributor guide

No contributing guide indexed for this repository

Research direction

Compare the variant.h files for variants that already create SDA and SCL with the variants that do not. Confirm how PIN_WIRE_SDA and PIN_WIRE_SCL are defined, then ensure the missing SDA and SCL symbols are created consistently. Done means every platform variant provides both symbols for portable sketches.

Written by the indexing model from the issue text.

Assessment

Tech stack
c
Domain
embedded-iot
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.