PaulStoffregen / OneWire

Library for Dallas/Maxim 1-Wire Chips
http://www.pjrc.com/teensy/td_libs_OneWire.html
607 stars 391 forks source link

Fix issue with getDeviceCount() on ESP32 #106

Closed mp-se closed 5 months ago

mp-se commented 2 years ago

This PR implements the changes suggested in "Error ds18b20 with esp32" #57. Credits goes to the author of the fix.

I can confirm that the getDS18Count()/getDeviceCount() always return 0 on a ESP32 system but this small change fixest that. I could see the fix needed but could not find a PR that actually changes the code.

mathertel commented 2 years ago

Why is IRAM_ATTR required for ESP32 ? using IRAM_ATTR must be done with care as this is a rare ressource !

mp-se commented 2 years ago

Dont know, check with the author of the code, see link above

uzi18 commented 2 years ago

@mathertel I guess it is cache/flash fetch issue.

blazoncek commented 1 year ago

Why is IRAM_ATTR required for ESP32 ?

Apparently caching issue skewing micros() timings.