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