Loading...
Searching...
No Matches
dev_hooks.h
Go to the documentation of this file.
1
25#pragma once
26#include <pebble.h>
27
32
33#ifndef DEV_MODE
34#error "DEV_MODE comes from the build, which sets it on every face. Build the face with paf build, and add --dev for dev mode"
35#endif
36
37#if DEV_MODE
38#if !defined(DEV_TIME_HOUR) || !defined(DEV_TIME_MIN)
39#error "DEV_MODE is on without DEV_TIME_HOUR and DEV_TIME_MIN. Turn dev mode on with paf build <face> --dev, which sets all three"
40#endif
41#include "dev/dev_walk.h"
42#endif
43#include "dev/dev_config.h"
44
52static inline bool dev_seed_stores(void)
53{
54#if DEV_MODE
55 // the settings go first, since the fixture's weather takes the temperature unit they may set
57 dev_walk_seed_stores(DEV_TIME_HOUR, DEV_TIME_MIN);
58 return true;
59#else
60 return false;
61#endif
62}
63
73static inline void dev_start(void (*apply_theme)(void))
74{
75#if DEV_MODE
76#if defined(DEV_TAP_WALK_THEMES) && DEV_TAP_WALK_THEMES
77 dev_walk_init(DEV_WALK_THEMES, apply_theme);
78#elif defined(DEV_WALK_FROM_CONFIG) && DEV_WALK_FROM_CONFIG
79 dev_walk_init(DEV_WALK_CONFIG, apply_theme);
80#else
81 dev_walk_init(DEV_WALK_NONE, apply_theme);
82#endif
83#else
84 (void)apply_theme;
85#endif
86}
87
89static inline void dev_stop(void)
90{
91#if DEV_MODE
93#endif
94}
95
104static inline void dev_force_time(struct tm *when)
105{
106#if DEV_MODE
107 dev_config_pin(when);
108#else
109 (void)when;
110#endif
111}
112
What a dev build takes from the unit's paf.dev.config.json beyond the walk: the clock and date each s...
Shared dev harness for screenshots. It seeds the clock, weather, health, system, and location stores ...
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....
Definition dev_hooks.h:104
void dev_walk_deinit(void)
Drop the tap subscription. Call from deinit.
Definition dev_walk.c:376
static void dev_config_pin(struct tm *when)
Leaves the time alone with dev mode off.
Definition dev_config.h:237
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 t...
Definition dev_hooks.h:73
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,...
Definition dev_walk.c:349
static void dev_stop(void)
Drops the walk's tap subscription when dev mode is on. Call from deinit.
Definition dev_hooks.h:89
void dev_walk_seed_stores(int hour, int min)
Inits the clock, weather, health, system, and location stores from the default fixture,...
Definition dev_walk.c:340
static bool dev_seed_stores(void)
Applies the config's settings, then seeds the stores on the pinned clock, when dev mode is on....
Definition dev_hooks.h:52
static void dev_config_apply_settings(void)
Does nothing with dev mode off.
Definition dev_config.h:231
@ DEV_WALK_CONFIG
A tap steps to the next step of the walk the unit's paf.dev.config.json lays out.
Definition dev_walk.h:35
@ DEV_WALK_THEMES
A tap steps to the next theme.
Definition dev_walk.h:34
@ DEV_WALK_NONE
Just pin the fixture, no tap handler.
Definition dev_walk.h:33