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

gpio_pad_select_gpio() has changed to gpio_reset_pin() #1

Open
nopnop2002 opened this issue Oct 19, 2021 · 2 comments
Open

gpio_pad_select_gpio() has changed to gpio_reset_pin() #1

nopnop2002 opened this issue Oct 19, 2021 · 2 comments

Comments

@nopnop2002
Copy link

Thank you for publishing the library.

esp-idf v4.4 added support for ESP32-C3.

Along with this, gpio_pad_select_gpio() has changed to gpio_reset_pin().

Some GPIOs are not initialized properly when using gpio_pad_select_gpio().

https://github.com/espressif/esp-idf/blob/master/examples/get-started/blink/main/blink_example_main.c#L63

@mbratch
Copy link

mbratch commented Dec 10, 2022

Thanks for the info. I had to do some searching to hunt this down. The ESP-IDF 4.4 to 5.0 migration guide doesn't mention it.

@nopnop2002
Copy link
Author

nopnop2002 commented Dec 10, 2022

esp-idf v5 gives error like this

../components/rotary-encoder/include/rotary_encoder.h:47:10: fatal error: driver/gpio.h: No such file or directory
   47 | #include "driver/gpio.h"

In Ver5, driver component is not included by target components anymore. Applications using driver shall now explicitly require it in their CMakeLists.txt file.


CMakeLists.txt changes required

idf_component_register(SRCS "rotary_encoder.c" PRIV_REQUIRES driver INCLUDE_DIRS include)

#set(COMPONENT_ADD_INCLUDEDIRS include)
#set(COMPONENT_SRCS "rotary_encoder.c")
#register_component()

In Ver5, gpio_pad_select_gpio is obsolete.

../components/rotary-encoder/rotary_encoder.c:223:9: error: implicit declaration of function 'gpio_pad_select_gpio'; did you mean 'esp_rom_gpio_pad_select_gpio'? [-Werror=implicit-function-declaration]
  223 |         gpio_pad_select_gpio(info->pin_a);
      |         ^~~~~~~~~~~~~~~~~~~~
      |         esp_rom_gpio_pad_select_gpio

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants