improve sunrise/sunset on custom LCD

This commit is contained in:
Joey Castillo 2025-03-08 17:40:39 -05:00
parent 73aac153e2
commit ea47ea2bce
3 changed files with 28 additions and 15 deletions

View File

@ -88,8 +88,11 @@ static void _sunrise_sunset_face_update(sunrise_sunset_state_t *state) {
watch_clear_colon();
watch_clear_indicator(WATCH_INDICATOR_PM);
watch_clear_indicator(WATCH_INDICATOR_24H);
sprintf(buf, "%s%2d none ", (result == 1) ? "SE" : "rI", scratch_time.unit.day);
watch_display_text(WATCH_POSITION_FULL, buf);
if (result == 1) watch_display_text_with_fallback(WATCH_POSITION_TOP_LEFT, "SET", "SE");
else watch_display_text_with_fallback(WATCH_POSITION_TOP_LEFT, "RIS", "rI");
sprintf(buf, "%2d", scratch_time.unit.day);
watch_display_text(WATCH_POSITION_TOP_RIGHT, buf);
watch_display_text(WATCH_POSITION_BOTTOM, "None ");
return;
}
@ -118,8 +121,11 @@ static void _sunrise_sunset_face_update(sunrise_sunset_state_t *state) {
if (watch_utility_convert_to_12_hour(&scratch_time)) watch_set_indicator(WATCH_INDICATOR_PM);
else watch_clear_indicator(WATCH_INDICATOR_PM);
}
sprintf(buf, "rI%2d%2d%02d%s", scratch_time.unit.day, scratch_time.unit.hour, scratch_time.unit.minute,longLatPresets[state->longLatToUse].name);
watch_display_text(WATCH_POSITION_FULL, buf);
watch_display_text_with_fallback(WATCH_POSITION_TOP_LEFT, "RIS", "rI");
sprintf(buf, "%2d", scratch_time.unit.day);
watch_display_text(WATCH_POSITION_TOP_RIGHT, buf);
sprintf(buf, "%2d%02d%s", scratch_time.unit.hour, scratch_time.unit.minute,longLatPresets[state->longLatToUse].name);
watch_display_text(WATCH_POSITION_BOTTOM, buf);
return;
} else {
show_next_match = true;
@ -145,8 +151,11 @@ static void _sunrise_sunset_face_update(sunrise_sunset_state_t *state) {
if (watch_utility_convert_to_12_hour(&scratch_time)) watch_set_indicator(WATCH_INDICATOR_PM);
else watch_clear_indicator(WATCH_INDICATOR_PM);
}
sprintf(buf, "SE%2d%2d%02d%s", scratch_time.unit.day, scratch_time.unit.hour, scratch_time.unit.minute, longLatPresets[state->longLatToUse].name);
watch_display_text(WATCH_POSITION_FULL, buf);
watch_display_text_with_fallback(WATCH_POSITION_TOP_LEFT, "SET", "SE");
sprintf(buf, "%2d", scratch_time.unit.day);
watch_display_text(WATCH_POSITION_TOP_RIGHT, buf);
sprintf(buf, "%2d%02d%s", scratch_time.unit.hour, scratch_time.unit.minute,longLatPresets[state->longLatToUse].name);
watch_display_text(WATCH_POSITION_BOTTOM, buf);
return;
} else {
show_next_match = true;
@ -205,20 +214,24 @@ 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) {
char buf[12];
watch_clear_display();
switch (state->page) {
case 0:
return;
case 1:
sprintf(buf, "LA %c %04d", state->working_latitude.sign ? '-' : '+', abs(_sunrise_sunset_face_latlon_from_struct(state->working_latitude)));
watch_display_text_with_fallback(WATCH_POSITION_TOP_LEFT, "LAT", "LA");
sprintf(buf, "%c %04d", state->working_latitude.sign ? '-' : '+', abs(_sunrise_sunset_face_latlon_from_struct(state->working_latitude)));
if (event.subsecond % 2) buf[state->active_digit] = ' ';
watch_display_text(WATCH_POSITION_BOTTOM, buf);
break;
case 2:
sprintf(buf, "LO %c%05d", state->working_longitude.sign ? '-' : '+', abs(_sunrise_sunset_face_latlon_from_struct(state->working_longitude)));
case 2:
watch_display_text_with_fallback(WATCH_POSITION_TOP_LEFT, "LON", "LO");
sprintf(buf, "%c%05d", state->working_longitude.sign ? '-' : '+', abs(_sunrise_sunset_face_latlon_from_struct(state->working_longitude)));
if (event.subsecond % 2) buf[state->active_digit] = ' ';
watch_display_text(WATCH_POSITION_BOTTOM, buf);
break;
}
if (event.subsecond % 2) {
buf[state->active_digit + 4] = ' ';
}
watch_display_text(WATCH_POSITION_FULL, buf);
}
static void _sunrise_sunset_face_advance_digit(sunrise_sunset_state_t *state) {

View File

@ -33,7 +33,7 @@ uint32_t IndicatorSegments[7] = {0};
void watch_display_character(uint8_t character, uint8_t position) {
if (watch_get_lcd_type() == WATCH_LCD_TYPE_CUSTOM) {
if (character == 'R') character = 'r'; // We can't display uppercase R on this display.
if (character == 'R' && position > 1 && position < 8) character = 'r'; // We can't display uppercase R in these positions
else if (character == 'T' && position > 1 && position < 8) character = 't'; // lowercase t is the only option for these positions
} else {
// special cases for positions 4 and 6

View File

@ -97,7 +97,7 @@ static const uint8_t Custom_LCD_Character_Set[] =
0b00111111, // O
0b01110011, // P
0b01100111, // Q
0b01010000, // R (lowercase, this is the only capital we can't do)
0b11000111, // R
0b01101101, // S
0b10000001, // T (only works in position 0; set (1, 12) to make it work in position 1)
0b00111110, // U