mirror of
https://github.com/meshtastic/firmware.git
synced 2025-08-05 21:24:34 +00:00
Fixed missing brackets
This commit is contained in:
parent
f3c15eb6cc
commit
c5f3cad0f9
@ -99,8 +99,7 @@ ErrorCode RadioLibInterface::send(MeshPacket *p)
|
||||
if (config.lora.region != Config_LoRaConfig_RegionCode_Unset) {
|
||||
if (disabled || config.lora.tx_disabled) {
|
||||
|
||||
|
||||
if (radioConfig.preferences.region != RegionCode_Unset) {
|
||||
if (config.lora.region != Config_LoRaConfig_RegionCode_Unset) {
|
||||
if (disabled || config.lora.tx_disabled) {
|
||||
DEBUG_MSG("send - lora_tx_disabled\n");
|
||||
packetPool.release(p);
|
||||
@ -112,6 +111,8 @@ ErrorCode RadioLibInterface::send(MeshPacket *p)
|
||||
packetPool.release(p);
|
||||
return ERRNO_DISABLED;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#else
|
||||
|
||||
@ -171,13 +172,13 @@ bool RadioLibInterface::cancelSending(NodeNum from, PacketId id)
|
||||
/** radio helper thread callback.
|
||||
|
||||
We never immediately transmit after any operation (either rx or tx). Instead we should start receiving and
|
||||
wait a random delay of 100ms to 100ms+shortPacketMsec to make sure we are not stomping on someone else. The 100ms delay at the
|
||||
beginning ensures all possible listeners have had time to finish processing the previous packet and now have their radio in RX
|
||||
state. The up to 100ms+shortPacketMsec random delay gives a chance for all possible senders to have high odds of detecting that
|
||||
someone else started transmitting first and then they will wait until that packet finishes.
|
||||
wait a random delay of 100ms to 100ms+shortPacketMsec to make sure we are not stomping on someone else. The 100ms delay
|
||||
at the beginning ensures all possible listeners have had time to finish processing the previous packet and now have their
|
||||
radio in RX state. The up to 100ms+shortPacketMsec random delay gives a chance for all possible senders to have high odds
|
||||
of detecting that someone else started transmitting first and then they will wait until that packet finishes.
|
||||
|
||||
NOTE: the large flood rebroadcast delay might still be needed even with this approach. Because we might not be able to hear other
|
||||
transmitters that we are potentially stomping on. Requires further thought.
|
||||
NOTE: the large flood rebroadcast delay might still be needed even with this approach. Because we might not be able to
|
||||
hear other transmitters that we are potentially stomping on. Requires further thought.
|
||||
|
||||
FIXME, the MIN_TX_WAIT_MSEC and MAX_TX_WAIT_MSEC values should be tuned via logic analyzer later.
|
||||
*/
|
||||
@ -381,7 +382,8 @@ void RadioLibInterface::startSend(MeshPacket *txp)
|
||||
startReceive(); // Restart receive mode (because startTransmit failed to put us in xmit mode)
|
||||
}
|
||||
|
||||
// Must be done AFTER, starting transmit, because startTransmit clears (possibly stale) interrupt pending register bits
|
||||
// Must be done AFTER, starting transmit, because startTransmit clears (possibly stale) interrupt pending register
|
||||
// bits
|
||||
enableInterrupt(isrTxLevel0);
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user