Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
P
PHASE
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Wiki
Wiki
image/svg+xml
Discourse
Discourse
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Projects
PHASE
Commits
2a183e62
Commit
2a183e62
authored
Apr 13, 2011
by
Wesley W. Terpstra
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Windows doesn't have select, and we don't need it.
parent
50a42e25
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
16 deletions
+7
-16
main.cpp
src/main.cpp
+7
-16
No files found.
src/main.cpp
View file @
2a183e62
...
...
@@ -224,6 +224,8 @@ int main() {
signal
(
SIGINT
,
&
trapSIGINT
);
std
::
cerr
<<
"Executing break -- and entering pipe-mode"
<<
std
::
endl
;
uint8_t
buf
[
1024
];
while
(
1
)
{
// Poll device
try
{
...
...
@@ -233,22 +235,11 @@ int main() {
return
-
1
;
}
/* Check for stdin ready */
struct
timeval
tv
;
tv
.
tv_sec
=
0
;
tv
.
tv_usec
=
10000
;
/* 10ms */
fd_set
ifds
;
FD_ZERO
(
&
ifds
);
FD_SET
(
0
,
&
ifds
);
select
(
1
,
&
ifds
,
0
,
0
,
&
tv
);
if
(
FD_ISSET
(
0
,
&
ifds
))
{
uint8_t
buf
[
1024
];
int
got
=
read
(
0
,
buf
,
sizeof
(
buf
));
if
(
got
<=
0
)
break
;
// EOF
for
(
int
i
=
0
;
i
<
got
;
++
i
)
uart
(
Bits
(
buf
[
i
]));
}
// Get next command
int
got
=
read
(
0
,
buf
,
sizeof
(
buf
));
if
(
got
<=
0
)
break
;
// EOF
for
(
int
i
=
0
;
i
<
got
;
++
i
)
uart
(
Bits
(
buf
[
i
]));
}
return
0
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment