summaryrefslogtreecommitdiff
path: root/bsp/simlinux
diff options
context:
space:
mode:
authorprife <[email protected]>2013-01-15 21:38:54 +0800
committerprife <[email protected]>2013-01-15 21:38:54 +0800
commit395178ebfae6033d578193ed8b855fa196a1f408 (patch)
treef6af12af31f0dd8288f7ef32335530c69507921b /bsp/simlinux
parentf0d6e0e17366987a8c5c5bb0883e52f6801663f3 (diff)
rewrite cpu_port.c (but still has bug)
Diffstat (limited to 'bsp/simlinux')
-rwxr-xr-xbsp/simlinux/drivers/usart_sim.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/bsp/simlinux/drivers/usart_sim.c b/bsp/simlinux/drivers/usart_sim.c
index e554fbb55a..5ce223fb2b 100755
--- a/bsp/simlinux/drivers/usart_sim.c
+++ b/bsp/simlinux/drivers/usart_sim.c
@@ -56,6 +56,7 @@ void rt_hw_usart_init(void)
#include <pthread.h>
#include <semaphore.h>
#include <stdlib.h>
+#include <signal.h>
#include <termios.h> /* for tcxxxattr, ECHO, etc */
#include <unistd.h> /* for STDIN_FILENO */
@@ -122,7 +123,7 @@ static int savekey(unsigned char key)
serial_device.rx_indicate(&serial_device, rx_length);
}
- return 0;
+ return 0;
}
#ifdef _WIN32
static DWORD WINAPI ThreadforKeyGet(LPVOID lpParam)
@@ -148,11 +149,14 @@ static void * ThreadforKeyGet(void * lpParam)
{
unsigned char key;
- (void)lpParam; //prevent compiler warnings
#ifndef _WIN32
+ sigset_t sigmask, oldmask;
/* set the getchar without buffer */
+ sigfillset(&sigmask);
+ pthread_sigmask(SIG_BLOCK, &sigmask, &oldmask);
setgetchar();
#endif
+ (void)lpParam; //prevent compiler warnings
for (;;)
{
key = getch();