-
Notifications
You must be signed in to change notification settings - Fork 40
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Refactored commit - VL53L4CX default settings #564
base: main
Are you sure you want to change the base?
Conversation
@brentru ready for review, release blocked until partition size resolved on some build targets as discussed yesterday |
e0abaf8
to
213fcef
Compare
@brentru ready for review, tested locally, will retest on staging before merge |
Re-ready for review @brentru |
*/ | ||
/*******************************************************************************/ | ||
void awaitDataReady(int &status, uint8_t &NewDataReady) { | ||
for (uint8_t retries = 0; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could we return NAN, and return immediately vs retrying three times? These drivers are supposed to be very small and fast, like an interrupt routine.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
NaN doesn't mean data not ready, especially with these ToF sensors. It's meant to mean nothing in range (but a clear signal response).
I kind of feel like we should return false and retry in the next polling loop, but the retry logic in main polling loop is not smart (endlessly retries sensors returning false).
Maybe I should I rejig the polling logic in the main file to retry falses a couple of times instead (per poll period) before marking their next poll period in the future regardless (like a good read would after first value returned)?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe restrict the polling logic to a limited # of retries?
if (status != VL53L4CX_ERROR_NONE) { | ||
WS_DEBUG_PRINT( | ||
"VL53L4CX Error clearing interrupt and starting measurement: "); | ||
{ USBSerial.println(status); }; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
?
No description provided.