in UART_BasicExample_bbbAM335x_armTestProject's function UART_test_trglvl(...)
there are the code
for ( i = -1; i < 2; i++)
{
uart = UART_open(uartTestInstance, &uartParams);
if (uart == NULL)
{
goto Err;
}
if (UART_test_trglvl_xfer(uart, dmaMode, (uint32_t)(uintptr_t)(txTrigLvl + i)) == false)
{
goto Err;
}
if (uart)
{
UART_close(uart);
uart = NULL;
}
uart = UART_open(uartTestInstance, &uartParams);
if (uart == NULL)
{
goto Err;
}
if (UART_test_trglvl_xfer(uart, dmaMode, (uint32_t)(uintptr_t)(rxTrigLvl + i)) == false)
{
goto Err;
}
if (uart)
{
UART_close(uart);
uart = NULL;
}
}
My question is why we need to callopen and close twice? Thanks