Skip to content

Commit

Permalink
added update to 690
Browse files Browse the repository at this point in the history
  • Loading branch information
EricB-ADI committed May 10, 2024
1 parent f9e5cfb commit e372fac
Show file tree
Hide file tree
Showing 2 changed files with 37 additions and 21 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -84,13 +84,12 @@ static struct {
/*************************************************************************************************/
void UART_CommonHandler(mxc_uart_regs_t *uart)
{
int32_t err = MXC_UART_AsyncHandler(uart);
const int32_t err = MXC_UART_AsyncHandler(uart);

if(err == E_INVALID)
{
// If the uart is the console, we can try to recover since it is not critical
uint8_t uartIdx = MXC_UART_GET_IDX(uart);
if(uartIdx == CONSOLE_UART)
if(MXC_UART_GET_IDX(uart) == CONSOLE_UART)
{
MXC_UART_ClearRXFIFO(uart);
}
Expand All @@ -99,11 +98,14 @@ void UART_CommonHandler(mxc_uart_regs_t *uart)
PAL_SYS_ASSERT(err == E_NO_ERROR);
}
}

}
void UART0_IRQHandler(void)
{

PalLedOn(PAL_LED_ID_CPU_ACTIVE);
UART_CommonHandler(MXC_UART0);

}
void UART1_IRQHandler(void)
{
Expand All @@ -113,15 +115,15 @@ void UART1_IRQHandler(void)

}
void UART2_IRQHandler(void)
{
{

PalLedOn(PAL_LED_ID_CPU_ACTIVE);
UART_CommonHandler(MXC_UART2);

}
void UART3_IRQHandler(void)
{

PalLedOn(PAL_LED_ID_CPU_ACTIVE);
UART_CommonHandler(MXC_UART3);

Expand Down
46 changes: 30 additions & 16 deletions Libraries/Cordio/platform/targets/maxim/max32690/sources/pal_uart.c
Original file line number Diff line number Diff line change
Expand Up @@ -82,37 +82,51 @@ static struct {
* \return None.
*/
/*************************************************************************************************/
void UART_CommonHandler(mxc_uart_regs_t *uart)
{
const int32_t err = MXC_UART_AsyncHandler(uart);

if(err == E_INVALID)
{
// If the uart is the console, we can try to recover since it is not critical
if(MXC_UART_GET_IDX(uart) == CONSOLE_UART)
{
MXC_UART_ClearRXFIFO(uart);
}
else
{
PAL_SYS_ASSERT(err == E_NO_ERROR);
}
}

}
void UART0_IRQHandler(void)
{
int result0;

PalLedOn(PAL_LED_ID_CPU_ACTIVE);
result0 = MXC_UART_AsyncHandler(MXC_UART0);
(void)result0;
PAL_SYS_ASSERT(result0 == 0);
UART_CommonHandler(MXC_UART0);

}
void UART1_IRQHandler(void)
{
int result1;

PalLedOn(PAL_LED_ID_CPU_ACTIVE);
result1 = MXC_UART_AsyncHandler(MXC_UART1);
(void)result1;
PAL_SYS_ASSERT(result1 == 0);
UART_CommonHandler(MXC_UART1);

}
void UART2_IRQHandler(void)
{
int result2;

PalLedOn(PAL_LED_ID_CPU_ACTIVE);
result2 = MXC_UART_AsyncHandler(MXC_UART2);
(void)result2;
PAL_SYS_ASSERT(result2 == 0);
UART_CommonHandler(MXC_UART2);

}
void UART3_IRQHandler(void)
{
int result3;

PalLedOn(PAL_LED_ID_CPU_ACTIVE);
result3 = MXC_UART_AsyncHandler(MXC_UART3);
(void)result3;
PAL_SYS_ASSERT(result3 == 0);
UART_CommonHandler(MXC_UART3);

}

/*************************************************************************************************/
Expand Down

0 comments on commit e372fac

Please sign in to comment.