using the rs485 example code
void rs485_read_task
(
uint_32 initial_data
)
{
MQX_FILE_PTR rs485_dev = NULL;
char data_buffer[256];
rs485_dev = fopen( RS485_CHANNEL, NULL );
if( rs485_dev == NULL )
{
/* device could not be opened */
_task_block();
}
/* wait for data */
fread(data_buffer, 1, 18, rs485_dev);
while(1)
{
printf("\n - Buffer_DAta = %s Hz", &data_buffer);
};
}
The write task is printing the "RS485 example " in the serial terminal ,so write routine is working sine , but the read task is not reading the character typed on serial terminal . if anybody has tried this program please support anything to be modified .
Hi
As you are trying to read 18 bytes in the fread call, it will block the task until all 18 bytes are received in the buffer.
Try reading byte by byte..