diff options
| author | guozhanxin <[email protected]> | 2022-03-29 20:50:38 +0800 |
|---|---|---|
| committer | guozhanxin <[email protected]> | 2022-03-29 20:50:38 +0800 |
| commit | f9245ef6fbcf2288309820930d473db39ef95cfa (patch) | |
| tree | d81b381046152b9bf5fc373a8130c10cadc8b5d4 /components | |
| parent | 61f1f698ec60db75d314b3782800514c706d7980 (diff) | |
| parent | a4a5ec0232ad32b70fed704b2a71803849e610f4 (diff) | |
Merge branch 'master' of https://github.com/RT-Thread/rt-thread
Diffstat (limited to 'components')
| -rw-r--r-- | components/dfs/src/dfs.c | 4 | ||||
| -rw-r--r-- | components/drivers/serial/serial_v2.c | 14 | ||||
| -rw-r--r-- | components/finsh/cmd.c | 2 | ||||
| -rw-r--r-- | components/finsh/msh.c | 2 | ||||
| -rw-r--r-- | components/libc/posix/Kconfig | 6 | ||||
| -rw-r--r-- | components/net/sal/Kconfig | 19 |
6 files changed, 30 insertions, 17 deletions
diff --git a/components/dfs/src/dfs.c b/components/dfs/src/dfs.c index 0299465a99..23cac5c9e9 100644 --- a/components/dfs/src/dfs.c +++ b/components/dfs/src/dfs.c @@ -548,6 +548,10 @@ int list_fd(void) else rt_kprintf("%-8.8s ", "unknown"); rt_kprintf("%3d ", fd->ref_count); rt_kprintf("%04x ", fd->magic); + if (fd->fs && fd->fs->path && rt_strlen(fd->fs->path) > 1) + { + rt_kprintf("%s", fd->fs->path); + } if (fd->path) { rt_kprintf("%s\n", fd->path); diff --git a/components/drivers/serial/serial_v2.c b/components/drivers/serial/serial_v2.c index 404e7abae9..7a7a04de35 100644 --- a/components/drivers/serial/serial_v2.c +++ b/components/drivers/serial/serial_v2.c @@ -484,21 +484,27 @@ static rt_size_t _serial_fifo_tx_blocking_buf(struct rt_device *dev, { struct rt_serial_device *serial; struct rt_serial_tx_fifo *tx_fifo = RT_NULL; + rt_size_t length = size; + rt_size_t offset = 0; - RT_ASSERT(dev != RT_NULL); if (size == 0) return 0; + RT_ASSERT(dev != RT_NULL); serial = (struct rt_serial_device *)dev; RT_ASSERT((serial != RT_NULL) && (buffer != RT_NULL)); + tx_fifo = (struct rt_serial_tx_fifo *) serial->serial_tx; RT_ASSERT(tx_fifo != RT_NULL); + + if (rt_thread_self() == RT_NULL || (serial->parent.open_flag & RT_DEVICE_FLAG_STREAM)) + { + /* using poll tx when the scheduler not startup or in stream mode */ + return _serial_poll_tx(dev, pos, buffer, size); + } /* When serial transmit in tx_blocking mode, * if the activated mode is RT_TRUE, it will return directly */ if (tx_fifo->activated == RT_TRUE) return 0; - tx_fifo->activated = RT_TRUE; - rt_size_t length = size; - rt_size_t offset = 0; while (size) { diff --git a/components/finsh/cmd.c b/components/finsh/cmd.c index 8fd03e3126..6e86d9214a 100644 --- a/components/finsh/cmd.c +++ b/components/finsh/cmd.c @@ -55,7 +55,7 @@ long version(void) return 0; } -MSH_CMD_EXPORT(version, show RT - Thread version information); +MSH_CMD_EXPORT(version, show RT-Thread version information); rt_inline void object_split(int len) { diff --git a/components/finsh/msh.c b/components/finsh/msh.c index bb649549d4..5272f0728a 100644 --- a/components/finsh/msh.c +++ b/components/finsh/msh.c @@ -52,7 +52,7 @@ int msh_help(int argc, char **argv) return 0; } -MSH_CMD_EXPORT_ALIAS(msh_help, help, RT - Thread shell help.); +MSH_CMD_EXPORT_ALIAS(msh_help, help, RT-Thread shell help.); #ifdef MSH_USING_BUILT_IN_COMMANDS int cmd_ps(int argc, char **argv) diff --git a/components/libc/posix/Kconfig b/components/libc/posix/Kconfig index 411289baf6..ee2fd81a73 100644 --- a/components/libc/posix/Kconfig +++ b/components/libc/posix/Kconfig @@ -26,6 +26,12 @@ if RT_USING_POSIX_FS select RT_USING_POSIX_POLL default n + config RT_USING_POSIX_SOCKET + bool "Enable BSD Socket I/O <sys/socket.h> <netdb.h>" + select RT_USING_POSIX_SELECT + select RT_USING_SAL + default n + config RT_USING_POSIX_TERMIOS bool "Enable Terminal I/O <termios.h>" select RT_USING_POSIX_STDIO diff --git a/components/net/sal/Kconfig b/components/net/sal/Kconfig index 3836049333..8542f02a2e 100644 --- a/components/net/sal/Kconfig +++ b/components/net/sal/Kconfig @@ -35,19 +35,16 @@ if RT_USING_SAL endif config SAL_USING_POSIX - bool "Enable BSD socket operated by file system API" - default n - select RT_USING_POSIX_FS - select RT_USING_POSIX_SELECT + bool + depends on DFS_USING_POSIX + default y help + Enable BSD socket operated by file system API Let BSD socket operated by file system API, such as read/write and involveed in select/poll POSIX APIs. - if !SAL_USING_POSIX - - config SAL_SOCKETS_NUM - int "the maximum number of sockets" - default 16 - - endif + config SAL_SOCKETS_NUM + int "the maximum number of sockets" + depends on !SAL_USING_POSIX + default 16 endif |
