]> git.earman.xyz Git - sensor-watch.git/commitdiff
Remove a few unnecessary date_time to timestamp conversions
authorAlessandro Genova <ales.genova@gmail.com>
Wed, 27 Aug 2025 02:23:14 +0000 (22:23 -0400)
committerAlessandro Genova <ales.genova@gmail.com>
Sat, 3 Jan 2026 01:07:56 +0000 (20:07 -0500)
watch-faces/complication/interval_face.c
watch-faces/complication/totp_face.c
watch-faces/complication/totp_lfs_face.c

index 1559356723f54da7172cc61c778fa11f7c6a0852..89f00b83620442107d747ac143ccd99b2c807c19 100644 (file)
@@ -96,8 +96,7 @@ static inline void _inc_uint8(uint8_t *value, uint8_t step, uint8_t max) {
 
 static uint32_t _get_now_ts() {
     // returns the current date time as unix timestamp
-    watch_date_time_t now = watch_rtc_get_date_time();
-    return watch_utility_date_time_to_unix_time(now, 0);
+    return movement_get_utc_timestamp();
 }
 
 static inline void _button_beep() {
index b45c62f6f70e2954c6f58a137bd10d025f779db6..666c3337df0aeaa6ce010d887d68fe4b9041322b 100644 (file)
@@ -36,7 +36,6 @@
 #include <string.h>
 #include "totp_face.h"
 #include "watch.h"
-#include "watch_utility.h"
 #include "TOTP.h"
 #include "base32.h"
 
@@ -159,7 +158,7 @@ static void totp_generate_and_display(totp_state_t *totp_state) {
 }
 
 static inline uint32_t totp_compute_base_timestamp() {
-    return watch_utility_date_time_to_unix_time(movement_get_utc_date_time(), 0);
+    return movement_get_utc_timestamp();
 }
 
 void totp_face_setup(uint8_t watch_face_index, void ** context_ptr) {
index 8be3e28db3e74c9c3ecf0c78b3c1d625875a7daf..7d63bba4b9dfeb8d41eba8a021b45be23aacfd46 100644 (file)
@@ -30,7 +30,6 @@
 #include "base32.h"
 
 #include "watch.h"
-#include "watch_utility.h"
 #include "filesystem.h"
 
 #include "totp_lfs_face.h"
@@ -253,7 +252,7 @@ void totp_lfs_face_activate(void *context) {
     }
 #endif
 
-    totp_state->timestamp = watch_utility_date_time_to_unix_time(movement_get_utc_date_time(), 0);
+    totp_state->timestamp = movement_get_utc_timestamp();
     totp_face_set_record(totp_state, 0);
 }