[RF] Use exponential backoff delay in initCC1101() #1874
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description:
In #1812, the function initCC1101() was created to poll getCC1101() until it returns true before using the CC1101 chip. A 500ms delay was put between polls.
In my experience, this delay is too long as the the chip is often ready very shortly after the first check. This change makes the function use exponential backoff to initially check quickly (16ms), then double the wait time until waiting the original 500ms.
A simpler change would be to just use a smaller constant delay, but exponential backoff is a good compromise in case there are instances where a longer delay is needed.
Checklist: