I've added new parameter to ioctl. From application now I can call:
ioctl ( ttya_handle, IO_IOCTL_DRAIN_INPUT, &attr );
In serl_int.c function _io_serial_int_ioctl I've added:
case IO_IOCTL_DRAIN_INPUT:
{
KUART_INFO_STRUCT_PTR sci_info_ptr;
sci_info_ptr = int_io_dev_ptr->DEV_INFO_PTR;
sci_info_ptr->SCI_PTR->CFIFO |= UART_CFIFO_RXFLUSH_MASK; // flush HW FIFO
_CHARQ_RESET(int_io_dev_ptr->IN_QUEUE); // flush SW queue
}
break;
The parameter is defined in io.h:
#define IO_IOCTL_DRAIN_INPUT _IO(IO_TYPE_MQX,0x0D)
This works for me :smileyhappy:
@Freescale: PLS could you add this code or similar in next MQX release? TIA