mirror of
https://github.com/lwip-tcpip/lwip.git
synced 2025-03-09 22:13:23 +00:00
implement 'keypressed()' in the unix port
Signed-off-by: Simon Goldschmidt <goldsimon@gmx.de>
This commit is contained in:
parent
7c10065bd2
commit
f272a75b6a
@ -59,5 +59,8 @@ typedef struct sys_mbox * sys_mbox_t;
|
||||
struct sys_thread;
|
||||
typedef struct sys_thread * sys_thread_t;
|
||||
|
||||
#define LWIP_EXAMPLE_APP_ABORT() lwip_unix_keypressed()
|
||||
int lwip_unix_keypressed(void);
|
||||
|
||||
#endif /* LWIP_ARCH_SYS_ARCH_H */
|
||||
|
||||
|
@ -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);
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user