diff --git a/applications/main/subghz/subghz.c b/applications/main/subghz/subghz.c index 8fe8a7eb2..aaa25fe17 100644 --- a/applications/main/subghz/subghz.c +++ b/applications/main/subghz/subghz.c @@ -112,7 +112,9 @@ SubGhz* subghz_alloc(bool alloc_for_tx_only) { // Open Notification record subghz->notifications = furi_record_open(RECORD_NOTIFICATION); - +#ifdef SUBGHZ_MEASURE_LOADING + uint32_t load_ticks = furi_get_tick(); +#endif subghz->txrx = subghz_txrx_alloc(); if(!alloc_for_tx_only) { @@ -229,6 +231,10 @@ SubGhz* subghz_alloc(bool alloc_for_tx_only) { subghz->last_settings->rssi = SUBGHZ_LAST_SETTING_FREQUENCY_ANALYZER_TRIGGER; } } +#ifdef SUBGHZ_MEASURE_LOADING + load_ticks = furi_get_tick() - load_ticks; + FURI_LOG_I(TAG, "Loaded: %ld ms.", load_ticks); +#endif //Init Error_str subghz->error_str = furi_string_alloc(); diff --git a/applications/main/subghz/subghz_i.h b/applications/main/subghz/subghz_i.h index 118e272cd..e348b279f 100644 --- a/applications/main/subghz/subghz_i.h +++ b/applications/main/subghz/subghz_i.h @@ -43,6 +43,7 @@ #define SUBGHZ_MAX_LEN_NAME 64 #define SUBGHZ_EXT_PRESET_NAME true #define SUBGHZ_RAW_THRESHOLD_MIN (-90.0f) +#define SUBGHZ_MEASURE_LOADING true typedef struct { uint8_t fix[4]; @@ -106,7 +107,6 @@ bool subghz_tx_start(SubGhz* subghz, FlipperFormat* flipper_format); void subghz_dialog_message_freq_error(SubGhz* subghz, bool only_rx); bool subghz_key_load(SubGhz* subghz, const char* file_path, bool show_dialog); -// Not used bool subghz_get_next_name_file(SubGhz* subghz, uint8_t max_len); bool subghz_save_protocol_to_file( SubGhz* subghz,