The calls a face makes to run the dev harness, and the switches they read. The build sets the switches from paf build <face> --dev and the unit's paf.dev.config.json, beside its paf.config.json, so a face writes none of them and main.c calls the hooks without any #if of its own. More...
Go to the source code of this file.
Functions | |
| static bool | dev_seed_stores (void) |
| Applies the config's settings, then seeds the stores on the pinned clock, when dev mode is on. A store the config seeds takes the config's readings, and the rest take the dev fixture. Call it after settings_init and in place of the live store inits, and skip them when it returns true. | |
| static void | dev_start (void(*apply_theme)(void)) |
| Starts the walk when dev mode is on. With the theme walk picked it forces the first theme and steps to the next on each tap. With a walk the config lays out it shows the first step and steps to the next on each tap. Any other walk, or none, just paints the fixture once and leaves the taps to the face. Call after engine_init. | |
| static void | dev_stop (void) |
| Drops the walk's tap subscription when dev mode is on. Call from deinit. | |
| static void | dev_force_time (struct tm *when) |
| Sets a time to the pinned clock when dev mode is on, and to the pinned date when the config has one. Both follow the screen on show, so a step of a walk with a clock of its own moves them. A panel that builds its own time, such as a second time zone, calls it so a screenshot shows the same time and day in every panel. | |
The calls a face makes to run the dev harness, and the switches they read. The build sets the switches from paf build <face> --dev and the unit's paf.dev.config.json, beside its paf.config.json, so a face writes none of them and main.c calls the hooks without any #if of its own.
DEV_MODE is 1 on a build with --dev and 0 otherwise. The build sets it on every face, so a face's own header with a plain #define DEV_MODE of a different value stops the build on the redefinition. With dev mode on the build also sets DEV_TIME_HOUR and DEV_TIME_MIN from the pinned clock, and DEV_TAP_WALK_<NAME> to 1 for the walk the switches pick, such as DEV_TAP_WALK_THEMES. A face's own walk reads its own name the same way. A walk the config lays out as a list also sets DEV_WALK_FROM_CONFIG, and the rest of the config reaches the harness through dev/dev_config.h.
A face that includes this header deletes its own dev_seed_stores, dev_start, dev_stop, and dev_force_time everywhere, in every file and in its family core too. Each copy is static, so one left in a file that never includes this header builds without a word and runs its own switches in that file alone.
The hooks are static inline, and with dev mode off each one is empty or returns false, so a release build never includes the harness and carries none of it.