mirror of
https://git.savannah.nongnu.org/git/lwip.git
synced 2026-06-16 18:03:44 +08:00
implement 'keypressed()' in the unix port
Signed-off-by: Simon Goldschmidt <goldsimon@gmx.de>
This commit is contained in:
@@ -717,3 +717,14 @@ sys_arch_unprotect(sys_prot_t pval)
|
||||
}
|
||||
}
|
||||
#endif /* SYS_LIGHTWEIGHT_PROT */
|
||||
|
||||
/* get keyboard state to terminate the debug app by using select */
|
||||
int
|
||||
lwip_unix_keypressed(void)
|
||||
{
|
||||
struct timeval tv = { 0L, 0L };
|
||||
fd_set fds;
|
||||
FD_ZERO(&fds);
|
||||
FD_SET(0, &fds);
|
||||
return select(1, &fds, NULL, NULL, &tv);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user