Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve Log Messages in GPIO HAL #9011

Merged
merged 4 commits into from
Dec 19, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions cores/esp32/esp32-hal-gpio.c
Original file line number Diff line number Diff line change
Expand Up @@ -104,14 +104,14 @@ extern void ARDUINO_ISR_ATTR __pinMode(uint8_t pin, uint8_t mode)
#endif

if (pin >= SOC_GPIO_PIN_COUNT) {
log_e("Invalid pin selected");
log_e("Invalid IO %i selected", pin);
return;
}

if(perimanGetPinBus(pin, ESP32_BUS_TYPE_GPIO) == NULL){
perimanSetBusDeinit(ESP32_BUS_TYPE_GPIO, gpioDetachBus);
if(!perimanClearPinBus(pin)){
log_e("Deinit of previous bus failed");
log_e("Deinit of previous bus from IO %i failed", pin);
return;
}
}
Expand Down Expand Up @@ -140,7 +140,7 @@ extern void ARDUINO_ISR_ATTR __pinMode(uint8_t pin, uint8_t mode)
}
if(gpio_config(&conf) != ESP_OK)
{
log_e("GPIO config failed");
log_e("IO %i config failed", pin);
return;
}
if(perimanGetPinBus(pin, ESP32_BUS_TYPE_GPIO) == NULL){
Expand All @@ -164,7 +164,7 @@ extern void ARDUINO_ISR_ATTR __digitalWrite(uint8_t pin, uint8_t val)
if(perimanGetPinBus(pin, ESP32_BUS_TYPE_GPIO) != NULL){
gpio_set_level((gpio_num_t)pin, val);
} else {
log_e("Pin is not set as GPIO.");
log_e("IO %i is not set as GPIO.", pin);
}
}

Expand All @@ -174,7 +174,7 @@ extern int ARDUINO_ISR_ATTR __digitalRead(uint8_t pin)
return gpio_get_level((gpio_num_t)pin);
}
else {
log_e("Pin is not set as GPIO.");
log_e("IO %i is not set as GPIO.", pin);
return 0;
}
}
Expand Down Expand Up @@ -204,7 +204,7 @@ extern void __attachInterruptFunctionalArg(uint8_t pin, voidFuncPtrArg userFunc,
interrupt_initialized = (err == ESP_OK) || (err == ESP_ERR_INVALID_STATE);
}
if(!interrupt_initialized) {
log_e("GPIO ISR Service Failed To Start");
log_e("IO %i ISR Service Failed To Start", pin);
return;
}

Expand Down