[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
This commit is contained in:
@@ -45,11 +45,11 @@ void subghz_test_basic_draw(Canvas* canvas, SubghzTestBasicModel* model) {
|
||||
char* path_name = "Unknown";
|
||||
if(model->path == ApiHalSubGhzPathIsolate) {
|
||||
path_name = "isolate";
|
||||
} else if(model->path == ApiHalSubGhzPath1) {
|
||||
} else if(model->path == ApiHalSubGhzPath433) {
|
||||
path_name = "433MHz";
|
||||
} else if(model->path == ApiHalSubGhzPath2) {
|
||||
} else if(model->path == ApiHalSubGhzPath315) {
|
||||
path_name = "315MHz";
|
||||
} else if(model->path == ApiHalSubGhzPath3) {
|
||||
} else if(model->path == ApiHalSubGhzPath868) {
|
||||
path_name = "868MHz";
|
||||
}
|
||||
snprintf(buffer, sizeof(buffer), "Path: %d - %s", model->path, path_name);
|
||||
@@ -88,22 +88,20 @@ bool subghz_test_basic_input(InputEvent* event, void* context) {
|
||||
} else if(event->key == InputKeyDown) {
|
||||
if(model->path > 0) model->path--;
|
||||
} else if(event->key == InputKeyUp) {
|
||||
if(model->path < ApiHalSubGhzPath3) model->path++;
|
||||
if(model->path < ApiHalSubGhzPath868) model->path++;
|
||||
} else if(event->key == InputKeyOk) {
|
||||
if(model->status == SubghzTestBasicModelStatusTx) {
|
||||
model->status = SubghzTestBasicModelStatusRx;
|
||||
} else {
|
||||
model->status = SubghzTestBasicModelStatusTx;
|
||||
}
|
||||
}
|
||||
|
||||
model->real_frequency =
|
||||
api_hal_subghz_set_frequency(subghz_frequencies[model->frequency]);
|
||||
api_hal_subghz_set_frequency(subghz_frequencies[model->frequency].frequency);
|
||||
api_hal_subghz_set_path(model->path);
|
||||
}
|
||||
|
||||
if(event->key == InputKeyOk) {
|
||||
if(event->type == InputTypePress) {
|
||||
model->status = SubghzTestBasicModelStatusTx;
|
||||
} else if(event->type == InputTypeRelease) {
|
||||
model->status = SubghzTestBasicModelStatusRx;
|
||||
}
|
||||
}
|
||||
|
||||
if(model->status == SubghzTestBasicModelStatusRx) {
|
||||
hal_gpio_init(&gpio_cc1101_g0, GpioModeInput, GpioPullNo, GpioSpeedLow);
|
||||
api_hal_subghz_rx();
|
||||
@@ -131,9 +129,9 @@ void subghz_test_basic_enter(void* context) {
|
||||
|
||||
with_view_model(
|
||||
subghz_test_basic->view, (SubghzTestBasicModel * model) {
|
||||
model->frequency = 4; // 433
|
||||
model->frequency = subghz_frequencies_433_92; // 433
|
||||
model->real_frequency =
|
||||
api_hal_subghz_set_frequency(subghz_frequencies[model->frequency]);
|
||||
api_hal_subghz_set_frequency(subghz_frequencies[model->frequency].frequency);
|
||||
model->path = ApiHalSubGhzPathIsolate; // isolate
|
||||
model->rssi = 0.0f;
|
||||
model->status = SubghzTestBasicModelStatusRx;
|
||||
|
||||
Reference in New Issue
Block a user