mirror of
https://github.com/DarkFlippers/unleashed-firmware
synced 2024-11-23 04:53:08 +00:00
parent
002e5cd9de
commit
9f71be6fef
1 changed files with 7 additions and 2 deletions
|
@ -13,11 +13,12 @@
|
||||||
#define INFRARED_TASK_STACK_SIZE (2048UL)
|
#define INFRARED_TASK_STACK_SIZE (2048UL)
|
||||||
|
|
||||||
#define INFRARED_SETTINGS_PATH INT_PATH(".infrared.settings")
|
#define INFRARED_SETTINGS_PATH INT_PATH(".infrared.settings")
|
||||||
#define INFRARED_SETTINGS_VERSION (0)
|
#define INFRARED_SETTINGS_VERSION (1)
|
||||||
#define INFRARED_SETTINGS_MAGIC (0x1F)
|
#define INFRARED_SETTINGS_MAGIC (0x1F)
|
||||||
|
|
||||||
typedef struct {
|
typedef struct {
|
||||||
uint8_t tx_pin;
|
FuriHalInfraredTxPin tx_pin;
|
||||||
|
bool otg_enabled;
|
||||||
} InfraredSettings;
|
} InfraredSettings;
|
||||||
|
|
||||||
static const NotificationSequence*
|
static const NotificationSequence*
|
||||||
|
@ -488,11 +489,15 @@ static void infrared_load_settings(InfraredApp* infrared) {
|
||||||
}
|
}
|
||||||
|
|
||||||
infrared_set_tx_pin(infrared, settings.tx_pin);
|
infrared_set_tx_pin(infrared, settings.tx_pin);
|
||||||
|
if(settings.tx_pin < FuriHalInfraredTxPinMax) {
|
||||||
|
infrared_enable_otg(infrared, settings.otg_enabled);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void infrared_save_settings(InfraredApp* infrared) {
|
void infrared_save_settings(InfraredApp* infrared) {
|
||||||
InfraredSettings settings = {
|
InfraredSettings settings = {
|
||||||
.tx_pin = infrared->app_state.tx_pin,
|
.tx_pin = infrared->app_state.tx_pin,
|
||||||
|
.otg_enabled = infrared->app_state.is_otg_enabled,
|
||||||
};
|
};
|
||||||
|
|
||||||
if(!saved_struct_save(
|
if(!saved_struct_save(
|
||||||
|
|
Loading…
Reference in a new issue