allow setting default LED colors in movement_config

This commit is contained in:
joeycastillo 2022-11-28 11:43:51 -06:00
parent 34d72e3296
commit 59260c25de
2 changed files with 12 additions and 6 deletions

View File

@ -27,11 +27,8 @@
#include "movement_faces.h"
#define MOVEMENT_CUSTOM_BOOT_COMMANDS() { \
movement_state.settings.bit.led_green_color = 0x0;\
movement_state.settings.bit.led_red_color = 0xF;\
watch_store_backup_data(movement_state.settings.reg, 0);\
}
#define MOVEMENT_DEFAULT_RED_COLOR 0xF
#define MOVEMENT_DEFAULT_GREEN_COLOR 0x0
const watch_face_t watch_faces[] = {
simple_clock_face,

View File

@ -57,6 +57,14 @@
#define MOVEMENT_SECONDARY_FACE_INDEX 0
#endif
// Set default LED colors if not set
#ifndef MOVEMENT_DEFAULT_RED_COLOR
#define MOVEMENT_DEFAULT_RED_COLOR 0x0
#endif
#ifndef MOVEMENT_DEFAULT_GREEN_COLOR
#define MOVEMENT_DEFAULT_GREEN_COLOR 0xF
#endif
#if __EMSCRIPTEN__
#include <emscripten.h>
#endif
@ -284,7 +292,8 @@ uint8_t movement_claim_backup_register(void) {
void app_init(void) {
memset(&movement_state, 0, sizeof(movement_state));
movement_state.settings.bit.led_green_color = 0xF;
movement_state.settings.bit.led_red_color = MOVEMENT_DEFAULT_RED_COLOR;
movement_state.settings.bit.led_green_color = MOVEMENT_DEFAULT_GREEN_COLOR;
movement_state.settings.bit.button_should_sound = true;
movement_state.settings.bit.le_interval = 1;
movement_state.settings.bit.led_duration = 1;