|
@@ -33,7 +33,14 @@ const uint32_t led_value[2] = {
|
|
|
XRemoteLedOff,
|
|
XRemoteLedOff,
|
|
|
XRemoteLedOn,
|
|
XRemoteLedOn,
|
|
|
};
|
|
};
|
|
|
-
|
|
|
|
|
|
|
+const char* const loop_text[2] = {
|
|
|
|
|
+ "OFF",
|
|
|
|
|
+ "ON",
|
|
|
|
|
+};
|
|
|
|
|
+const uint32_t loop_value[2] = {
|
|
|
|
|
+ XRemoteLoopOff,
|
|
|
|
|
+ XRemoteLoopOn,
|
|
|
|
|
+};
|
|
|
const char* const settings_text[2] = {
|
|
const char* const settings_text[2] = {
|
|
|
"OFF",
|
|
"OFF",
|
|
|
"ON",
|
|
"ON",
|
|
@@ -72,6 +79,13 @@ static void xremote_scene_settings_set_save_settings(VariableItem* item) {
|
|
|
app->save_settings = settings_value[index];
|
|
app->save_settings = settings_value[index];
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+static void xremote_scene_settings_set_loop(VariableItem* item) {
|
|
|
|
|
+ XRemote* app = variable_item_get_context(item);
|
|
|
|
|
+ uint8_t index = variable_item_get_current_value_index(item);
|
|
|
|
|
+ variable_item_set_current_value_text(item, loop_text[index]);
|
|
|
|
|
+ app->loopir = loop_value[index];
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
static void xremote_scene_settings_set_ir_timing(VariableItem* item) {
|
|
static void xremote_scene_settings_set_ir_timing(VariableItem* item) {
|
|
|
XRemote* app = variable_item_get_context(item);
|
|
XRemote* app = variable_item_get_context(item);
|
|
|
uint32_t index = variable_item_get_current_value_index(item);
|
|
uint32_t index = variable_item_get_current_value_index(item);
|
|
@@ -121,6 +135,13 @@ void xremote_scene_settings_on_enter(void* context) {
|
|
|
variable_item_set_current_value_index(item, value_index);
|
|
variable_item_set_current_value_index(item, value_index);
|
|
|
variable_item_set_current_value_text(item, led_text[value_index]);
|
|
variable_item_set_current_value_text(item, led_text[value_index]);
|
|
|
|
|
|
|
|
|
|
+ /* NEW: Loop saved command functionality */
|
|
|
|
|
+ item = variable_item_list_add(
|
|
|
|
|
+ app->variable_item_list, "Loop IR", 2, xremote_scene_settings_set_loop, app);
|
|
|
|
|
+ value_index = value_index_uint32(app->loopir, loop_value, 2);
|
|
|
|
|
+ variable_item_set_current_value_index(item, value_index);
|
|
|
|
|
+ variable_item_set_current_value_text(item, loop_text[value_index]);
|
|
|
|
|
+
|
|
|
// Save Settings to File
|
|
// Save Settings to File
|
|
|
item = variable_item_list_add(
|
|
item = variable_item_list_add(
|
|
|
app->variable_item_list, "Save Settings", 2, xremote_scene_settings_set_save_settings, app);
|
|
app->variable_item_list, "Save Settings", 2, xremote_scene_settings_set_save_settings, app);
|