Skip to content

Commit 5ab2901

Browse files
authored
Merge pull request #5168 from mysterywolf/str
2 parents 33263d7 + 8f62601 commit 5ab2901

File tree

5 files changed

+30
-5
lines changed

5 files changed

+30
-5
lines changed

bsp/simulator/applications/platform.c

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,14 @@
1111

1212
#include <shell.h>
1313

14+
#ifdef RT_USING_POSIX
15+
#error "simulator does not support RT_USING_POSIX"
16+
#endif
17+
18+
#ifdef RT_USING_LIBC
19+
#error "simulator does not support RT_USING_LIBC"
20+
#endif
21+
1422
int platform_init(void)
1523
{
1624
#ifdef RT_USING_LWIP

bsp/simulator/drivers/board.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -110,4 +110,10 @@ int rt_hw_board_init(void)
110110
#endif
111111
return 0;
112112
}
113+
114+
void rt_hw_us_delay(rt_uint32_t usec)
115+
{
116+
117+
}
118+
113119
/*@}*/

components/libc/compilers/common/nogcc/sys/select.h

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,10 @@
1515
#include <sys/types.h>
1616
#include <sys/time.h>
1717

18+
#ifdef _WIN32
19+
#include <winsock.h>
20+
#endif
21+
1822
#ifndef FD_SETSIZE
1923
#define FD_SETSIZE 32
2024
#endif
@@ -26,16 +30,17 @@
2630
#define FD_SETSIZE DFS_FD_MAX
2731
#endif /* SAL_USING_POSIX */
2832

29-
#define NBBY 8 /* number of bits in a byte */
30-
3133
typedef long fd_mask;
3234

35+
#ifndef _WIN32
36+
#ifndef _SYS_TYPES_FD_SET /* MIPS */
37+
38+
#define NBBY 8 /* number of bits in a byte */
3339
#define NFDBITS (sizeof (fd_mask) * NBBY) /* bits per mask */
3440
#ifndef howmany
3541
#define howmany(x,y) (((x)+((y)-1))/(y))
3642
#endif
3743

38-
#ifndef _SYS_TYPES_FD_SET /* MIPS */
3944
typedef struct _types_fd_set {
4045
fd_mask fds_bits[howmany(FD_SETSIZE, NFDBITS)];
4146
} _types_fd_set;
@@ -48,5 +53,6 @@ typedef struct _types_fd_set {
4853
#endif /* _SYS_TYPES_FD_SET */
4954

5055
int select(int nfds, fd_set *readfds, fd_set *writefds, fd_set *exceptfds, struct timeval *timeout);
56+
#endif /* _WIN32 */
5157

5258
#endif /* __SYS_SELECT_H__ */

components/libc/compilers/common/sys/ioctl.h

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,10 @@
1515
#include <dfs_posix.h>
1616
#endif
1717

18+
#ifdef _WIN32
19+
#include <winsock.h>
20+
#endif
21+
1822
struct winsize {
1923
unsigned short ws_row;
2024
unsigned short ws_col;
@@ -35,8 +39,8 @@ struct winsize {
3539

3640
#define FIONREAD _IOR('f', 127, int) /* get # bytes to read */
3741
#define FIONBIO _IOW('f', 126, int) /* set/clear non-blocking i/o */
38-
#define FIONWRITE _IOR('f', 121, int) /* get # bytes outstanding in send queue */
3942
#endif
43+
#define FIONWRITE _IOR('f', 121, int) /* get # bytes outstanding in send queue */
4044

4145
#define TCGETS 0x5401
4246
#define TCSETS 0x5402

components/libc/compilers/gcc/newlib/stdio.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,8 @@ int libc_stdio_set_console(const char* device_name, int mode)
7272
return -1;
7373
}
7474

75-
int libc_stdio_get_console(void) {
75+
int libc_stdio_get_console(void)
76+
{
7677
if (std_console)
7778
return fileno(std_console);
7879
else

0 commit comments

Comments
 (0)