Skip to content

Commit

Permalink
Show bypass before extend
Browse files Browse the repository at this point in the history
  • Loading branch information
Willy-JL committed Mar 19, 2024
1 parent a84e2ef commit a9fa995
Showing 1 changed file with 13 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,28 +2,29 @@

enum VarItemListIndex {
VarItemListIndexSubghzFreqs,
VarItemListIndexSubghzExtend,
VarItemListIndexSubghzBypass,
VarItemListIndexSubghzExtend,
VarItemListIndexGpioPins,
VarItemListIndexFileNamingPrefix,
};

void momentum_app_scene_protocols_var_item_list_callback(void* context, uint32_t index) {
MomentumApp* app = context;
view_dispatcher_send_custom_event(app->view_dispatcher, index);
}

static void momentum_app_scene_protocols_subghz_extend_changed(VariableItem* item) {
static void xtreme_app_scene_protocols_subghz_bypass_changed(VariableItem* item) {
MomentumApp* app = variable_item_get_context(item);
app->subghz_extend = variable_item_get_current_value_index(item);
variable_item_set_current_value_text(item, app->subghz_extend ? "ON" : "OFF");
app->subghz_bypass = variable_item_get_current_value_index(item);
variable_item_set_current_value_text(item, app->subghz_bypass ? "ON" : "OFF");
app->save_subghz = true;
app->require_reboot = true;
}

static void xtreme_app_scene_protocols_subghz_bypass_changed(VariableItem* item) {
static void momentum_app_scene_protocols_subghz_extend_changed(VariableItem* item) {
MomentumApp* app = variable_item_get_context(item);
app->subghz_bypass = variable_item_get_current_value_index(item);
variable_item_set_current_value_text(item, app->subghz_bypass ? "ON" : "OFF");
app->subghz_extend = variable_item_get_current_value_index(item);
variable_item_set_current_value_text(item, app->subghz_extend ? "ON" : "OFF");
app->save_subghz = true;
app->require_reboot = true;
}
Expand All @@ -44,16 +45,16 @@ void momentum_app_scene_protocols_on_enter(void* context) {
item = variable_item_list_add(var_item_list, "SubGHz Freqs", 0, NULL, app);
variable_item_set_current_value_text(item, ">");

item = variable_item_list_add(
var_item_list, "SubGHz Extend", 2, momentum_app_scene_protocols_subghz_extend_changed, app);
variable_item_set_current_value_index(item, app->subghz_extend);
variable_item_set_current_value_text(item, app->subghz_extend ? "ON" : "OFF");

item = variable_item_list_add(
var_item_list, "SubGHz Bypass", 2, xtreme_app_scene_protocols_subghz_bypass_changed, app);
variable_item_set_current_value_index(item, app->subghz_bypass);
variable_item_set_current_value_text(item, app->subghz_bypass ? "ON" : "OFF");

item = variable_item_list_add(
var_item_list, "SubGHz Extend", 2, momentum_app_scene_protocols_subghz_extend_changed, app);
variable_item_set_current_value_index(item, app->subghz_extend);
variable_item_set_current_value_text(item, app->subghz_extend ? "ON" : "OFF");

item = variable_item_list_add(var_item_list, "GPIO Pins", 0, NULL, app);
variable_item_set_current_value_text(item, ">");

Expand Down

0 comments on commit a9fa995

Please sign in to comment.