change: add measure loading to SubGHz

This commit is contained in:
DerSkythe
2023-08-25 06:14:13 +04:00
parent f53246d40b
commit 9ef1a4dfaa
2 changed files with 8 additions and 2 deletions

View File

@@ -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();

View File

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