Skip to content

fix(nrf52): P1 pins declared with local numbers get port 0 in nrf_pin(); FASTLED_FORCE_SOFTWARE_SPI fails to compile #5120

Closed

Description

@zackees

Found in review of #5048. Part of #5024.

1. Wrong port from nrf_pin() (from reading the code, not run on hardware). _FL_DEFPIN in fastpin_arm_nrf52_variants.h derives the port number as BOARD_PIN / 32, while mask and registers use BOARD_PORT. A definition such as _FL_DEFPIN(2, 10, 1); // D2 is P1.10 therefore writes P1, but nrf_pin() gives NRF_GPIO_PIN_MAP(0, 10). setOutput() and SPIM PSEL would then target P0.10. Definitions like _FL_DEFPIN(3, 47, 1) are not affected. Each board's form needs checking.

2. Compile failure. bash compile adafruit_feather_nrf52840_sense --examples Apa102 --defines FASTLED_FORCE_SOFTWARE_SPI fails on the #5048 branch; #5048 does not touch this dispatch. From reading the code, spi_output_template.h always derives from NRF52HardwareSPIOutput, which that define compiles out. Routing to GenericSoftwareSPIOutput under the define would also give the software path an in-tree route.

Activity

  1. added
    sanitized
    on Nov 6, 2026
  2. moved this from Triage to Done in FastLED Trackeron Nov 8, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    sanitized

    Type

    No type

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions