From e7707b31f0a503ada1ae6f92d5a8c6735405da50 Mon Sep 17 00:00:00 2001 From: MX <10697207+xMasterX@users.noreply.github.com> Date: Wed, 10 May 2023 23:28:09 +0300 Subject: [PATCH] Do some TODOs --- .../subghz/scenes/subghz_scene_decode_raw.c | 21 +------------------ .../subghz/scenes/subghz_scene_read_raw.c | 4 +--- .../scenes/subghz_scene_receiver_info.c | 4 ++-- .../subghz/scenes/subghz_scene_set_type.c | 5 ----- .../subghz/scenes/subghz_scene_transmitter.c | 2 -- 5 files changed, 4 insertions(+), 32 deletions(-) diff --git a/applications/main/subghz/scenes/subghz_scene_decode_raw.c b/applications/main/subghz/scenes/subghz_scene_decode_raw.c index 7dead8d4e..4412676f3 100644 --- a/applications/main/subghz/scenes/subghz_scene_decode_raw.c +++ b/applications/main/subghz/scenes/subghz_scene_decode_raw.c @@ -7,21 +7,6 @@ #define TAG "SubGhzDecodeRaw" #define SAMPLES_TO_READ_PER_TICK 400 -// TODO: -// [X] Remember RAW file after decoding -// [X] Decode in tick events instead of on_enter -// [X] Make "Config" label optional in subghz_view_receiver_draw (../views/receiver.c) -// [X] Make "Scanning..." label optional in subghz_view_receiver_draw (../views/receiver.c) -// [X] Add Decoding logo -// [ ] Design nicer Decoding logo -// [X] Check progress in stream_buffer, instead of raw stream -// [X] Blink led while decoding -// [X] Stop rx blink (blue, fast) on history item view -// [X] Don't reparse file on back -// [X] Fix: RX animation+LED returning from decoded detail view -// [X] Find good value for SAMPLES_TO_READ_PER_TICK -// [X] Fix: read errors (slow flash) after aborting decode read - static void subghz_scene_receiver_update_statusbar(void* context) { SubGhz* subghz = context; FuriString* history_stat_str = furi_string_alloc(); @@ -163,7 +148,7 @@ void subghz_scene_decode_raw_on_enter(void* context) { FuriString* item_time = furi_string_alloc(); subghz_view_receiver_set_lock( - subghz->subghz_receiver, subghz_is_locked(subghz)); //TODO Doesn't matter in DecodeRAW + subghz->subghz_receiver, false); //TODO Doesn't matter in DecodeRAW subghz_view_receiver_set_mode(subghz->subghz_receiver, SubGhzViewReceiverModeFile); subghz_view_receiver_set_callback( subghz->subghz_receiver, subghz_scene_decode_raw_callback, subghz); @@ -243,10 +228,6 @@ bool subghz_scene_decode_raw_on_event(void* context, SceneManagerEvent event) { notification_message(subghz->notifications, &sequence_display_backlight_off); consumed = true; break; - case SubGhzCustomEventViewReceiverUnlock: - subghz_unlock(subghz); //TODO There is no such event in DecodeRAW - consumed = true; - break; default: break; } diff --git a/applications/main/subghz/scenes/subghz_scene_read_raw.c b/applications/main/subghz/scenes/subghz_scene_read_raw.c index 4b8303ddd..a1b25cbd1 100644 --- a/applications/main/subghz/scenes/subghz_scene_read_raw.c +++ b/applications/main/subghz/scenes/subghz_scene_read_raw.c @@ -42,10 +42,8 @@ static void subghz_scene_read_raw_update_statusbar(void* context) { #ifdef SUBGHZ_EXT_PRESET_NAME subghz_txrx_get_frequency_and_modulation(subghz->txrx, frequency_str, modulation_str, true); - //TODO if need subghz_txrx_get_preset - //furi_string_printf(modulation_str, "%s", furi_string_get_cstr(subghz->txrx->preset->name)); #else - subghz_get_frequency_modulation(subghz->txrx, frequency_str, modulation_str, false); + subghz_txrx_get_frequency_and_modulation(subghz->txrx, frequency_str, modulation_str, false); #endif subghz_read_raw_add_data_statusbar( subghz->subghz_read_raw, diff --git a/applications/main/subghz/scenes/subghz_scene_receiver_info.c b/applications/main/subghz/scenes/subghz_scene_receiver_info.c index c04f39cb8..370638931 100644 --- a/applications/main/subghz/scenes/subghz_scene_receiver_info.c +++ b/applications/main/subghz/scenes/subghz_scene_receiver_info.c @@ -27,7 +27,7 @@ static bool subghz_scene_receiver_info_update_parser(void* context) { if(subghz_txrx_load_decoder_by_name_protocol( subghz->txrx, subghz_history_get_protocol_name(subghz->history, subghz->idx_menu_chosen))) { - //todo we are trying to deserialize without checking for errors, since it is assumed that we just received this chignal + //todo we are trying to deserialize without checking for errors, since it is assumed that we just received this signal subghz_protocol_decoder_base_deserialize( subghz_txrx_get_decoder(subghz->txrx), subghz_history_get_raw_data(subghz->history, subghz->idx_menu_chosen)); @@ -140,7 +140,7 @@ bool subghz_scene_receiver_info_on_event(void* context, SceneManagerEvent event) widget_reset(subghz->widget); subghz_scene_receiver_info_draw_widget(subghz); - subghz_txrx_stop(subghz->txrx); //TODO this is probably a redundant call + subghz_txrx_stop(subghz->txrx); if(!subghz->in_decoder_scene) { subghz_txrx_rx_start(subghz->txrx); diff --git a/applications/main/subghz/scenes/subghz_scene_set_type.c b/applications/main/subghz/scenes/subghz_scene_set_type.c index 23ecbb539..ef53006da 100644 --- a/applications/main/subghz/scenes/subghz_scene_set_type.c +++ b/applications/main/subghz/scenes/subghz_scene_set_type.c @@ -562,11 +562,6 @@ bool subghz_scene_set_type_on_event(void* context, SceneManagerEvent event) { case SubmenuIndexSomfyTelis: generated_protocol = subghz_txrx_gen_somfy_telis_protocol( subghz->txrx, "AM650", 433920000, key & 0x00FFFFFF, 0x2, 0x0003); - if(!generated_protocol) { //TODO does not use databases - furi_string_set( - subghz->error_str, "Function requires\nan SD card with\nfresh databases."); - scene_manager_next_scene(subghz->scene_manager, SubGhzSceneShowError); - } break; case SubmenuIndexDoorHan_433_92: generated_protocol = subghz_txrx_gen_keeloq_protocol( diff --git a/applications/main/subghz/scenes/subghz_scene_transmitter.c b/applications/main/subghz/scenes/subghz_scene_transmitter.c index c3ae04a8f..dc8c51b7a 100644 --- a/applications/main/subghz/scenes/subghz_scene_transmitter.c +++ b/applications/main/subghz/scenes/subghz_scene_transmitter.c @@ -81,8 +81,6 @@ bool subghz_scene_transmitter_on_event(void* context, SceneManagerEvent event) { uint8_t tmp_counter = furi_hal_subghz_get_rolling_counter_mult(); furi_hal_subghz_set_rolling_counter_mult(0); // Calling restore! - subghz_txrx_stop(subghz->txrx); //TODO this is probably a redundant call - if(!subghz_tx_start(subghz, subghz_txrx_get_fff_data(subghz->txrx))) { scene_manager_next_scene( subghz->scene_manager, SubGhzSceneShowOnlyRx); //TODO Is this necessary?