Skip to content

Commit

Permalink
correct receiver LBT TXdoneCallback (ExpressLRS#2768)
Browse files Browse the repository at this point in the history
* correct receiver LBT TXdoneCallback

* revert diversity rx ChannelIsClear improvment
  • Loading branch information
JyeSmith authored Jun 12, 2024
1 parent 074c22a commit 528e312
Showing 1 changed file with 9 additions and 8 deletions.
17 changes: 9 additions & 8 deletions src/src/rx_main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -511,6 +511,15 @@ bool ICACHE_RAM_ATTR HandleSendTelemetryResponse()

#if defined(Regulatory_Domain_EU_CE_2400)
transmittingRadio &= ChannelIsClear(transmittingRadio); // weed out the radio(s) if channel in use

if (transmittingRadio == SX12XX_Radio_NONE)
{
// No packet will be sent due to LBT.
// Defer TXdoneCallback() to prepare for TLM when the IRQ is normally triggered.
deferExecutionMicros(ExpressLRS_currAirRate_RFperfParams->TOA, []() {
Radio.TXdoneCallback();
});
}
#endif

if (config.GetForceTlmOff())
Expand Down Expand Up @@ -730,14 +739,6 @@ static void ICACHE_RAM_ATTR updateDiversity()

void ICACHE_RAM_ATTR HWtimerCallbackTock()
{
if (tlmSent && Radio.GetLastTransmitRadio() == SX12XX_Radio_NONE)
{
// Since we were meant to send telemetry, but didn't, defer TXdoneCallback() to when the IRQ is normally triggered.
deferExecutionMicros(ExpressLRS_currAirRate_RFperfParams->TOA, []() {
Radio.TXdoneCallback();
});
}

PFDloop.intEvent(micros()); // our internal osc just fired

if (ExpressLRS_currAirRate_Modparams->numOfSends > 1 && !(OtaNonce % ExpressLRS_currAirRate_Modparams->numOfSends))
Expand Down

0 comments on commit 528e312

Please sign in to comment.