Prevent ints from corrupting the read sequence#62
Conversation
Enclose the read sequence within an ATOMIC_BLOCK macro to prevent system interrupts from corrupting the value returned by read()
|
Dear @dhmsjs, we just pushed some amendments to this popular library where we rebundled some pieces which have been loosely floating around here [1]. While being at it, we also cherry-picked one of your commits, thanks again. For more details, please follow the issue referenced above. As we actually don't have any hardware on our workbench, we will be happy to hear about successful reports from the community running this on a real iron, actually on as much as possible things supported by the Arduino framework. Maybe you can afford some minutes to check whether the status quo works as expected if you still have a MCU and a HX711 breakout around? We will appreciate your feedback, thanks already. With kind regards, |
|
As we already told you that your suggestions have been incorporated into this library, we just wanted to give you appropriate credits, @dhmsjs . Your contributions have been very valuable to account for perfectly valid corner cases most users would never have recognized, don't even imagine fixing them. While being at it, we added appropriate critical section definitions for other popular Arduino platforms around and also used your well written inline comment as a perfect reference example for explaining things to our little community, see Protect code when accessing shared resources: AVR-specifics. Thanks again! As being superseded by merging #123, we might want to close this now. |
|
Nice work and thanks for the credits. Closing as suggested -- superseded by #123 Spring Cleaning |
Enclose the read sequence within an ATOMIC_BLOCK macro to prevent system interrupts from corrupting the value returned by read()