Skip to content

Commit

Permalink
Rename to cherryusb_esp32 to keep consistency with upstream
Browse files Browse the repository at this point in the history
  • Loading branch information
leeebo committed Sep 6, 2023
1 parent b39880a commit 7a09b2e
Show file tree
Hide file tree
Showing 7 changed files with 29 additions and 21 deletions.
8 changes: 7 additions & 1 deletion .github/workflows/sync_esp_pkgmng.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,19 @@ jobs:
upload_components:
runs-on: ubuntu-latest
steps:
- name: Check the repository name
run: |
if [[ ${{ github.repository }} == "leeebo/cherryusb_esp32" ]]; then
echo "This action is only for leeebo/cherryusb_esp32 repository"
::exit::neutral
fi
- uses: actions/checkout@v2
with:
submodules: "recursive"

- name: Upload component to the component registry
uses: espressif/upload-components-ci-action@v1
with:
name: "esp_cherryusb"
name: "cherryusb_esp32"
namespace: "leeebo"
api_token: ${{ secrets.IDF_COMPONENT_API_TOKEN }}
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# ChangeLog

## v0.0.3 - 2023-09-06

* Rename component name to `cherryusb_esp32` to keep consistency with upstream

## v0.0.2 - 2023-09-05

* Fix github build action
Expand Down
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# CherryUSB Component and Examples for ESP

[![Component Registry](https://components.espressif.com/components/leeebo/esp_cherryusb/badge.svg)](https://components.espressif.com/components/leeebo/esp_cherryusb) [![Build Status](https://github.com/leeebo/esp_cherryusb/actions/workflows/build_examples.yml/badge.svg)](https://github.com/leeebo/esp_cherryusb/actions/workflows/build_examples.yml)
[![Component Registry](https://components.espressif.com/components/leeebo/cherryusb_esp32/badge.svg)](https://components.espressif.com/components/leeebo/cherryusb_esp32) [![Build Status](https://github.com/leeebo/cherryusb_esp32/actions/workflows/build_examples.yml/badge.svg)](https://github.com/leeebo/cherryusb_esp32/actions/workflows/build_examples.yml)

This is the component and examples repository for the [CherryUSB](https://github.com/cherry-embedded/CherryUSB), which is a tiny and portable USB Stack (device & host) for embedded system with USB IP.

Expand All @@ -15,13 +15,13 @@ Just add ``idf_component.yml`` to your main component with the following content
```yaml
## IDF Component Manager Manifest File
dependencies:
leeebo/esp_cherryusb: "*"
leeebo/cherryusb_esp32: "*"
```
Or simply run:
```
idf.py add-dependency "leeebo/esp_cherryusb"
idf.py add-dependency "leeebo/cherryusb_esp32"
```

During the build process, the ESP-IDF build system will automatically download and install this component.
Expand All @@ -31,7 +31,7 @@ During the build process, the ESP-IDF build system will automatically download a
Please use the component manager command `create-project-from-example` to create the project from example template

```
idf.py create-project-from-example "leeebo/esp_cherryusb=*:cherryusb_device_cdc"
idf.py create-project-from-example "leeebo/cherryusb_esp32=*:cherryusb_device_cdc"
```

## How to build the examples
Expand Down
2 changes: 1 addition & 1 deletion additions/esp_cherryusb.c
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ void usb_dc_low_level_init(void)
return;
}
USB_LOG_INFO("cherryusb, version: 0x%06x\r\n", CHERRYUSB_VERSION);
USB_LOG_INFO("esp_cherryusb, version: %d.%d.%d\r\n", ESP_CHERRYUSB_VER_MAJOR, ESP_CHERRYUSB_VER_MINOR, ESP_CHERRYUSB_VER_PATCH);
USB_LOG_INFO("cherryusb_esp32, version: %d.%d.%d\r\n", CHERRYUSB_ESP32_VER_MAJOR, CHERRYUSB_ESP32_VER_MINOR, CHERRYUSB_ESP32_VER_PATCH);
}

void usb_dc_low_level_deinit(void)
Expand Down
14 changes: 7 additions & 7 deletions examples/device/cherryusb_device_cdc/main/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,15 @@ idf_component_register(SRCS
"."
)

# Determine whether esp_cherryusb is fetched from the component registry or from the local path
# Determine whether cherryusb_esp32 is fetched from the component registry or from the local path
idf_build_get_property(build_components BUILD_COMPONENTS)
if(esp_cherryusb IN_LIST build_components)
set(esp_cherryusb_name esp_cherryusb) # Local component
if(cherryusb_esp32 IN_LIST build_components)
set(cherryusb_esp32_name cherryusb_esp32) # Local component
else()
set(esp_cherryusb_name leeebo__esp_cherryusb) # Managed component
set(cherryusb_esp32_name leeebo__cherryusb_esp32) # Managed component
endif()

# Pass usb_config.h.h from this component to esp_cherryusb
idf_component_get_property(_esp_cherryusb_lib ${esp_cherryusb_name} COMPONENT_LIB)
# Pass usb_config.h.h from this component to cherryusb_esp32
idf_component_get_property(_cherryusb_esp32_lib ${cherryusb_esp32_name} COMPONENT_LIB)
cmake_policy(SET CMP0079 NEW)
target_link_libraries(${_esp_cherryusb_lib} PRIVATE ${COMPONENT_LIB})
target_link_libraries(${_cherryusb_esp32_lib} PRIVATE ${COMPONENT_LIB})
6 changes: 3 additions & 3 deletions examples/device/cherryusb_device_cdc/main/idf_component.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@ targets:
- esp32s3
dependencies:
idf: ">=4.4.1"
leeebo/esp_cherryusb:
version: "*"
override_path: "../../../../../esp_cherryusb"
leeebo/cherryusb_esp32:
version: "0.0.*"
override_path: "../../../../../cherryusb_esp32"
8 changes: 3 additions & 5 deletions idf_component.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,10 @@ targets:
- esp32s2
- esp32s3
description: CherryUSB Port and Examples for ESP SoC with USB-OTG (S2/S3/C5/P4)
url: https://github.com/leeebo/esp_cherryusb
repository: https://github.com/leeebo/esp_cherryusb.git
issues: https://github.com/leeebo/esp_cherryusb/issues
url: https://github.com/leeebo/cherryusb_esp32
repository: https://github.com/leeebo/cherryusb_esp32.git
issues: https://github.com/leeebo/cherryusb_esp32/issues
dependencies:
idf: ">=4.4.1"
leeebo/cherryusb: "~=0.10.1"
cmake_utilities: "0.*"
examples:
- path: examples/device/cherryusb_device_cdc

0 comments on commit 7a09b2e

Please sign in to comment.