-
Notifications
You must be signed in to change notification settings - Fork 435
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
[LR11XX] Add missing override specifiers #1409
Conversation
Hmm, this does not seem completely correct - why should I think the real issue is stated in the original error message: |
I need to use the LR11xx object pointer in order to support both LR1110 and LR1121 ICs within the same code: Every 'overrides' of LR11XX class such as
are confirmed to work just fine with real LR1110 (Seed T1000-E) and LR1121 (Ebyte E80) hardware But I've got an issue with HPDTeK HPD-16E module (LR1121) - they do not use TX_LP pin, only TX_HP is connected to RF switch and antenna circuits. I've actually verified this PR on the real hardware that I have - it works fine to me on both LR1110 and LR1121. |
That's not the issue, this PR is based on a faulty understanding of how inheritance works. Just because you used float f = 5.0;
int i = f; Does this mean that after the second assignment, the type of the variable Bottom line is this is not the correct way to do this. Either you have to use the // some custom radio selection logic
bool lr1110;
#if RADIO_LR1110
LR1110 radio = new Module(10, 2, 9, 3);
lr1110 = true;
#else
SX1261 radio = new Module(10, 2, 9, 3);
lr1110 = false;
#endif
PhysicalLayer* phy = (PhysicalLayer*)&radio;
// this is common to the PHY interface
uint8_t* data;
size_t len;
phy->transmit(data, len);
// now I need to do something module-specific
if(lr1110) {
LR1110* ptr = (LR1110*)phy;
ptr->setOutputPower(10, true);
} |
For sure I did that before applying this PR. When I changed the then a radio receiver located nearby stops receiving any packets because signal level is too low (LP_TX is NC). If virtual setOutputPower() method defined in PhysicalLayer would work - there would be no difference of the radio operation. The radio TX power setting would stay on the IC default level in both cases. |
The core issue with your code is that |
I will be happy to use your own PR that will give the same effect necessary. One of the options I can see is to supply an extra argument for LR11XX begin() method to pass this 'forceHighPower' requirement |
Build of an MCVE sketch like that:
causes a failure:
This PR is intended to fix the issue.