Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/ClusterM/flipperzero-firmware.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorあく <alleteam@gmail.com>2021-05-25 13:19:07 +0300
committerGitHub <noreply@github.com>2021-05-25 13:19:07 +0300
commit84f46e670a7404a1808a2050fbdafa749711c10e (patch)
treeaef5fbc24bbcb35a47544aed7b5774625fd69ae3 /applications/subghz/subghz.c
parent1a1c5fa05d0d483d4cebcf221c89c574d980b2b4 (diff)
[FL-1254] ViewDispatcher improvements, SubGhz cli and certification preparation (#482)
* Add more more frequencees and change ok key bahavior to toggle * GUI: add queue support to ViewDispatcher * SubGhz: basic cli * SubGHz: pt send cli * SubGhz: carrier cli commands. * Fix irda test data merge artifacts
Diffstat (limited to 'applications/subghz/subghz.c')
-rw-r--r--applications/subghz/subghz.c73
1 files changed, 67 insertions, 6 deletions
diff --git a/applications/subghz/subghz.c b/applications/subghz/subghz.c
index bf20574a..1a470386 100644
--- a/applications/subghz/subghz.c
+++ b/applications/subghz/subghz.c
@@ -1,6 +1,70 @@
#include "subghz_i.h"
-osThreadId subghz_thread_id = NULL;
+const SubGhzFrequency subghz_frequencies[] = {
+ /* 301 */
+ {
+ .frequency = 301000000,
+ .path = ApiHalSubGhzPath315,
+ },
+ /* 315 */
+ {
+ .frequency = 315000000,
+ .path = ApiHalSubGhzPath315,
+ },
+ /* 346 - 385 */
+ {
+ .frequency = 346000000,
+ .path = ApiHalSubGhzPath315,
+ },
+ {
+ .frequency = 385000000,
+ .path = ApiHalSubGhzPath315,
+ },
+ /* LPD433 first, mid, last channels */
+ {
+ .frequency = 433075000,
+ .path = ApiHalSubGhzPath433,
+ },
+ {
+ .frequency = 433920000,
+ .path = ApiHalSubGhzPath433,
+ },
+ {
+ .frequency = 434775000,
+ .path = ApiHalSubGhzPath433,
+ },
+ /* 438.9 - 781 */
+ {
+ .frequency = 438900000,
+ .path = ApiHalSubGhzPath433,
+ },
+ {
+ .frequency = 463000000,
+ .path = ApiHalSubGhzPath433,
+ },
+ {
+ .frequency = 781000000,
+ .path = ApiHalSubGhzPath868,
+ },
+ /* 868.35 */
+ {
+ .frequency = 868350000,
+ .path = ApiHalSubGhzPath868,
+ },
+ /* 915 */
+ {
+ .frequency = 915000000,
+ .path = ApiHalSubGhzPath868,
+ },
+ /* 925 */
+ {
+ .frequency = 925000000,
+ .path = ApiHalSubGhzPath868,
+ },
+};
+
+const uint32_t subghz_frequencies_count = sizeof(subghz_frequencies) / sizeof(SubGhzFrequency);
+const uint32_t subghz_frequencies_433_92 = 5;
void subghz_menu_callback(void* context, uint32_t index) {
furi_assert(context);
@@ -17,21 +81,18 @@ void subghz_menu_callback(void* context, uint32_t index) {
}
uint32_t subghz_exit(void* context) {
- osThreadResume(subghz_thread_id);
return VIEW_NONE;
}
SubGhz* subghz_alloc() {
SubGhz* subghz = furi_alloc(sizeof(SubGhz));
- // Thread id
- subghz_thread_id = osThreadGetId();
-
// GUI
subghz->gui = furi_record_open("gui");
// View Dispatcher
subghz->view_dispatcher = view_dispatcher_alloc();
+ view_dispatcher_enable_queue(subghz->view_dispatcher);
view_dispatcher_attach_to_gui(
subghz->view_dispatcher, subghz->gui, ViewDispatcherTypeFullscreen);
@@ -99,7 +160,7 @@ void subghz_free(SubGhz* subghz) {
int32_t subghz_app(void* context) {
SubGhz* subghz = subghz_alloc();
- osThreadSuspend(subghz_thread_id);
+ view_dispatcher_run(subghz->view_dispatcher);
subghz_free(subghz);