Skip to content

warn(teensy3): emit a #warning on pre-4.0 Teensy boards that the hardware is EOL and unvalidated #3987

Closed

Description

@zackees

Emit a compile-time #warning on Teensy boards older than 4.0, telling users the hardware is out of production, pointing them at 3.10.3 if they hit trouble, and asking for bug reports here.

Why

Teensy LC and 3.0–3.6 are discontinued. FastLED still compiles for them and we intend to keep doing so, but they get no hardware validation — see #3983, where bench testing is scoped to 4.0/4.1 only, and #3970/#3972, where the whole SdFat DSPI transport for 3.x shipped compile-verified only with no board available.

Right now a user on a 3.2 has no signal that they are on an unvalidated path. A one-line warning at compile time is the cheapest honest way to say so.

Proposed message

Wording is a starting point, not a prescription:

This Teensy board (pre-4.0) is out of production and FastLED no longer
hardware-validates it. If you hit a problem, try FastLED 3.10.3, which is the
last release verified against these boards, and please file a report at
https://github.com/FastLED/FastLED/issues -- we do still fix these.
Define FASTLED_NO_TEENSY3_EOL_WARNING to silence this.

The guard is easy to get wrong

FL_IS_TEENSY_3X covers only 3.0–3.6. Teensy LC is a sibling, not a member:

// src/platforms/arm/teensy/is_teensy.h:73-76
#if defined(FL_IS_TEENSY_30) || defined(FL_IS_TEENSY_31) || defined(FL_IS_TEENSY_32) || \
    defined(FL_IS_TEENSY_35) || defined(FL_IS_TEENSY_36)
    #define FL_IS_TEENSY_3X
#endif

// :84-86 -- LC is ORed in separately at the umbrella level
#if defined(FL_IS_TEENSY_LC) || defined(FL_IS_TEENSY_3X) || defined(FL_IS_TEENSY_4X)
    #define FL_IS_TEENSY
#endif

So the condition must be:

#if (defined(FL_IS_TEENSY_3X) || defined(FL_IS_TEENSY_LC)) && \
    !defined(FASTLED_NO_TEENSY3_EOL_WARNING)
#warning "..."
#endif

Writing #if defined(FL_IS_TEENSY_3X) alone would silently skip the LC, which is arguably the most end-of-life board of the set.

Requirements

  • Must be silenceable. An unsuppressable warning on every build is hostile to anyone maintaining a working 3.2 project, and they will patch it out of their vendored copy, which is worse. FASTLED_NO_TEENSY3_EOL_WARNING (name negotiable).
  • Warning, never #error. These boards still build and we are not dropping them.
  • Fires once, not once per translation unit. Placement matters — putting it in a header pulled into the unity build will repeat it. A single spot reachable from FastLED.h is likely right; verify empirically rather than assuming.
  • Does not fire on Teensy 4.x, or on any non-Teensy platform.
  • Does not break bash test --cpp (83/83 host example builds) or any CI board build — check whether any workflow compiles with -Werror, which would turn this into a hard failure.

Version note

library.json is at 3.10.3 while src/FastLED.h:37 has FASTLED_VERSION 3010004, i.e. master is 3.10.4-in-progress. So "3.10.3" in the message means the current published release. Whoever implements this should re-check the released version at the time rather than hardcoding a number that has moved on — or word it as "the latest 3.10.x release" to avoid the staleness problem entirely.

Verification

  • bash compile teensy31 --examples Blink shows the warning exactly once
  • bash compile teensylc --examples Blink shows it (this is the case a naive guard misses)
  • bash compile teensy41 --examples Blink does not show it
  • bash compile uno --examples Blink does not show it
  • Building with -DFASTLED_NO_TEENSY3_EOL_WARNING silences it
  • bash test --cpp still 283/283 unit + 83/83 examples

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions