Pull OneWire 2.3.8 from Paul Stoffregen's upstream #2981
Pull OneWire 2.3.8 from Paul Stoffregen's upstream #2981slaff merged 8 commits intoSmingHub:developfrom
Conversation
PR Summary
|
|
not sure how I should interpret those test failures, given that the code compiles fine on Windows? (I'm also not seeing the full test run output) |
|
Thanks for this PR!
Yep, Windows builds are very slow so are not as comprehensive as linux builds.
Do you mean in code? esp32 runs in a separate git action, though they all fail due to missing The other failures seem to be because |
- Make ARDUINO_xxx definitions available for `OneWire_direct_regtype.h` - Provide `digitalPinIsValid()` macro for ESP32 use
|
@pljakobs I've taken the liberty of (hopefully) fixing the build errors. |
Fixes support for all variants, including esp32c2 which fails CI tests.
|
thanks @mikee47! |
|
I note that |
|
generally, OneWire is an open collector bus, so a pullup is needed, but that's generally an external 4.7k - not sure why you'd explicitly disable the internal pullup unless it was significantly lower than 10k or so. |
|
@pljakobs Please test this PR on your micro controllers to see if the issue is fixed with this PR and there are no un-expected side effects. |
The internal pullup on esp* and rp2040 are all very weak by comparison (47K+ IIRC) so I would agree. Although now I think about this, So I think this is safe. |
|
@pljakobs Have you checked this out on an esp8266? |
I have not yet have time to do so but will asap. I can also test Esp32. |
@pljakobs any progress here? |
|
finally got around to verify it with an ESP8266 (sorry it took a while, most of them are designed into things, so I had to dig out a dev board) PS: I have a few more OneWire devices on order to verify wider compatibility, but DS18x20 should be the most widely used |
You can try this sample: https://github.com/SmingHub/Sming/tree/develop/samples/Temperature_DS1820 |
|
works too Reading temperature DEMO 70052661 DBG: DS1820 reading task start, try to read up to 4 sensors |
Thank you for testing this too. |
I have noticed OneWire issues on the ESP32C3 when using WiFi - from the data on the wire, it seemed like the timing was slightly off due to calling nointerrups() for the critical sections.
After some investigation and dropping the idea to implement the protocol using the RMT peripheral (mostly because that is strictly send or receive and having both on the same pin requires constantly switching modes) I looked at the upstream and there, the same issue is addressed by using
instead of actually disabling / enabling interrupts.
This works reliably for me
However: this has had pretty little testig on my end (just this one platform, just a DS18B12 temperature sensor) so I would love to see it tested in more environments.