sx driver, bug, handle non initialized gconfig #302
Closed
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.
this should account for the crash with diversity, #245
we had already two attempts to resolve,
https://github.com/olliw42/mLRS/tree/owpr-rfpower-antenna
#266
however, I've determined that the underlying "true" issue is that gconfig in the sx drivers is not initialized due to these lines https://github.com/olliw42/mLRS/blob/main/mLRS/CommonRx/mlrs-rx.cpp#L549-L550, which make the Startup() may not be called and gconfig thus not be set. The result is an acces to an undefined location.
Interesting enough that the issue, which is clearly a bug, never came up before.
One could have changed code such that Startup() is always called but only the sx not initialzed. I've opted for allowing gconfig to be non-initzialized. Not sure which approach is better, bith seem to me to do the same at the end of the day.