So I made change on Serial buffer to 64 and I have my arrry buffer (msg_in[80])
my code is like this
Code: Select all
clearMSG_in();
sdWrite(&SD2,"2A0\r",4);
sdReadTimeout(&SD2,msg_in,64,500);
if(!strcmp(msg_in,"2A\r")){
return DONESUCCESS;
}
else{
chThdSleepMilliseconds(50);
}The sending is working perfect but in reading I got all the previous data left in sd buffer and I have problem to check the input.
So there are any solutions to solve this?
Thank you and Regards,
Saran