Compare commits
5 Commits
legacy_moo
...
50afeba82c
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
50afeba82c | ||
|
|
0433e62e8d | ||
|
|
0b58ac750e | ||
|
|
45583b3120 | ||
|
|
8abf6f4f5b |
@@ -33,20 +33,20 @@ const char *words[12] = {
|
|||||||
" ",
|
" ",
|
||||||
" 5",
|
" 5",
|
||||||
"10",
|
"10",
|
||||||
"15",
|
"CU",
|
||||||
"20",
|
"20",
|
||||||
"25",
|
"Me",
|
||||||
"30",
|
"ME",
|
||||||
"35",
|
"mE",
|
||||||
"40",
|
"40",
|
||||||
"45",
|
"45",
|
||||||
"50",
|
"50",
|
||||||
"55",
|
"55",
|
||||||
};
|
};
|
||||||
|
|
||||||
static const char *past_word = " P";
|
static const char *past_word = " y";
|
||||||
static const char *to_word = " 2";
|
static const char *to_word = " -";
|
||||||
static const char *oclock_word = "OC";
|
static const char *oclock_word = "EP";
|
||||||
|
|
||||||
// sets when in the five minute period we switch
|
// sets when in the five minute period we switch
|
||||||
// from "X past HH" to "X to HH+1"
|
// from "X past HH" to "X to HH+1"
|
||||||
@@ -55,9 +55,9 @@ static const int hour_switch_index = 8;
|
|||||||
static void _update_alarm_indicator(bool settings_alarm_enabled, close_enough_clock_state_t *state) {
|
static void _update_alarm_indicator(bool settings_alarm_enabled, close_enough_clock_state_t *state) {
|
||||||
state->alarm_enabled = settings_alarm_enabled;
|
state->alarm_enabled = settings_alarm_enabled;
|
||||||
if (state->alarm_enabled) {
|
if (state->alarm_enabled) {
|
||||||
watch_set_indicator(WATCH_INDICATOR_BELL);
|
watch_set_indicator(WATCH_INDICATOR_SIGNAL);
|
||||||
} else {
|
} else {
|
||||||
watch_clear_indicator(WATCH_INDICATOR_BELL);
|
watch_clear_indicator(WATCH_INDICATOR_SIGNAL);
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -185,7 +185,7 @@ bool close_enough_clock_face_loop(movement_event_t event, movement_settings_t *s
|
|||||||
int words_length = sizeof(words) / sizeof(words[0]);
|
int words_length = sizeof(words) / sizeof(words[0]);
|
||||||
|
|
||||||
strncpy(
|
strncpy(
|
||||||
first_word,
|
third_word,
|
||||||
five_minute_period >= hour_switch_index ?
|
five_minute_period >= hour_switch_index ?
|
||||||
words[words_length - five_minute_period] :
|
words[words_length - five_minute_period] :
|
||||||
words[five_minute_period],
|
words[five_minute_period],
|
||||||
@@ -197,7 +197,7 @@ bool close_enough_clock_face_loop(movement_event_t event, movement_settings_t *s
|
|||||||
to_word : past_word,
|
to_word : past_word,
|
||||||
3
|
3
|
||||||
);
|
);
|
||||||
sprintf(third_word, "%2d", close_enough_hour);
|
sprintf(first_word, "%2d", close_enough_hour);
|
||||||
}
|
}
|
||||||
|
|
||||||
sprintf(
|
sprintf(
|
||||||
|
|||||||
@@ -148,7 +148,7 @@ static void _alarm_update_alarm_enabled(movement_settings_t *settings, alarm_sta
|
|||||||
uint16_t now_minutes_of_day;
|
uint16_t now_minutes_of_day;
|
||||||
uint16_t alarm_minutes_of_day;
|
uint16_t alarm_minutes_of_day;
|
||||||
for (uint8_t i = 0; i < ALARM_ALARMS; i++) {
|
for (uint8_t i = 0; i < ALARM_ALARMS; i++) {
|
||||||
if (state->alarm[i].enabled) {
|
if (state->alarm[i].enabled && state->alarm[i].beeps != 0) {
|
||||||
// figure out if alarm is to go off in the next 24 h
|
// figure out if alarm is to go off in the next 24 h
|
||||||
if (state->alarm[i].day == ALARM_DAY_EACH_DAY || state->alarm[i].day == ALARM_DAY_ONE_TIME) {
|
if (state->alarm[i].day == ALARM_DAY_EACH_DAY || state->alarm[i].day == ALARM_DAY_ONE_TIME) {
|
||||||
active_alarms = true;
|
active_alarms = true;
|
||||||
|
|||||||
@@ -45,7 +45,7 @@ static void _sunrise_sunset_set_expiration(sunrise_sunset_state_t *state, watch_
|
|||||||
}
|
}
|
||||||
|
|
||||||
static void _sunrise_sunset_face_update(movement_settings_t *settings, sunrise_sunset_state_t *state) {
|
static void _sunrise_sunset_face_update(movement_settings_t *settings, sunrise_sunset_state_t *state) {
|
||||||
char buf[14];
|
char buf[11];
|
||||||
double rise, set, minutes, seconds;
|
double rise, set, minutes, seconds;
|
||||||
bool show_next_match = false;
|
bool show_next_match = false;
|
||||||
movement_location_t movement_location;
|
movement_location_t movement_location;
|
||||||
@@ -87,7 +87,7 @@ static void _sunrise_sunset_face_update(movement_settings_t *settings, sunrise_s
|
|||||||
watch_clear_colon();
|
watch_clear_colon();
|
||||||
watch_clear_indicator(WATCH_INDICATOR_PM);
|
watch_clear_indicator(WATCH_INDICATOR_PM);
|
||||||
watch_clear_indicator(WATCH_INDICATOR_24H);
|
watch_clear_indicator(WATCH_INDICATOR_24H);
|
||||||
sprintf(buf, "%s%2d none ", (result == 1) ? "SE" : "rI", scratch_time.unit.day);
|
snprintf(buf, sizeof(buf), "%s%2d none ", (result == 1) ? "SE" : "rI", scratch_time.unit.day);
|
||||||
watch_display_string(buf, 0);
|
watch_display_string(buf, 0);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -120,7 +120,7 @@ static void _sunrise_sunset_face_update(movement_settings_t *settings, sunrise_s
|
|||||||
} else if (settings->bit.clock_24h_leading_zero && scratch_time.unit.hour < 10) {
|
} else if (settings->bit.clock_24h_leading_zero && scratch_time.unit.hour < 10) {
|
||||||
set_leading_zero = true;
|
set_leading_zero = true;
|
||||||
}
|
}
|
||||||
sprintf(buf, "rI%2d%2d%02d%s", scratch_time.unit.day, scratch_time.unit.hour, scratch_time.unit.minute,longLatPresets[state->longLatToUse].name);
|
snprintf(buf, sizeof(buf), "rI%2d%2d%02d%s", scratch_time.unit.day, scratch_time.unit.hour, scratch_time.unit.minute,longLatPresets[state->longLatToUse].name);
|
||||||
watch_display_string(buf, 0);
|
watch_display_string(buf, 0);
|
||||||
if (set_leading_zero)
|
if (set_leading_zero)
|
||||||
watch_display_string("0", 4);
|
watch_display_string("0", 4);
|
||||||
@@ -152,7 +152,7 @@ static void _sunrise_sunset_face_update(movement_settings_t *settings, sunrise_s
|
|||||||
} else if (settings->bit.clock_24h_leading_zero && scratch_time.unit.hour < 10) {
|
} else if (settings->bit.clock_24h_leading_zero && scratch_time.unit.hour < 10) {
|
||||||
set_leading_zero = true;
|
set_leading_zero = true;
|
||||||
}
|
}
|
||||||
sprintf(buf, "SE%2d%2d%02d%s", scratch_time.unit.day, scratch_time.unit.hour, scratch_time.unit.minute, longLatPresets[state->longLatToUse].name);
|
snprintf(buf, sizeof(buf), "SE%2d%2d%02d%s", scratch_time.unit.day, scratch_time.unit.hour, scratch_time.unit.minute, longLatPresets[state->longLatToUse].name);
|
||||||
watch_display_string(buf, 0);
|
watch_display_string(buf, 0);
|
||||||
if (set_leading_zero)
|
if (set_leading_zero)
|
||||||
watch_display_string("0", 4);
|
watch_display_string("0", 4);
|
||||||
@@ -212,16 +212,16 @@ static void _sunrise_sunset_face_update_location_register(sunrise_sunset_state_t
|
|||||||
}
|
}
|
||||||
|
|
||||||
static void _sunrise_sunset_face_update_settings_display(movement_event_t event, sunrise_sunset_state_t *state) {
|
static void _sunrise_sunset_face_update_settings_display(movement_event_t event, sunrise_sunset_state_t *state) {
|
||||||
char buf[12];
|
char buf[11];
|
||||||
|
|
||||||
switch (state->page) {
|
switch (state->page) {
|
||||||
case 0:
|
case 0:
|
||||||
return;
|
return;
|
||||||
case 1:
|
case 1:
|
||||||
sprintf(buf, "LA %c %04d", state->working_latitude.sign ? '-' : '+', abs(_sunrise_sunset_face_latlon_from_struct(state->working_latitude)));
|
snprintf(buf, sizeof(buf), "LA %c %04d", state->working_latitude.sign ? '-' : '+', abs(_sunrise_sunset_face_latlon_from_struct(state->working_latitude)));
|
||||||
break;
|
break;
|
||||||
case 2:
|
case 2:
|
||||||
sprintf(buf, "LO %c%05d", state->working_longitude.sign ? '-' : '+', abs(_sunrise_sunset_face_latlon_from_struct(state->working_longitude)));
|
snprintf(buf, sizeof(buf), "LO %c%05d", state->working_longitude.sign ? '-' : '+', abs(_sunrise_sunset_face_latlon_from_struct(state->working_longitude)));
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
if (event.subsecond % 2) {
|
if (event.subsecond % 2) {
|
||||||
|
|||||||
@@ -26,7 +26,7 @@
|
|||||||
#include "watch_utility.h"
|
#include "watch_utility.h"
|
||||||
|
|
||||||
const char * watch_utility_get_weekday(watch_date_time date_time) {
|
const char * watch_utility_get_weekday(watch_date_time date_time) {
|
||||||
static const char weekdays[7][3] = {"MO", "TU", "WE", "TH", "FR", "SA", "SU"};
|
static const char weekdays[7][3] = {"LU", "MA", "MI", "JU", "VI", "SA", "do"};
|
||||||
return weekdays[watch_utility_get_iso8601_weekday_number(date_time.unit.year + WATCH_RTC_REFERENCE_YEAR, date_time.unit.month, date_time.unit.day) - 1];
|
return weekdays[watch_utility_get_iso8601_weekday_number(date_time.unit.year + WATCH_RTC_REFERENCE_YEAR, date_time.unit.month, date_time.unit.day) - 1];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user