|
|
@@ -5,7 +5,6 @@
|
|
|
#include <furi.h>
|
|
|
#include <furi_hal.h>
|
|
|
#include <furi_hal_power.h>
|
|
|
-#include <furi_hal_console.h>
|
|
|
#include <gui/gui.h>
|
|
|
#include <input/input.h>
|
|
|
#include <stdlib.h>
|
|
|
@@ -183,7 +182,7 @@ int32_t hc_sr04_app() {
|
|
|
|
|
|
hc_sr04_state_init(plugin_state);
|
|
|
|
|
|
- furi_hal_console_disable();
|
|
|
+ FuriHalSerialHandle* serial_handle = furi_hal_serial_control_acquire(FuriHalSerialIdUsart);
|
|
|
|
|
|
plugin_state->mutex = furi_mutex_alloc(FuriMutexTypeNormal);
|
|
|
if(!plugin_state->mutex) {
|
|
|
@@ -191,7 +190,7 @@ int32_t hc_sr04_app() {
|
|
|
if(furi_hal_power_is_otg_enabled()) {
|
|
|
furi_hal_power_disable_otg();
|
|
|
}
|
|
|
- furi_hal_console_enable();
|
|
|
+ furi_hal_serial_control_release(serial_handle);
|
|
|
furi_hal_power_suppress_charge_exit();
|
|
|
furi_message_queue_free(event_queue);
|
|
|
free(plugin_state);
|
|
|
@@ -260,7 +259,7 @@ int32_t hc_sr04_app() {
|
|
|
GpioPullUp,
|
|
|
GpioSpeedVeryHigh,
|
|
|
GpioAltFn7USART1);
|
|
|
- furi_hal_console_enable();
|
|
|
+ furi_hal_serial_control_release(serial_handle);
|
|
|
|
|
|
view_port_enabled_set(view_port, false);
|
|
|
gui_remove_view_port(gui, view_port);
|