mirror of
https://github.com/Next-Flip/Momentum-Firmware.git
synced 2026-04-24 03:29:57 -07:00
DateTime lib refactor fixes
This commit is contained in:
Submodule applications/external updated: ae8e6f4764...a1fd07bd39
@@ -206,7 +206,7 @@ static void subghz_scene_add_to_history_callback(
|
||||
const char* suf = subghz->last_settings->protocol_file_names ?
|
||||
decoder_base->protocol->name :
|
||||
SUBGHZ_APP_FILENAME_PREFIX;
|
||||
FuriHalRtcDateTime time = subghz_history_get_datetime(history, idx);
|
||||
DateTime time = subghz_history_get_datetime(history, idx);
|
||||
name_generator_make_detailed_datetime(file, sizeof(file), suf, &time, true);
|
||||
// Dir name
|
||||
FuriString* path = furi_string_alloc_set(SUBGHZ_APP_FOLDER "/Autosave");
|
||||
@@ -493,7 +493,7 @@ bool subghz_scene_receiver_on_event(void* context, SceneManagerEvent event) {
|
||||
subghz->threshold_rssi, subghz_txrx_radio_device_get_rssi(subghz->txrx));
|
||||
|
||||
if(subghz->last_settings->gps_baudrate != 0) {
|
||||
FuriHalRtcDateTime datetime;
|
||||
DateTime datetime;
|
||||
furi_hal_rtc_get_datetime(&datetime);
|
||||
if((datetime.second - subghz->gps->fix_second) > 15) {
|
||||
subghz->gps->latitude = NAN;
|
||||
|
||||
@@ -10,7 +10,7 @@ void subghz_scene_saved_show_gps_draw_satellites(void* context) {
|
||||
|
||||
subghz_txrx_get_latitude_and_longitude(subghz->txrx, lat_str, lon_str);
|
||||
|
||||
FuriHalRtcDateTime datetime;
|
||||
DateTime datetime;
|
||||
furi_hal_rtc_get_datetime(&datetime);
|
||||
if((datetime.second - subghz->gps->fix_second) > 15) {
|
||||
subghz->gps->latitude = NAN;
|
||||
|
||||
@@ -7,7 +7,7 @@ void subghz_scene_show_gps_draw_satellites(void* context) {
|
||||
FuriString* text = furi_string_alloc();
|
||||
FuriString* time_text = furi_string_alloc();
|
||||
|
||||
FuriHalRtcDateTime datetime;
|
||||
DateTime datetime;
|
||||
furi_hal_rtc_get_datetime(&datetime);
|
||||
if((datetime.second - subghz->gps->fix_second) > 15) {
|
||||
subghz->gps->latitude = NAN;
|
||||
|
||||
@@ -210,10 +210,7 @@ bool subghz_history_get_text_space_left(
|
||||
furi_string_printf(output, "%02u", instance->last_index_write);
|
||||
return false;
|
||||
} else {
|
||||
FuriHalRtcDateTime datetime;
|
||||
furi_hal_rtc_get_datetime(&datetime);
|
||||
|
||||
if(furi_hal_rtc_datetime_to_timestamp(&datetime) % 2) {
|
||||
if(furi_hal_rtc_get_timestamp() % 2) {
|
||||
furi_string_printf(output, "%02u", instance->last_index_write);
|
||||
} else {
|
||||
furi_string_printf(output, "%d sats", sats);
|
||||
|
||||
@@ -69,7 +69,7 @@ void desktop_view_locked_draw_lockscreen(Canvas* canvas, void* m) {
|
||||
char second_str[5];
|
||||
char date_str[14];
|
||||
char meridian_str[3];
|
||||
FuriHalRtcDateTime datetime;
|
||||
DateTime datetime;
|
||||
furi_hal_rtc_get_datetime(&datetime);
|
||||
LocaleTimeFormat time_format = locale_get_time_format();
|
||||
LocaleDateFormat date_format = locale_get_date_format();
|
||||
|
||||
@@ -73,9 +73,7 @@ bool dolphin_state_load(DolphinState* dolphin_state) {
|
||||
}
|
||||
|
||||
uint64_t dolphin_state_timestamp() {
|
||||
DateTime datetime;
|
||||
furi_hal_rtc_get_datetime(&datetime);
|
||||
return datetime_datetime_to_timestamp(&datetime);
|
||||
return furi_hal_rtc_get_timestamp();
|
||||
}
|
||||
|
||||
bool dolphin_state_is_levelup(uint32_t icounter) {
|
||||
|
||||
@@ -225,9 +225,7 @@ static void clock_tick(void* ctx) {
|
||||
|
||||
void timer_start_stop(ClockState* plugin_state) {
|
||||
// START/STOP TIMER
|
||||
FuriHalRtcDateTime 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 = furi_hal_rtc_get_timestamp();
|
||||
|
||||
if(plugin_state->timer_running) {
|
||||
// Update stopped seconds
|
||||
|
||||
@@ -120,9 +120,7 @@ SubGhzProtocolStatus tpms_block_generic_serialize(
|
||||
}
|
||||
|
||||
//DATE AGE set
|
||||
FuriHalRtcDateTime 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 = furi_hal_rtc_get_timestamp();
|
||||
|
||||
temp_data = curr_ts;
|
||||
if(!flipper_format_write_uint32(flipper_format, "Ts", &temp_data, 1)) {
|
||||
|
||||
@@ -121,9 +121,7 @@ SubGhzProtocolStatus ws_block_generic_serialize(
|
||||
}
|
||||
|
||||
//DATE AGE set
|
||||
FuriHalRtcDateTime 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 = furi_hal_rtc_get_timestamp();
|
||||
|
||||
temp_data = curr_ts;
|
||||
if(!flipper_format_write_uint32(flipper_format, "Ts", &temp_data, 1)) {
|
||||
|
||||
Reference in New Issue
Block a user