test
Fork of mbed-dev by
Diff: targets/TARGET_Maxim/TARGET_MAX32630/serial_api.c
- Revision:
- 171:19eb464bc2be
- Parent:
- 166:e614a9f1c9e2
--- a/targets/TARGET_Maxim/TARGET_MAX32630/serial_api.c Wed Jul 19 17:31:21 2017 +0100 +++ b/targets/TARGET_Maxim/TARGET_MAX32630/serial_api.c Thu Aug 03 13:13:39 2017 +0100 @@ -180,6 +180,10 @@ //****************************************************************************** void uart_handler(serial_t *obj) { + // clear interrupts + volatile uint32_t flags = obj->uart->intfl; + obj->uart->intfl = flags; + if (obj && obj->id) { irq_handler(obj->id, RxIrq); } @@ -200,6 +204,9 @@ //****************************************************************************** void serial_irq_set(serial_t *obj, SerialIrq irq, uint32_t enable) { + MBED_ASSERT(obj->index < MXC_CFG_UART_INSTANCES); + objs[obj->index] = obj; + switch (obj->index) { case 0: NVIC_SetVector(UART0_IRQn, (uint32_t)uart0_handler);