Skip to content

Rename SKETCH_HAS_*_MEMORY macros to FL_PLATFORM_HAS_*_MEMORY #3000

Closed

Description

@zackees

Summary

The memory-tier classification macros are named SKETCH_HAS_*_MEMORY, but they describe platform memory capacity, not anything about a user sketch. The name is misleading. Rename the family to FL_PLATFORM_HAS_*_MEMORY (preferred) or FL_HAS_*_MEMORY, while keeping backward-compatible aliases for external user code.

Macros to rename

Defined in src/fl/system/sketch_macros.h:

Current Proposed
SKETCH_HAS_TINY_MEMORY FL_PLATFORM_HAS_TINY_MEMORY
SKETCH_HAS_LARGE_MEMORY FL_PLATFORM_HAS_LARGE_MEMORY
SKETCH_HAS_HUGE_MEMORY FL_PLATFORM_HAS_HUGE_MEMORY
SKETCH_HAS_TINY_MEMORY_OVERRIDDEN FL_PLATFORM_HAS_TINY_MEMORY_OVERRIDDEN
SKETCH_HAS_LARGE_MEMORY_OVERRIDDEN FL_PLATFORM_HAS_LARGE_MEMORY_OVERRIDDEN
SKETCH_HAS_HUGE_MEMORY_OVERRIDDEN FL_PLATFORM_HAS_HUGE_MEMORY_OVERRIDDEN

Existing backward-compat aliases that also reference these:

  • SKETCH_HAS_LOTS_OF_MEMORY -> SKETCH_HAS_LARGE_MEMORY
  • SKETCH_HAS_VERY_LARGE_MEMORY -> SKETCH_HAS_HUGE_MEMORY

Naming decision

Recommend FL_PLATFORM_HAS_LARGE_MEMORY over FL_HAS_LARGE_MEMORY because the tier is a property of the target platform/MCU, and the FL_PLATFORM_ prefix matches other platform-detection macros. Open to FL_HAS_* if shorter is preferred — needs a maintainer call before implementation.

Backward compatibility (required)

sketch_macros.h explicitly documents these as public ("Backward compatibility aliases for external user code"). The rename MUST keep the old SKETCH_HAS_* names working as deprecated aliases so downstream sketches don't break, e.g.:

#ifndef SKETCH_HAS_LARGE_MEMORY
#define SKETCH_HAS_LARGE_MEMORY FL_PLATFORM_HAS_LARGE_MEMORY
#endif

(Consider keeping SKETCH_HAS_LOTS_OF_MEMORY / SKETCH_HAS_VERY_LARGE_MEMORY as well.)

Affected areas (investigation)

~50 files reference these macros. Breakdown:

Definition

  • src/fl/system/sketch_macros.h (the source of truth; also consider renaming the file -> platform_memory.h)

Core src/

  • src/FastLED.h, src/FastLED.cpp.hpp, src/cled_controller.cpp.hpp
  • src/power_mgt.h, src/power_mgt.cpp.hpp
  • src/fl/system/{engine_events.h, yield.cpp.hpp, delay.h, delay.cpp.hpp}
  • src/fl/channels/manager.cpp.hpp
  • src/fl/audio/{audio_reactive.h, audio_reactive.cpp.hpp}
  • src/fl/log/log.h, src/fl/stl/istream.h

Platforms

  • src/platforms/intmap.h (many sites)
  • src/platforms/{esp,avr,apollo3,arm,stub}/compile_test.hpp
  • src/platforms/esp/32/core/esp_log_control.h
  • src/platforms/avr/{attiny/math/math8_attiny.h, atmega/common/math8_avr.h, is_avr.h}
  • src/platforms/shared/{math8.h, spi_bitbang/spi_isr_engine.cpp.hpp, ui/json/json_console.cpp.hpp}

Tests

  • tests/fl/ui/ui.cpp, tests/fl/log/log.hpp

Examples

  • examples/Audio/Audio.ino, examples/NoisePlusPalette/NoisePlusPalette.h, examples/BeatDetection/BeatDetection.ino
  • examples/AutoResearch/LegacyClocklessProxy.h
  • examples/CompileTest/{wasm_test.h, avr_test.h, arm_test.h, apollo3_test.h}
  • examples/Fx/FxWave2d/{wavefx.h, wavefx.cpp}

CI / tooling (string references — must be updated too)

  • ci/build_example.toml (build flags -DSKETCH_HAS_LARGE_MEMORY=1, etc.)
  • ci/meson/native/meson.build (-DSKETCH_HAS_* flags)
  • ci/boards.py (tier docstrings + flag emission)
  • ci/tools/{validate_sketch_filters.py, migrate_to_filters.py, audit_memory_classification.py} (regex/string matches)
  • ci/tools/noexcept_baseline.txt

Docs

  • src/platforms/esp/32/{README.md, ARCHITECTURE.md}
  • examples/Audio/advanced/README.md

Implementation notes

  • The ci/ Python tools match these macros by literal string / regex — they need updating in lockstep or the rename will silently break sketch-filter validation and the memory-classification audit.
  • Build flags passed via -D in ci/build_example.toml and ci/meson/native/meson.build set the canonical (new) name; the header's #ifdef ... _OVERRIDDEN logic must key off the new name while still honoring a user-supplied old name.

Defaults chosen by automated investigation — edit freely. Open question: FL_PLATFORM_HAS_* vs FL_HAS_*.

Activity

  1. added
    type: feature
    area: core
    area: ci
    on Jun 13, 2026
  2. added a commit that references this issue on Jun 14, 2026
    bde26da
  3. moved this from Triage to Done in FastLED Trackeron Jun 14, 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: ciarea: coretype: feature

    Type

    No type

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions