Repository navigation
Description
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_MEMORYSKETCH_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.hppsrc/power_mgt.h,src/power_mgt.cpp.hppsrc/fl/system/{engine_events.h, yield.cpp.hpp, delay.h, delay.cpp.hpp}src/fl/channels/manager.cpp.hppsrc/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.hppsrc/platforms/esp/32/core/esp_log_control.hsrc/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.inoexamples/AutoResearch/LegacyClocklessProxy.hexamples/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
-Dinci/build_example.tomlandci/meson/native/meson.buildset the canonical (new) name; the header's#ifdef ... _OVERRIDDENlogic 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_*.
Metadata
Metadata
Assignees
Labels
Type
Projects
- StatusShow more project fieldsDone
Activity
refactor(system): introduce FL_PLATFORM_HAS_*_MEMORY canonical names (c…
feat(autoresearch): retire AutoResearchLpc.ino, fold into AutoResearc…