Skip to content

Commit b2a4f22

Browse files
committed
fix(idf): Fix compilation warnings when as component
1 parent 3231bcc commit b2a4f22

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

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;
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+
cs = strdup(buf);
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;
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+
cs = strdup(buf);
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

0 commit comments

Comments
 (0)