xmos / fwk_io

I/O Framework
Other
2 stars 11 forks source link

Add device teardown methods for lib_uart #26

Open ed-xmos opened 2 years ago

ed-xmos commented 2 years ago

We potentially have a request to be able to instantiate UART Rx devices dynamically. Today we have rtos_uart_rx_init() and rtos_uart_rx_start() methods but no rtos_uart_rx_stop() and rtos_uart_rx_deinit().

Currently rtos_uart_rx_init spins off the xcore thread uart_rx_hil_thread and rtos_uart_rx_start enables the ISR and FreeRTOS uart_rx_app_thread. It should be possible to carefully release resources / undo ISR setup and then vTaskDelete both tasks.

The HIL thread underneath already has a uart_rx_deinit() method

Talking to @xmos-jmccarthy would be a good idea as there are likely gotchas in this approach.