try clearing buffer before reading

pull/72/head
alanbjohnston 5 years ago committed by GitHub
parent 6971275a02
commit 2c78a95284
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -1199,6 +1199,11 @@ if (payload == ON)
STEMBoardFailure = 0; STEMBoardFailure = 0;
char c; char c;
int charss = serialDataAvail (uart_fd);
printf("Clearing buffer of %d chars \n", charss);
while ((charss-- > 0))
c = serialGetchar (uart_fd); // clear buffer
unsigned int waitTime; unsigned int waitTime;
int i = 0; int i = 0;
serialPutchar (uart_fd, '?'); serialPutchar (uart_fd, '?');

Loading…
Cancel
Save

Powered by TurnKey Linux.