Skip to content
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

Open
wants to merge 15 commits into
base: main
Choose a base branch
from

Conversation

tyeth
Copy link
Contributor

@tyeth tyeth commented Apr 9, 2024

No description provided.

@tyeth
Copy link
Contributor Author

tyeth commented Apr 10, 2024

@brentru ready for review, release blocked until partition size resolved on some build targets as discussed yesterday

@tyeth tyeth requested a review from brentru April 10, 2024 15:42
@tyeth tyeth force-pushed the add-VL53L4CX branch 2 times, most recently from e0abaf8 to 213fcef Compare April 24, 2024 19:46
@tyeth tyeth marked this pull request as ready for review April 25, 2024 18:39
@tyeth
Copy link
Contributor Author

tyeth commented Apr 25, 2024

@brentru ready for review, tested locally, will retest on staging before merge

@tyeth
Copy link
Contributor Author

tyeth commented May 17, 2024

Re-ready for review @brentru

@tyeth tyeth requested a review from brentru May 17, 2024 16:59
*/
/*******************************************************************************/
void awaitDataReady(int &status, uint8_t &NewDataReady) {
for (uint8_t retries = 0;
Copy link
Member

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.

Copy link
Contributor Author

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)?

Copy link
Member

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); };
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants