Conversation
BanjoR
marked this pull request as ready for review
August 17, 2026 09:34
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Automatic issue closing
Fixes #492
Summary
Correct
GPIOBase<T>::_configure()so the temporary input mask uses the GPIOBase template typeT, preventing truncation when a GPIO module uses more than 16 bits. Add a host-side regression test covering the production source contract and the 16-, 32-, and 64-pin boundary masks.Root cause
IO_GPIOBase.hpreviously declared the_configure()mask asuint16_t mask = 1 << pin;. The fixed-width local could discard bits above bit 15 even though GPIOBase stores port state inT. It is nowT mask = T(1) << pin;.Bounded scope
In scope:
IO_GPIOBase.h: derive the_configure()mask fromT.test/gpio_base_mask_test.py: verify the production source contract and the 16-, 32-, and 64-bit boundary masks.Explicit exclusions:
Validation
Local host checks:
C:\Users\banjo\.cache\codex-runtimes\codex-primary-runtime\dependencies\python\python.exe test\gpio_base_mask_test.py: 4 tests passed.C:\Users\banjo\.cache\codex-runtimes\codex-primary-runtime\dependencies\python\python.exe -m unittest discover -s test -p "*_test.py": 4 tests passed.compile()syntax check fortest/gpio_base_mask_test.py: passed.git diff --check upstream/master...HEAD: passed.python -m py_compile test\gpio_base_mask_test.py: not completed because this host denied creatingtest\__pycache__([WinError 5] Access is denied); the no-write syntax check above passed.python -m platformio runin a clean task checkout with an isolated PlatformIO core completed for all five configured environments:mega2560,ESP32,Nucleo-F411RE,Nucleo-F446RE, andNucleo-F429ZI.CI:
mega2560,ESP32,Nucleo-F411RE,Nucleo-F446RE, andNucleo-F429ZI.<cassert>was unavailable; commit4cb8e43replaced it with the host Python test. The current run is the corrected result.master; the PR check rollup is empty because the workflow is push-triggered. The linked green run is the available CI result.Hardware validation
Not run—no hardware available.
Maintainer bench criteria (not performed in this contribution):
GPIOBase<uint16_t>,GPIOBase<uint32_t>, andGPIOBase<uint64_t>._portInUseretains the highest-bit mask,_portModeclears that bit, and the device receives the corresponding pull-up and mode writes without truncation.References
The issue reference is intentionally non-closing.