|
|
@@ -195,6 +195,8 @@ 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);
|
|
|
@@ -205,24 +207,25 @@ int32_t xremote_app(void* p) {
|
|
|
|
|
|
furi_hal_power_suppress_charge_enter();
|
|
|
|
|
|
- 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) {
|
|
|
+ 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) {
|
|
|
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);
|