feat(vfs): Add linux target support for esp_vfs_eventfd

This commit is contained in:
Guillaume Souchere
2025-02-05 11:30:32 +01:00
parent 203b3b5a4e
commit 8a89dc0b9c
4 changed files with 30 additions and 3 deletions

View File

@@ -5,12 +5,13 @@ set(srcs "commands.c"
"split_argv.c"
"linenoise/linenoise.c")
set(requires vfs)
if(${target} STREQUAL "linux")
list(APPEND srcs "esp_console_repl_linux.c")
set(requires "")
else()
list(APPEND srcs "esp_console_repl_chip.c")
set(requires vfs esp_vfs_console)
list(APPEND requires esp_vfs_console)
endif()
set(argtable_srcs argtable3/arg_cmd.c

View File

@@ -10,7 +10,11 @@
#include "console_private.h"
#include "esp_log.h"
#include "linenoise/linenoise.h"
#include "esp_vfs_eventfd.h"
#if CONFIG_IDF_TARGET_LINUX
#include <unistd.h>
#endif
static const char *TAG = "console.common";

View File

@@ -1,7 +1,10 @@
idf_build_get_property(target IDF_TARGET)
# On Linux, we only support a few features, hence this simple component registration
if(${target} STREQUAL "linux")
return() # This component is not supported by the POSIX/Linux simulator
idf_component_register(SRCS "vfs_eventfd_linux.c"
INCLUDE_DIRS "include")
return()
endif()
list(APPEND sources "vfs.c"

View File

@@ -0,0 +1,19 @@
/*
* SPDX-FileCopyrightText: 2025 Espressif Systems (Shanghai) CO LTD
*
* SPDX-License-Identifier: Apache-2.0
*/
#include "esp_vfs_eventfd.h"
#include <sys/eventfd.h>
esp_err_t esp_vfs_eventfd_register(const esp_vfs_eventfd_config_t *config)
{
(void)config;
return ESP_OK;
}
esp_err_t esp_vfs_eventfd_unregister(void)
{
return ESP_OK;
}