VFS: Fix Kconfig prefix
This commit is contained in:
parent
6895ea1624
commit
43eb58da99
9 changed files with 25 additions and 20 deletions
|
@ -27,7 +27,7 @@
|
||||||
#include <sys/types.h>
|
#include <sys/types.h>
|
||||||
#include "sdkconfig.h"
|
#include "sdkconfig.h"
|
||||||
|
|
||||||
#ifdef CONFIG_SUPPORT_TERMIOS
|
#ifdef CONFIG_VFS_SUPPORT_TERMIOS
|
||||||
|
|
||||||
// subscripts for the array c_cc:
|
// subscripts for the array c_cc:
|
||||||
#define VEOF 0 /** EOF character */
|
#define VEOF 0 /** EOF character */
|
||||||
|
@ -291,6 +291,6 @@ int tcsetattr(int fd, int optional_actions, const struct termios *p);
|
||||||
} // extern "C"
|
} // extern "C"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#endif // CONFIG_SUPPORT_TERMIOS
|
#endif // CONFIG_VFS_SUPPORT_TERMIOS
|
||||||
|
|
||||||
#endif //__ESP_SYS_TERMIOS_H__
|
#endif //__ESP_SYS_TERMIOS_H__
|
||||||
|
|
|
@ -19,9 +19,9 @@
|
||||||
#ifdef CONFIG_LWIP_USE_ONLY_LWIP_SELECT
|
#ifdef CONFIG_LWIP_USE_ONLY_LWIP_SELECT
|
||||||
#include "lwip/sockets.h"
|
#include "lwip/sockets.h"
|
||||||
|
|
||||||
#ifdef CONFIG_SUPPRESS_SELECT_DEBUG_OUTPUT
|
#ifdef CONFIG_VFS_SUPPRESS_SELECT_DEBUG_OUTPUT
|
||||||
#define LOG_LOCAL_LEVEL ESP_LOG_NONE
|
#define LOG_LOCAL_LEVEL ESP_LOG_NONE
|
||||||
#endif //CONFIG_SUPPRESS_SELECT_DEBUG_OUTPUT
|
#endif //CONFIG_VFS_SUPPRESS_SELECT_DEBUG_OUTPUT
|
||||||
#include "esp_log.h"
|
#include "esp_log.h"
|
||||||
|
|
||||||
static const char *TAG = "newlib_select";
|
static const char *TAG = "newlib_select";
|
||||||
|
|
|
@ -14,7 +14,7 @@
|
||||||
|
|
||||||
#include "sdkconfig.h"
|
#include "sdkconfig.h"
|
||||||
|
|
||||||
#ifdef CONFIG_SUPPORT_TERMIOS
|
#ifdef CONFIG_VFS_SUPPORT_TERMIOS
|
||||||
|
|
||||||
#include <sys/termios.h>
|
#include <sys/termios.h>
|
||||||
#include <sys/errno.h>
|
#include <sys/errno.h>
|
||||||
|
@ -51,4 +51,4 @@ int cfsetospeed(struct termios *p, speed_t sp)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif // CONFIG_SUPPORT_TERMIOS
|
#endif // CONFIG_VFS_SUPPORT_TERMIOS
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
menu "Virtual file system"
|
menu "Virtual file system"
|
||||||
|
|
||||||
config SUPPRESS_SELECT_DEBUG_OUTPUT
|
config VFS_SUPPRESS_SELECT_DEBUG_OUTPUT
|
||||||
bool "Suppress select() related debug outputs"
|
bool "Suppress select() related debug outputs"
|
||||||
default y
|
default y
|
||||||
help
|
help
|
||||||
|
@ -9,7 +9,7 @@ menu "Virtual file system"
|
||||||
It is possible to suppress these debug outputs by enabling this
|
It is possible to suppress these debug outputs by enabling this
|
||||||
option.
|
option.
|
||||||
|
|
||||||
config SUPPORT_TERMIOS
|
config VFS_SUPPORT_TERMIOS
|
||||||
bool "Add support for termios.h"
|
bool "Add support for termios.h"
|
||||||
default y
|
default y
|
||||||
help
|
help
|
||||||
|
|
|
@ -196,7 +196,7 @@ typedef struct
|
||||||
int (*utime_p)(void* ctx, const char *path, const struct utimbuf *times);
|
int (*utime_p)(void* ctx, const char *path, const struct utimbuf *times);
|
||||||
int (*utime)(const char *path, const struct utimbuf *times);
|
int (*utime)(const char *path, const struct utimbuf *times);
|
||||||
};
|
};
|
||||||
#ifdef CONFIG_SUPPORT_TERMIOS
|
#ifdef CONFIG_VFS_SUPPORT_TERMIOS
|
||||||
union {
|
union {
|
||||||
int (*tcsetattr_p)(void *ctx, int fd, int optional_actions, const struct termios *p);
|
int (*tcsetattr_p)(void *ctx, int fd, int optional_actions, const struct termios *p);
|
||||||
int (*tcsetattr)(int fd, int optional_actions, const struct termios *p);
|
int (*tcsetattr)(int fd, int optional_actions, const struct termios *p);
|
||||||
|
@ -225,7 +225,7 @@ typedef struct
|
||||||
int (*tcsendbreak_p)(void *ctx, int fd, int duration);
|
int (*tcsendbreak_p)(void *ctx, int fd, int duration);
|
||||||
int (*tcsendbreak)(int fd, int duration);
|
int (*tcsendbreak)(int fd, int duration);
|
||||||
};
|
};
|
||||||
#endif // CONFIG_SUPPORT_TERMIOS
|
#endif // CONFIG_VFS_SUPPORT_TERMIOS
|
||||||
|
|
||||||
/** start_select is called for setting up synchronous I/O multiplexing of the desired file descriptors in the given VFS */
|
/** start_select is called for setting up synchronous I/O multiplexing of the desired file descriptors in the given VFS */
|
||||||
esp_err_t (*start_select)(int nfds, fd_set *readfds, fd_set *writefds, fd_set *exceptfds, esp_vfs_select_sem_t sem);
|
esp_err_t (*start_select)(int nfds, fd_set *readfds, fd_set *writefds, fd_set *exceptfds, esp_vfs_select_sem_t sem);
|
||||||
|
|
5
components/vfs/sdkconfig.rename
Normal file
5
components/vfs/sdkconfig.rename
Normal file
|
@ -0,0 +1,5 @@
|
||||||
|
# sdkconfig replacement configurations for deprecated options formatted as
|
||||||
|
# CONFIG_DEPRECATED_OPTION CONFIG_NEW_OPTION
|
||||||
|
|
||||||
|
CONFIG_SUPPRESS_SELECT_DEBUG_OUTPUT CONFIG_VFS_SUPPRESS_SELECT_DEBUG_OUTPUT
|
||||||
|
CONFIG_SUPPORT_TERMIOS CONFIG_VFS_SUPPORT_TERMIOS
|
|
@ -202,7 +202,7 @@ TEST_CASE("can write to UART while another task is reading", "[vfs]")
|
||||||
vSemaphoreDelete(write_arg.done);
|
vSemaphoreDelete(write_arg.done);
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef CONFIG_SUPPORT_TERMIOS
|
#ifdef CONFIG_VFS_SUPPORT_TERMIOS
|
||||||
TEST_CASE("Can use termios for UART", "[vfs]")
|
TEST_CASE("Can use termios for UART", "[vfs]")
|
||||||
{
|
{
|
||||||
uart_config_t uart_config = {
|
uart_config_t uart_config = {
|
||||||
|
@ -328,4 +328,4 @@ TEST_CASE("Can use termios for UART", "[vfs]")
|
||||||
close(uart_fd);
|
close(uart_fd);
|
||||||
uart_driver_delete(UART_NUM_1);
|
uart_driver_delete(UART_NUM_1);
|
||||||
}
|
}
|
||||||
#endif // CONFIG_SUPPORT_TERMIOS
|
#endif // CONFIG_VFS_SUPPORT_TERMIOS
|
||||||
|
|
|
@ -27,9 +27,9 @@
|
||||||
#include "esp_vfs.h"
|
#include "esp_vfs.h"
|
||||||
#include "sdkconfig.h"
|
#include "sdkconfig.h"
|
||||||
|
|
||||||
#ifdef CONFIG_SUPPRESS_SELECT_DEBUG_OUTPUT
|
#ifdef CONFIG_VFS_SUPPRESS_SELECT_DEBUG_OUTPUT
|
||||||
#define LOG_LOCAL_LEVEL ESP_LOG_NONE
|
#define LOG_LOCAL_LEVEL ESP_LOG_NONE
|
||||||
#endif //CONFIG_SUPPRESS_SELECT_DEBUG_OUTPUT
|
#endif //CONFIG_VFS_SUPPRESS_SELECT_DEBUG_OUTPUT
|
||||||
#include "esp_log.h"
|
#include "esp_log.h"
|
||||||
|
|
||||||
static const char *TAG = "vfs";
|
static const char *TAG = "vfs";
|
||||||
|
@ -1032,7 +1032,7 @@ void esp_vfs_select_triggered_isr(esp_vfs_select_sem_t sem, BaseType_t *woken)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef CONFIG_SUPPORT_TERMIOS
|
#ifdef CONFIG_VFS_SUPPORT_TERMIOS
|
||||||
int tcgetattr(int fd, struct termios *p)
|
int tcgetattr(int fd, struct termios *p)
|
||||||
{
|
{
|
||||||
const vfs_entry_t* vfs = get_vfs_for_fd(fd);
|
const vfs_entry_t* vfs = get_vfs_for_fd(fd);
|
||||||
|
@ -1130,7 +1130,7 @@ int tcsendbreak(int fd, int duration)
|
||||||
CHECK_AND_CALL(ret, r, vfs, tcsendbreak, local_fd, duration);
|
CHECK_AND_CALL(ret, r, vfs, tcsendbreak, local_fd, duration);
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
#endif // CONFIG_SUPPORT_TERMIOS
|
#endif // CONFIG_VFS_SUPPORT_TERMIOS
|
||||||
|
|
||||||
int esp_vfs_utime(const char *path, const struct utimbuf *times)
|
int esp_vfs_utime(const char *path, const struct utimbuf *times)
|
||||||
{
|
{
|
||||||
|
|
|
@ -463,7 +463,7 @@ static void uart_end_select()
|
||||||
_lock_release(&s_one_select_lock);
|
_lock_release(&s_one_select_lock);
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef CONFIG_SUPPORT_TERMIOS
|
#ifdef CONFIG_VFS_SUPPORT_TERMIOS
|
||||||
static int uart_tcsetattr(int fd, int optional_actions, const struct termios *p)
|
static int uart_tcsetattr(int fd, int optional_actions, const struct termios *p)
|
||||||
{
|
{
|
||||||
if (fd < 0 || fd >= UART_NUM) {
|
if (fd < 0 || fd >= UART_NUM) {
|
||||||
|
@ -913,7 +913,7 @@ static int uart_tcflush(int fd, int select)
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
#endif // CONFIG_SUPPORT_TERMIOS
|
#endif // CONFIG_VFS_SUPPORT_TERMIOS
|
||||||
|
|
||||||
void esp_vfs_dev_uart_register()
|
void esp_vfs_dev_uart_register()
|
||||||
{
|
{
|
||||||
|
@ -929,12 +929,12 @@ void esp_vfs_dev_uart_register()
|
||||||
.access = &uart_access,
|
.access = &uart_access,
|
||||||
.start_select = &uart_start_select,
|
.start_select = &uart_start_select,
|
||||||
.end_select = &uart_end_select,
|
.end_select = &uart_end_select,
|
||||||
#ifdef CONFIG_SUPPORT_TERMIOS
|
#ifdef CONFIG_VFS_SUPPORT_TERMIOS
|
||||||
.tcsetattr = &uart_tcsetattr,
|
.tcsetattr = &uart_tcsetattr,
|
||||||
.tcgetattr = &uart_tcgetattr,
|
.tcgetattr = &uart_tcgetattr,
|
||||||
.tcdrain = &uart_tcdrain,
|
.tcdrain = &uart_tcdrain,
|
||||||
.tcflush = &uart_tcflush,
|
.tcflush = &uart_tcflush,
|
||||||
#endif // CONFIG_SUPPORT_TERMIOS
|
#endif // CONFIG_VFS_SUPPORT_TERMIOS
|
||||||
};
|
};
|
||||||
ESP_ERROR_CHECK(esp_vfs_register("/dev/uart", &vfs, NULL));
|
ESP_ERROR_CHECK(esp_vfs_register("/dev/uart", &vfs, NULL));
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue