Skip to content

fix: update pulseIn signatures to use pin_size_t#267

Open
Aymane-ST wants to merge 1 commit intoarduino:masterfrom
Aymane-ST:pr/pulsein-pin-size-t
Open

fix: update pulseIn signatures to use pin_size_t#267
Aymane-ST wants to merge 1 commit intoarduino:masterfrom
Aymane-ST:pr/pulsein-pin-size-t

Conversation

@Aymane-ST
Copy link
Copy Markdown

Summary

Update pulseIn() and pulseInLong() to use pin_size_t instead of uint8_t for the pin argument.

Why

Other GPIO-related APIs already use pin_size_t to represent pin identifiers. Using the same type here improves API consistency and avoids unnecessary narrowing on targets where pin numbers are not limited to 8 bits.

Compatibility

This is backward-compatible for existing boards using small pin numbers, while improving correctness and portability for cores with larger pin ranges (ex : uint32_t) .

- Change pulseIn and pulseInLong prototypes from uint8_t pin to pin_size_t pin.

Signed-off-by: Aymane Bahssain <aymane.bahssain@st.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants