Skip to content

Commit f270146

Browse files
authored
Merge pull request #12052 from yarbcy/pr/fix-for-arm-issue-11860
fpga tests: clear uart fix Fixes #11860 (correction from the commit msg)
2 parents 06da499 + a79b1b3 commit f270146

File tree

2 files changed

+5
-0
lines changed
  • TESTS/mbed_hal_fpga_ci_test_shield/uart
  • targets/TARGET_Cypress/TARGET_PSOC6/psoc6csp/hal/src

2 files changed

+5
-0
lines changed

TESTS/mbed_hal_fpga_ci_test_shield/uart/main.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -133,6 +133,9 @@ static void uart_test_common(int baudrate, int data_bits, SerialParity parity, i
133133
serial_set_flow_control_direct(&serial, FlowControlRTSCTS, &pinmap);
134134
#else
135135
//skip this test case if static pinmap is not supported
136+
// Cleanup uart to be able execute next test case
137+
serial_free(&serial);
138+
tester.reset();
136139
return;
137140
#endif
138141
} else {

targets/TARGET_Cypress/TARGET_PSOC6/psoc6csp/hal/src/cyhal_uart.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -720,10 +720,12 @@ void cyhal_uart_enable_event(cyhal_uart_t *obj, cyhal_uart_event_t event, uint8_
720720
obj->irq_cause &= ~event;
721721
if (event & CYHAL_UART_IRQ_RX_NOT_EMPTY)
722722
{
723+
Cy_SCB_ClearRxInterrupt(obj->base, CY_SCB_RX_INTR_NOT_EMPTY);
723724
Cy_SCB_SetRxInterruptMask(obj->base, Cy_SCB_GetRxInterruptMask(obj->base) & ~CY_SCB_RX_INTR_NOT_EMPTY);
724725
}
725726
if (event & CYHAL_UART_IRQ_TX_EMPTY)
726727
{
728+
Cy_SCB_ClearTxInterrupt(obj->base, CY_SCB_UART_TX_EMPTY);
727729
Cy_SCB_SetTxInterruptMask(obj->base, Cy_SCB_GetTxInterruptMask(obj->base) & ~CY_SCB_UART_TX_EMPTY);
728730
}
729731
}

0 commit comments

Comments
 (0)