MX 1 год назад
Родитель
Сommit
d8becee1b5
26 измененных файлов с 52 добавлено и 52 удалено
  1. 2 2
      apps_broken_by_last_refactors/flipperzero_vb_migrate/lib/nfc/helpers/nfc_debug_pcap.c
  2. 2 2
      apps_source_code/bpmtapper/bpm.c
  3. 4 4
      apps_source_code/color_guess/views/color_guess_play.c
  4. 3 3
      apps_source_code/flipper-dcf77/dcf77_app.c
  5. 1 1
      apps_source_code/flipper_analog_clock/analog_clock.c
  6. 1 1
      apps_source_code/flipper_geiger/flipper_geiger.c
  7. 1 1
      apps_source_code/mifare_fuzzer/scenes/mifare_fuzzer_scene_emulator.c
  8. 4 4
      apps_source_code/pomodoro/pomodoro_timer.c
  9. 1 1
      base_pack/avr_isp_programmer/scenes/avr_isp_scene_input_name.c
  10. 1 1
      base_pack/camera_suite/views/camera_suite_view_camera.c
  11. 4 4
      base_pack/picopass/loclass_writer.c
  12. 1 1
      base_pack/totp/services/config/config.c
  13. 2 2
      base_pack/weather_station/protocols/ws_generic.c
  14. 4 4
      base_pack/weather_station/views/weather_station_receiver_info.c
  15. 4 4
      non_catalog_apps/FlipperNightStand_clock/clock_app.c
  16. 1 1
      non_catalog_apps/FlipperNightStand_clock/clock_app.h
  17. 1 1
      non_catalog_apps/calendar/calendar.c
  18. 1 1
      non_catalog_apps/flipperzero-camera/camera.c
  19. 3 3
      non_catalog_apps/nrf24-batch/nrf24batch.c
  20. 2 2
      non_catalog_apps/tpms_receiver/protocols/tpms_generic.c
  21. 4 4
      non_catalog_apps/tpms_receiver/views/tpms_receiver_info.c
  22. 1 1
      non_catalog_apps/ublox/scenes/ublox_scene_enter_file_name.c
  23. 1 1
      non_catalog_apps/ublox/scenes/ublox_scene_sync_time.c
  24. 1 1
      non_catalog_apps/ublox/views/data_display_view.c
  25. 1 1
      non_catalog_apps/wiegand/scenes/wiegand_save.c
  26. 1 1
      non_catalog_apps/wiegand/scenes/wiegand_scan.c

+ 2 - 2
apps_broken_by_last_refactors/flipperzero_vb_migrate/lib/nfc/helpers/nfc_debug_pcap.c

@@ -88,7 +88,7 @@ void nfc_debug_pcap_process_data(
     bool crc_dropped) {
     furi_assert(instance);
     furi_assert(data);
-    FuriHalRtcDateTime datetime;
+    DateTime datetime;
     furi_hal_rtc_get_datetime(&datetime);
 
     uint8_t event = 0;
@@ -117,7 +117,7 @@ void nfc_debug_pcap_process_data(
         uint8_t event;
         uint16_t len;
     } __attribute__((__packed__)) pkt_hdr = {
-        .ts_sec = furi_hal_rtc_datetime_to_timestamp(&datetime),
+        .ts_sec = datetime_datetime_to_timestamp(&datetime),
         .ts_usec = 0,
         .incl_len = len + 4,
         .orig_len = len + 4,

+ 2 - 2
apps_source_code/bpmtapper/bpm.c

@@ -84,9 +84,9 @@ static float queue_avg(queue* q) {
 
 // TOO SLOW!
 //uint64_t dolphin_state_timestamp() {
-//    FuriHalRtcDateTime datetime;
+//    DateTime datetime;
 //    furi_hal_rtc_get_datetime(&datetime);
-//    return furi_hal_rtc_datetime_to_timestamp(&datetime);
+//    return datetime_datetime_to_timestamp(&datetime);
 //}
 //
 typedef struct {

+ 4 - 4
apps_source_code/color_guess/views/color_guess_play.c

@@ -55,9 +55,9 @@ void color_guess_play_new_round(void* context, ColorGuessPlayModel* model) {
     furi_assert(context);
     ColorGuess* app = context;
     //Reset timer
-    FuriHalRtcDateTime date_time;
+    DateTime date_time;
     furi_hal_rtc_get_datetime(&date_time);
-    model->timestamp_start = furi_hal_rtc_datetime_to_timestamp(&date_time);
+    model->timestamp_start = datetime_datetime_to_timestamp(&date_time);
     model->success = 0;
     model->closeness = 0;
     model->prev_closeness = 0;
@@ -154,9 +154,9 @@ void color_guess_play_draw(Canvas* canvas, ColorGuessPlayModel* model) {
     }
     const int cursorOffset = 30;
     const int newCursorPos = (model->cursorpos * 12) + cursorOffset;
-    FuriHalRtcDateTime date_time;
+    DateTime date_time;
     furi_hal_rtc_get_datetime(&date_time);
-    uint32_t timestamp = furi_hal_rtc_datetime_to_timestamp(&date_time);
+    uint32_t timestamp = datetime_datetime_to_timestamp(&date_time);
     uint32_t time_elapsed = timestamp - model->timestamp_start;
     model->time_spent = time_elapsed;
 

+ 3 - 3
apps_source_code/flipper-dcf77/dcf77_app.c

@@ -26,7 +26,7 @@ uint8_t get_dcf_message_bit(uint8_t* message, uint8_t bit) {
 
 // should it still be const?
 static void update_dcf77_message_from_rtc(AppFSM* app_fsm) {
-    FuriHalRtcDateTime dt;
+    DateTime dt;
     furi_hal_rtc_get_datetime(&dt);
     app_fsm->bit_number = dt.second;
     app_fsm->next_message = malloc(8);
@@ -165,7 +165,7 @@ static void render_callback(Canvas* const canvas, void* ctx) {
     canvas_draw_frame(canvas, 0, 0, 128, 64);
     canvas_set_font(canvas, FontPrimary);
     snprintf(buffer, 64, "%1x.%1x=%01x", bit_number / 8, (bit_number % 8), bit_value);
-    FuriHalRtcDateTime dt;
+    DateTime dt;
     furi_hal_rtc_get_datetime(&dt);
     //canvas_draw_str_aligned(canvas, 64, 10, AlignCenter, AlignBottom, "DCF77 emulator");
     snprintf(
@@ -270,7 +270,7 @@ static void on_timer_tick(AppFSM* app_fsm) {
     static bool last_output = false;
     bool output = true;
 
-    FuriHalRtcDateTime dt;
+    DateTime dt;
     furi_hal_rtc_get_datetime(&dt);
     app_fsm->bit_number = dt.second;
     app_fsm->bit_value = get_dcf_message_bit(app_fsm->dcf77_message, app_fsm->bit_number);

+ 1 - 1
apps_source_code/flipper_analog_clock/analog_clock.c

@@ -24,7 +24,7 @@ typedef struct {
 
 typedef struct {
     FuriMutex* mutex;
-    FuriHalRtcDateTime date_time;
+    DateTime date_time;
 } ClockApp;
 
 static Vector2 angle_to_vector2(float angle_in_degrees, uint8_t distance, Vector2 center) {

+ 1 - 1
apps_source_code/flipper_geiger/flipper_geiger.c

@@ -263,7 +263,7 @@ int32_t flipper_geiger_app() {
                     if(recordData == 0) {
                         notification_message(notification, &sequence_set_only_red_255);
 
-                        FuriHalRtcDateTime datetime;
+                        DateTime datetime;
                         furi_hal_rtc_get_datetime(&datetime);
 
                         char path[64];

+ 1 - 1
apps_source_code/mifare_fuzzer/scenes/mifare_fuzzer_scene_emulator.c

@@ -243,7 +243,7 @@ bool mifare_fuzzer_scene_emulator_on_event(void* context, SceneManagerEvent even
         //FURI_LOG_D(TAG, "mifare_fuzzer_scene_emulator_on_event() :: SceneManagerEventTypeTick");
 
         // Used to check tick length (not perfect but enough)
-        //FuriHalRtcDateTime curr_dt;
+        //DateTime curr_dt;
         //furi_hal_rtc_get_datetime(&curr_dt);
         //FURI_LOG_D(TAG, "Time is: %.2d:%.2d:%.2d", curr_dt.hour, curr_dt.minute, curr_dt.second);
 

+ 4 - 4
apps_source_code/pomodoro/pomodoro_timer.c

@@ -77,9 +77,9 @@ void pomodoro_timer_process(PomodoroTimer* pomodoro_timer, InputEvent* event) {
                     model->ok_pressed = false;
 
                     // START/STOP TIMER
-                    FuriHalRtcDateTime curr_dt;
+                    DateTime curr_dt;
                     furi_hal_rtc_get_datetime(&curr_dt);
-                    uint32_t current_timestamp = furi_hal_rtc_datetime_to_timestamp(&curr_dt);
+                    uint32_t current_timestamp = datetime_datetime_to_timestamp(&curr_dt);
 
                     // STARTED -> PAUSED
                     if(model->timer_running) {
@@ -116,9 +116,9 @@ void pomodoro_timer_process(PomodoroTimer* pomodoro_timer, InputEvent* event) {
 void pomodoro_draw_callback(Canvas* canvas, void* context, int max_seconds, int max_seconds_rest) {
     furi_assert(context);
     PomodoroTimerModel* model = context;
-    FuriHalRtcDateTime curr_dt;
+    DateTime curr_dt;
     furi_hal_rtc_get_datetime(&curr_dt);
-    uint32_t current_timestamp = furi_hal_rtc_datetime_to_timestamp(&curr_dt);
+    uint32_t current_timestamp = datetime_datetime_to_timestamp(&curr_dt);
 
     // Header
     canvas_set_font(canvas, FontPrimary);

+ 1 - 1
base_pack/avr_isp_programmer/scenes/avr_isp_scene_input_name.c

@@ -11,7 +11,7 @@ void avr_isp_scene_input_name_text_callback(void* context) {
 }
 
 void avr_isp_scene_input_name_get_timefilename(FuriString* name) {
-    FuriHalRtcDateTime datetime = {0};
+    DateTime datetime = {0};
     furi_hal_rtc_get_datetime(&datetime);
     furi_string_printf(
         name,

+ 1 - 1
base_pack/camera_suite/views/camera_suite_view_camera.c

@@ -94,7 +94,7 @@ static void save_image_to_flipper_sd_card(void* model) {
     FuriString* file_name = furi_string_alloc();
 
     // Get the current date and time.
-    FuriHalRtcDateTime datetime = {0};
+    DateTime datetime = {0};
     furi_hal_rtc_get_datetime(&datetime);
 
     // Create the file name.

+ 4 - 4
base_pack/picopass/loclass_writer.c

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

+ 1 - 1
base_pack/totp/services/config/config.c

@@ -71,7 +71,7 @@ static char* totp_config_file_backup_i(Storage* storage) {
         return NULL;
     }
 
-    FuriHalRtcDateTime current_datetime;
+    DateTime current_datetime;
     furi_hal_rtc_get_datetime(&current_datetime);
 
     uint8_t backup_path_size = sizeof(CONFIG_FILE_BACKUP_BASE_PATH) + 14;

+ 2 - 2
base_pack/weather_station/protocols/ws_generic.c

@@ -111,9 +111,9 @@ SubGhzProtocolStatus ws_block_generic_serialize(
         }
 
         //DATE AGE set
-        FuriHalRtcDateTime curr_dt;
+        DateTime curr_dt;
         furi_hal_rtc_get_datetime(&curr_dt);
-        uint32_t curr_ts = furi_hal_rtc_datetime_to_timestamp(&curr_dt);
+        uint32_t curr_ts = datetime_datetime_to_timestamp(&curr_dt);
 
         temp_data = curr_ts;
         if(!flipper_format_write_uint32(flipper_format, "Ts", &temp_data, 1)) {

+ 4 - 4
base_pack/weather_station/views/weather_station_receiver_info.c

@@ -30,9 +30,9 @@ void ws_view_receiver_info_update(WSReceiverInfo* ws_receiver_info, FlipperForma
 
             ws_block_generic_deserialize(model->generic, fff);
 
-            FuriHalRtcDateTime curr_dt;
+            DateTime curr_dt;
             furi_hal_rtc_get_datetime(&curr_dt);
-            model->curr_ts = furi_hal_rtc_datetime_to_timestamp(&curr_dt);
+            model->curr_ts = datetime_datetime_to_timestamp(&curr_dt);
         },
         true);
 }
@@ -186,9 +186,9 @@ static void ws_view_receiver_info_timer(void* context) {
         ws_receiver_info->view,
         WSReceiverInfoModel * model,
         {
-            FuriHalRtcDateTime curr_dt;
+            DateTime curr_dt;
             furi_hal_rtc_get_datetime(&curr_dt);
-            model->curr_ts = furi_hal_rtc_datetime_to_timestamp(&curr_dt);
+            model->curr_ts = datetime_datetime_to_timestamp(&curr_dt);
         },
         true);
 }

+ 4 - 4
non_catalog_apps/FlipperNightStand_clock/clock_app.c

@@ -131,9 +131,9 @@ static void clock_render_callback(Canvas* const canvas, void* ctx) {
         return;
     }
 
-    FuriHalRtcDateTime curr_dt;
+    DateTime curr_dt;
     furi_hal_rtc_get_datetime(&curr_dt);
-    uint32_t curr_ts = furi_hal_rtc_datetime_to_timestamp(&curr_dt);
+    uint32_t curr_ts = datetime_datetime_to_timestamp(&curr_dt);
 
     char time_string[TIME_LEN];
     char date_string[DATE_LEN];
@@ -225,9 +225,9 @@ static void clock_tick(void* ctx) {
 
 void timer_start_stop(ClockState* plugin_state) {
     // START/STOP TIMER
-    FuriHalRtcDateTime curr_dt;
+    DateTime curr_dt;
     furi_hal_rtc_get_datetime(&curr_dt);
-    uint32_t curr_ts = furi_hal_rtc_datetime_to_timestamp(&curr_dt);
+    uint32_t curr_ts = datetime_datetime_to_timestamp(&curr_dt);
 
     if(plugin_state->timer_running) {
         // Update stopped seconds

+ 1 - 1
non_catalog_apps/FlipperNightStand_clock/clock_app.h

@@ -30,7 +30,7 @@ typedef struct {
 typedef struct {
     LocaleDateFormat date_format;
     LocaleTimeFormat time_format;
-    FuriHalRtcDateTime datetime;
+    DateTime datetime;
     FuriMutex* mutex;
     FuriMessageQueue* event_queue;
     uint32_t timer_start_timestamp;

+ 1 - 1
non_catalog_apps/calendar/calendar.c

@@ -19,7 +19,7 @@ static bool calendar_app_back_event_callback(void* context) {
 }
 
 VariableSharedContext* calendar_app_variable_shared_context_alloc() {
-    FuriHalRtcDateTime datetime;
+    DateTime datetime;
     furi_hal_rtc_get_datetime(&datetime);
     VariableSharedContext* variable_shared_context = malloc(sizeof(VariableSharedContext));
     variable_shared_context->year_selected = datetime.year;

+ 1 - 1
non_catalog_apps/flipperzero-camera/camera.c

@@ -32,7 +32,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,

+ 3 - 3
non_catalog_apps/nrf24-batch/nrf24batch.c

@@ -117,7 +117,7 @@ uint8_t listen_addr[5];
 uint8_t listen_addr_len = 0;
 char* ListenFields = NULL; // ptr to string: field1,field2,... max 5 field now
 bool ListenNew;
-FuriHalRtcDateTime ListenLastTime = {0};
+DateTime ListenLastTime = {0};
 uint32_t ListenPrev = 0;
 uint32_t ListenLast = 0;
 FuriString** Read_cmd = NULL; // Names of read cmd
@@ -1039,7 +1039,7 @@ static void save_batch(void) {
     FURI_LOG_D(TAG, "Save Batch");
     char *p, *p2;
     stream_seek(file_stream, 0, StreamOffsetFromEnd);
-    FuriHalRtcDateTime dt;
+    DateTime dt;
     furi_hal_rtc_get_datetime(&dt);
     stream_write_format(file_stream, "\n%s ", SettingsFld_WriteBatch);
     p = (char*)furi_string_get_cstr(ReadBatch_cmd[view_cmd[rwt_read_batch]]);
@@ -1447,7 +1447,7 @@ void work_timer_callback(void* ctx) {
                     if(rw_type == rwt_listen) {
                         ListenPrev = ListenLast;
                         furi_hal_rtc_get_datetime(&ListenLastTime);
-                        ListenLast = furi_hal_rtc_datetime_to_timestamp(&ListenLastTime);
+                        ListenLast = datetime_datetime_to_timestamp(&ListenLastTime);
                         ListenNew = true;
                     } else if(send_status != sst_receiving)
                         break;

+ 2 - 2
non_catalog_apps/tpms_receiver/protocols/tpms_generic.c

@@ -111,9 +111,9 @@ SubGhzProtocolStatus tpms_block_generic_serialize(
         }
 
         //DATE AGE set
-        FuriHalRtcDateTime curr_dt;
+        DateTime curr_dt;
         furi_hal_rtc_get_datetime(&curr_dt);
-        uint32_t curr_ts = furi_hal_rtc_datetime_to_timestamp(&curr_dt);
+        uint32_t curr_ts = datetime_datetime_to_timestamp(&curr_dt);
 
         temp_data = curr_ts;
         if(!flipper_format_write_uint32(flipper_format, "Ts", &temp_data, 1)) {

+ 4 - 4
non_catalog_apps/tpms_receiver/views/tpms_receiver_info.c

@@ -30,9 +30,9 @@ void tpms_view_receiver_info_update(TPMSReceiverInfo* tpms_receiver_info, Flippe
 
             tpms_block_generic_deserialize(model->generic, fff);
 
-            FuriHalRtcDateTime curr_dt;
+            DateTime curr_dt;
             furi_hal_rtc_get_datetime(&curr_dt);
-            model->curr_ts = furi_hal_rtc_datetime_to_timestamp(&curr_dt);
+            model->curr_ts = datetime_datetime_to_timestamp(&curr_dt);
         },
         true);
 }
@@ -172,9 +172,9 @@ static void tpms_view_receiver_info_timer(void* context) {
         tpms_receiver_info->view,
         TPMSReceiverInfoModel * model,
         {
-            FuriHalRtcDateTime curr_dt;
+            DateTime curr_dt;
             furi_hal_rtc_get_datetime(&curr_dt);
-            model->curr_ts = furi_hal_rtc_datetime_to_timestamp(&curr_dt);
+            model->curr_ts = datetime_datetime_to_timestamp(&curr_dt);
         },
         true);
 }

+ 1 - 1
non_catalog_apps/ublox/scenes/ublox_scene_enter_file_name.c

@@ -11,7 +11,7 @@ void ublox_text_input_callback(void* context) {
 }
 
 FuriString* ublox_scene_enter_file_name_get_timename() {
-    FuriHalRtcDateTime datetime;
+    DateTime datetime;
     furi_hal_rtc_get_datetime(&datetime);
     FuriString* s = furi_string_alloc();
 

+ 1 - 1
non_catalog_apps/ublox/scenes/ublox_scene_sync_time.c

@@ -31,7 +31,7 @@ bool ublox_scene_sync_time_on_event(void* context, SceneManagerEvent event) {
             // We don't have a timezone (or even UTC offset) in the
             // RTC, so we can only update the minute and second---not
             // even the date.
-            FuriHalRtcDateTime datetime;
+            DateTime datetime;
             furi_hal_rtc_get_datetime(&datetime);
             datetime.minute = (ublox->nav_timeutc).min;
             datetime.second = (ublox->nav_timeutc).sec;

+ 1 - 1
non_catalog_apps/ublox/views/data_display_view.c

@@ -136,7 +136,7 @@ static void data_display_draw_callback(Canvas* canvas, void* model) {
 	canvas_set_font(canvas, FontPrimary);
 	canvas_draw_str(canvas, 0, 48, "Time:");
 	
-	FuriHalRtcDateTime datetime;
+	DateTime datetime;
 	furi_hal_rtc_get_datetime(&datetime);
 	locale_format_time(s, &datetime, locale_get_time_format(), false);
 

+ 1 - 1
non_catalog_apps/wiegand/scenes/wiegand_save.c

@@ -85,7 +85,7 @@ void wiegand_save_scene_on_enter(void* context) {
     App* app = context;
     text_input_reset(app->text_input);
 
-    FuriHalRtcDateTime datetime;
+    DateTime datetime;
     furi_hal_rtc_get_datetime(&datetime);
     snprintf(
         app->file_name,

+ 1 - 1
non_catalog_apps/wiegand/scenes/wiegand_scan.c

@@ -59,7 +59,7 @@ static void wiegand_stop_scan(void* context) {
 static void wiegand_scan_found(void* context) {
     App* app = context;
 
-    FuriHalRtcDateTime datetime;
+    DateTime datetime;
     furi_hal_rtc_get_datetime(&datetime);
     snprintf(
         app->file_name,