Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
L
Linac-200 Gun Server
Manage
Activity
Members
Plan
Redmine
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Model registry
Analyze
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Mikhail Nozdrin
Linac-200 Gun Server
Commits
57a88459
Commit
57a88459
authored
4 years ago
by
Mikhail Nozdrin
Browse files
Options
Downloads
Patches
Plain Diff
0.12. Added input buffer clearing in send_ctrl_msg
parent
88c27acd
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
Gun.cpp
+5
-0
5 additions, 0 deletions
Gun.cpp
changelog.txt
+6
-0
6 additions, 0 deletions
changelog.txt
with
11 additions
and
0 deletions
Gun.cpp
+
5
−
0
View file @
57a88459
...
...
@@ -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
++
)
...
...
This diff is collapsed.
Click to expand it.
changelog.txt
+
6
−
0
View file @
57a88459
-------------------------------------------------------------------------------
Version 0.12
-------------------------------------------------------------------------------
- Added input buffer clearing before sending message to the controller
-------------------------------------------------------------------------------
Version 0.11
-------------------------------------------------------------------------------
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment