-
Notifications
You must be signed in to change notification settings - Fork 7.4k
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
Conversation
👋 Hello SuGlider, we appreciate your contribution to this project! Click to see more instructions ...
Review and merge process you can expect ...
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just suggested small change, else looks good. :)
cores/esp32/esp32-hal-gpio.c
Outdated
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 GPIO %i failed", pin); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pin is not set as GPIO yet, so better to use "pin" instead of "GPIO".
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pin: usually the physical pin number on a chip or module
GPIO: usually the hardware IO+IOBUS number inside the chip. Do not apply for special purpose IOs
IO: usually wider sense, which includes GPIO and special purpose IOs
BUT because we are special and have IO mode = GPIO and all our IOs can be GPIOs, let's use IO from now on for when we want to specify something on the hardware level that might not be in GPIO mode.
If we are in pinMode
or going through the matrix, then we are in GPIO mode. If we are using something analog (ADC, DAC, Touch, etc.) we are in RTC mode. Else we are in special mode (I'm pretty sure we don't currently use it, but UART0 starts that way, Flash/PSRAM are that way also and if IO numbers match SPI, we could use it there too for better 80MHz support)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have changed the message in this and other places. Let me know if you agree.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
@me-no-dev - Ready for final review. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
Description of Change
Improves the log messages by adding the GPIO number that has triggered the error message for better debugging.
Tests scenarios
Tested with ESP32-C3.
Related links
Fixes #9008