-
-
Notifications
You must be signed in to change notification settings - Fork 19
chore: Update to use espp IDF components from component registry, also update some deps #108
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
34129dc
chore: Update to use espp IDF components from component registry, als…
finger563 0930d75
update to esp-idf v5.5 and add delta action
finger563 3316ef9
simplify main manifest
finger563 870b0b6
fix build
finger563 1b0e10d
fix example build
finger563 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,6 +1,3 @@ | ||
| [submodule "components/espp"] | ||
| path = components/espp | ||
| url = [email protected]:esp-cpp/espp | ||
| [submodule "components/jpegdec"] | ||
| path = components/jpegdec | ||
| url = https://github.com/esp-cpp/jpegdec |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -10,6 +10,7 @@ idf_component_register( | |
| "hal" | ||
| "usb" | ||
| "esp_tinyusb" | ||
| "lvgl" | ||
| "codec" | ||
| "adc" | ||
| "aw9523" | ||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,4 +1,16 @@ | ||
| ## IDF Component Manager Manifest File | ||
| dependencies: | ||
| espressif/esp_tinyusb: "^1.4.2" | ||
| idf: "^5.1" | ||
| idf: ">=5.5" | ||
| espressif/esp_tinyusb: ">=2.0" | ||
| lvgl/lvgl: '>=9.2.2' | ||
| espp/adc: ">=1.0" | ||
| espp/aw9523: ">=1.0" | ||
| espp/button: ">=1.0" | ||
| espp/drv2605: ">=1.0" | ||
| espp/esp-box: ">=1.0" | ||
| espp/event_manager: ">=1.0" | ||
| espp/max1704x: ">=1.0" | ||
| espp/mcp23x17: ">=1.0" | ||
| espp/task: ">=1.0" | ||
| espp/timer: ">=1.0" | ||
| espp/serialization: ">=1.0" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -650,30 +650,47 @@ bool BoxEmu::initialize_usb() { | |
| usb_del_phy(jtag_phy_); | ||
|
|
||
| fmt::print("USB MSC initialization\n"); | ||
| // register the callback for the storage mount changed event. | ||
| tinyusb_msc_sdmmc_config_t config_sdmmc = { | ||
| .card = card, | ||
| .callback_mount_changed = nullptr, | ||
| .callback_premount_changed = nullptr, | ||
| .mount_config = { | ||
| .format_if_mount_failed = false, | ||
| .max_files = 5, | ||
| .allocation_unit_size = 2 * 1024, // sector size is 512 bytes, this should be between sector size and (128 * sector size). Larger means higher read/write performance and higher overhead for small files. | ||
| .disk_status_check_enable = false, // true if you see issues or are unmounted properly; slows down I/O | ||
| esp_vfs_fat_mount_config_t fat_mount_config = { | ||
| .format_if_mount_failed = false, | ||
| .max_files = 5, | ||
| .allocation_unit_size = 2 * 1024, // sector size is 512 bytes, this should be between sector size and (128 * sector size). Larger means higher read/write performance and higher overhead for small files. | ||
| .disk_status_check_enable = false, // true if you see issues or are unmounted properly; slows down I/O | ||
| }; | ||
|
|
||
| tinyusb_msc_fatfs_config_t config_msc = { | ||
| .base_path = (char*)mount_point, | ||
| .config = fat_mount_config, | ||
| .do_not_format = true, | ||
| .format_flags = 0, | ||
| }; | ||
|
|
||
| tinyusb_msc_storage_config_t msc_storage_config = { | ||
| .medium = { | ||
| .card = card, | ||
| }, | ||
| .fat_fs = config_msc, | ||
| .mount_point = TINYUSB_MSC_STORAGE_MOUNT_USB, | ||
| }; | ||
| ESP_ERROR_CHECK(tinyusb_msc_storage_init_sdmmc(&config_sdmmc)); | ||
|
|
||
| ESP_ERROR_CHECK(tinyusb_msc_new_storage_sdmmc(&msc_storage_config, &msc_storage_handle_)); | ||
| // register the callback for the storage mount changed event. | ||
| // ESP_ERROR_CHECK(tinyusb_msc_register_callback(TINYUSB_MSC_EVENT_MOUNT_CHANGED, storage_mount_changed_cb)); | ||
|
|
||
| // initialize the tinyusb stack | ||
| fmt::print("USB MSC initialization\n"); | ||
| tinyusb_config_t tusb_cfg; | ||
| memset(&tusb_cfg, 0, sizeof(tusb_cfg)); | ||
| tusb_cfg.device_descriptor = &descriptor_config; | ||
| tusb_cfg.string_descriptor = string_desc_arr; | ||
| tusb_cfg.string_descriptor_count = sizeof(string_desc_arr) / sizeof(string_desc_arr[0]); | ||
| tusb_cfg.external_phy = false; | ||
| tusb_cfg.configuration_descriptor = desc_configuration; | ||
| // no device_event_handler for tud_mount and tud_unmount callbacks | ||
| tinyusb_config_t tusb_cfg = TINYUSB_DEFAULT_CONFIG(); | ||
| tusb_cfg.task = TINYUSB_TASK_CUSTOM(4096 /*size */, 4 /* priority */, | ||
| 0 /* affinity: 0 - CPU0, 1 - CPU1 ... */); | ||
|
Comment on lines
+681
to
+684
|
||
| tusb_cfg.descriptor.device = &descriptor_config; | ||
| tusb_cfg.descriptor.string = string_desc_arr; | ||
| tusb_cfg.descriptor.string_count = | ||
| sizeof(string_desc_arr) / sizeof(string_desc_arr[0]); | ||
| tusb_cfg.descriptor.full_speed_config = desc_configuration; | ||
| tusb_cfg.phy.skip_setup = false; // was external-phy = false | ||
| tusb_cfg.phy.self_powered = false; | ||
| tusb_cfg.phy.vbus_monitor_io = -1; | ||
|
|
||
| ESP_ERROR_CHECK(tinyusb_driver_install(&tusb_cfg)); | ||
| fmt::print("USB MSC initialization DONE\n"); | ||
| usb_enabled_ = true; | ||
|
|
@@ -686,8 +703,16 @@ bool BoxEmu::deinitialize_usb() { | |
| logger_.warn("USB MSC not initialized"); | ||
| return false; | ||
| } | ||
| esp_err_t err; | ||
| logger_.info("USB MSC deinitialization"); | ||
| auto err = tinyusb_driver_uninstall(); | ||
| // deinit + delete the msc storage handle | ||
| err = tinyusb_msc_delete_storage(msc_storage_handle_); | ||
| if (err != ESP_OK) { | ||
| logger_.error("tinyusb_msc_delete_storage failed: {}", esp_err_to_name(err)); | ||
| return false; | ||
| } | ||
| logger_.info("USB deinitialization"); | ||
| err = tinyusb_driver_uninstall(); | ||
| if (err != ESP_OK) { | ||
| logger_.error("tinyusb_driver_uninstall failed: {}", esp_err_to_name(err)); | ||
| return false; | ||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Submodule espp
deleted from
7cf2ea
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Submodule jpegdec
updated
39 files
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| ## IDF Component Manager Manifest File | ||
| dependencies: | ||
| ## Required IDF version | ||
| idf: '>=5.4' | ||
| espp/monitor: '>=1.0' |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The C-style cast
(char*)mount_pointshould be replaced with a C++ static_cast for better type safety:static_cast<char*>(mount_point).