From 2ff11b5d3e63e1f6ddab5a416772c19d34eef94a Mon Sep 17 00:00:00 2001 From: joeycastillo Date: Wed, 17 Jul 2024 01:19:49 -0400 Subject: [PATCH] add functions to display in hours, minutes and seconds place --- .../shared/watch/watch_common_display.c | 21 +++++++++++++++++++ watch-library/shared/watch/watch_slcd.h | 18 ++++++++++++++++ 2 files changed, 39 insertions(+) diff --git a/watch-library/shared/watch/watch_common_display.c b/watch-library/shared/watch/watch_common_display.c index dbb5f7fd..86b48fc9 100644 --- a/watch-library/shared/watch/watch_common_display.c +++ b/watch-library/shared/watch/watch_common_display.c @@ -171,6 +171,27 @@ void watch_display_main_line(char *string) { } } +void watch_display_hours(char *string) { + watch_display_character(string[0], 4); + if (string[1]) { + watch_display_character(string[1], 5); + } +} + +void watch_display_minutes(char *string) { + watch_display_character(string[0], 6); + if (string[1]) { + watch_display_character(string[1], 7); + } +} + +void watch_display_seconds(char *string) { + watch_display_character(string[0], 8); + if (string[1]) { + watch_display_character(string[1], 9); + } +} + void watch_set_colon(void) { #ifdef USE_CUSTOM_LCD watch_set_pixel(0, 0); diff --git a/watch-library/shared/watch/watch_slcd.h b/watch-library/shared/watch/watch_slcd.h index fc7637eb..b79d68ab 100644 --- a/watch-library/shared/watch/watch_slcd.h +++ b/watch-library/shared/watch/watch_slcd.h @@ -113,6 +113,24 @@ void watch_display_top_right(char *string); */ void watch_display_main_line(char *string); +/** + * @brief Displays a string in the hours portion of the main line. + * @param string A null-terminated string with two characters to display. + */ +void watch_display_hours(char *string); + +/** + * @brief Displays a string in the minutes portion of the main line. + * @param string A null-terminated string with two characters to display. + */ +void watch_display_minutes(char *string); + +/** + * @brief Displays a string in the seconds portion of the main line. + * @param string A null-terminated string with two characters to display. + */ +void watch_display_seconds(char *string); + /** @brief Turns the colon segment on. */ void watch_set_colon(void);