Kaynağa Gözat

DateTime lib refactor fixes

Willy-JL 1 yıl önce
ebeveyn
işleme
3215625170

+ 1 - 1
mayhem_camera/camera.c

@@ -40,7 +40,7 @@ static void camera_view_draw_callback(Canvas* canvas, void* _model) {
 }
 
 void get_timefilename(FuriString* name) {
-    FuriHalRtcDateTime datetime = {0};
+    DateTime datetime = {0};
     furi_hal_rtc_get_datetime(&datetime);
     furi_string_printf(
         name,

+ 1 - 1
multi_dice/dice.c

@@ -20,7 +20,7 @@ typedef struct {
 typedef struct {
     FuriMutex* mutex;
     FuriMessageQueue* event_queue;
-    FuriHalRtcDateTime datetime;
+    DateTime datetime;
     uint8_t diceSelect;
     uint8_t diceQty;
     uint8_t diceRoll;

+ 1 - 3
nrf24batch/nrf24batch.c

@@ -1445,9 +1445,7 @@ void work_timer_callback(void* ctx) {
             for(uint8_t i = 0; i < 3; i++) {
                 if(nrf24_read_newpacket()) {
                     if(rw_type == rwt_listen) {
-                        ListenPrev = ListenLast;
-                        furi_hal_rtc_get_datetime(&ListenLastTime);
-                        ListenLast = datetime_datetime_to_timestamp(&ListenLastTime);
+                        ListenLast = furi_hal_rtc_get_timestamp();
                         ListenNew = true;
                     } else if(send_status != sst_receiving)
                         break;

+ 2 - 6
picopass/loclass_writer.c

@@ -41,9 +41,7 @@ void loclass_writer_free(LoclassWriter* instance) {
 bool loclass_writer_write_start_stop(LoclassWriter* instance, bool start) {
     furi_assert(instance != NULL);
 
-    DateTime curr_dt;
-    furi_hal_rtc_get_datetime(&curr_dt);
-    uint32_t curr_ts = datetime_datetime_to_timestamp(&curr_dt);
+    uint32_t curr_ts = furi_hal_rtc_get_timestamp();
 
     FuriString* str = furi_string_alloc_printf(
         "loclass-v1-info ts %lu %s\n", curr_ts, start ? "started" : "finished");
@@ -61,9 +59,7 @@ bool loclass_writer_write_params(
     const uint8_t mac[4]) {
     furi_assert(instance != NULL);
 
-    DateTime curr_dt;
-    furi_hal_rtc_get_datetime(&curr_dt);
-    uint32_t curr_ts = datetime_datetime_to_timestamp(&curr_dt);
+    uint32_t curr_ts = furi_hal_rtc_get_timestamp();
 
     FuriString* str = furi_string_alloc_printf(
         "loclass-v1-mac ts %lu no %u "

+ 2 - 2
wardriver/wardriver.c

@@ -5,7 +5,7 @@
 
 void save_file(Context* ctx) {
     Storage* storage = furi_record_open(RECORD_STORAGE);
-    FuriHalRtcDateTime datetime;
+    DateTime datetime;
     furi_hal_rtc_get_datetime(&datetime);
 
     FuriString* filename = furi_string_alloc();
@@ -154,7 +154,7 @@ static void draw_access_point(Canvas* canvas, Context* context) {
         ap.datetime.hour,
         ap.datetime.minute,
         ap.datetime.second,
-        furi_hal_rtc_get_timestamp() - furi_hal_rtc_datetime_to_timestamp(&ap.datetime));
+        furi_hal_rtc_get_timestamp() - datetime_datetime_to_timestamp(&ap.datetime));
     canvas_draw_str_aligned(
         canvas, 3, 59, AlignLeft, AlignBottom, furi_string_get_cstr(ctx->buffer));
 }

+ 1 - 1
wardriver/wardriver.h

@@ -43,7 +43,7 @@ typedef struct {
     char* bssid;
     int8_t rssi;
     uint8_t channel;
-    FuriHalRtcDateTime datetime;
+    DateTime datetime;
     uint16_t packetRxCount;
     uint16_t packetTxCount;
     float latitude;