You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
fix(nrf52): build FASTLED_FORCE_SOFTWARE_SPI through the generic bit-bang SPIOutput (#5120) - #5169
_FL_DEFPIN in fastpin_arm_nrf52_variants.h now takes the port number from BOARD_PORT and passes BOARD_PIN & 31. This landed in #5149, so _FL_DEFPIN(2, 10, 1) gives NRF_GPIO_PIN_MAP(1, 10). This PR does not change it.
Part 2: FASTLED_FORCE_SOFTWARE_SPI did not compile
The define compiles out NRF52HardwareSPIOutput, but spi_device_proxy.h and spi_output_template.h still named it.
spi_device_proxy.h: compiled only when software SPI is not forced.
spi_output_template.h: under the define, it uses the generic bit-bang SPIOutput (platforms/shared/spi_bitbang/spi_output_template.h), the same route nRF51 uses.
Evidence
RED: on master, bash compile adafruit_feather_nrf52840_sense --examples Apa102 --defines FASTLED_FORCE_SOFTWARE_SPI fails with spi_device_proxy.h:60:20: error: 'NRF52HardwareSPIOutput' was not declared in this scope.
GREEN: the same command builds (52464 B flash). The ELF has 2 SoftwareSPIOutput symbols and no NRF52HardwareSPIOutput or SPIDeviceProxy.
Normal mode unchanged: Apa102 and Blink build. Apa102 still links the hardware path (9 NRF52HardwareSPIOutput/SPIDeviceProxy symbols, no software SPI symbols).
Lint:bash lint exits 0.
Limits
Not run on hardware. The bit-bang output is the shared generic one, and its timing on nRF52 is not measured here.
No hosted job builds nRF52 with this define, so there is no regression test for the compile.
Summary by CodeRabbit
Bug Fixes
Forced software SPI now uses the generic bit-bang output on NRF52 platforms instead of the hardware SPI proxy.
The NRF52 SPI output now uses the shared bit-bang implementation when FASTLED_FORCE_SOFTWARE_SPI is defined. The NRF52 hardware proxy is excluded under that condition. Without the define, the hardware-backed SPI output remains in use.
When FASTLED_FORCE_SOFTWARE_SPI is defined, the output template includes the shared bit-bang implementation and the NRF52 proxy is excluded. Otherwise, fl::SPIOutput continues to use the hardware-backed output.
The forced-software path has a bounded configuration risk: conflicting settings across source files can corrupt controller state. Keep the setting consistent throughout the application. With that constraint understood, the change is mergeable; automated forced-mode coverage would improve confidence.
- [ ] Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.
Change in examples/Blink per target. The left number is this PR's image flash / attributed RAM in bytes; the colored delta is the change from the merge base (red ↑ is larger, green ↓ is smaller, 0 is unchanged).
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
sanitizedTitle, body and conversation screened; review text requires separate screening.
1 participant
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.
Closes #5120. Part of #5024.
Part 1: P1 short-form pins (already fixed)
_FL_DEFPINinfastpin_arm_nrf52_variants.hnow takes the port number fromBOARD_PORTand passesBOARD_PIN & 31. This landed in #5149, so_FL_DEFPIN(2, 10, 1)givesNRF_GPIO_PIN_MAP(1, 10). This PR does not change it.Part 2:
FASTLED_FORCE_SOFTWARE_SPIdid not compileThe define compiles out
NRF52HardwareSPIOutput, butspi_device_proxy.handspi_output_template.hstill named it.spi_device_proxy.h: compiled only when software SPI is not forced.spi_output_template.h: under the define, it uses the generic bit-bangSPIOutput(platforms/shared/spi_bitbang/spi_output_template.h), the same route nRF51 uses.Evidence
bash compile adafruit_feather_nrf52840_sense --examples Apa102 --defines FASTLED_FORCE_SOFTWARE_SPIfails withspi_device_proxy.h:60:20: error: 'NRF52HardwareSPIOutput' was not declared in this scope.SoftwareSPIOutputsymbols and noNRF52HardwareSPIOutputorSPIDeviceProxy.NRF52HardwareSPIOutput/SPIDeviceProxysymbols, no software SPI symbols).bash lintexits 0.Limits
Summary by CodeRabbit