Skip to content

Commit d998336

Browse files
Skorpionmskotopes
authored andcommitted
SubGhz: support 310 MHz and fix (flipperdevices#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>
1 parent fc1a5a5 commit d998336

10 files changed

+550
-586
lines changed

applications/storage/storage_cli.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -593,7 +593,7 @@ static void storage_cli_factory_reset(Cli* cli, string_t args, void* context) {
593593
void storage_on_system_start() {
594594
#ifdef SRV_CLI
595595
Cli* cli = furi_record_open("cli");
596-
cli_add_command(cli, "storage", CliCommandFlagDefault, storage_cli, NULL);
596+
cli_add_command(cli, "storage", CliCommandFlagParallelSafe, storage_cli, NULL);
597597
cli_add_command(
598598
cli, "factory_reset", CliCommandFlagParallelSafe, storage_cli_factory_reset, NULL);
599599
furi_record_close("cli");

applications/subghz/helpers/subghz_frequency_analyzer_worker.c

+4-6
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,6 @@
33

44
#include <furi.h>
55

6-
#include "../subghz_i.h"
7-
86
#define TAG "SubghzFrequencyAnalyzerWorker"
97

108
#define SUBGHZ_FREQUENCY_ANALYZER_THRESHOLD -95.0f
@@ -225,7 +223,8 @@ static int32_t subghz_frequency_analyzer_worker_thread(void* context) {
225223
return 0;
226224
}
227225

228-
SubGhzFrequencyAnalyzerWorker* subghz_frequency_analyzer_worker_alloc() {
226+
SubGhzFrequencyAnalyzerWorker* subghz_frequency_analyzer_worker_alloc(void* context) {
227+
furi_assert(context);
229228
SubGhzFrequencyAnalyzerWorker* instance = malloc(sizeof(SubGhzFrequencyAnalyzerWorker));
230229

231230
instance->thread = furi_thread_alloc();
@@ -234,16 +233,15 @@ SubGhzFrequencyAnalyzerWorker* subghz_frequency_analyzer_worker_alloc() {
234233
furi_thread_set_context(instance->thread, instance);
235234
furi_thread_set_callback(instance->thread, subghz_frequency_analyzer_worker_thread);
236235

237-
instance->setting = subghz_setting_alloc();
238-
subghz_setting_load(instance->setting, "/ext/subghz/assets/setting_frequency_analyzer_user");
236+
SubGhz* subghz = context;
237+
instance->setting = subghz->setting;
239238
return instance;
240239
}
241240

242241
void subghz_frequency_analyzer_worker_free(SubGhzFrequencyAnalyzerWorker* instance) {
243242
furi_assert(instance);
244243

245244
furi_thread_free(instance->thread);
246-
subghz_setting_free(instance->setting);
247245
free(instance);
248246
}
249247

applications/subghz/helpers/subghz_frequency_analyzer_worker.h

+3-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
#pragma once
22

33
#include <furi_hal.h>
4+
#include "../subghz_i.h"
45

56
typedef struct SubGhzFrequencyAnalyzerWorker SubGhzFrequencyAnalyzerWorker;
67

@@ -14,9 +15,10 @@ typedef struct {
1415

1516
/** Allocate SubGhzFrequencyAnalyzerWorker
1617
*
18+
* @param context SubGhz* context
1719
* @return SubGhzFrequencyAnalyzerWorker*
1820
*/
19-
SubGhzFrequencyAnalyzerWorker* subghz_frequency_analyzer_worker_alloc();
21+
SubGhzFrequencyAnalyzerWorker* subghz_frequency_analyzer_worker_alloc(void* context);
2022

2123
/** Free SubGhzFrequencyAnalyzerWorker
2224
*
+38-38
Original file line numberDiff line numberDiff line change
@@ -1,38 +1,38 @@
1-
#include "subghz_testing.h"
2-
3-
const uint32_t subghz_frequencies_testing[] = {
4-
/* 300 - 348 */
5-
300000000,
6-
304500000,
7-
310000000,
8-
312025000,
9-
313250000,
10-
313625000,
11-
315000000,
12-
315225000,
13-
321950000,
14-
348000000,
15-
/* 387 - 464 */
16-
387000000,
17-
433075000, /* LPD433 first */
18-
433825000,
19-
433920000, /* LPD433 mid */
20-
434420000,
21-
434775000, /* LPD433 last channels */
22-
438900000,
23-
464000000,
24-
/* 779 - 928 */
25-
779000000,
26-
868150000,
27-
868350000,
28-
868550000,
29-
915000000,
30-
925000000,
31-
926500000,
32-
927950000,
33-
928000000,
34-
};
35-
36-
const uint32_t subghz_frequencies_count_testing =
37-
sizeof(subghz_frequencies_testing) / sizeof(uint32_t);
38-
const uint32_t subghz_frequencies_433_92_testing = 13;
1+
#include "subghz_testing.h"
2+
3+
const uint32_t subghz_frequencies_testing[] = {
4+
/* 300 - 348 */
5+
300000000,
6+
304500000,
7+
310000000,
8+
312025000,
9+
313250000,
10+
313625000,
11+
315000000,
12+
315225000,
13+
321950000,
14+
348000000,
15+
/* 387 - 464 */
16+
387000000,
17+
433075000, /* LPD433 first */
18+
433825000,
19+
433920000, /* LPD433 mid */
20+
434420000,
21+
434775000, /* LPD433 last channels */
22+
438900000,
23+
464000000,
24+
/* 779 - 928 */
25+
779000000,
26+
868150000,
27+
868350000,
28+
868550000,
29+
915000000,
30+
925000000,
31+
926500000,
32+
927950000,
33+
928000000,
34+
};
35+
36+
const uint32_t subghz_frequencies_count_testing =
37+
sizeof(subghz_frequencies_testing) / sizeof(uint32_t);
38+
const uint32_t subghz_frequencies_433_92_testing = 13;

0 commit comments

Comments
 (0)