Which is used to implement user/indexable_functions.cpp callbacks.
As feature, there is new user actions such as:
scrolling through all modes & groups (4H)
jumping to a « favorite mode » (4C) that can be configured (5H+2s)
There is also late-initialization of StateTy state structure of modes, meaning it is build only on the first instantiation of the mode (and not on the initialization of the program).
There is still on-going works, to be completed in further pull requests:
no filesystem interaction has been done yet, causing the lamp to "forget" about things after a reboot
there should be a defined interface between modes and hardware, and more work is needed here
Note that the long-term goal is to move user-purpose (non-hardware related code) away from src/system to src/modes/include to fully delimit software from hardware, but this will need incremental work.
This is two contributions:
user/functions.h
behaviorsuser/indexable_functions.cpp
This goes towards separating the software from the hardware and is thus fully testable with
make simulator
(note that the simulator uses the space bar as lamp button interaction)
There is some preliminary documentation written, but not exhaustive:
The overall abstraction, is that each mode have callbacks defined in a similar fashion to
user/functions.h
:This enable short definitions of modes, such as:
Modes to be listed inside a « mode group » as in the example below:
Groups to be listed inside a global « mode manager » as in the example below:
Which is used to implement
user/indexable_functions.cpp
callbacks.As feature, there is new user actions such as:
There is also late-initialization of
StateTy
state structure of modes, meaning it is build only on the first instantiation of the mode (and not on the initialization of the program).There is still on-going works, to be completed in further pull requests:
there should be a defined interface between modes and hardware, and more work is needed here
Note that the long-term goal is to move user-purpose (non-hardware related code) away from
src/system
tosrc/modes/include
to fully delimit software from hardware, but this will need incremental work.