diff --git a/bsp/simulator/applications/platform.c b/bsp/simulator/applications/platform.c index 1b7127e370a1c14392924ecd5200108a4aae9c8b..815c189e40d3e7ba04e76a121971ce5b864bd49f 100644 --- a/bsp/simulator/applications/platform.c +++ b/bsp/simulator/applications/platform.c @@ -11,6 +11,14 @@ #include +#ifdef RT_USING_POSIX +#error "simulator does not support RT_USING_POSIX" +#endif + +#ifdef RT_USING_LIBC +#error "simulator does not support RT_USING_LIBC" +#endif + int platform_init(void) { #ifdef RT_USING_LWIP diff --git a/bsp/simulator/drivers/board.c b/bsp/simulator/drivers/board.c index 17339d4e1a98dbc8627a87312b098242227a6537..0516af6f799aab6feb2d262a0db2862d4a852c2d 100755 --- a/bsp/simulator/drivers/board.c +++ b/bsp/simulator/drivers/board.c @@ -110,4 +110,10 @@ int rt_hw_board_init(void) #endif return 0; } + +void rt_hw_us_delay(rt_uint32_t usec) +{ + +} + /*@}*/ diff --git a/components/libc/compilers/common/nogcc/sys/select.h b/components/libc/compilers/common/nogcc/sys/select.h index 575ad3a1b59f0fea8b479c60891bdef45f44060e..02fb77dd89b17779a09be546b7461c1a3c84a6c3 100644 --- a/components/libc/compilers/common/nogcc/sys/select.h +++ b/components/libc/compilers/common/nogcc/sys/select.h @@ -15,6 +15,10 @@ #include #include +#ifdef _WIN32 +#include +#endif + #ifndef FD_SETSIZE #define FD_SETSIZE 32 #endif @@ -26,16 +30,17 @@ #define FD_SETSIZE DFS_FD_MAX #endif /* SAL_USING_POSIX */ -#define NBBY 8 /* number of bits in a byte */ - typedef long fd_mask; +#ifndef _WIN32 +#ifndef _SYS_TYPES_FD_SET /* MIPS */ + +#define NBBY 8 /* number of bits in a byte */ #define NFDBITS (sizeof (fd_mask) * NBBY) /* bits per mask */ #ifndef howmany #define howmany(x,y) (((x)+((y)-1))/(y)) #endif -#ifndef _SYS_TYPES_FD_SET /* MIPS */ typedef struct _types_fd_set { fd_mask fds_bits[howmany(FD_SETSIZE, NFDBITS)]; } _types_fd_set; @@ -48,5 +53,6 @@ typedef struct _types_fd_set { #endif /* _SYS_TYPES_FD_SET */ int select(int nfds, fd_set *readfds, fd_set *writefds, fd_set *exceptfds, struct timeval *timeout); +#endif /* _WIN32 */ #endif /* __SYS_SELECT_H__ */ diff --git a/components/libc/compilers/common/sys/ioctl.h b/components/libc/compilers/common/sys/ioctl.h index b926a7187532ab332deedf17a586a3b0e6d68db2..04f73837bcfdd90dcca9087e74fe814518769d2e 100644 --- a/components/libc/compilers/common/sys/ioctl.h +++ b/components/libc/compilers/common/sys/ioctl.h @@ -15,6 +15,10 @@ #include #endif +#ifdef _WIN32 +#include +#endif + struct winsize { unsigned short ws_row; unsigned short ws_col; @@ -35,8 +39,8 @@ struct winsize { #define FIONREAD _IOR('f', 127, int) /* get # bytes to read */ #define FIONBIO _IOW('f', 126, int) /* set/clear non-blocking i/o */ -#define FIONWRITE _IOR('f', 121, int) /* get # bytes outstanding in send queue */ #endif +#define FIONWRITE _IOR('f', 121, int) /* get # bytes outstanding in send queue */ #define TCGETS 0x5401 #define TCSETS 0x5402 diff --git a/components/libc/compilers/gcc/newlib/stdio.c b/components/libc/compilers/gcc/newlib/stdio.c index baccafad871de329ab34e95c3f6841640083a4eb..1875d50e3f443be2504a63768bed8b078b315393 100644 --- a/components/libc/compilers/gcc/newlib/stdio.c +++ b/components/libc/compilers/gcc/newlib/stdio.c @@ -72,7 +72,8 @@ int libc_stdio_set_console(const char* device_name, int mode) return -1; } -int libc_stdio_get_console(void) { +int libc_stdio_get_console(void) +{ if (std_console) return fileno(std_console); else