|
SBK_BarDrive Library 2.1.0
LED bar meter control and queued animations for Arduino
|
This document records possible future directions. Items listed here are ideas, not commitments, and may change after profiling and hardware testing.
The 2.1.x series should favor compatibility and predictable embedded behavior:
Version 3.0.0 may reorganize the animation engine while preserving the useful chainable API where practical.
Replace generic active fields such as _param1, _counter1, and _ledTracker1 with clearly named state structures:
Only one animation runs at a time, so these structures could share storage in a union. This should improve readability without automatically increasing SRAM.
Clearly distinguish:
Every animation should follow one lifecycle:
Queue entries could store only the information required to initialize an animation instead of snapshotting most of the controller state. The active typed state would be initialized when the entry starts.
The queue must remain fixed-storage and compile-time configurable by default. No allocation should occur while animations are running.
Introduce an AnimationType enum for queue descriptors and active-state selection. Compare a switch dispatcher with the current member-function pointer dispatcher on AVR, retaining whichever produces the better flash and runtime result.
Evaluate explicit bit-mask flags for loop, logic, direction, and pointer modes. Do not use C++ bitfields without measurement: the 2.1.0 experiment reduced SRAM but increased AVR flash enough to be rejected.
Consider separating the animation implementation into focused template headers:
This is an organizational change, not a reason to duplicate state or force all animation code into every firmware image.
Investigate alternatives to the construction-time heap allocation used by the shared block/random workspace:
Any alternative should preserve universal display sizes and avoid heap activity during operation.
Architectural changes should be accepted only after comparison with 2.1.x:
Readability improvements are important, but they must not silently make the library unsuitable for constrained AVR targets.