new preferences face with support for RGB LED

This commit is contained in:
joeycastillo
2024-09-22 22:26:59 -04:00
parent 608d6e2e9d
commit 687f1d9f60
8 changed files with 301 additions and 220 deletions

View File

@@ -41,9 +41,7 @@
// This allows these preferences to be stored before entering BACKUP mode and and restored after waking from reset.
// movement_settings_t contains global settings that cover watch behavior, including preferences around clock and unit
// display, time zones, buzzer behavior, LED color and low energy mode timeouts. These settings are stored in BKUP[0].
// If your watch face changes one of these settings, you should store your changes in either your loop or resign
// function by calling `watch_store_backup_data(settings->reg, 0)`. Otherwise it may not persist after a reset event.
// display, time zones, buzzer behavior, LED color and low energy mode timeouts.
typedef union {
struct {
bool button_should_sound : 1; // if true, pressing a button emits a sound.
@@ -53,6 +51,7 @@ typedef union {
uint8_t led_duration : 3; // how many seconds to shine the LED for (x2), 0 to shine only while the button is depressed, or all bits set to disable the LED altogether.
uint8_t led_red_color : 4; // for general purpose illumination, the red LED value (0-15)
uint8_t led_green_color : 4; // for general purpose illumination, the green LED value (0-15)
uint8_t led_blue_color : 4; // for general purpose illumination, the green LED value (0-15)
uint8_t time_zone : 6; // an integer representing an index in the time zone table.
// while Movement itself doesn't implement a clock or display units, it may make sense to include some
@@ -61,8 +60,10 @@ typedef union {
// altimeter to display feet or meters as easily as it tells a thermometer to display degrees in F or C.
bool clock_mode_24h : 1; // indicates whether clock should use 12 or 24 hour mode.
bool use_imperial_units : 1; // indicates whether to use metric units (the default) or imperial.
/// TODO: for #SecondMovement: move alarm_enabled out of preferences
bool alarm_enabled : 1; // indicates whether there is at least one alarm enabled.
uint8_t reserved : 6; // room for more preferences if needed.
uint8_t reserved : 1; // room for more preferences if needed.
} bit;
uint32_t reg;
} movement_settings_t;