UART echo app (#831)

* HAL: add context to UART IRQ's
* Apps: uart echo/log application
* Sync api
* Another api sync
This commit is contained in:
SG
2021-11-20 08:19:31 +10:00
committed by GitHub
parent 4303945748
commit 013ed64cbb
10 changed files with 498 additions and 107 deletions

View File

@@ -57,7 +57,7 @@ static CdcCallbacks cdc_cb = {
static int32_t usb_uart_tx_thread(void* context);
static void usb_uart_on_irq_cb(UartIrqEvent ev, uint8_t data) {
static void usb_uart_on_irq_cb(UartIrqEvent ev, uint8_t data, void* context) {
BaseType_t xHigherPriorityTaskWoken = pdFALSE;
if(ev == UartIrqEventRXNE) {
@@ -94,10 +94,10 @@ static int32_t usb_uart_worker(void* context) {
furi_hal_console_disable();
} else if(usb_uart->cfg.uart_ch == FuriHalUartIdLPUART1) {
furi_hal_uart_init(usb_uart->cfg.uart_ch, 115200);
furi_hal_uart_set_irq_cb(usb_uart->cfg.uart_ch, usb_uart_on_irq_cb);
furi_hal_uart_set_irq_cb(usb_uart->cfg.uart_ch, usb_uart_on_irq_cb, NULL);
}
furi_hal_uart_set_irq_cb(usb_uart->cfg.uart_ch, usb_uart_on_irq_cb);
furi_hal_uart_set_irq_cb(usb_uart->cfg.uart_ch, usb_uart_on_irq_cb, NULL);
if(usb_uart->cfg.baudrate != 0)
furi_hal_uart_set_br(usb_uart->cfg.uart_ch, usb_uart->cfg.baudrate);
else