Skip to content

Commit

Permalink
fix(idf): Fix compilation warnings when as component
Browse files Browse the repository at this point in the history
  • Loading branch information
lucasssvaz committed Jun 7, 2024
1 parent 3231bcc commit b2a4f22
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
8 changes: 4 additions & 4 deletions cores/esp32/MacAddress.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -67,12 +67,12 @@ bool MacAddress::fromString(const char *buf) {

//Parse user entered string into MAC address
bool MacAddress::fromString6(const char *buf) {
char cs[18];
char *cs;
char *token;
char *next; //Unused but required
int i;

strncpy(cs, buf, sizeof(cs)); //strtok modifies the buffer: copy to working buffer.
cs = strdup(buf);

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

bool MacAddress::fromString8(const char *buf) {
char cs[24];
char *cs;
char *token;
char *next; //Unused but required
int i;

strncpy(cs, buf, sizeof(cs)); //strtok modifies the buffer: copy to working buffer.
cs = strdup(buf);

for (i = 0; i < 8; i++) {
token = strtok((i == 0) ? cs : NULL, ":"); //Find first or next token
Expand Down
2 changes: 1 addition & 1 deletion cores/esp32/esp32-hal-adc.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)) {
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;

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

0 comments on commit b2a4f22

Please sign in to comment.