Skip to content

Commit

Permalink
Infrared: Use new settings loading
Browse files Browse the repository at this point in the history
  • Loading branch information
Willy-JL committed Jan 22, 2025
1 parent b1d5158 commit 337177a
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 21 deletions.
9 changes: 2 additions & 7 deletions ir_intervalometer/intervalometer.c
Original file line number Diff line number Diff line change
Expand Up @@ -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>
Expand Down Expand Up @@ -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) {
Expand Down
9 changes: 2 additions & 7 deletions ir_remote/infrared_remote_app.c
Original file line number Diff line number Diff line change
Expand Up @@ -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>
Expand Down Expand Up @@ -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) {
Expand Down
9 changes: 2 additions & 7 deletions xremote/xremote.c
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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) {
Expand Down

0 comments on commit 337177a

Please sign in to comment.