camera_suite_uart.c 1.4 KB

123456789101112131415161718192021222324252627282930313233343536
  1. #include "camera_suite_uart.h"
  2. #include "../camera_suite.h"
  3. // void camera_suite_uart_alloc(CameraSuite* instance, FuriThreadCallback* callback) {
  4. // // Allocate a stream buffer
  5. // instance->rx_stream = furi_stream_buffer_alloc(2048, 1);
  6. // // Allocate a thread for this camera to run on.
  7. // FuriThread* thread = furi_thread_alloc_ex("UsbUartWorker", 2048, callback, instance);
  8. // instance->worker_thread = thread;
  9. // furi_thread_start(instance->worker_thread);
  10. // // Set up UART thread.
  11. // instance->serial_handle = furi_hal_serial_control_acquire(UART_CH);
  12. // furi_check(instance->serial_handle);
  13. // furi_hal_serial_init(instance->serial_handle, 230400);
  14. // // Enable UART1 and set the IRQ callback.
  15. // furi_hal_serial_async_rx_start(instance->serial_handle, callback, instance, false);
  16. // }
  17. // void camera_suite_uart_free(CameraSuite* app_instance) {
  18. // furi_assert(app_instance);
  19. // // Free the worker thread.
  20. // furi_thread_flags_set(furi_thread_get_id(app_instance->worker_thread), WorkerEventStop);
  21. // furi_thread_join(app_instance->worker_thread);
  22. // furi_thread_free(app_instance->worker_thread);
  23. // // Free the stream buffer.
  24. // furi_stream_buffer_free(app_instance->rx_stream);
  25. // // Free the serial handle.
  26. // furi_hal_serial_deinit(app_instance->serial_handle);
  27. // furi_hal_serial_control_release(app_instance->serial_handle);
  28. // }