use consistent naming style for typedefs

This commit is contained in:
joeycastillo
2024-10-05 10:31:17 -04:00
parent 997f091c16
commit 0a9d71e2d4
70 changed files with 222 additions and 222 deletions

View File

@@ -92,7 +92,7 @@ bool close_enough_clock_face_loop(movement_event_t event, void *context) {
close_enough_clock_state_t *state = (close_enough_clock_state_t *)context;
char buf[11];
watch_date_time date_time;
watch_date_time_t date_time;
bool show_next_hour = false;
int prev_five_minute_period;
int prev_min_checked;

View File

@@ -34,7 +34,7 @@ static double better_fmod(double x, double y) {
return fmod(fmod(x, y) + y, y);
}
static void recalculate(watch_date_time utc_now, day_night_percentage_state_t *state) {
static void recalculate(watch_date_time_t utc_now, day_night_percentage_state_t *state) {
movement_location_t movement_location = (movement_location_t) watch_get_backup_data(1);
if (movement_location.reg == 0) {
@@ -61,7 +61,7 @@ void day_night_percentage_face_setup(uint8_t watch_face_index, void ** context_p
if (*context_ptr == NULL) {
*context_ptr = malloc(sizeof(day_night_percentage_state_t));
day_night_percentage_state_t *state = (day_night_percentage_state_t *)*context_ptr;
watch_date_time utc_now = watch_utility_date_time_convert_zone(watch_rtc_get_date_time(), movement_get_current_timezone_offset(), 0);
watch_date_time_t utc_now = watch_utility_date_time_convert_zone(watch_rtc_get_date_time(), movement_get_current_timezone_offset(), 0);
recalculate(utc_now, state);
}
}
@@ -74,8 +74,8 @@ bool day_night_percentage_face_loop(movement_event_t event, void *context) {
day_night_percentage_state_t *state = (day_night_percentage_state_t *)context;
char buf[12];
watch_date_time date_time = watch_rtc_get_date_time();
watch_date_time utc_now = watch_utility_date_time_convert_zone(date_time, movement_get_current_timezone_offset(), 0);
watch_date_time_t date_time = watch_rtc_get_date_time();
watch_date_time_t utc_now = watch_utility_date_time_convert_zone(date_time, movement_get_current_timezone_offset(), 0);
switch (event.event_type) {
case EVENT_ACTIVATE:

View File

@@ -72,7 +72,7 @@ bool decimal_time_face_loop(movement_event_t event, void *context) {
char buf[16];
uint8_t centihours, decimal_seconds;
watch_date_time date_time;
watch_date_time_t date_time;
switch (event.event_type) {
case EVENT_ACTIVATE:

View File

@@ -52,7 +52,7 @@ bool french_revolutionary_face_loop(movement_event_t event, void *context) {
french_revolutionary_state_t *state = (french_revolutionary_state_t *)context;
char buf[11];
watch_date_time date_time;
watch_date_time_t date_time;
fr_decimal_time decimal_time;
switch (event.event_type) {
@@ -139,7 +139,7 @@ void french_revolutionary_face_resign(void *context) {
}
// Calculate decimal time from normal (24hr) time
fr_decimal_time get_decimal_time(watch_date_time *date_time) {
fr_decimal_time get_decimal_time(watch_date_time_t *date_time) {
uint32_t current_24hr_secs, current_decimal_seconds;
fr_decimal_time decimal_time;
// Current 24-hr time in seconds (There are 86400 of these in a day.)
@@ -167,7 +167,7 @@ fr_decimal_time get_decimal_time(watch_date_time *date_time) {
// - Decimal-time with normal time in the top (minutes first, then hours, due to display limitations)
// TODO: There is some power-saving stuff that simple clock does here around not redrawing characters that haven't changed, but we're not doing that here.
// I'll try to add that optimization could be added in a future commit.
void set_display_buffer(char *buf, french_revolutionary_state_t *state, fr_decimal_time *decimal_time, watch_date_time *date_time) {
void set_display_buffer(char *buf, french_revolutionary_state_t *state, fr_decimal_time *decimal_time, watch_date_time_t *date_time) {
switch (state->display_type) {
// Decimal time only
case 0:

View File

@@ -68,8 +68,8 @@ void french_revolutionary_face_activate(void *context);
bool french_revolutionary_face_loop(movement_event_t event, void *context);
void french_revolutionary_face_resign(void *context);
char fix_character_one(char digit);
fr_decimal_time get_decimal_time(watch_date_time *date_time);
void set_display_buffer(char *buf, french_revolutionary_state_t *state, fr_decimal_time *decimal_time, watch_date_time *date_time);
fr_decimal_time get_decimal_time(watch_date_time_t *date_time);
void set_display_buffer(char *buf, french_revolutionary_state_t *state, fr_decimal_time *decimal_time, watch_date_time_t *date_time);
#define french_revolutionary_face ((const watch_face_t){ \

View File

@@ -69,7 +69,7 @@ static void _h_to_hms(mars_clock_hms_t *date_time, double h) {
static void _update(mars_time_state_t *state) {
char buf[11];
watch_date_time date_time = watch_rtc_get_date_time();
watch_date_time_t date_time = watch_rtc_get_date_time();
uint32_t now = watch_utility_date_time_to_unix_time(date_time, movement_get_current_timezone_offset());
// TODO: I'm skipping over some steps here.
// https://www.giss.nasa.gov/tools/mars24/help/algorithm.html

View File

@@ -27,7 +27,7 @@
#include "minimal_clock_face.h"
static void _minimal_clock_face_update_display() {
watch_date_time date_time = watch_rtc_get_date_time();
watch_date_time_t date_time = watch_rtc_get_date_time();
char buffer[11];
if (!movement_clock_mode_24h()) {

View File

@@ -102,7 +102,7 @@ bool minute_repeater_decimal_face_loop(movement_event_t event, void *context) {
char buf[11];
uint8_t pos;
watch_date_time date_time;
watch_date_time_t date_time;
uint32_t previous_date_time;
switch (event.event_type) {
case EVENT_ACTIVATE:
@@ -230,7 +230,7 @@ movement_watch_face_advisory_t minute_repeater_decimal_face_advise(void *context
movement_watch_face_advisory_t retval = { 0 };
if (state->signal_enabled) {
watch_date_time date_time = watch_rtc_get_date_time();
watch_date_time_t date_time = watch_rtc_get_date_time();
retval.wants_background_task = date_time.unit.minute == 0;
}

View File

@@ -87,7 +87,7 @@ bool repetition_minute_face_loop(movement_event_t event, void *context) {
char buf[11];
uint8_t pos;
watch_date_time date_time;
watch_date_time_t date_time;
uint32_t previous_date_time;
switch (event.event_type) {
case EVENT_ACTIVATE:
@@ -213,7 +213,7 @@ movement_watch_face_advisory_t repetition_minute_face_advise(void *context) {
movement_watch_face_advisory_t retval = { 0 };
if (state->signal_enabled) {
watch_date_time date_time = watch_rtc_get_date_time();
watch_date_time_t date_time = watch_rtc_get_date_time();
retval.wants_background_task = date_time.unit.minute == 0;
}

View File

@@ -79,7 +79,7 @@ bool simple_clock_bin_led_face_loop(movement_event_t event, void *context) {
char buf[11];
uint8_t pos;
watch_date_time date_time;
watch_date_time_t date_time;
uint32_t previous_date_time;
switch (event.event_type) {
case EVENT_ACTIVATE:
@@ -214,7 +214,7 @@ movement_watch_face_advisory_t simple_clock_bin_led_face_advise(void *context) {
movement_watch_face_advisory_t retval = { 0 };
if (state->signal_enabled) {
watch_date_time date_time = watch_rtc_get_date_time();
watch_date_time_t date_time = watch_rtc_get_date_time();
retval.wants_background_task = date_time.unit.minute == 0;
}

View File

@@ -69,7 +69,7 @@ bool weeknumber_clock_face_loop(movement_event_t event, void *context) {
char buf[11];
uint8_t pos;
watch_date_time date_time;
watch_date_time_t date_time;
uint32_t previous_date_time;
switch (event.event_type) {
case EVENT_ACTIVATE:
@@ -148,7 +148,7 @@ movement_watch_face_advisory_t weeknumber_clock_face_advise(void *context) {
movement_watch_face_advisory_t retval = { 0 };
if (state->signal_enabled) {
watch_date_time date_time = watch_rtc_get_date_time();
watch_date_time_t date_time = watch_rtc_get_date_time();
retval.wants_background_task = date_time.unit.minute == 0;
}

View File

@@ -162,7 +162,7 @@ static bool mode_display(movement_event_t event, world_clock2_state_t *state)
uint32_t timestamp;
uint32_t previous_date_time;
watch_date_time date_time;
watch_date_time_t date_time;
switch (event.event_type) {
case EVENT_ACTIVATE:

View File

@@ -109,7 +109,7 @@ void wyoscan_face_activate(void *context) {
bool wyoscan_face_loop(movement_event_t event, void *context) {
wyoscan_state_t *state = (wyoscan_state_t *)context;
watch_date_time date_time;
watch_date_time_t date_time;
switch (event.event_type) {
case EVENT_ACTIVATE:
break;