SubGhz: support 310 MHz and fix (#1262)

* SubGhz: add frequency support 310 MHz
* SubGhz: deleting a TMP file using the "Erase" button in Read RAW
* SubGhz: fix frequency analyzer scan speed
* SubGhz: fix start duration came_atomo protocol
* SubGhz: refactoring subghz_setting
* SubGhz: refactoring load setting frequency analyzer
* SubGhz: fix load setting,  default frequency
* SubGhz: patch raw temp file remove code to work with string_t
* Storage: parallel safe cli
* SubGhz: new frequency settings loading system
* Assets: recompile to include latest subghz custom frequency control changes

Co-authored-by: あく <alleteam@gmail.com>
This commit is contained in:
Skorpionm
2022-05-31 19:50:50 +04:00
committed by GitHub
parent 69d90d5b00
commit 66dbb68947
11 changed files with 172 additions and 182 deletions

View File

@@ -3,8 +3,6 @@
#include <furi.h>
#include "../subghz_i.h"
#define TAG "SubghzFrequencyAnalyzerWorker"
#define SUBGHZ_FREQUENCY_ANALYZER_THRESHOLD -95.0f
@@ -82,7 +80,7 @@ static int32_t subghz_frequency_analyzer_worker_thread(void* context) {
cc1101_flush_tx(&furi_hal_spi_bus_handle_subghz);
cc1101_write_reg(&furi_hal_spi_bus_handle_subghz, CC1101_IOCFG0, CC1101IocfgHW);
cc1101_write_reg(&furi_hal_spi_bus_handle_subghz, CC1101_MDMCFG3,
0b11111111); // symbol rate
0b01111111); // symbol rate
cc1101_write_reg(
&furi_hal_spi_bus_handle_subghz,
CC1101_AGCCTRL2,
@@ -130,7 +128,7 @@ static int32_t subghz_frequency_analyzer_worker_thread(void* context) {
furi_hal_spi_release(&furi_hal_spi_bus_handle_subghz);
// delay will be in range between 1 and 2ms
osDelay(2);
osDelay(3);
rssi = furi_hal_subghz_get_rssi();
@@ -179,9 +177,12 @@ static int32_t subghz_frequency_analyzer_worker_thread(void* context) {
furi_hal_spi_release(&furi_hal_spi_bus_handle_subghz);
// delay will be in range between 1 and 2ms
osDelay(2);
osDelay(3);
rssi = furi_hal_subghz_get_rssi();
FURI_LOG_T(TAG, "#:%u:%f", frequency, (double)rssi);
if(frequency_rssi.rssi < rssi) {
frequency_rssi.rssi = rssi;
frequency_rssi.frequency = frequency;
@@ -222,7 +223,8 @@ static int32_t subghz_frequency_analyzer_worker_thread(void* context) {
return 0;
}
SubGhzFrequencyAnalyzerWorker* subghz_frequency_analyzer_worker_alloc() {
SubGhzFrequencyAnalyzerWorker* subghz_frequency_analyzer_worker_alloc(void* context) {
furi_assert(context);
SubGhzFrequencyAnalyzerWorker* instance = malloc(sizeof(SubGhzFrequencyAnalyzerWorker));
instance->thread = furi_thread_alloc();
@@ -231,8 +233,8 @@ SubGhzFrequencyAnalyzerWorker* subghz_frequency_analyzer_worker_alloc() {
furi_thread_set_context(instance->thread, instance);
furi_thread_set_callback(instance->thread, subghz_frequency_analyzer_worker_thread);
instance->setting = subghz_setting_alloc();
subghz_setting_load(instance->setting, "/ext/subghz/assets/setting_frequency_analyzer_user");
SubGhz* subghz = context;
instance->setting = subghz->setting;
return instance;
}
@@ -240,7 +242,6 @@ void subghz_frequency_analyzer_worker_free(SubGhzFrequencyAnalyzerWorker* instan
furi_assert(instance);
furi_thread_free(instance->thread);
subghz_setting_free(instance->setting);
free(instance);
}