mirror of
https://github.com/espressif/esp-idf.git
synced 2025-07-30 18:57:19 +02:00
feature(examples/usb): Define maximum opend files in MSC device example
This commit is contained in:
@ -1,4 +1,4 @@
|
||||
## IDF Component Manager Manifest File
|
||||
dependencies:
|
||||
espressif/esp_tinyusb: "^1.2"
|
||||
espressif/esp_tinyusb: "^1.4.2"
|
||||
idf: "^5.0"
|
||||
|
@ -347,7 +347,8 @@ void app_main(void)
|
||||
|
||||
const tinyusb_msc_spiflash_config_t config_spi = {
|
||||
.wl_handle = wl_handle,
|
||||
.callback_mount_changed = storage_mount_changed_cb /* First way to register the callback. This is while initializing the storage. */
|
||||
.callback_mount_changed = storage_mount_changed_cb, /* First way to register the callback. This is while initializing the storage. */
|
||||
.mount_config.max_files = 5,
|
||||
};
|
||||
ESP_ERROR_CHECK(tinyusb_msc_storage_init_spiflash(&config_spi));
|
||||
ESP_ERROR_CHECK(tinyusb_msc_register_callback(TINYUSB_MSC_EVENT_MOUNT_CHANGED, storage_mount_changed_cb)); /* Other way to register the callback i.e. registering using separate API. If the callback had been already registered, it will be overwritten. */
|
||||
@ -357,7 +358,8 @@ void app_main(void)
|
||||
|
||||
const tinyusb_msc_sdmmc_config_t config_sdmmc = {
|
||||
.card = card,
|
||||
.callback_mount_changed = storage_mount_changed_cb /* First way to register the callback. This is while initializing the storage. */
|
||||
.callback_mount_changed = storage_mount_changed_cb, /* First way to register the callback. This is while initializing the storage. */
|
||||
.mount_config.max_files = 5,
|
||||
};
|
||||
ESP_ERROR_CHECK(tinyusb_msc_storage_init_sdmmc(&config_sdmmc));
|
||||
ESP_ERROR_CHECK(tinyusb_msc_register_callback(TINYUSB_MSC_EVENT_MOUNT_CHANGED, storage_mount_changed_cb)); /* Other way to register the callback i.e. registering using separate API. If the callback had been already registered, it will be overwritten. */
|
||||
|
Reference in New Issue
Block a user