summaryrefslogtreecommitdiffstats
path: root/watch-library/shared
diff options
context:
space:
mode:
Diffstat (limited to 'watch-library/shared')
-rw-r--r--watch-library/shared/watch/watch_private_display.c1
-rw-r--r--watch-library/shared/watch/watch_utility.c8
-rw-r--r--watch-library/shared/watch/watch_utility.h8
3 files changed, 17 insertions, 0 deletions
diff --git a/watch-library/shared/watch/watch_private_display.c b/watch-library/shared/watch/watch_private_display.c
index 87e3f1ae..1454a3b6 100644
--- a/watch-library/shared/watch/watch_private_display.c
+++ b/watch-library/shared/watch/watch_private_display.c
@@ -52,6 +52,7 @@ void watch_display_character(uint8_t character, uint8_t position) {
if (character == 'T') character = 't'; // uppercase T only works in positions 0 and 1
}
if (position == 1) {
+ if (character == 'a') character = 'A'; // A needs to be uppercase
if (character == 'o') character = 'O'; // O needs to be uppercase
if (character == 'i') character = 'l'; // I needs to be uppercase (use an l, it looks the same)
if (character == 'n') character = 'N'; // N needs to be uppercase
diff --git a/watch-library/shared/watch/watch_utility.c b/watch-library/shared/watch/watch_utility.c
index 3f8aa619..252624b3 100644
--- a/watch-library/shared/watch/watch_utility.c
+++ b/watch-library/shared/watch/watch_utility.c
@@ -188,3 +188,11 @@ float watch_utility_thermistor_temperature(uint16_t value, bool highside, float
return reading;
}
+
+uint32_t watch_utility_offset_timestamp(uint32_t now, int8_t hours, int8_t minutes, int8_t seconds) {
+ uint32_t new = now;
+ new += hours * 60 * 60;
+ new += minutes * 60;
+ new += seconds;
+ return new;
+}
diff --git a/watch-library/shared/watch/watch_utility.h b/watch-library/shared/watch/watch_utility.h
index 4c50cb59..57bcbed7 100644
--- a/watch-library/shared/watch/watch_utility.h
+++ b/watch-library/shared/watch/watch_utility.h
@@ -124,4 +124,12 @@ watch_date_time watch_utility_date_time_convert_zone(watch_date_time date_time,
*/
float watch_utility_thermistor_temperature(uint16_t value, bool highside, float b_coefficient, float nominal_temperature, float nominal_resistance, float series_resistance);
+/** @brief Offset a timestamp by a given amount
+ * @param now Timestamp to offset from
+ * @param hours Number of hours to offset
+ * @param minutes Nmber of minutes to offset
+ * @param seconds Number of secodns to offset
+ */
+uint32_t watch_utility_offset_timestamp(uint32_t now, int8_t hours, int8_t minutes, int8_t seconds);
+
#endif