Closed jlpoltrack closed 1 week ago
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 :(
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.
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.
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
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
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.
To address: https://github.com/olliw42/mLRS/issues/200
Tested on SuperD