[FL-1758, FL-1790] SubGhz refactoring part 2, fix generation of a new GateTX serial (#696)

* WidGet: fix name  Multiline String Element
* SubGhz: rename  SubGhzProtocol to SubGhzParser and bring it up
* SubGhz: a new way to navigate in receiver views
* SubGhz: fix syntax
* WedGet: add forwarding input type to wedget button callback, fix using a callback in an application
* SubGhz: add assertions and status checks
* SubGhz: fix syntax
* [FL-1790] SubGhz: fix GateTX
* SubGhz:  add 434.42 MHz frequency support
* SubGhz: rename type protocol, add decoder stage names
* SubGhz: fix navigation through received signals when changing scenes
* SubGhz: fix 2-fsk config

Co-authored-by: Aleksandr Kutuzov <alleteam@gmail.com>
This commit is contained in:
Skorpionm
2021-09-15 19:24:19 +04:00
committed by GitHub
parent 72ca76097a
commit 8fd411097e
35 changed files with 1326 additions and 1113 deletions

View File

@@ -7,6 +7,7 @@ const char* const subghz_frequencies_text[] = {
"387.00",
"433.08",
"433.92",
"434.42",
"434.78",
"438.90",
"464.00",
@@ -26,6 +27,7 @@ const uint32_t subghz_frequencies[] = {
387000000,
433075000, /* LPD433 first */
433920000, /* LPD433 mid */
434420000,
434775000, /* LPD433 last channels */
438900000,
464000000,
@@ -156,24 +158,24 @@ SubGhz* subghz_alloc() {
subghz->txrx = furi_alloc(sizeof(SubGhzTxRx));
subghz->txrx->frequency = subghz_frequencies[subghz_frequencies_433_92];
subghz->txrx->preset = FuriHalSubGhzPresetOok650Async;
subghz->txrx->txrx_state = SubGhzTxRxStateIdle;
subghz->txrx->txrx_state = SubGhzTxRxStateSleep;
subghz->txrx->hopper_state = SubGhzHopperStateOFF;
subghz->txrx->history = subghz_history_alloc();
subghz->txrx->worker = subghz_worker_alloc();
subghz->txrx->protocol = subghz_protocol_alloc();
subghz->txrx->parser = subghz_parser_alloc();
subghz_worker_set_overrun_callback(
subghz->txrx->worker, (SubGhzWorkerOverrunCallback)subghz_protocol_reset);
subghz->txrx->worker, (SubGhzWorkerOverrunCallback)subghz_parser_reset);
subghz_worker_set_pair_callback(
subghz->txrx->worker, (SubGhzWorkerPairCallback)subghz_protocol_parse);
subghz_worker_set_context(subghz->txrx->worker, subghz->txrx->protocol);
subghz->txrx->worker, (SubGhzWorkerPairCallback)subghz_parser_parse);
subghz_worker_set_context(subghz->txrx->worker, subghz->txrx->parser);
//Init Error_str
string_init(subghz->error_str);
subghz_protocol_load_keeloq_file(subghz->txrx->protocol, "/ext/subghz/keeloq_mfcodes");
subghz_protocol_load_nice_flor_s_file(subghz->txrx->protocol, "/ext/subghz/nice_floor_s_rx");
subghz_parser_load_keeloq_file(subghz->txrx->parser, "/ext/subghz/keeloq_mfcodes");
subghz_parser_load_nice_flor_s_file(subghz->txrx->parser, "/ext/subghz/nice_floor_s_rx");
//subghz_protocol_enable_dump_text(subghz->protocol, subghz_text_callback, subghz);
//subghz_parser_enable_dump_text(subghz->protocol, subghz_text_callback, subghz);
return subghz;
}
@@ -232,7 +234,7 @@ void subghz_free(SubGhz* subghz) {
subghz->gui = NULL;
//Worker & Protocol & History
subghz_protocol_free(subghz->txrx->protocol);
subghz_parser_free(subghz->txrx->parser);
subghz_worker_free(subghz->txrx->worker);
subghz_history_free(subghz->txrx->history);
free(subghz->txrx);