소스 검색

Merge quac from https://github.com/xMasterX/all-the-plugins

# Conflicts:
#	quac/actions/action_ir.c
Willy-JL 1 년 전
부모
커밋
eebe66c11c
1개의 변경된 파일9개의 추가작업 그리고 4개의 파일을 삭제
  1. 9 4
      quac/actions/action_ir.c

+ 9 - 4
quac/actions/action_ir.c

@@ -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();
+        }
+    }
 }