Просмотр исходного кода

Infrared: Use new settings loading

Willy-JL 11 месяцев назад
Родитель
Сommit
337177af64
3 измененных файлов с 6 добавлено и 21 удалено
  1. 2 7
      ir_intervalometer/intervalometer.c
  2. 2 7
      ir_remote/infrared_remote_app.c
  3. 2 7
      xremote/xremote.c

+ 2 - 7
ir_intervalometer/intervalometer.c

@@ -13,7 +13,7 @@
 #include <gui/icon.h>
 #include <infrared_transmit.h>
 
-#include <infrared/infrared_app.h>
+#include <infrared/infrared_settings.h>
 #include <toolbox/saved_struct.h>
 
 #include <input/input.h>
@@ -634,12 +634,7 @@ int32_t flipvalo_app() {
 
     bool otg_was_enabled = furi_hal_power_is_otg_enabled();
     InfraredSettings settings = {0};
-    saved_struct_load(
-        INFRARED_SETTINGS_PATH,
-        &settings,
-        sizeof(InfraredSettings),
-        INFRARED_SETTINGS_MAGIC,
-        INFRARED_SETTINGS_VERSION);
+    infrared_settings_load(&settings);
     if(settings.tx_pin < FuriHalInfraredTxPinMax) {
         furi_hal_infrared_set_tx_output(settings.tx_pin);
         if(settings.otg_enabled != otg_was_enabled) {

+ 2 - 7
ir_remote/infrared_remote_app.c

@@ -8,7 +8,7 @@
 #include <dialogs/dialogs.h>
 #include <ir_remote_icons.h>
 
-#include <infrared/infrared_app.h>
+#include <infrared/infrared_settings.h>
 #include <toolbox/saved_struct.h>
 
 #include <notification/notification.h>
@@ -404,12 +404,7 @@ int32_t infrared_remote_app(char* p) {
 
     bool otg_was_enabled = furi_hal_power_is_otg_enabled();
     InfraredSettings settings = {0};
-    saved_struct_load(
-        INFRARED_SETTINGS_PATH,
-        &settings,
-        sizeof(InfraredSettings),
-        INFRARED_SETTINGS_MAGIC,
-        INFRARED_SETTINGS_VERSION);
+    infrared_settings_load(&settings);
     if(settings.tx_pin < FuriHalInfraredTxPinMax) {
         furi_hal_infrared_set_tx_output(settings.tx_pin);
         if(settings.otg_enabled != otg_was_enabled) {

+ 2 - 7
xremote/xremote.c

@@ -16,7 +16,7 @@
 #include "views/xremote_learn_view.h"
 #include "views/xremote_signal_view.h"
 
-#include <infrared/infrared_app.h>
+#include <infrared/infrared_settings.h>
 #include <toolbox/saved_struct.h>
 
 #define TAG "XRemote"
@@ -95,12 +95,7 @@ int32_t xremote_main(void* p) {
 
     bool otg_was_enabled = furi_hal_power_is_otg_enabled();
     InfraredSettings settings = {0};
-    saved_struct_load(
-        INFRARED_SETTINGS_PATH,
-        &settings,
-        sizeof(InfraredSettings),
-        INFRARED_SETTINGS_MAGIC,
-        INFRARED_SETTINGS_VERSION);
+    infrared_settings_load(&settings);
     if(settings.tx_pin < FuriHalInfraredTxPinMax) {
         furi_hal_infrared_set_tx_output(settings.tx_pin);
         if(settings.otg_enabled != otg_was_enabled) {