Преглед изворни кода

Revert "Cross Remote: No ext IR if using ext CC1101"

This reverts commit a0323eb3305d8d5db47c4ec18a08842170fccb66.
Willy-JL пре 10 месеци
родитељ
комит
67c6940641
1 измењених фајлова са 15 додато и 18 уклоњено
  1. 15 18
      cross_remote/xremote.c

+ 15 - 18
cross_remote/xremote.c

@@ -195,8 +195,6 @@ void xremote_text_input_callback(void* context) {
 
 int32_t xremote_app(void* p) {
     UNUSED(p);
-    bool otg_was_enabled = furi_hal_power_is_otg_enabled();
-
     XRemote* app = xremote_app_alloc();
 
     view_dispatcher_attach_to_gui(app->view_dispatcher, app->gui, ViewDispatcherTypeFullscreen);
@@ -207,25 +205,24 @@ int32_t xremote_app(void* p) {
 
     furi_hal_power_suppress_charge_enter();
 
-    if(strcmp(subghz_txrx_radio_device_get_name(app->subghz->txrx), "cc1101_ext") != 0) {
-        InfraredSettings settings = {0};
-        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) {
-                if(settings.otg_enabled) {
-                    furi_hal_power_enable_otg();
-                } else {
-                    furi_hal_power_disable_otg();
-                }
-            }
-        } else {
-            FuriHalInfraredTxPin tx_pin_detected = furi_hal_infrared_detect_tx_output();
-            furi_hal_infrared_set_tx_output(tx_pin_detected);
-            if(tx_pin_detected != FuriHalInfraredTxPinInternal) {
+    bool otg_was_enabled = furi_hal_power_is_otg_enabled();
+    InfraredSettings settings = {0};
+    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) {
+            if(settings.otg_enabled) {
                 furi_hal_power_enable_otg();
+            } else {
+                furi_hal_power_disable_otg();
             }
         }
+    } else {
+        FuriHalInfraredTxPin tx_pin_detected = furi_hal_infrared_detect_tx_output();
+        furi_hal_infrared_set_tx_output(tx_pin_detected);
+        if(tx_pin_detected != FuriHalInfraredTxPinInternal) {
+            furi_hal_power_enable_otg();
+        }
     }
 
     view_dispatcher_run(app->view_dispatcher);