faces: rename simple_clock_face to clock_face
It's not actually so simple and will only gain features from now on. Just "clock face" also feels more canonical.
This commit is contained in:
parent
af18673e1a
commit
8f040252fd
@ -49,7 +49,7 @@ SRCS += \
|
|||||||
../../littlefs/lfs_util.c \
|
../../littlefs/lfs_util.c \
|
||||||
../movement.c \
|
../movement.c \
|
||||||
../filesystem.c \
|
../filesystem.c \
|
||||||
../watch_faces/clock/simple_clock_face.c \
|
../watch_faces/clock/clock_face.c \
|
||||||
../watch_faces/clock/world_clock_face.c \
|
../watch_faces/clock/world_clock_face.c \
|
||||||
../watch_faces/clock/beats_face.c \
|
../watch_faces/clock/beats_face.c \
|
||||||
../watch_faces/clock/weeknumber_clock_face.c \
|
../watch_faces/clock/weeknumber_clock_face.c \
|
||||||
|
@ -28,7 +28,7 @@
|
|||||||
#include "movement_faces.h"
|
#include "movement_faces.h"
|
||||||
|
|
||||||
const watch_face_t watch_faces[] = {
|
const watch_face_t watch_faces[] = {
|
||||||
simple_clock_face,
|
clock_face,
|
||||||
world_clock_face,
|
world_clock_face,
|
||||||
sunrise_sunset_face,
|
sunrise_sunset_face,
|
||||||
moon_phase_face,
|
moon_phase_face,
|
||||||
|
@ -25,7 +25,7 @@
|
|||||||
#ifndef MOVEMENT_FACES_H_
|
#ifndef MOVEMENT_FACES_H_
|
||||||
#define MOVEMENT_FACES_H_
|
#define MOVEMENT_FACES_H_
|
||||||
|
|
||||||
#include "simple_clock_face.h"
|
#include "clock_face.h"
|
||||||
#include "world_clock_face.h"
|
#include "world_clock_face.h"
|
||||||
#include "preferences_face.h"
|
#include "preferences_face.h"
|
||||||
#include "set_time_face.h"
|
#include "set_time_face.h"
|
||||||
|
@ -23,31 +23,31 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include "simple_clock_face.h"
|
#include "clock_face.h"
|
||||||
#include "watch.h"
|
#include "watch.h"
|
||||||
#include "watch_utility.h"
|
#include "watch_utility.h"
|
||||||
#include "watch_private_display.h"
|
#include "watch_private_display.h"
|
||||||
|
|
||||||
static void _update_alarm_indicator(bool settings_alarm_enabled, simple_clock_state_t *state) {
|
static void _update_alarm_indicator(bool settings_alarm_enabled, clock_state_t *state) {
|
||||||
state->alarm_enabled = settings_alarm_enabled;
|
state->alarm_enabled = settings_alarm_enabled;
|
||||||
if (state->alarm_enabled) watch_set_indicator(WATCH_INDICATOR_SIGNAL);
|
if (state->alarm_enabled) watch_set_indicator(WATCH_INDICATOR_SIGNAL);
|
||||||
else watch_clear_indicator(WATCH_INDICATOR_SIGNAL);
|
else watch_clear_indicator(WATCH_INDICATOR_SIGNAL);
|
||||||
}
|
}
|
||||||
|
|
||||||
void simple_clock_face_setup(movement_settings_t *settings, uint8_t watch_face_index, void ** context_ptr) {
|
void clock_face_setup(movement_settings_t *settings, uint8_t watch_face_index, void ** context_ptr) {
|
||||||
(void) settings;
|
(void) settings;
|
||||||
(void) watch_face_index;
|
(void) watch_face_index;
|
||||||
|
|
||||||
if (*context_ptr == NULL) {
|
if (*context_ptr == NULL) {
|
||||||
*context_ptr = malloc(sizeof(simple_clock_state_t));
|
*context_ptr = malloc(sizeof(clock_state_t));
|
||||||
simple_clock_state_t *state = (simple_clock_state_t *)*context_ptr;
|
clock_state_t *state = (clock_state_t *) *context_ptr;
|
||||||
state->signal_enabled = false;
|
state->signal_enabled = false;
|
||||||
state->watch_face_index = watch_face_index;
|
state->watch_face_index = watch_face_index;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void simple_clock_face_activate(movement_settings_t *settings, void *context) {
|
void clock_face_activate(movement_settings_t *settings, void *context) {
|
||||||
simple_clock_state_t *state = (simple_clock_state_t *)context;
|
clock_state_t *state = (clock_state_t *) context;
|
||||||
|
|
||||||
if (watch_tick_animation_is_running()) watch_stop_tick_animation();
|
if (watch_tick_animation_is_running()) watch_stop_tick_animation();
|
||||||
|
|
||||||
@ -66,8 +66,8 @@ void simple_clock_face_activate(movement_settings_t *settings, void *context) {
|
|||||||
state->previous_date_time = 0xFFFFFFFF;
|
state->previous_date_time = 0xFFFFFFFF;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool simple_clock_face_loop(movement_event_t event, movement_settings_t *settings, void *context) {
|
bool clock_face_loop(movement_event_t event, movement_settings_t *settings, void *context) {
|
||||||
simple_clock_state_t *state = (simple_clock_state_t *)context;
|
clock_state_t *state = (clock_state_t *) context;
|
||||||
char buf[11];
|
char buf[11];
|
||||||
uint8_t pos;
|
uint8_t pos;
|
||||||
|
|
||||||
@ -145,14 +145,14 @@ bool simple_clock_face_loop(movement_event_t event, movement_settings_t *setting
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
void simple_clock_face_resign(movement_settings_t *settings, void *context) {
|
void clock_face_resign(movement_settings_t *settings, void *context) {
|
||||||
(void) settings;
|
(void) settings;
|
||||||
(void) context;
|
(void) context;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool simple_clock_face_wants_background_task(movement_settings_t *settings, void *context) {
|
bool clock_face_wants_background_task(movement_settings_t *settings, void *context) {
|
||||||
(void) settings;
|
(void) settings;
|
||||||
simple_clock_state_t *state = (simple_clock_state_t *)context;
|
clock_state_t *state = (clock_state_t *) context;
|
||||||
if (!state->signal_enabled) return false;
|
if (!state->signal_enabled) return false;
|
||||||
|
|
||||||
watch_date_time date_time = watch_rtc_get_date_time();
|
watch_date_time date_time = watch_rtc_get_date_time();
|
@ -22,16 +22,17 @@
|
|||||||
* SOFTWARE.
|
* SOFTWARE.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef SIMPLE_CLOCK_FACE_H_
|
#ifndef CLOCK_FACE_H_
|
||||||
#define SIMPLE_CLOCK_FACE_H_
|
#define CLOCK_FACE_H_
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* SIMPLE CLOCK FACE
|
* CLOCK FACE
|
||||||
*
|
*
|
||||||
* Displays the current time, matching the original operation of the watch.
|
* Displays the current local time, just like the original watch.
|
||||||
* This is the default display mode in most watch configurations.
|
* This is the default display mode in most watch configurations.
|
||||||
*
|
*
|
||||||
* Long-press ALARM to toggle the hourly chime.
|
* Long-press ALARM to toggle the hourly chime.
|
||||||
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "movement.h"
|
#include "movement.h"
|
||||||
@ -43,20 +44,20 @@ typedef struct {
|
|||||||
bool signal_enabled;
|
bool signal_enabled;
|
||||||
bool battery_low;
|
bool battery_low;
|
||||||
bool alarm_enabled;
|
bool alarm_enabled;
|
||||||
} simple_clock_state_t;
|
} clock_state_t;
|
||||||
|
|
||||||
void simple_clock_face_setup(movement_settings_t *settings, uint8_t watch_face_index, void ** context_ptr);
|
void clock_face_setup(movement_settings_t *settings, uint8_t watch_face_index, void ** context_ptr);
|
||||||
void simple_clock_face_activate(movement_settings_t *settings, void *context);
|
void clock_face_activate(movement_settings_t *settings, void *context);
|
||||||
bool simple_clock_face_loop(movement_event_t event, movement_settings_t *settings, void *context);
|
bool clock_face_loop(movement_event_t event, movement_settings_t *settings, void *context);
|
||||||
void simple_clock_face_resign(movement_settings_t *settings, void *context);
|
void clock_face_resign(movement_settings_t *settings, void *context);
|
||||||
bool simple_clock_face_wants_background_task(movement_settings_t *settings, void *context);
|
bool clock_face_wants_background_task(movement_settings_t *settings, void *context);
|
||||||
|
|
||||||
#define simple_clock_face ((const watch_face_t){ \
|
#define clock_face ((const watch_face_t) { \
|
||||||
simple_clock_face_setup, \
|
clock_face_setup, \
|
||||||
simple_clock_face_activate, \
|
clock_face_activate, \
|
||||||
simple_clock_face_loop, \
|
clock_face_loop, \
|
||||||
simple_clock_face_resign, \
|
clock_face_resign, \
|
||||||
simple_clock_face_wants_background_task, \
|
clock_face_wants_background_task, \
|
||||||
})
|
})
|
||||||
|
|
||||||
#endif // SIMPLE_CLOCK_FACE_H_
|
#endif // CLOCK_FACE_H_
|
Loading…
x
Reference in New Issue
Block a user