|
Lamp-Da 0.1
A compact lantern project
|
Defer the user commands to the main loop. More...
Functions | |
| bool | post (const common::UserCommand &command) |
| Post a user command, run by the main loop on its next tick. Thread safe. | |
| void | request_brightness_user_callback () |
| Request a call to the user brightness callback (see brightness::force_brightness_user_callback()), run by the main loop on its next tick, after the posted commands. Thread safe. Several requests before the next tick result in a single call. | |
| size_t | get_pending_count () |
| Return the number of commands waiting for the main loop. Thread safe. | |
| void | loop () |
| Main loop only: run the posted commands, in order, then the requested brightness callback. | |
Variables | |
| static constexpr size_t | maxStoredCommands = 16 |
| Maximum number of commands waiting for the main loop. | |
Defer the user commands to the main loop.
| bool lampda::logic::user_command_queue::post | ( | const common::UserCommand & | command | ) |
Post a user command, run by the main loop on its next tick. Thread safe.
| [in] | command | The command to run |