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

Fix UART deinit issues in multiple apps

Also thanks to Willy-JL for finding the issue and fixing part of the apps
MX пре 1 година
родитељ
комит
615e88e285
1 измењених фајлова са 5 додато и 4 уклоњено
  1. 5 4
      views/camera_suite_view_camera.c

+ 5 - 4
views/camera_suite_view_camera.c

@@ -634,6 +634,11 @@ CameraSuiteViewCamera* camera_suite_view_camera_alloc() {
 void camera_suite_view_camera_free(CameraSuiteViewCamera* instance) {
 void camera_suite_view_camera_free(CameraSuiteViewCamera* instance) {
     furi_assert(instance);
     furi_assert(instance);
 
 
+    // Deinitialize the serial handle and release the control.
+    furi_hal_serial_async_rx_stop(instance->serial_handle);
+    furi_hal_serial_deinit(instance->serial_handle);
+    furi_hal_serial_control_release(instance->serial_handle);
+
     // Free the worker thread.
     // Free the worker thread.
     furi_thread_flags_set(furi_thread_get_id(instance->camera_worker_thread), WorkerEventStop);
     furi_thread_flags_set(furi_thread_get_id(instance->camera_worker_thread), WorkerEventStop);
     furi_thread_join(instance->camera_worker_thread);
     furi_thread_join(instance->camera_worker_thread);
@@ -642,10 +647,6 @@ void camera_suite_view_camera_free(CameraSuiteViewCamera* instance) {
     // Free the allocated stream buffer.
     // Free the allocated stream buffer.
     furi_stream_buffer_free(instance->camera_rx_stream);
     furi_stream_buffer_free(instance->camera_rx_stream);
 
 
-    // Deinitialize the serial handle and release the control.
-    furi_hal_serial_deinit(instance->serial_handle);
-    furi_hal_serial_control_release(instance->serial_handle);
-
     with_view_model(
     with_view_model(
         instance->view, UartDumpModel * model, { UNUSED(model); }, true);
         instance->view, UartDumpModel * model, { UNUSED(model); }, true);
     view_free(instance->view);
     view_free(instance->view);