mirror of
https://github.com/DarkFlippers/unleashed-firmware
synced 2024-11-10 06:54:19 +00:00
extra checks [ci skip]
This commit is contained in:
parent
b6644d7727
commit
80ad381eef
6 changed files with 14 additions and 14 deletions
|
@ -80,9 +80,9 @@ bool gpio_scene_start_on_event(void* context, SceneManagerEvent event) {
|
|||
|
||||
if(event.type == SceneManagerEventTypeCustom) {
|
||||
if(event.event == GpioStartEventOtgOn) {
|
||||
furi_hal_power_enable_otg();
|
||||
if(!furi_hal_power_is_otg_enabled()) furi_hal_power_enable_otg();
|
||||
} else if(event.event == GpioStartEventOtgOff) {
|
||||
furi_hal_power_disable_otg();
|
||||
if(furi_hal_power_is_otg_enabled()) furi_hal_power_disable_otg();
|
||||
} else if(event.event == GpioStartEventManualControl) {
|
||||
scene_manager_set_scene_state(app->scene_manager, GpioSceneStart, GpioItemTest);
|
||||
scene_manager_next_scene(app->scene_manager, GpioSceneTest);
|
||||
|
|
|
@ -460,9 +460,9 @@ void infrared_set_tx_pin(InfraredApp* infrared, FuriHalInfraredTxPin tx_pin) {
|
|||
|
||||
void infrared_enable_otg(InfraredApp* infrared, bool enable) {
|
||||
if(enable) {
|
||||
furi_hal_power_enable_otg();
|
||||
if(!furi_hal_power_is_otg_enabled()) furi_hal_power_enable_otg();
|
||||
} else {
|
||||
furi_hal_power_disable_otg();
|
||||
if(furi_hal_power_is_otg_enabled()) furi_hal_power_disable_otg();
|
||||
}
|
||||
infrared->app_state.is_otg_enabled = enable;
|
||||
}
|
||||
|
|
|
@ -20,7 +20,7 @@ static void onewire_cli_search(Cli* cli) {
|
|||
printf("Search started\r\n");
|
||||
|
||||
onewire_host_start(onewire);
|
||||
furi_hal_power_enable_otg();
|
||||
if(!furi_hal_power_is_otg_enabled()) furi_hal_power_enable_otg();
|
||||
|
||||
while(!done) {
|
||||
if(onewire_host_search(onewire, address, OneWireHostSearchModeNormal) != 1) {
|
||||
|
@ -37,7 +37,7 @@ static void onewire_cli_search(Cli* cli) {
|
|||
furi_delay_ms(100);
|
||||
}
|
||||
|
||||
furi_hal_power_disable_otg();
|
||||
if(furi_hal_power_is_otg_enabled()) furi_hal_power_disable_otg();
|
||||
onewire_host_free(onewire);
|
||||
}
|
||||
|
||||
|
|
|
@ -250,9 +250,9 @@ static bool expansion_worker_handle_state_connected(
|
|||
if(!expansion_worker_rpc_session_open(instance)) break;
|
||||
instance->state = ExpansionWorkerStateRpcActive;
|
||||
} else if(command == ExpansionFrameControlCommandEnableOtg) {
|
||||
furi_hal_power_enable_otg();
|
||||
if(!furi_hal_power_is_otg_enabled()) furi_hal_power_enable_otg();
|
||||
} else if(command == ExpansionFrameControlCommandDisableOtg) {
|
||||
furi_hal_power_disable_otg();
|
||||
if(furi_hal_power_is_otg_enabled()) furi_hal_power_disable_otg();
|
||||
} else {
|
||||
break;
|
||||
}
|
||||
|
|
|
@ -219,9 +219,9 @@ void rpc_system_gpio_set_otg_mode(const PB_Main* request, void* context) {
|
|||
const PB_Gpio_GpioOtgMode mode = request->content.gpio_set_otg_mode.mode;
|
||||
|
||||
if(mode == PB_Gpio_GpioOtgMode_OFF) {
|
||||
furi_hal_power_disable_otg();
|
||||
if(furi_hal_power_is_otg_enabled()) furi_hal_power_disable_otg();
|
||||
} else {
|
||||
furi_hal_power_enable_otg();
|
||||
if(!furi_hal_power_is_otg_enabled()) furi_hal_power_enable_otg();
|
||||
}
|
||||
|
||||
rpc_send_and_release_empty(session, request->command_id, PB_CommandStatus_OK);
|
||||
|
|
|
@ -75,7 +75,7 @@ void ibutton_worker_mode_idle_stop(iButtonWorker* worker) {
|
|||
|
||||
void ibutton_worker_mode_read_start(iButtonWorker* worker) {
|
||||
UNUSED(worker);
|
||||
furi_hal_power_enable_otg();
|
||||
if(!furi_hal_power_is_otg_enabled()) furi_hal_power_enable_otg();
|
||||
}
|
||||
|
||||
void ibutton_worker_mode_read_tick(iButtonWorker* worker) {
|
||||
|
@ -90,7 +90,7 @@ void ibutton_worker_mode_read_tick(iButtonWorker* worker) {
|
|||
|
||||
void ibutton_worker_mode_read_stop(iButtonWorker* worker) {
|
||||
UNUSED(worker);
|
||||
furi_hal_power_disable_otg();
|
||||
if(furi_hal_power_is_otg_enabled()) furi_hal_power_disable_otg();
|
||||
}
|
||||
|
||||
/*********************** EMULATE ***********************/
|
||||
|
@ -120,7 +120,7 @@ void ibutton_worker_mode_emulate_stop(iButtonWorker* worker) {
|
|||
|
||||
void ibutton_worker_mode_write_common_start(iButtonWorker* worker) { //-V524
|
||||
UNUSED(worker);
|
||||
furi_hal_power_enable_otg();
|
||||
if(!furi_hal_power_is_otg_enabled()) furi_hal_power_enable_otg();
|
||||
}
|
||||
|
||||
void ibutton_worker_mode_write_id_tick(iButtonWorker* worker) {
|
||||
|
@ -149,5 +149,5 @@ void ibutton_worker_mode_write_copy_tick(iButtonWorker* worker) {
|
|||
|
||||
void ibutton_worker_mode_write_common_stop(iButtonWorker* worker) { //-V524
|
||||
UNUSED(worker);
|
||||
furi_hal_power_disable_otg();
|
||||
if(furi_hal_power_is_otg_enabled()) furi_hal_power_disable_otg();
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue