Verified Commit 940708d0 authored by Rahix's avatar Rahix
Browse files

fix(epicardium): Reenable cdcacm

parent 6f8e69c3
Pipeline #927 passed with stage
in 1 minute and 51 seconds
...@@ -172,6 +172,8 @@ void cdcacm_init(void) ...@@ -172,6 +172,8 @@ void cdcacm_init(void)
/* Start with USB in low power mode */ /* Start with USB in low power mode */
usb_app_sleep(); usb_app_sleep();
/* TODO: Fix priority */
NVIC_SetPriority(USB_IRQn, 6);
NVIC_EnableIRQ(USB_IRQn); NVIC_EnableIRQ(USB_IRQn);
} }
...@@ -338,9 +340,19 @@ static int usb_read_callback(void) ...@@ -338,9 +340,19 @@ static int usb_read_callback(void)
} }
/******************************************************************************/ /******************************************************************************/
#include "FreeRTOS.h"
#include "task.h"
extern TaskHandle_t serial_task_id;
void USB_IRQHandler(void) void USB_IRQHandler(void)
{ {
usb_event_handler(); usb_event_handler();
if (serial_task_id != NULL) {
BaseType_t xHigherPriorityTaskWoken = pdFALSE;
vTaskNotifyGiveFromISR(serial_task_id, &xHigherPriorityTaskWoken);
portYIELD_FROM_ISR(xHigherPriorityTaskWoken);
}
} }
/******************************************************************************/ /******************************************************************************/
......
...@@ -13,7 +13,7 @@ ...@@ -13,7 +13,7 @@
#include "queue.h" #include "queue.h"
/* Task ID for the serial handler */ /* Task ID for the serial handler */
TaskHandle_t serial_task_id; TaskHandle_t serial_task_id = NULL;
/* The serial console in use (UART0) */ /* The serial console in use (UART0) */
extern mxc_uart_regs_t* ConsoleUart; extern mxc_uart_regs_t* ConsoleUart;
...@@ -109,5 +109,9 @@ void vSerialTask(void*pvParameters) ...@@ -109,5 +109,9 @@ void vSerialTask(void*pvParameters)
while (UART_NumReadAvail(ConsoleUart) > 0) { while (UART_NumReadAvail(ConsoleUart) > 0) {
enqueue_char(UART_ReadByte(ConsoleUart)); enqueue_char(UART_ReadByte(ConsoleUart));
} }
while (cdcacm_num_read_avail() > 0) {
enqueue_char(cdcacm_read());
}
} }
} }
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment