]> git.earman.xyz Git - sensor-watch.git/commitdiff
faces/totp: define current TOTP data function
authorMatheus Afonso Martins Moreira <matheus.a.m.moreira@gmail.com>
Wed, 21 Feb 2024 02:18:00 +0000 (23:18 -0300)
committerMatheus Afonso Martins Moreira <matheus.a.m.moreira@gmail.com>
Wed, 21 Feb 2024 02:18:00 +0000 (23:18 -0300)
Selects the appropriate TOTP data structure
given the TOTP watch face state.

movement/watch_faces/complication/totp_face.c

index 4ab77c373b1a13f376ac6771eaa7c0cc7fc4ff42..8af5fbc4f693b79889fbab68a6c6ee3f850f969a 100644 (file)
@@ -65,6 +65,10 @@ static totp_t totp_data[] = {
 // END OF KEY DATA.
 ////////////////////////////////////////////////////////////////////////////////
 
+static inline totp_t *_totp_current(totp_state_t *totp_state) {
+    return &totp_data[totp_state->current_index];
+}
+
 static inline size_t _totp_num(void) {
     return sizeof(totp_data) / sizeof(*totp_data);
 }