Added saving DetectRAW settings, trying to write files on SD instead of memory

This commit is contained in:
derskythe
2022-10-01 08:39:51 +04:00
parent 41c93431c8
commit 24e744f1d1
8 changed files with 305 additions and 70 deletions

View File

@@ -341,5 +341,5 @@ void subghz_scene_read_raw_on_exit(void* context) {
notification_message(subghz->notifications, &sequence_reset_rgb);
//filter restoration
subghz_receiver_set_filter(subghz->txrx->receiver, SubGhzProtocolFlag_Decodable);
subghz_last_settings_set_detect_raw_values(subghz);
}

View File

@@ -29,11 +29,6 @@ const char* const detect_raw_text[DETECT_RAW_COUNT] = {
"ON",
};
const SubGhzProtocolFlag detect_raw_value[DETECT_RAW_COUNT] = {
SubGhzProtocolFlag_Decodable,
SubGhzProtocolFlag_Decodable | SubGhzProtocolFlag_RAW,
};
#define RSSI_THRESHOLD_COUNT 7
const char* const rssi_threshold_text[RSSI_THRESHOLD_COUNT] = {
"-72db",
@@ -105,20 +100,6 @@ uint8_t subghz_scene_receiver_config_hopper_value_index(
}
}
uint8_t subghz_scene_receiver_config_detect_raw_value_index(
const SubGhzProtocolFlag value,
const SubGhzProtocolFlag values[],
uint8_t values_count) {
uint8_t index = 0;
for(uint8_t i = 0; i < values_count; i++) {
if(value == values[i]) {
index = i;
break;
}
}
return index;
}
uint8_t subghz_scene_receiver_config_rssi_threshold_value_index(
const int value,
const int values[],
@@ -186,12 +167,9 @@ static void subghz_scene_receiver_config_set_detect_raw(VariableItem* item) {
uint8_t index = variable_item_get_current_value_index(item);
variable_item_set_current_value_text(item, detect_raw_text[index]);
subghz_receiver_set_filter(subghz->txrx->receiver, detect_raw_value[index]);
subghz->last_settings->detect_raw = index;
subghz_protocol_decoder_raw_set_auto_mode(
subghz_receiver_search_decoder_base_by_name(
subghz->txrx->receiver, SUBGHZ_PROTOCOL_RAW_NAME),
(index == 1));
subghz_last_settings_set_detect_raw_values(subghz);
}
static void subghz_scene_receiver_config_set_hopping_running(VariableItem* item) {
@@ -304,10 +282,7 @@ void subghz_scene_receiver_config_on_enter(void* context) {
DETECT_RAW_COUNT,
subghz_scene_receiver_config_set_detect_raw,
subghz);
value_index = subghz_scene_receiver_config_detect_raw_value_index(
subghz_receiver_get_filter(subghz->txrx->receiver),
detect_raw_value,
DETECT_RAW_COUNT);
value_index = subghz->last_settings->detect_raw;
variable_item_set_current_value_index(item, value_index);
variable_item_set_current_value_text(item, detect_raw_text[value_index]);

View File

@@ -26,6 +26,7 @@ static bool subghz_scene_receiver_info_update_parser(void* context) {
subghz->txrx->receiver,
subghz_history_get_protocol_name(subghz->txrx->history, subghz->txrx->idx_menu_chosen));
if(subghz->txrx->decoder_result) {
// In this case flipper format was changed to short file content
subghz_protocol_decoder_base_deserialize(
subghz->txrx->decoder_result,
subghz_history_get_raw_data(subghz->txrx->history, subghz->txrx->idx_menu_chosen));

View File

@@ -21,11 +21,7 @@ void subghz_scene_start_on_enter(void* context) {
if(subghz->state_notifications == SubGhzNotificationStateStarting) {
subghz->state_notifications = SubGhzNotificationStateIDLE;
}
subghz_protocol_decoder_raw_set_auto_mode(
subghz_receiver_search_decoder_base_by_name(
subghz->txrx->receiver, SUBGHZ_PROTOCOL_RAW_NAME),
false);
subghz_receiver_set_filter(subghz->txrx->receiver, SubGhzProtocolFlag_Decodable);
subghz_last_settings_set_detect_raw_values(subghz);
submenu_add_item(
subghz->submenu, "Read", SubmenuIndexRead, subghz_scene_start_submenu_callback, subghz);