change(idf): Rename component example and fix compilation warnings (#9801)
* change(idf): Rename component example * ci(push): Fix steps conditions * ci(tests): Remove unnecessary concurrency * ci(push): Fix step condition * fix(idf): Fix compilation warnings when as component
This commit is contained in:
parent
e3fedc5e8c
commit
2928654027
15 changed files with 15 additions and 31 deletions
4
.github/workflows/build_tests.yml
vendored
4
.github/workflows/build_tests.yml
vendored
|
|
@ -12,10 +12,6 @@ on:
|
||||||
description: 'Chip to build tests for'
|
description: 'Chip to build tests for'
|
||||||
required: true
|
required: true
|
||||||
|
|
||||||
concurrency:
|
|
||||||
group: tests-build-${{ github.event.pull_request.number || github.ref }}-${{ inputs.chip }}-${{ inputs.type }}
|
|
||||||
cancel-in-progress: true
|
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
build-tests:
|
build-tests:
|
||||||
name: Build ${{ inputs.type }} tests for ${{ inputs.chip }}
|
name: Build ${{ inputs.type }} tests for ${{ inputs.chip }}
|
||||||
|
|
|
||||||
4
.github/workflows/hw.yml
vendored
4
.github/workflows/hw.yml
vendored
|
|
@ -12,10 +12,6 @@ on:
|
||||||
description: 'Chip to run tests for'
|
description: 'Chip to run tests for'
|
||||||
required: true
|
required: true
|
||||||
|
|
||||||
concurrency:
|
|
||||||
group: tests-hw-${{ github.event.pull_request.number || github.ref }}-${{ inputs.chip }}-${{ inputs.type }}
|
|
||||||
cancel-in-progress: true
|
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
hardware-test:
|
hardware-test:
|
||||||
name: Hardware ${{ inputs.chip }} ${{ inputs.type }} tests
|
name: Hardware ${{ inputs.chip }} ${{ inputs.type }} tests
|
||||||
|
|
|
||||||
6
.github/workflows/push.yml
vendored
6
.github/workflows/push.yml
vendored
|
|
@ -171,7 +171,7 @@ jobs:
|
||||||
echo "chunks=$chunks" >> $GITHUB_OUTPUT
|
echo "chunks=$chunks" >> $GITHUB_OUTPUT
|
||||||
|
|
||||||
- name: Upload sketches found
|
- name: Upload sketches found
|
||||||
if: ${{ steps.set-chunks.outputs.build_all == 'false' }}
|
if: ${{ steps.set-chunks.outputs.build_all == 'false' && steps.set-chunks.outputs.build_libraries == 'true' }}
|
||||||
uses: actions/upload-artifact@v4
|
uses: actions/upload-artifact@v4
|
||||||
with:
|
with:
|
||||||
name: sketches_found
|
name: sketches_found
|
||||||
|
|
@ -214,13 +214,13 @@ jobs:
|
||||||
run: bash ./.github/scripts/on-push.sh ${{ matrix.chunk }} ${{ env.MAX_CHUNKS }} 1
|
run: bash ./.github/scripts/on-push.sh ${{ matrix.chunk }} ${{ env.MAX_CHUNKS }} 1
|
||||||
|
|
||||||
- name: Download sketches found
|
- name: Download sketches found
|
||||||
if: ${{ needs.gen-chunks.outputs.build_all == 'false' }}
|
if: ${{ needs.gen-chunks.outputs.build_all == 'false' && needs.gen-chunks.outputs.build_libraries == 'true' }}
|
||||||
uses: actions/download-artifact@v4
|
uses: actions/download-artifact@v4
|
||||||
with:
|
with:
|
||||||
name: sketches_found
|
name: sketches_found
|
||||||
|
|
||||||
- name: Build selected sketches
|
- name: Build selected sketches
|
||||||
if: ${{ needs.gen-chunks.outputs.build_all == 'false' }}
|
if: ${{ needs.gen-chunks.outputs.build_all == 'false' && needs.gen-chunks.outputs.build_libraries == 'true' }}
|
||||||
run: bash ./.github/scripts/on-push.sh ${{ matrix.chunk }} ${{ needs.gen-chunks.outputs.chunk_count }} 1 sketches_found.txt
|
run: bash ./.github/scripts/on-push.sh ${{ matrix.chunk }} ${{ needs.gen-chunks.outputs.chunk_count }} 1 sketches_found.txt
|
||||||
|
|
||||||
#Upload cli compile json as artifact
|
#Upload cli compile json as artifact
|
||||||
|
|
|
||||||
4
.github/workflows/qemu.yml
vendored
4
.github/workflows/qemu.yml
vendored
|
|
@ -10,10 +10,6 @@ on:
|
||||||
required: true
|
required: true
|
||||||
type: string
|
type: string
|
||||||
|
|
||||||
concurrency:
|
|
||||||
group: qemu-${{ github.event.pull_request.number || github.ref }}-${{ inputs.chip }}-${{ inputs.type }}
|
|
||||||
cancel-in-progress: true
|
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
qemu-test:
|
qemu-test:
|
||||||
name: QEMU ${{ inputs.chip }} ${{ inputs.type }} tests
|
name: QEMU ${{ inputs.chip }} ${{ inputs.type }} tests
|
||||||
|
|
|
||||||
4
.github/workflows/wokwi.yml
vendored
4
.github/workflows/wokwi.yml
vendored
|
|
@ -16,10 +16,6 @@ on:
|
||||||
description: 'Wokwi CLI API token'
|
description: 'Wokwi CLI API token'
|
||||||
required: true
|
required: true
|
||||||
|
|
||||||
concurrency:
|
|
||||||
group: tests-wokwi-${{ github.event.pull_request.number || github.ref }}-${{ inputs.chip }}-${{ inputs.type }}
|
|
||||||
cancel-in-progress: true
|
|
||||||
|
|
||||||
env:
|
env:
|
||||||
WOKWI_TIMEOUT: 600000 # Milliseconds
|
WOKWI_TIMEOUT: 600000 # Milliseconds
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -67,12 +67,12 @@ bool MacAddress::fromString(const char *buf) {
|
||||||
|
|
||||||
//Parse user entered string into MAC address
|
//Parse user entered string into MAC address
|
||||||
bool MacAddress::fromString6(const char *buf) {
|
bool MacAddress::fromString6(const char *buf) {
|
||||||
char cs[18];
|
char cs[18]; // 17 + 1 for null terminator
|
||||||
char *token;
|
char *token;
|
||||||
char *next; //Unused but required
|
char *next; //Unused but required
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
strncpy(cs, buf, sizeof(cs)); //strtok modifies the buffer: copy to working buffer.
|
strncpy(cs, buf, sizeof(cs) - 1); //strtok modifies the buffer: copy to working buffer.
|
||||||
|
|
||||||
for (i = 0; i < 6; i++) {
|
for (i = 0; i < 6; i++) {
|
||||||
token = strtok((i == 0) ? cs : NULL, ":"); //Find first or next token
|
token = strtok((i == 0) ? cs : NULL, ":"); //Find first or next token
|
||||||
|
|
@ -86,12 +86,12 @@ bool MacAddress::fromString6(const char *buf) {
|
||||||
}
|
}
|
||||||
|
|
||||||
bool MacAddress::fromString8(const char *buf) {
|
bool MacAddress::fromString8(const char *buf) {
|
||||||
char cs[24];
|
char cs[24]; // 23 + 1 for null terminator
|
||||||
char *token;
|
char *token;
|
||||||
char *next; //Unused but required
|
char *next; //Unused but required
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
strncpy(cs, buf, sizeof(cs)); //strtok modifies the buffer: copy to working buffer.
|
strncpy(cs, buf, sizeof(cs) - 1); //strtok modifies the buffer: copy to working buffer.
|
||||||
|
|
||||||
for (i = 0; i < 8; i++) {
|
for (i = 0; i < 8; i++) {
|
||||||
token = strtok((i == 0) ? cs : NULL, ":"); //Find first or next token
|
token = strtok((i == 0) ? cs : NULL, ":"); //Find first or next token
|
||||||
|
|
|
||||||
|
|
@ -458,7 +458,7 @@ esp_err_t __analogContinuousInit(adc_channel_t *channel, uint8_t channel_num, ad
|
||||||
|
|
||||||
bool analogContinuous(uint8_t pins[], size_t pins_count, uint32_t conversions_per_pin, uint32_t sampling_freq_hz, void (*userFunc)(void)) {
|
bool analogContinuous(uint8_t pins[], size_t pins_count, uint32_t conversions_per_pin, uint32_t sampling_freq_hz, void (*userFunc)(void)) {
|
||||||
adc_channel_t channel[pins_count];
|
adc_channel_t channel[pins_count];
|
||||||
adc_unit_t adc_unit;
|
adc_unit_t adc_unit = ADC_UNIT_1;
|
||||||
esp_err_t err = ESP_OK;
|
esp_err_t err = ESP_OK;
|
||||||
|
|
||||||
//Convert pins to channels and check if all are ADC1s unit
|
//Convert pins to channels and check if all are ADC1s unit
|
||||||
|
|
|
||||||
|
|
@ -87,4 +87,4 @@ dependencies:
|
||||||
version: "1.0.3"
|
version: "1.0.3"
|
||||||
require: public
|
require: public
|
||||||
examples:
|
examples:
|
||||||
- path: ./idf_component_examples/Hello_world
|
- path: ./idf_component_examples/hello_world
|
||||||
|
|
|
||||||
|
|
@ -12,13 +12,13 @@ To create a ESP-IDF project from this example with the latest release of Arduino
|
||||||
ESP-IDF will download all dependencies needed from the component registry and setup the project for you.
|
ESP-IDF will download all dependencies needed from the component registry and setup the project for you.
|
||||||
|
|
||||||
If you want to use cloned Arduino-esp32 repository, you can build this example directly.
|
If you want to use cloned Arduino-esp32 repository, you can build this example directly.
|
||||||
Go to the example folder `arduino-esp32/idf_component_examples/Hello_world`.
|
Go to the example folder `arduino-esp32/idf_component_examples/hello_world`.
|
||||||
First you need to comment line 6 `pre_release: true` in examples `/main/idf_component.yml`.
|
First you need to comment line 6 `pre_release: true` in examples `/main/idf_component.yml`.
|
||||||
Then just run command: `idf.py build`.
|
Then just run command: `idf.py build`.
|
||||||
|
|
||||||
## Example folder contents
|
## Example folder contents
|
||||||
|
|
||||||
The project **Hello_world** contains one source file in C++ language [main.cpp](main/main.cpp). The file is located in folder [main](main).
|
The project **hello_world** contains one source file in C++ language [main.cpp](main/main.cpp). The file is located in folder [main](main).
|
||||||
|
|
||||||
ESP-IDF projects are built using CMake. The project build configuration is contained in `CMakeLists.txt`
|
ESP-IDF projects are built using CMake. The project build configuration is contained in `CMakeLists.txt`
|
||||||
files that provide set of directives and instructions describing the project's source files and targets
|
files that provide set of directives and instructions describing the project's source files and targets
|
||||||
|
|
@ -358,11 +358,11 @@ err:
|
||||||
#endif /* CONFIG_ETH_USE_ESP32_EMAC */
|
#endif /* CONFIG_ETH_USE_ESP32_EMAC */
|
||||||
|
|
||||||
#if ETH_SPI_SUPPORTS_CUSTOM
|
#if ETH_SPI_SUPPORTS_CUSTOM
|
||||||
static void *_eth_spi_init(const void *ctx) {
|
__unused static void *_eth_spi_init(const void *ctx) {
|
||||||
return (void *)ctx;
|
return (void *)ctx;
|
||||||
}
|
}
|
||||||
|
|
||||||
static esp_err_t _eth_spi_deinit(void *ctx) {
|
__unused static esp_err_t _eth_spi_deinit(void *ctx) {
|
||||||
return ESP_OK;
|
return ESP_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -575,8 +575,8 @@ bool ETHClass::beginSPI(
|
||||||
}
|
}
|
||||||
|
|
||||||
// Init common MAC and PHY configs to default
|
// Init common MAC and PHY configs to default
|
||||||
eth_mac_config_t eth_mac_config = ETH_MAC_DEFAULT_CONFIG();
|
__unused eth_mac_config_t eth_mac_config = ETH_MAC_DEFAULT_CONFIG();
|
||||||
eth_phy_config_t phy_config = ETH_PHY_DEFAULT_CONFIG();
|
__unused eth_phy_config_t phy_config = ETH_PHY_DEFAULT_CONFIG();
|
||||||
|
|
||||||
// Update PHY config based on board specific configuration
|
// Update PHY config based on board specific configuration
|
||||||
phy_config.phy_addr = phy_addr;
|
phy_config.phy_addr = phy_addr;
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue