refactor: watch faces no longer need a pointer to settings!
This commit is contained in:
@@ -55,8 +55,7 @@ static void _accel_interrupt_count_face_configure_threshold(uint8_t threshold) {
|
||||
lis2dw_configure_wakeup_int1(threshold, false, true);
|
||||
}
|
||||
|
||||
void accel_interrupt_count_face_setup(movement_settings_t *settings, uint8_t watch_face_index, void ** context_ptr) {
|
||||
(void) settings;
|
||||
void accel_interrupt_count_face_setup(uint8_t watch_face_index, void ** context_ptr) {
|
||||
(void) watch_face_index;
|
||||
if (*context_ptr == NULL) {
|
||||
*context_ptr = malloc(sizeof(accel_interrupt_count_state_t));
|
||||
@@ -75,7 +74,7 @@ void accel_interrupt_count_face_setup(movement_settings_t *settings, uint8_t wat
|
||||
}
|
||||
}
|
||||
|
||||
void accel_interrupt_count_face_activate(movement_settings_t *settings, void *context) {
|
||||
void accel_interrupt_count_face_activate(void *context) {
|
||||
accel_interrupt_count_state_t *state = (accel_interrupt_count_state_t *)context;
|
||||
|
||||
// never in settings mode at the start
|
||||
@@ -85,7 +84,7 @@ void accel_interrupt_count_face_activate(movement_settings_t *settings, void *co
|
||||
movement_set_low_energy_timeout(0);
|
||||
}
|
||||
|
||||
bool accel_interrupt_count_face_loop(movement_event_t event, movement_settings_t *settings, void *context) {
|
||||
bool accel_interrupt_count_face_loop(movement_event_t event, void *context) {
|
||||
accel_interrupt_count_state_t *state = (accel_interrupt_count_state_t *)context;
|
||||
|
||||
if (state->is_setting) {
|
||||
@@ -107,7 +106,7 @@ bool accel_interrupt_count_face_loop(movement_event_t event, movement_settings_t
|
||||
state->is_setting = false;
|
||||
break;
|
||||
default:
|
||||
movement_default_loop_handler(event, settings);
|
||||
movement_default_loop_handler(event);
|
||||
break;
|
||||
}
|
||||
} else {
|
||||
@@ -142,7 +141,7 @@ bool accel_interrupt_count_face_loop(movement_event_t event, movement_settings_t
|
||||
}
|
||||
return false;
|
||||
default:
|
||||
movement_default_loop_handler(event, settings);
|
||||
movement_default_loop_handler(event);
|
||||
break;
|
||||
}
|
||||
}
|
||||
@@ -150,13 +149,11 @@ bool accel_interrupt_count_face_loop(movement_event_t event, movement_settings_t
|
||||
return true;
|
||||
}
|
||||
|
||||
void accel_interrupt_count_face_resign(movement_settings_t *settings, void *context) {
|
||||
(void) settings;
|
||||
void accel_interrupt_count_face_resign(void *context) {
|
||||
(void) context;
|
||||
}
|
||||
|
||||
bool accel_interrupt_count_face_wants_background_task(movement_settings_t *settings, void *context) {
|
||||
(void) settings;
|
||||
bool accel_interrupt_count_face_wants_background_task(void *context) {
|
||||
(void) context;
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -43,11 +43,11 @@ typedef struct {
|
||||
bool is_setting;
|
||||
} accel_interrupt_count_state_t;
|
||||
|
||||
void accel_interrupt_count_face_setup(movement_settings_t *settings, uint8_t watch_face_index, void ** context_ptr);
|
||||
void accel_interrupt_count_face_activate(movement_settings_t *settings, void *context);
|
||||
bool accel_interrupt_count_face_loop(movement_event_t event, movement_settings_t *settings, void *context);
|
||||
void accel_interrupt_count_face_resign(movement_settings_t *settings, void *context);
|
||||
bool accel_interrupt_count_face_wants_background_task(movement_settings_t *settings, void *context);
|
||||
void accel_interrupt_count_face_setup(uint8_t watch_face_index, void ** context_ptr);
|
||||
void accel_interrupt_count_face_activate(void *context);
|
||||
bool accel_interrupt_count_face_loop(movement_event_t event, void *context);
|
||||
void accel_interrupt_count_face_resign(void *context);
|
||||
bool accel_interrupt_count_face_wants_background_task(void *context);
|
||||
|
||||
#define accel_interrupt_count_face ((const watch_face_t){ \
|
||||
accel_interrupt_count_face_setup, \
|
||||
|
||||
@@ -56,7 +56,7 @@ static const char activity_types[][3] = {
|
||||
static void update(accelerometer_data_acquisition_state_t *state);
|
||||
static void update_settings(accelerometer_data_acquisition_state_t *state);
|
||||
static void advance_current_setting(accelerometer_data_acquisition_state_t *state);
|
||||
static void start_reading(accelerometer_data_acquisition_state_t *state, movement_settings_t *settings);
|
||||
static void start_reading(accelerometer_data_acquisition_state_t *state);
|
||||
static void continue_reading(accelerometer_data_acquisition_state_t *state);
|
||||
static void finish_reading(accelerometer_data_acquisition_state_t *state);
|
||||
static bool wait_for_flash_ready(void);
|
||||
@@ -65,8 +65,7 @@ static void write_buffer_to_page(uint8_t *buf, uint16_t page);
|
||||
static void write_page(accelerometer_data_acquisition_state_t *state);
|
||||
static void log_data_point(accelerometer_data_acquisition_state_t *state, lis2dw_reading_t reading, uint8_t centiseconds);
|
||||
|
||||
void accelerometer_data_acquisition_face_setup(movement_settings_t *settings, uint8_t watch_face_index, void ** context_ptr) {
|
||||
(void) settings;
|
||||
void accelerometer_data_acquisition_face_setup(uint8_t watch_face_index, void ** context_ptr) {
|
||||
(void) watch_face_index;
|
||||
accelerometer_data_acquisition_state_t *state = (accelerometer_data_acquisition_state_t *)*context_ptr;
|
||||
if (*context_ptr == NULL) {
|
||||
@@ -92,14 +91,12 @@ void accelerometer_data_acquisition_face_setup(movement_settings_t *settings, ui
|
||||
|
||||
}
|
||||
|
||||
void accelerometer_data_acquisition_face_activate(movement_settings_t *settings, void *context) {
|
||||
(void) settings;
|
||||
void accelerometer_data_acquisition_face_activate(void *context) {
|
||||
accelerometer_data_acquisition_state_t *state = (accelerometer_data_acquisition_state_t *)context;
|
||||
state->next_available_page = get_next_available_page();
|
||||
}
|
||||
|
||||
bool accelerometer_data_acquisition_face_loop(movement_event_t event, movement_settings_t *settings, void *context) {
|
||||
(void) settings;
|
||||
bool accelerometer_data_acquisition_face_loop(movement_event_t event, void *context) {
|
||||
accelerometer_data_acquisition_state_t *state = (accelerometer_data_acquisition_state_t *)context;
|
||||
|
||||
switch (event.event_type) {
|
||||
@@ -131,7 +128,7 @@ bool accelerometer_data_acquisition_face_loop(movement_event_t event, movement_s
|
||||
state->reading_ticks = SECONDS_TO_RECORD + 1;
|
||||
// also beep if the user asked for it
|
||||
if (state->beep_with_countdown) watch_buzzer_play_note(BUZZER_NOTE_C6, 75);
|
||||
start_reading(state, settings);
|
||||
start_reading(state);
|
||||
} else if (state->countdown_ticks < 3) {
|
||||
// beep for last two ticks before reading
|
||||
if (state->beep_with_countdown) watch_buzzer_play_note(BUZZER_NOTE_C5, 75);
|
||||
@@ -218,15 +215,14 @@ bool accelerometer_data_acquisition_face_loop(movement_event_t event, movement_s
|
||||
// don't light up every time light is hit
|
||||
break;
|
||||
default:
|
||||
movement_default_loop_handler(event, settings);
|
||||
movement_default_loop_handler(event);
|
||||
break;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
void accelerometer_data_acquisition_face_resign(movement_settings_t *settings, void *context) {
|
||||
(void) settings;
|
||||
void accelerometer_data_acquisition_face_resign(void *context) {
|
||||
accelerometer_data_acquisition_state_t *state = (accelerometer_data_acquisition_state_t *)context;
|
||||
if (state->reading_ticks) {
|
||||
state->reading_ticks = 0;
|
||||
@@ -429,7 +425,7 @@ static void log_data_point(accelerometer_data_acquisition_state_t *state, lis2dw
|
||||
}
|
||||
}
|
||||
|
||||
static void start_reading(accelerometer_data_acquisition_state_t *state, movement_settings_t *settings) {
|
||||
static void start_reading(accelerometer_data_acquisition_state_t *state) {
|
||||
printf("Start reading\n");
|
||||
watch_enable_i2c();
|
||||
lis2dw_begin();
|
||||
|
||||
@@ -101,10 +101,10 @@ typedef struct {
|
||||
uint16_t pos;
|
||||
} accelerometer_data_acquisition_state_t;
|
||||
|
||||
void accelerometer_data_acquisition_face_setup(movement_settings_t *settings, uint8_t watch_face_index, void ** context_ptr);
|
||||
void accelerometer_data_acquisition_face_activate(movement_settings_t *settings, void *context);
|
||||
bool accelerometer_data_acquisition_face_loop(movement_event_t event, movement_settings_t *settings, void *context);
|
||||
void accelerometer_data_acquisition_face_resign(movement_settings_t *settings, void *context);
|
||||
void accelerometer_data_acquisition_face_setup(uint8_t watch_face_index, void ** context_ptr);
|
||||
void accelerometer_data_acquisition_face_activate(void *context);
|
||||
bool accelerometer_data_acquisition_face_loop(movement_event_t event, void *context);
|
||||
void accelerometer_data_acquisition_face_resign(void *context);
|
||||
|
||||
#define accelerometer_data_acquisition_face ((const watch_face_t){ \
|
||||
accelerometer_data_acquisition_face_setup, \
|
||||
|
||||
@@ -48,8 +48,7 @@ static void _alarm_thermometer_face_clear(int last[]) {
|
||||
}
|
||||
}
|
||||
|
||||
void alarm_thermometer_face_setup(movement_settings_t *settings, uint8_t watch_face_index, void ** context_ptr) {
|
||||
(void) settings;
|
||||
void alarm_thermometer_face_setup(uint8_t watch_face_index, void ** context_ptr) {
|
||||
(void) watch_face_index;
|
||||
if (*context_ptr == NULL) {
|
||||
*context_ptr = malloc(sizeof(alarm_thermometer_state_t));
|
||||
@@ -57,15 +56,14 @@ void alarm_thermometer_face_setup(movement_settings_t *settings, uint8_t watch_f
|
||||
}
|
||||
}
|
||||
|
||||
void alarm_thermometer_face_activate(movement_settings_t *settings, void *context) {
|
||||
(void) settings;
|
||||
void alarm_thermometer_face_activate(void *context) {
|
||||
alarm_thermometer_state_t *state = (alarm_thermometer_state_t *)context;
|
||||
state->mode = MODE_NORMAL;
|
||||
_alarm_thermometer_face_clear(state->last);
|
||||
watch_display_string("AT", 0);
|
||||
}
|
||||
|
||||
bool alarm_thermometer_face_loop(movement_event_t event, movement_settings_t *settings, void *context) {
|
||||
bool alarm_thermometer_face_loop(movement_event_t event, void *context) {
|
||||
alarm_thermometer_state_t *state = (alarm_thermometer_state_t *)context;
|
||||
|
||||
switch (event.event_type) {
|
||||
@@ -142,13 +140,12 @@ bool alarm_thermometer_face_loop(movement_event_t event, movement_settings_t *se
|
||||
}
|
||||
break;
|
||||
default:
|
||||
return movement_default_loop_handler(event, settings);
|
||||
return movement_default_loop_handler(event);
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
void alarm_thermometer_face_resign(movement_settings_t *settings, void *context) {
|
||||
(void) settings;
|
||||
void alarm_thermometer_face_resign(void *context) {
|
||||
(void) context;
|
||||
}
|
||||
|
||||
@@ -58,10 +58,10 @@ typedef struct {
|
||||
alarm_thermometer_mode_t mode;
|
||||
} alarm_thermometer_state_t;
|
||||
|
||||
void alarm_thermometer_face_setup(movement_settings_t *settings, uint8_t watch_face_index, void ** context_ptr);
|
||||
void alarm_thermometer_face_activate(movement_settings_t *settings, void *context);
|
||||
bool alarm_thermometer_face_loop(movement_event_t event, movement_settings_t *settings, void *context);
|
||||
void alarm_thermometer_face_resign(movement_settings_t *settings, void *context);
|
||||
void alarm_thermometer_face_setup(uint8_t watch_face_index, void ** context_ptr);
|
||||
void alarm_thermometer_face_activate(void *context);
|
||||
bool alarm_thermometer_face_loop(movement_event_t event, void *context);
|
||||
void alarm_thermometer_face_resign(void *context);
|
||||
|
||||
#define alarm_thermometer_face ((const watch_face_t){ \
|
||||
alarm_thermometer_face_setup, \
|
||||
|
||||
@@ -31,8 +31,7 @@
|
||||
|
||||
uint16_t lightmeter_mod(uint16_t m, uint16_t n) { return (m%n + n)%n; }
|
||||
|
||||
void lightmeter_face_setup(movement_settings_t *settings, uint8_t watch_face_index, void ** context_ptr) {
|
||||
(void) settings;
|
||||
void lightmeter_face_setup(uint8_t watch_face_index, void ** context_ptr) {
|
||||
(void) watch_face_index;
|
||||
if (*context_ptr == NULL) {
|
||||
*context_ptr = malloc(sizeof(lightmeter_state_t));
|
||||
@@ -45,8 +44,7 @@ void lightmeter_face_setup(movement_settings_t *settings, uint8_t watch_face_ind
|
||||
}
|
||||
}
|
||||
|
||||
void lightmeter_face_activate(movement_settings_t *settings, void *context) {
|
||||
(void) settings;
|
||||
void lightmeter_face_activate(void *context) {
|
||||
lightmeter_state_t *state = (lightmeter_state_t*) context;
|
||||
state->waiting_for_conversion = 0;
|
||||
lightmeter_show_ev(state); // Print most current reading
|
||||
@@ -101,8 +99,7 @@ void lightmeter_show_ev(lightmeter_state_t *state) {
|
||||
return;
|
||||
}
|
||||
|
||||
bool lightmeter_face_loop(movement_event_t event, movement_settings_t *settings, void *context) {
|
||||
(void) settings;
|
||||
bool lightmeter_face_loop(movement_event_t event, void *context) {
|
||||
lightmeter_state_t *state = (lightmeter_state_t*) context;
|
||||
|
||||
opt3001_Config_t c;
|
||||
@@ -160,14 +157,13 @@ bool lightmeter_face_loop(movement_event_t event, movement_settings_t *settings,
|
||||
break;
|
||||
|
||||
default:
|
||||
movement_default_loop_handler(event, settings);
|
||||
movement_default_loop_handler(event);
|
||||
break;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
void lightmeter_face_resign(movement_settings_t *settings, void *context) {
|
||||
(void) settings;
|
||||
void lightmeter_face_resign(void *context) {
|
||||
(void) context;
|
||||
opt3001_writeConfig(lightmeter_addr, lightmeter_off);
|
||||
watch_disable_i2c();
|
||||
|
||||
@@ -172,11 +172,11 @@ static const opt3001_Config_t lightmeter_off = {
|
||||
|
||||
uint16_t lightmeter_mod(uint16_t m, uint16_t n);
|
||||
|
||||
void lightmeter_face_setup(movement_settings_t *settings, uint8_t watch_face_index, void ** context_ptr);
|
||||
void lightmeter_face_activate(movement_settings_t *settings, void *context);
|
||||
void lightmeter_face_setup(uint8_t watch_face_index, void ** context_ptr);
|
||||
void lightmeter_face_activate(void *context);
|
||||
void lightmeter_show_ev(lightmeter_state_t *state);
|
||||
bool lightmeter_face_loop(movement_event_t event, movement_settings_t *settings, void *context);
|
||||
void lightmeter_face_resign(movement_settings_t *settings, void *context);
|
||||
bool lightmeter_face_loop(movement_event_t event, void *context);
|
||||
void lightmeter_face_resign(void *context);
|
||||
|
||||
static const uint8_t lightmeter_addr = 0x44;
|
||||
|
||||
|
||||
@@ -83,8 +83,7 @@ static void _minmax_face_update_display(float temperature_c, bool in_fahrenheit)
|
||||
}
|
||||
|
||||
|
||||
void minmax_face_setup(movement_settings_t *settings, uint8_t watch_face_index, void ** context_ptr) {
|
||||
(void) settings;
|
||||
void minmax_face_setup(uint8_t watch_face_index, void ** context_ptr) {
|
||||
(void) watch_face_index;
|
||||
if (*context_ptr == NULL) {
|
||||
*context_ptr = malloc(sizeof(minmax_state_t));
|
||||
@@ -93,14 +92,13 @@ void minmax_face_setup(movement_settings_t *settings, uint8_t watch_face_index,
|
||||
}
|
||||
|
||||
|
||||
void minmax_face_activate(movement_settings_t *settings, void *context) {
|
||||
(void) settings;
|
||||
void minmax_face_activate(void *context) {
|
||||
minmax_state_t *state = (minmax_state_t *)context;
|
||||
state->show_min = true;
|
||||
watch_display_string("MN", 0); // Start with minimum temp
|
||||
}
|
||||
|
||||
bool minmax_face_loop(movement_event_t event, movement_settings_t *settings, void *context) {
|
||||
bool minmax_face_loop(movement_event_t event, void *context) {
|
||||
minmax_state_t *state = (minmax_state_t *)context;
|
||||
float temp_c;
|
||||
|
||||
@@ -134,20 +132,18 @@ bool minmax_face_loop(movement_event_t event, movement_settings_t *settings, voi
|
||||
_minmax_face_log_data(state);
|
||||
break;
|
||||
default:
|
||||
return movement_default_loop_handler(event, settings);
|
||||
return movement_default_loop_handler(event);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
void minmax_face_resign(movement_settings_t *settings, void *context) {
|
||||
(void) settings;
|
||||
void minmax_face_resign(void *context) {
|
||||
(void) context;
|
||||
}
|
||||
|
||||
|
||||
bool minmax_face_wants_background_task(movement_settings_t *settings, void *context) {
|
||||
(void) settings;
|
||||
bool minmax_face_wants_background_task(void *context) {
|
||||
(void) context;
|
||||
// this will get called at the top of each minute; always request bg task
|
||||
return true;
|
||||
|
||||
@@ -51,11 +51,11 @@ typedef struct {
|
||||
float hourly_maxs[LOGGING_DATA_POINTS];
|
||||
} minmax_state_t;
|
||||
|
||||
void minmax_face_setup(movement_settings_t *settings, uint8_t watch_face_index, void ** context_ptr);
|
||||
void minmax_face_activate(movement_settings_t *settings, void *context);
|
||||
bool minmax_face_loop(movement_event_t event, movement_settings_t *settings, void *context);
|
||||
void minmax_face_resign(movement_settings_t *settings, void *context);
|
||||
bool minmax_face_wants_background_task(movement_settings_t *settings, void *context);
|
||||
void minmax_face_setup(uint8_t watch_face_index, void ** context_ptr);
|
||||
void minmax_face_activate(void *context);
|
||||
bool minmax_face_loop(movement_event_t event, void *context);
|
||||
void minmax_face_resign(void *context);
|
||||
bool minmax_face_wants_background_task(void *context);
|
||||
|
||||
#define minmax_face ((const watch_face_t){ \
|
||||
minmax_face_setup, \
|
||||
|
||||
@@ -72,8 +72,7 @@ static void _thermistor_logging_face_update_display(thermistor_logger_state_t *l
|
||||
watch_display_string(buf, 0);
|
||||
}
|
||||
|
||||
void thermistor_logging_face_setup(movement_settings_t *settings, uint8_t watch_face_index, void ** context_ptr) {
|
||||
(void) settings;
|
||||
void thermistor_logging_face_setup(uint8_t watch_face_index, void ** context_ptr) {
|
||||
(void) watch_face_index;
|
||||
if (*context_ptr == NULL) {
|
||||
*context_ptr = malloc(sizeof(thermistor_logger_state_t));
|
||||
@@ -81,14 +80,13 @@ void thermistor_logging_face_setup(movement_settings_t *settings, uint8_t watch_
|
||||
}
|
||||
}
|
||||
|
||||
void thermistor_logging_face_activate(movement_settings_t *settings, void *context) {
|
||||
(void) settings;
|
||||
void thermistor_logging_face_activate(void *context) {
|
||||
thermistor_logger_state_t *logger_state = (thermistor_logger_state_t *)context;
|
||||
logger_state->display_index = 0;
|
||||
logger_state->ts_ticks = 0;
|
||||
}
|
||||
|
||||
bool thermistor_logging_face_loop(movement_event_t event, movement_settings_t *settings, void *context) {
|
||||
bool thermistor_logging_face_loop(movement_event_t event, void *context) {
|
||||
thermistor_logger_state_t *logger_state = (thermistor_logger_state_t *)context;
|
||||
switch (event.event_type) {
|
||||
case EVENT_TIMEOUT:
|
||||
@@ -118,20 +116,18 @@ bool thermistor_logging_face_loop(movement_event_t event, movement_settings_t *s
|
||||
_thermistor_logging_face_log_data(logger_state);
|
||||
break;
|
||||
default:
|
||||
movement_default_loop_handler(event, settings);
|
||||
movement_default_loop_handler(event);
|
||||
break;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
void thermistor_logging_face_resign(movement_settings_t *settings, void *context) {
|
||||
(void) settings;
|
||||
void thermistor_logging_face_resign(void *context) {
|
||||
(void) context;
|
||||
}
|
||||
|
||||
bool thermistor_logging_face_wants_background_task(movement_settings_t *settings, void *context) {
|
||||
(void) settings;
|
||||
bool thermistor_logging_face_wants_background_task(void *context) {
|
||||
(void) context;
|
||||
// this will get called at the top of each minute, so all we check is if we're at the top of the hour as well.
|
||||
// if we are, we ask for a background task.
|
||||
|
||||
@@ -70,11 +70,11 @@ typedef struct {
|
||||
thermistor_logger_data_point_t data[THERMISTOR_LOGGING_NUM_DATA_POINTS];
|
||||
} thermistor_logger_state_t;
|
||||
|
||||
void thermistor_logging_face_setup(movement_settings_t *settings, uint8_t watch_face_index, void ** context_ptr);
|
||||
void thermistor_logging_face_activate(movement_settings_t *settings, void *context);
|
||||
bool thermistor_logging_face_loop(movement_event_t event, movement_settings_t *settings, void *context);
|
||||
void thermistor_logging_face_resign(movement_settings_t *settings, void *context);
|
||||
bool thermistor_logging_face_wants_background_task(movement_settings_t *settings, void *context);
|
||||
void thermistor_logging_face_setup(uint8_t watch_face_index, void ** context_ptr);
|
||||
void thermistor_logging_face_activate(void *context);
|
||||
bool thermistor_logging_face_loop(movement_event_t event, void *context);
|
||||
void thermistor_logging_face_resign(void *context);
|
||||
bool thermistor_logging_face_wants_background_task(void *context);
|
||||
|
||||
#define thermistor_logging_face ((const watch_face_t){ \
|
||||
thermistor_logging_face_setup, \
|
||||
|
||||
@@ -41,19 +41,17 @@ static void _thermistor_readout_face_update_display(bool in_fahrenheit) {
|
||||
thermistor_driver_disable();
|
||||
}
|
||||
|
||||
void thermistor_readout_face_setup(movement_settings_t *settings, uint8_t watch_face_index, void ** context_ptr) {
|
||||
(void) settings;
|
||||
void thermistor_readout_face_setup(uint8_t watch_face_index, void ** context_ptr) {
|
||||
(void) watch_face_index;
|
||||
(void) context_ptr;
|
||||
}
|
||||
|
||||
void thermistor_readout_face_activate(movement_settings_t *settings, void *context) {
|
||||
(void) settings;
|
||||
void thermistor_readout_face_activate(void *context) {
|
||||
(void) context;
|
||||
watch_display_string("TE", 0);
|
||||
}
|
||||
|
||||
bool thermistor_readout_face_loop(movement_event_t event, movement_settings_t *settings, void *context) {
|
||||
bool thermistor_readout_face_loop(movement_event_t event, void *context) {
|
||||
(void) context;
|
||||
watch_date_time date_time = watch_rtc_get_date_time();
|
||||
switch (event.event_type) {
|
||||
@@ -90,14 +88,13 @@ bool thermistor_readout_face_loop(movement_event_t event, movement_settings_t *s
|
||||
}
|
||||
break;
|
||||
default:
|
||||
movement_default_loop_handler(event, settings);
|
||||
movement_default_loop_handler(event);
|
||||
break;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
void thermistor_readout_face_resign(movement_settings_t *settings, void *context) {
|
||||
(void) settings;
|
||||
void thermistor_readout_face_resign(void *context) {
|
||||
(void) context;
|
||||
}
|
||||
|
||||
@@ -50,10 +50,10 @@
|
||||
|
||||
#include "movement.h"
|
||||
|
||||
void thermistor_readout_face_setup(movement_settings_t *settings, uint8_t watch_face_index, void ** context_ptr);
|
||||
void thermistor_readout_face_activate(movement_settings_t *settings, void *context);
|
||||
bool thermistor_readout_face_loop(movement_event_t event, movement_settings_t *settings, void *context);
|
||||
void thermistor_readout_face_resign(movement_settings_t *settings, void *context);
|
||||
void thermistor_readout_face_setup(uint8_t watch_face_index, void ** context_ptr);
|
||||
void thermistor_readout_face_activate(void *context);
|
||||
bool thermistor_readout_face_loop(movement_event_t event, void *context);
|
||||
void thermistor_readout_face_resign(void *context);
|
||||
|
||||
#define thermistor_readout_face ((const watch_face_t){ \
|
||||
thermistor_readout_face_setup, \
|
||||
|
||||
@@ -41,7 +41,7 @@ static void _thermistor_testing_face_update_display(bool in_fahrenheit) {
|
||||
thermistor_driver_disable();
|
||||
}
|
||||
|
||||
void thermistor_testing_face_setup(movement_settings_t *settings, uint8_t watch_face_index, void ** context_ptr) {
|
||||
void thermistor_testing_face_setup(uint8_t watch_face_index, void ** context_ptr) {
|
||||
(void) watch_face_index;
|
||||
(void) context_ptr;
|
||||
// force one setting: never enter low energy mode.
|
||||
@@ -49,14 +49,13 @@ void thermistor_testing_face_setup(movement_settings_t *settings, uint8_t watch_
|
||||
movement_set_low_energy_timeout(0);
|
||||
}
|
||||
|
||||
void thermistor_testing_face_activate(movement_settings_t *settings, void *context) {
|
||||
(void) settings;
|
||||
void thermistor_testing_face_activate(void *context) {
|
||||
(void) context;
|
||||
watch_display_string("TE", 0);
|
||||
movement_request_tick_frequency(8);
|
||||
}
|
||||
|
||||
bool thermistor_testing_face_loop(movement_event_t event, movement_settings_t *settings, void *context) {
|
||||
bool thermistor_testing_face_loop(movement_event_t event, void *context) {
|
||||
(void) context;
|
||||
switch (event.event_type) {
|
||||
case EVENT_ALARM_BUTTON_DOWN:
|
||||
@@ -68,14 +67,13 @@ bool thermistor_testing_face_loop(movement_event_t event, movement_settings_t *s
|
||||
_thermistor_testing_face_update_display(movement_use_imperial_units());
|
||||
break;
|
||||
default:
|
||||
movement_default_loop_handler(event, settings);
|
||||
movement_default_loop_handler(event);
|
||||
break;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
void thermistor_testing_face_resign(movement_settings_t *settings, void *context) {
|
||||
(void) settings;
|
||||
void thermistor_testing_face_resign(void *context) {
|
||||
(void) context;
|
||||
}
|
||||
|
||||
@@ -38,10 +38,10 @@
|
||||
|
||||
#include "movement.h"
|
||||
|
||||
void thermistor_testing_face_setup(movement_settings_t *settings, uint8_t watch_face_index, void ** context_ptr);
|
||||
void thermistor_testing_face_activate(movement_settings_t *settings, void *context);
|
||||
bool thermistor_testing_face_loop(movement_event_t event, movement_settings_t *settings, void *context);
|
||||
void thermistor_testing_face_resign(movement_settings_t *settings, void *context);
|
||||
void thermistor_testing_face_setup(uint8_t watch_face_index, void ** context_ptr);
|
||||
void thermistor_testing_face_activate(void *context);
|
||||
bool thermistor_testing_face_loop(movement_event_t event, void *context);
|
||||
void thermistor_testing_face_resign(void *context);
|
||||
|
||||
#define thermistor_testing_face ((const watch_face_t){ \
|
||||
thermistor_testing_face_setup, \
|
||||
|
||||
Reference in New Issue
Block a user