Skip to content

Fix missing GPIO definition#153

Open
h2zero wants to merge 1 commit intoPaulStoffregen:masterfrom
h2zero:GPIO-fix
Open

Fix missing GPIO definition#153
h2zero wants to merge 1 commit intoPaulStoffregen:masterfrom
h2zero:GPIO-fix

Conversation

@h2zero
Copy link
Copy Markdown

@h2zero h2zero commented Apr 12, 2025

Fixes the GPIO definition error for esp32 with IDF > v5.

@NecroMancer05
Copy link
Copy Markdown

I have same issue. This PR needs to merged asap. Thanks @h2zero

@joyfullservice
Copy link
Copy Markdown

It would be really helpful to have this merged. Right now I have to manually edit the source file for each project every time the library updates. I would rather not have to fork a custom version of the library just to add this line of code... 🤔 Is there anything holding this up from being merged?

@PaulStoffregen
Copy link
Copy Markdown
Owner

Does this work for everyone?

Usually this type of change involves an ifdef check to include the proper header based on the version used.

If I merge this, does it break for everyone using the old version?

@joyfullservice
Copy link
Copy Markdown

Hi Paul,

Thanks for looking at this! I can't speak for everyone, but in my environment I am using the following in PlatformIO/PIOArduino:

[env:esp32-s2-mini]
platform = https://github.com/pioarduino/platform-espressif32/releases/download/51.03.07/platform-espressif32.zip
board = lolin_s2_mini
framework = arduino

This release is based on IDF v5.1.4 and released in October 2024.

In my present build environment, I can use either of the following two lines to resolve the compile error:

#include <soc/gpio_struct.h>
#include <hal/gpio_ll.h>

The second line gpio_ll.h contains the include for gpio_struct.h, so my project can resolve it either way. If the second line is more compatible with newer version, that is fine with me.

After some more troubleshooting today, I think I have potentially uncovered the underlying issue for me. For some reason, it appears that the 2.3.8 version published on the PlatformIO registry is using the 2.3.7 version of OneWire/util/OneWire_direct_gpio.h. All the other files are identical to the GitHub release. I have confirmed this on a fresh install on a different computer. This means that I don't get either line shown above when installing the library through PlatformIO. I am guessing that I probably need to open an issue with PlatformIO to resolve the issue with the registry.

@joyfullservice
Copy link
Copy Markdown

For reference, I have created a post on the PlatformIO forum to address the issue with the broken library on the PlatformIO registry. https://community.platformio.org/t/onewire-2-3-8-from-registry-missing-important-line-of-code-from-github-release/48183

@joyfullservice
Copy link
Copy Markdown

FYI: PlatformIO was able to update their library version to match the files under the current release tag. (Evidently changes were made after the release tag was published, and were not picked up by the automated updater because the version number had not changed.) See the above link for details.

This fixes the compile issue for me, and allows me to build my projects using the current v2.3.8 release.

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

Successfully merging this pull request may close these issues.

4 participants