Update IDF to 9274814 (#767)

* Update IDF to 9274814

* Fix error in i2c and Arduino
This commit is contained in:
Me No Dev
2017-10-24 00:21:00 +02:00
committed by GitHub
parent 95123681d5
commit 55289a45af
99 changed files with 1011 additions and 1302 deletions

View File

@ -43,16 +43,30 @@ extern "C" {
*/
#define ESP_VFS_FLAG_CONTEXT_PTR 1
/**
* Flag which indicates that the FD space of the VFS implementation should be made
* the same as the FD space in newlib. This means that the normal masking off
* of VFS-independent fd bits is ignored and the full user-facing fd is passed to
* the VFS implementation.
*
* Set the p_minimum_fd & p_maximum_fd pointers when registering the socket in
* order to know what range of FDs can be used with the registered VFS.
*
* This is mostly useful for LWIP which shares the socket FD space with
* socket-specific functions.
*
*/
#define ESP_VFS_FLAG_SHARED_FD_SPACE 2
/**
* @brief VFS definition structure
*
* This structure should be filled with pointers to corresponding
* FS driver functions.
*
* If the FS implementation has an option to use certain offset for
* all file descriptors, this value should be passed into fd_offset
* field. Otherwise VFS component will translate all FDs to start
* at zero offset.
* VFS component will translate all FDs so that the filesystem implementation
* sees them starting at zero. The caller sees a global FD which is prefixed
* with an pre-filesystem-implementation.
*
* Some FS implementations expect some state (e.g. pointer to some structure)
* to be passed in as a first argument. For these implementations,
@ -67,8 +81,7 @@ extern "C" {
*/
typedef struct
{
int fd_offset; /*!< file descriptor offset, determined by the FS driver */
int flags; /*!< ESP_VFS_FLAG_CONTEXT_PTR or ESP_VFS_FLAG_DEFAULT */
int flags; /*!< ESP_VFS_FLAG_CONTEXT_PTR or ESP_VFS_FLAG_DEFAULT, plus optionally ESP_VFS_FLAG_SHARED_FD_SPACE */
union {
ssize_t (*write_p)(void* p, int fd, const void * data, size_t size);
ssize_t (*write)(int fd, const void * data, size_t size);
@ -145,6 +158,14 @@ typedef struct
int (*fcntl_p)(void* ctx, int fd, int cmd, va_list args);
int (*fcntl)(int fd, int cmd, va_list args);
};
union {
int (*ioctl_p)(void* ctx, int fd, int cmd, va_list args);
int (*ioctl)(int fd, int cmd, va_list args);
};
union {
int (*fsync_p)(void* ctx, int fd);
int (*fsync)(int fd);
};
} esp_vfs_t;
@ -170,6 +191,22 @@ typedef struct
esp_err_t esp_vfs_register(const char* base_path, const esp_vfs_t* vfs, void* ctx);
/**
* Special case function for registering a VFS that uses a method other than
* open() to open new file descriptors.
*
* This is a special-purpose function intended for registering LWIP sockets to VFS.
*
* @param vfs Pointer to esp_vfs_t. Meaning is the same as for esp_vfs_register().
* @param ctx Pointer to context structure. Meaning is the same as for esp_vfs_register().
* @param p_min_fd If non-NULL, on success this variable is written with the minimum (global/user-facing) FD that this VFS will use. This is useful when ESP_VFS_FLAG_SHARED_FD_SPACE is set in vfs->flags.
* @param p_max_fd If non-NULL, on success this variable is written with one higher than the maximum (global/user-facing) FD that this VFS will use. This is useful when ESP_VFS_FLAG_SHARED_FD_SPACE is set in vfs->flags.
*
* @return ESP_OK if successful, ESP_ERR_NO_MEM if too many VFSes are
* registered.
*/
esp_err_t esp_vfs_register_socket_space(const esp_vfs_t *vfs, void *ctx, int *p_min_fd, int *p_max_fd);
/**
* Unregister a virtual filesystem for given path prefix
*

View File

@ -12,11 +12,14 @@
// See the License for the specific language governing permissions and
// limitations under the License.
#ifndef __ESP_VFS_DEV_H__
#define __ESP_VFS_DEV_H__
#pragma once
#include "esp_vfs.h"
#ifdef __cplusplus
extern "C" {
#endif
/**
* @brief Line ending settings
*/
@ -81,4 +84,6 @@ void esp_vfs_dev_uart_use_nonblocking(int uart_num);
*/
void esp_vfs_dev_uart_use_driver(int uart_num);
#endif //__ESP_VFS_DEV_H__
#ifdef __cplusplus
}
#endif