mirror of
https://github.com/espressif/esp-idf.git
synced 2025-07-30 10:47:19 +02:00
feat(storage/esp_vfs_console): move cdcacm driver to new vfs API
This commit is contained in:
@ -20,7 +20,7 @@ extern "C" {
|
|||||||
*
|
*
|
||||||
* @return pointer to structure esp_vfs_t
|
* @return pointer to structure esp_vfs_t
|
||||||
*/
|
*/
|
||||||
const esp_vfs_t *esp_vfs_cdcacm_get_vfs(void);
|
const esp_vfs_fs_ops_t *esp_vfs_cdcacm_get_vfs(void);
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
}
|
}
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* SPDX-FileCopyrightText: 2015-2021 Espressif Systems (Shanghai) CO LTD
|
* SPDX-FileCopyrightText: 2015-2024 Espressif Systems (Shanghai) CO LTD
|
||||||
*
|
*
|
||||||
* SPDX-License-Identifier: Apache-2.0
|
* SPDX-License-Identifier: Apache-2.0
|
||||||
*/
|
*/
|
||||||
@ -300,8 +300,7 @@ void esp_vfs_dev_cdcacm_set_rx_line_endings(esp_line_endings_t mode)
|
|||||||
s_rx_mode = mode;
|
s_rx_mode = mode;
|
||||||
}
|
}
|
||||||
|
|
||||||
static const esp_vfs_t vfs = {
|
static const esp_vfs_fs_ops_t s_cdcacm_vfs = {
|
||||||
.flags = ESP_VFS_FLAG_DEFAULT,
|
|
||||||
.write = &cdcacm_write,
|
.write = &cdcacm_write,
|
||||||
.open = &cdcacm_open,
|
.open = &cdcacm_open,
|
||||||
.fstat = &cdcacm_fstat,
|
.fstat = &cdcacm_fstat,
|
||||||
@ -311,12 +310,12 @@ static const esp_vfs_t vfs = {
|
|||||||
.fsync = &cdcacm_fsync
|
.fsync = &cdcacm_fsync
|
||||||
};
|
};
|
||||||
|
|
||||||
const esp_vfs_t *esp_vfs_cdcacm_get_vfs(void)
|
const esp_vfs_fs_ops_t *esp_vfs_cdcacm_get_vfs(void)
|
||||||
{
|
{
|
||||||
return &vfs;
|
return &s_cdcacm_vfs;
|
||||||
}
|
}
|
||||||
|
|
||||||
esp_err_t esp_vfs_dev_cdcacm_register(void)
|
esp_err_t esp_vfs_dev_cdcacm_register(void)
|
||||||
{
|
{
|
||||||
return esp_vfs_register("/dev/cdcacm", &vfs, NULL);
|
return esp_vfs_register_fs("/dev/cdcacm", &s_cdcacm_vfs, ESP_VFS_FLAG_STATIC, NULL);
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user