Skip to content

Commit

Permalink
Revert "fix(BLE): Update PAL_UART to recover from error (#999)"
Browse files Browse the repository at this point in the history
This reverts commit 62377a9.
  • Loading branch information
EricB-ADI committed Aug 21, 2024
1 parent 3b5904e commit 28f410c
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 63 deletions.
50 changes: 17 additions & 33 deletions Libraries/Cordio/platform/targets/maxim/max32655/sources/pal_uart.c
Original file line number Diff line number Diff line change
Expand Up @@ -82,51 +82,37 @@ 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);
UART_CommonHandler(MXC_UART0);

result0 = MXC_UART_AsyncHandler(MXC_UART0);
(void)result0;
PAL_SYS_ASSERT(result0 == 0);
}
void UART1_IRQHandler(void)
{

int result1;
PalLedOn(PAL_LED_ID_CPU_ACTIVE);
UART_CommonHandler(MXC_UART1);

result1 = MXC_UART_AsyncHandler(MXC_UART1);
(void)result1;
PAL_SYS_ASSERT(result1 == 0);
}
void UART2_IRQHandler(void)
{

{
int result2;
PalLedOn(PAL_LED_ID_CPU_ACTIVE);
UART_CommonHandler(MXC_UART2);

result2 = MXC_UART_AsyncHandler(MXC_UART2);
(void)result2;
PAL_SYS_ASSERT(result2 == 0);
}
void UART3_IRQHandler(void)
{

int result3;
PalLedOn(PAL_LED_ID_CPU_ACTIVE);
UART_CommonHandler(MXC_UART3);

result3 = MXC_UART_AsyncHandler(MXC_UART3);
(void)result3;
PAL_SYS_ASSERT(result3 == 0);
}

/*************************************************************************************************/
Expand Down Expand Up @@ -173,8 +159,6 @@ void RISCV_IRQHandler(void)
/*************************************************************************************************/
void palUartCallback(mxc_uart_req_t* req, int error)
{


int i;
for(i = 0; i < PAL_UARTS; i++) {
/* Find the corresponding rqeuest and call the callback */
Expand Down
46 changes: 16 additions & 30 deletions Libraries/Cordio/platform/targets/maxim/max32690/sources/pal_uart.c
Original file line number Diff line number Diff line change
Expand Up @@ -82,51 +82,37 @@ 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);
UART_CommonHandler(MXC_UART0);

result0 = MXC_UART_AsyncHandler(MXC_UART0);
(void)result0;
PAL_SYS_ASSERT(result0 == 0);
}
void UART1_IRQHandler(void)
{

int result1;
PalLedOn(PAL_LED_ID_CPU_ACTIVE);
UART_CommonHandler(MXC_UART1);

result1 = MXC_UART_AsyncHandler(MXC_UART1);
(void)result1;
PAL_SYS_ASSERT(result1 == 0);
}
void UART2_IRQHandler(void)
{

int result2;
PalLedOn(PAL_LED_ID_CPU_ACTIVE);
UART_CommonHandler(MXC_UART2);

result2 = MXC_UART_AsyncHandler(MXC_UART2);
(void)result2;
PAL_SYS_ASSERT(result2 == 0);
}
void UART3_IRQHandler(void)
{

int result3;
PalLedOn(PAL_LED_ID_CPU_ACTIVE);
UART_CommonHandler(MXC_UART3);

result3 = MXC_UART_AsyncHandler(MXC_UART3);
(void)result3;
PAL_SYS_ASSERT(result3 == 0);
}

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

0 comments on commit 28f410c

Please sign in to comment.