PaulStoffregen / OneWire

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

Add ONEWIRE_MULTICORE flag to run in multi-core env #104

Open heeres opened 3 years ago

heeres commented 3 years ago

I could not get the OneWire library working reliably on my ESP32 board while using both cores: WiFi stuff on core 0, main application on core 1. It seems the culprit is that flash is shared between both cores, and execution will stall when both cores have to access it. The solution is to make the critical functions live in RAM. Perhaps flash access could also result in improper timing in a single core situation, although I did not observe that.

blazoncek commented 1 year ago

Similar to #93 The IRAM_ATTR helps solve the temperature readings.