Skip to content

Commit 2928654

Browse files
authored
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
1 parent e3fedc5 commit 2928654

File tree

15 files changed

+15
-31
lines changed

15 files changed

+15
-31
lines changed

Diff for: .github/workflows/build_tests.yml

-4
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,6 @@ on:
1212
description: 'Chip to build tests for'
1313
required: true
1414

15-
concurrency:
16-
group: tests-build-${{ github.event.pull_request.number || github.ref }}-${{ inputs.chip }}-${{ inputs.type }}
17-
cancel-in-progress: true
18-
1915
jobs:
2016
build-tests:
2117
name: Build ${{ inputs.type }} tests for ${{ inputs.chip }}

Diff for: .github/workflows/hw.yml

-4
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,6 @@ on:
1212
description: 'Chip to run tests for'
1313
required: true
1414

15-
concurrency:
16-
group: tests-hw-${{ github.event.pull_request.number || github.ref }}-${{ inputs.chip }}-${{ inputs.type }}
17-
cancel-in-progress: true
18-
1915
jobs:
2016
hardware-test:
2117
name: Hardware ${{ inputs.chip }} ${{ inputs.type }} tests

Diff for: .github/workflows/push.yml

+3-3
Original file line numberDiff line numberDiff line change
@@ -171,7 +171,7 @@ jobs:
171171
echo "chunks=$chunks" >> $GITHUB_OUTPUT
172172
173173
- name: Upload sketches found
174-
if: ${{ steps.set-chunks.outputs.build_all == 'false' }}
174+
if: ${{ steps.set-chunks.outputs.build_all == 'false' && steps.set-chunks.outputs.build_libraries == 'true' }}
175175
uses: actions/upload-artifact@v4
176176
with:
177177
name: sketches_found
@@ -214,13 +214,13 @@ jobs:
214214
run: bash ./.github/scripts/on-push.sh ${{ matrix.chunk }} ${{ env.MAX_CHUNKS }} 1
215215

216216
- name: Download sketches found
217-
if: ${{ needs.gen-chunks.outputs.build_all == 'false' }}
217+
if: ${{ needs.gen-chunks.outputs.build_all == 'false' && needs.gen-chunks.outputs.build_libraries == 'true' }}
218218
uses: actions/download-artifact@v4
219219
with:
220220
name: sketches_found
221221

222222
- name: Build selected sketches
223-
if: ${{ needs.gen-chunks.outputs.build_all == 'false' }}
223+
if: ${{ needs.gen-chunks.outputs.build_all == 'false' && needs.gen-chunks.outputs.build_libraries == 'true' }}
224224
run: bash ./.github/scripts/on-push.sh ${{ matrix.chunk }} ${{ needs.gen-chunks.outputs.chunk_count }} 1 sketches_found.txt
225225

226226
#Upload cli compile json as artifact

Diff for: .github/workflows/qemu.yml

-4
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,6 @@ on:
1010
required: true
1111
type: string
1212

13-
concurrency:
14-
group: qemu-${{ github.event.pull_request.number || github.ref }}-${{ inputs.chip }}-${{ inputs.type }}
15-
cancel-in-progress: true
16-
1713
jobs:
1814
qemu-test:
1915
name: QEMU ${{ inputs.chip }} ${{ inputs.type }} tests

Diff for: .github/workflows/wokwi.yml

-4
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,6 @@ on:
1616
description: 'Wokwi CLI API token'
1717
required: true
1818

19-
concurrency:
20-
group: tests-wokwi-${{ github.event.pull_request.number || github.ref }}-${{ inputs.chip }}-${{ inputs.type }}
21-
cancel-in-progress: true
22-
2319
env:
2420
WOKWI_TIMEOUT: 600000 # Milliseconds
2521

Diff for: cores/esp32/MacAddress.cpp

+4-4
Original file line numberDiff line numberDiff line change
@@ -67,12 +67,12 @@ bool MacAddress::fromString(const char *buf) {
6767

6868
//Parse user entered string into MAC address
6969
bool MacAddress::fromString6(const char *buf) {
70-
char cs[18];
70+
char cs[18]; // 17 + 1 for null terminator
7171
char *token;
7272
char *next; //Unused but required
7373
int i;
7474

75-
strncpy(cs, buf, sizeof(cs)); //strtok modifies the buffer: copy to working buffer.
75+
strncpy(cs, buf, sizeof(cs) - 1); //strtok modifies the buffer: copy to working buffer.
7676

7777
for (i = 0; i < 6; i++) {
7878
token = strtok((i == 0) ? cs : NULL, ":"); //Find first or next token
@@ -86,12 +86,12 @@ bool MacAddress::fromString6(const char *buf) {
8686
}
8787

8888
bool MacAddress::fromString8(const char *buf) {
89-
char cs[24];
89+
char cs[24]; // 23 + 1 for null terminator
9090
char *token;
9191
char *next; //Unused but required
9292
int i;
9393

94-
strncpy(cs, buf, sizeof(cs)); //strtok modifies the buffer: copy to working buffer.
94+
strncpy(cs, buf, sizeof(cs) - 1); //strtok modifies the buffer: copy to working buffer.
9595

9696
for (i = 0; i < 8; i++) {
9797
token = strtok((i == 0) ? cs : NULL, ":"); //Find first or next token

Diff for: cores/esp32/esp32-hal-adc.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -458,7 +458,7 @@ esp_err_t __analogContinuousInit(adc_channel_t *channel, uint8_t channel_num, ad
458458

459459
bool analogContinuous(uint8_t pins[], size_t pins_count, uint32_t conversions_per_pin, uint32_t sampling_freq_hz, void (*userFunc)(void)) {
460460
adc_channel_t channel[pins_count];
461-
adc_unit_t adc_unit;
461+
adc_unit_t adc_unit = ADC_UNIT_1;
462462
esp_err_t err = ESP_OK;
463463

464464
//Convert pins to channels and check if all are ADC1s unit

Diff for: idf_component.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -87,4 +87,4 @@ dependencies:
8787
version: "1.0.3"
8888
require: public
8989
examples:
90-
- path: ./idf_component_examples/Hello_world
90+
- path: ./idf_component_examples/hello_world

Diff for: idf_component_examples/Hello_world/README.md renamed to idf_component_examples/hello_world/README.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -12,13 +12,13 @@ To create a ESP-IDF project from this example with the latest release of Arduino
1212
ESP-IDF will download all dependencies needed from the component registry and setup the project for you.
1313

1414
If you want to use cloned Arduino-esp32 repository, you can build this example directly.
15-
Go to the example folder `arduino-esp32/idf_component_examples/Hello_world`.
15+
Go to the example folder `arduino-esp32/idf_component_examples/hello_world`.
1616
First you need to comment line 6 `pre_release: true` in examples `/main/idf_component.yml`.
1717
Then just run command: `idf.py build`.
1818

1919
## Example folder contents
2020

21-
The project **Hello_world** contains one source file in C++ language [main.cpp](main/main.cpp). The file is located in folder [main](main).
21+
The project **hello_world** contains one source file in C++ language [main.cpp](main/main.cpp). The file is located in folder [main](main).
2222

2323
ESP-IDF projects are built using CMake. The project build configuration is contained in `CMakeLists.txt`
2424
files that provide set of directives and instructions describing the project's source files and targets

Diff for: libraries/Ethernet/src/ETH.cpp

+4-4
Original file line numberDiff line numberDiff line change
@@ -358,11 +358,11 @@ bool ETHClass::begin(eth_phy_type_t type, int32_t phy_addr, int mdc, int mdio, i
358358
#endif /* CONFIG_ETH_USE_ESP32_EMAC */
359359

360360
#if ETH_SPI_SUPPORTS_CUSTOM
361-
static void *_eth_spi_init(const void *ctx) {
361+
__unused static void *_eth_spi_init(const void *ctx) {
362362
return (void *)ctx;
363363
}
364364

365-
static esp_err_t _eth_spi_deinit(void *ctx) {
365+
__unused static esp_err_t _eth_spi_deinit(void *ctx) {
366366
return ESP_OK;
367367
}
368368

@@ -575,8 +575,8 @@ bool ETHClass::beginSPI(
575575
}
576576

577577
// Init common MAC and PHY configs to default
578-
eth_mac_config_t eth_mac_config = ETH_MAC_DEFAULT_CONFIG();
579-
eth_phy_config_t phy_config = ETH_PHY_DEFAULT_CONFIG();
578+
__unused eth_mac_config_t eth_mac_config = ETH_MAC_DEFAULT_CONFIG();
579+
__unused eth_phy_config_t phy_config = ETH_PHY_DEFAULT_CONFIG();
580580

581581
// Update PHY config based on board specific configuration
582582
phy_config.phy_addr = phy_addr;

0 commit comments

Comments
 (0)