|
SBK_BarDrive Library 2.2.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.
Explore brightness-based transitions and animations, including fade-in, fade-out, cross-fade, and pulsing effects. The public API should remain non-blocking and compatible with animation queues.
Driver capabilities differ, so fading should be designed around an explicit brightness capability rather than assuming that every output supports PWM:
Add and validate a BarDrive adapter for the IS31FL3733 LED matrix driver. The integration should preserve the existing mapping constructors and animation API while taking advantage of the driver's per-LED brightness support where appropriate.
The work should include:
Explore a SoloDrive class for treating one driver pixel as an independent indicator instead of as part of a bar meter. It should reuse the same driver and pixel-addressing abstractions without requiring a one-segment SBK_BarDrive object.
Candidate indicator controls and animations include:
Multiple indicators should be able to share a compact scheduler. Indicators assigned to the same synchronization group should start together and remain phase-aligned even when their physical pixels, drivers, logic polarity, or brightness ranges differ. The design should define predictable behavior when an indicator joins, leaves, pauses, or resumes a running group, and should support an explicit phase reset for restarting a group in synchronization.
Independent indicators should remain possible without requiring separate hardware timers. The design should also evaluate an optional fixed-storage queue without forcing queue memory on simple indicators that only need on/off or synchronized blinking behavior.
On binary-only drivers, unsupported brightness effects should have an explicit and predictable policy. Software PWM should only be considered when its CPU, bus-traffic, and flicker costs are acceptable for the target platform.
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.