The shared dev harness. It seeds the stores from a fixed fixture and drives the theme walk. Compiled for any face that lists the dev plugin, and the linker drops it from any face that never calls it, which is every release build. More...
#include "dev/dev_walk.h"#include <time.h>#include "io/stores/time_store.h"#include "io/stores/weather_store.h"#include "io/stores/health_store.h"#include "io/stores/system_store.h"#include "io/stores/location_store.h"#include "io/appmessage/appmessage_features.h"#include "system/settings/settings.h"#include "ui/engine/engine.h"Data Structures | |
| struct | DevShot |
| One screenshot's worth of state, so a walk of eight themes is not eight shots of the same numbers. More... | |
| struct | [struct].s_fixed |
Functions | |
| static void | seed_shot (const DevShot *shot) |
| Seed the clock, weather, health, and system stores from one shot. A face without weather gets an empty weather store, so it never boots the harness with a reading it cannot show. | |
| static void | apply_shot (uint8_t index) |
| Move the walk onto one shot, Quiet Time mark included. | |
| static void | tap_handler (AccelAxisType axis, int32_t direction) |
| Accelerometer tap: advance the active walk by one. | |
| void | dev_walk_seed_stores (int hour, int min) |
| Inits the clock, weather, health, system, and location stores from the default fixture, with live set to false and a pinned clock, so the face shows fixed data that no live reading can stomp. Weather and location are only filled for a face that declares their keys, and left empty otherwise. Call in place of those stores' live inits. | |
| void | dev_walk_init (DevWalkMode mode, void(*apply_theme)(void)) |
| Starts the walk. A theme walk forces the first theme and subscribes the accelerometer tap. Either mode then paints. Call after engine_init. | |
| void | dev_walk_deinit (void) |
| Drop the tap subscription. Call from deinit. | |
Variables | |
| static const struct | s_fixed |
| The readings no shot varies, and where the watch is. | |
| static const DevShot | s_shots [] |
| The shots a theme walk steps through. The first is also what a face shows with no walk. | |
| static DevWalkMode | s_mode |
| Which walk is running. | |
| static void(*) | s_apply_theme (void) |
| The face's theme-apply hook, run before the engine rebuilds. | |
| static uint8_t | s_theme |
| The theme the walk is on. | |
| static int | s_hour |
| The hour the face pinned the clock to. | |
| static int | s_minute |
| The minute the face pinned the clock to. | |
The shared dev harness. It seeds the stores from a fixed fixture and drives the theme walk. Compiled for any face that lists the dev plugin, and the linker drops it from any face that never calls it, which is every release build.
|
static |
Move the walk onto one shot, Quiet Time mark included.
| index | Which shot, wrapped to the table. |
|
static |
Seed the clock, weather, health, and system stores from one shot. A face without weather gets an empty weather store, so it never boots the harness with a reading it cannot show.
The stores are only ever seeded here with live off, and none of them takes a subscription on that path, so seeding again on a tap re-seeds rather than stacking handlers.
| shot | The shot to seed from. |
|
static |
Accelerometer tap: advance the active walk by one.
| axis | The tap axis (unused). |
| direction | The tap direction (unused). |
| const struct [struct].s_fixed s_fixed |
The readings no shot varies, and where the watch is.
|
static |
The shots a theme walk steps through. The first is also what a face shows with no walk.
They cover the range rather than falling at random, with a flat battery and a full one, a dropped phone, the Quiet Time mark up and down, and a range of weather so the scene is not drawing the same sky eight times.