Skip to content

Commit

Permalink
call disable and enable only if previous state is different
Browse files Browse the repository at this point in the history
  • Loading branch information
xMasterX committed Sep 6, 2024
1 parent e7fb7ba commit 5c15c76
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions non_catalog_apps/quac/actions/action_ir.c
Original file line number Diff line number Diff line change
Expand Up @@ -78,8 +78,13 @@ void action_ir_power_otg(bool enable) {

if(tx_pin_detected == FuriHalInfraredTxPinInternal) return;

if(enable)
furi_hal_power_enable_otg();
else
furi_hal_power_disable_otg();
if(enable) {
if(!furi_hal_power_is_otg_enabled()) {
furi_hal_power_enable_otg();
}
} else {
if(furi_hal_power_is_otg_enabled()) {
furi_hal_power_disable_otg();
}
}
}

0 comments on commit 5c15c76

Please sign in to comment.