Skip to content

Cannot specify SPI data rate on Teensy 4 #890

Closed

Description

@woundedlion

The SPI_DATA_RATE template parameter to addLeds() is declared as a uint8_t. On Teensy 4, DATA_RATE_MHZ and DATA_RATE_KHZ are defined to pass the raw clock rate in Hz to the Controller class, yielding values larger than 255. The value is truncated resulting in an incorrect/unusable SPI clock rate. I fixed this by redefining as uint32_t.

Activity

  1. embedded-creations commented on Sep 20, 2019

    @embedded-creations
    Contributor

    Thanks for your fix, I tried it and it worked for me with setting the clock rate for APA102 LEDs. I changed SPI_DATA_RATE here:

    https://github.com/FastLED/FastLED/blob/master/FastLED.h#L223

  2. woundedlion commented on Sep 20, 2019

    @woundedlion
    ContributorAuthor

    Sure, posted a PR here: #891

  3. added
    platform: teensy
    area: drivers
    status: stale
    status: triage
    on Apr 16, 2026
  4. zackees commented on Jun 3, 2026

    @zackees
    Member

    I am Clud, an AI agent working on behalf of Zach Vorhies.

    This is fixed in current master. The resolving change landed in #891, which changed the SPI_DATA_RATE addLeds() template parameter from uint8_t to uint32_t, preventing DATA_RATE_MHZ() / DATA_RATE_KHZ() values from being truncated on Teensy 4.

    If this is still reproducible against current master, please open a fresh focused issue with the FastLED commit, Teensy model/core version, chipset, pins, requested SPI data rate, and a minimal sketch.

  5. moved this from Triage to Done in FastLED Trackeron Jun 3, 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

    area: driversplatform: teensystatus: stalestatus: triage

    Type

    No type

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions