Added optional timeout to all read functions. #8
Added optional timeout to all read functions. #8jlblancoc wants to merge 4 commits intoLowPowerLab:masterfrom
Conversation
|
Thanks Jose, |
|
Hi Felix, and thank you for sharing this project! We had a problem of the uC getting locked in one of the data request methods when no sensor was connected... it's weird because I thought that I2C should be able to detect a lack of ACK (so perhaps the problem was raised by our particular hardware design), but without this patch the firmware always locked when a SI7021 sensor was not connected. |
There was a problem hiding this comment.
Looking OK but I would like to request some changes to the formatting of the code. Please keep the spacing (single double-space for tabs, etc) so that unmodified code would not be changed.
Also:
- rather than passing parameters to all functions, I would implement a
#define TIMEOUT_MSand use that only where needed, would provide a much cleaner change - there should not be any TABs, only spaces (and 1 TAB=2 spaces).
- the changes to
int SI7021::getSerialBytesare invalid, it needs to return auint32_t, this function should be left untouched other than the timeout implementation.
Many thanks.
|
LowPowerLab you did the code review and instead of accepting the commit and submit your own version on top with the proposed fixes expected the original author to do that for you. He didn't. |
Added optional timeout to all read functions to avoid infinite locks upon sensor failure or disconnection.