-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Fix inverted IQ check #3291
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
Fix inverted IQ check #3291
Conversation
Fix LR1121 passing wrong value to command
CapnBry
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Bonus cleanup too, nice. Seems to resolve the 50Hz connection not working after binding.
I have to admit I was clearly not awake enough this morning when I was trying to understand FHSSgetInitialFreq() << 1000000000. Shift right a billion?! No, that's a comparison you dum dum.
|
The problem still exists... The bug procedure is demonstrated in the video here. |
|
Well hang on, I was just lucky I believe. subGHz is always true for SX1280, since the value of the initialfreq is in register values, not absolute herz, which is 12,307,660, which will ignore the IQinvert even for Team2.4 But there is another issue that when going into binding mode, it ALWAYS needs to go through all the code of diff --git a/src/src/tx_main.cpp b/src/src/tx_main.cpp
index 2b2d26ce..89afe9c7 100644
--- a/src/src/tx_main.cpp
+++ b/src/src/tx_main.cpp
@@ -387,7 +387,8 @@ void SetRFLinkRate(uint8_t index) // Set speed of RF link
if ((ModParams == ExpressLRS_currAirRate_Modparams)
&& (RFperf == ExpressLRS_currAirRate_RFperfParams)
&& (subGHz || invertIQ == Radio.IQinverted)
- && (OtaSwitchModeCurrent == newSwitchMode))
+ && (OtaSwitchModeCurrent == newSwitchMode)
+ && (!InBindingMode)) // binding mode must always execute code below to set frequency
return;
DBGLN("set rate %u", index); |
src/src/tx_main.cpp
Outdated
| bool invertIQ = InBindingMode || (UID[5] & 0x01); | ||
| OtaSwitchMode_e newSwitchMode = (OtaSwitchMode_e)config.GetSwitchMode(); | ||
|
|
||
| bool subGHz = FHSSgetInitialFreq() < 1000000000; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
bool subGHz = FHSSconfig->freq_center < 1000000000;
src/src/tx_main.cpp
Outdated
| #if defined(RADIO_LR1121) | ||
| if (FHSSuseDualBand && subGHz) | ||
| { | ||
| subGHz = FHSSgetInitialGeminiFreq() < 1000000000; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
subGHz = FHSSconfigDualBand->freq_center < 1000000000;
SunjunKim
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This will fix subGhz being always true (due to the FREQ_HZ_TO_REG_VAL conversion)
fbabb29 to
d4f2013
Compare
CapnBry
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok! Tested again, this time multiple times and also with devices that are both running InvertIQ and not InvertIQ. Binds ("at freq = 12307660") and connects on both. Tested 50Hz and 150Hz. SX1280 only though.
mha1
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
2.4G and 900MHz bind at 50Hz and 100Hz packet rates tested ok with BackRC 900/2400 Dual Band 1W Nano TX, BFPV SuperP 2.4G and SuperP 900M.
Problem
When binding in 50Hz 2.4GHz and the UID[5] bit 0 is unset, the radio config command would be ignored because logic for checking the InvertedIQ flag was removed and in binding mode the invertedIQ flag is always true.
This was a little more complicated than reverting #3014 because of 900MHz and LR1121 being dual band!