From 40035edcac9b97a6827bb6bf7c30d0b6a54b7844 Mon Sep 17 00:00:00 2001 From: Jiacheng Guo Date: Mon, 8 Mar 2021 16:29:22 +0800 Subject: [PATCH] vfs: add doc links --- components/vfs/README.rst | 11 +++++++++++ docs/doxygen/Doxyfile_common | 1 + docs/en/api-reference/storage/vfs.rst | 1 + 3 files changed, 13 insertions(+) diff --git a/components/vfs/README.rst b/components/vfs/README.rst index 6a4dce7990..9c80bffdf9 100644 --- a/components/vfs/README.rst +++ b/components/vfs/README.rst @@ -235,3 +235,14 @@ Such a design has the following consequences: - It is possible to set ``stdin``, ``stdout``, and ``stderr`` for any given task without affecting other tasks, e.g., by doing ``stdin = fopen("/dev/uart/1", "r")``. - Closing default ``stdin``, ``stdout``, or ``stderr`` using ``fclose`` will close the ``FILE`` stream object, which will affect all other tasks. - To change the default ``stdin``, ``stdout``, ``stderr`` streams for new tasks, modify ``_GLOBAL_REENT->_stdin`` (``_stdout``, ``_stderr``) before creating the task. + +Event fds +------------------------------------------- + +``eventfd()`` call is a powerful tool to notify a ``select()`` based loop of custom events. The ``eventfd()`` implementation in ESP-IDF is generally the same as described in ``man(2) eventfd`` except for: + +- ``esp_vfs_eventfd_register()`` has to be called before calling ``eventfd()`` +- Option ``EFD_CLOEXEC``, ``EFD_NONBLOCK`` and ``EFD_SEMAPHORE`` is not supported in flags. +- Option ``EFD_SUPPORT_ISR`` has been added in flags. This flag is required to read and the write the eventfd in an interrupt handler. + +Note that creating an eventfd with ``EFD_SUPPORT_ISR`` will cause interrupts to be temporarily disabled when reading, writing the file and during the beginning and the ending of the ``select()`` when this file is set. diff --git a/docs/doxygen/Doxyfile_common b/docs/doxygen/Doxyfile_common index 5ae279e691..985e6cde9f 100644 --- a/docs/doxygen/Doxyfile_common +++ b/docs/doxygen/Doxyfile_common @@ -157,6 +157,7 @@ INPUT = \ $(IDF_PATH)/components/openthread/include/openthread-core-esp32x-config.h \ $(IDF_PATH)/components/vfs/include/esp_vfs.h \ $(IDF_PATH)/components/vfs/include/esp_vfs_dev.h \ + $(IDF_PATH)/components/vfs/include/esp_vfs_eventfd.h \ $(IDF_PATH)/components/vfs/include/esp_vfs_semihost.h \ $(IDF_PATH)/components/fatfs/vfs/esp_vfs_fat.h \ $(IDF_PATH)/components/fatfs/diskio/diskio_impl.h \ diff --git a/docs/en/api-reference/storage/vfs.rst b/docs/en/api-reference/storage/vfs.rst index c7311d58ea..4adbd1110c 100644 --- a/docs/en/api-reference/storage/vfs.rst +++ b/docs/en/api-reference/storage/vfs.rst @@ -7,3 +7,4 @@ API Reference .. include-build-file:: inc/esp_vfs_dev.inc +.. include-build-file:: inc/esp_vfs_eventfd.inc