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

common, fix antenna 2 on single spi #202

Closed
wants to merge 1 commit into from

Conversation

jlpoltrack
Copy link
Collaborator

To address: #200

Tested on SuperD

@olliw42
Copy link
Owner

olliw42 commented Jun 25, 2024

THX!

I unfortunately don't like it all however. This breaks all abstraction, layering & architecture. The simplest approach to disentangle would be let Init have a parameter, like bool initialize_spi, and set that properly upon call in main.
Structure-wise it's all so nice, but I don't have any good idea either :(

@olliw42
Copy link
Owner

olliw42 commented Jun 26, 2024

it is actually also surprising it works

first, Config is populated in setup_init(); which is called only after sx2.Init(); ....

https://github.com/olliw42/mLRS/blob/main/mLRS/CommonTx/mlrs-tx.cpp#L274-L277
https://github.com/olliw42/mLRS/blob/main/mLRS/CommonRx/mlrs-rx.cpp#L147-L150

moreover, since sx.Init() is called anyway, whatever antenna is selected, spi should have been inited already, so the additional code in sx2.Init() is just doing what was done already before.

@jlpoltrack
Copy link
Collaborator Author

it is actually also surprising it works

It doesn't - the ESP soft reboot after parameter save made it looked like it did. Going to close.

@jlpoltrack jlpoltrack closed this Jun 26, 2024
@olliw42
Copy link
Owner

olliw42 commented Jun 26, 2024

It doesn't - the ESP soft reboot after parameter save made it looked like it did.

ha, yeah, this works ... the crash is after repowering

good to see we have at least some consistency

MANY THX anyways

@jlpoltrack
Copy link
Collaborator Author

One last thought - for the time being should we change the diversity mask for single SPI so that it doesn't allow Antenna 2 to be selected? Currently if you select Antenna 2 you'd get stuck and would have to wipe / reflash: https://github.com/olliw42/mLRS/blob/main/mLRS/Common/setup.h#L87-L89

@olliw42
Copy link
Owner

olliw42 commented Jun 26, 2024

I had that thought too but kind of was hoping that the proper solution might found in not too distant future ... but if we don't I guess we should do exactly that, at least as momentry precaution.

@jlpoltrack jlpoltrack deleted the common,-fix-antenna-2-on-single-spi branch June 29, 2024 00:36
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.

2 participants