Skip to content
Snippets Groups Projects
Commit 57a88459 authored by Mikhail Nozdrin's avatar Mikhail Nozdrin
Browse files

0.12. Added input buffer clearing in send_ctrl_msg

parent 88c27acd
No related branches found
No related tags found
No related merge requests found
......@@ -932,6 +932,11 @@ void Gun::send_ctrl_msg(unsigned char b1, unsigned char b2, unsigned char b3, un
unsigned char command[1]; // Data to write
// Clear input buffer (to prevent wrong behavior if some trash is left there, e.g. from the corrupted previous message)
// NOTE: when trying to clear also output buffer (TCIOFLUSH) program stops working correctly (Global error 1)
// (reason unknown)
tcflush(fd, TCIFLUSH);
ioctl(fd, TIOCMBIC, &RTS_flag); // Drop RTS
for (int i = 0; i < 4; i++)
......
-------------------------------------------------------------------------------
Version 0.12
-------------------------------------------------------------------------------
- Added input buffer clearing before sending message to the controller
-------------------------------------------------------------------------------
Version 0.11
-------------------------------------------------------------------------------
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment