Fixed missing brackets

This commit is contained in:
Jm Casler 2022-05-24 18:06:53 -07:00
parent f3c15eb6cc
commit c5f3cad0f9

View File

@ -99,8 +99,7 @@ ErrorCode RadioLibInterface::send(MeshPacket *p)
if (config.lora.region != Config_LoRaConfig_RegionCode_Unset) { if (config.lora.region != Config_LoRaConfig_RegionCode_Unset) {
if (disabled || config.lora.tx_disabled) { if (disabled || config.lora.tx_disabled) {
if (config.lora.region != Config_LoRaConfig_RegionCode_Unset) {
if (radioConfig.preferences.region != RegionCode_Unset) {
if (disabled || config.lora.tx_disabled) { if (disabled || config.lora.tx_disabled) {
DEBUG_MSG("send - lora_tx_disabled\n"); DEBUG_MSG("send - lora_tx_disabled\n");
packetPool.release(p); packetPool.release(p);
@ -112,6 +111,8 @@ ErrorCode RadioLibInterface::send(MeshPacket *p)
packetPool.release(p); packetPool.release(p);
return ERRNO_DISABLED; return ERRNO_DISABLED;
} }
}
}
#else #else
@ -171,13 +172,13 @@ bool RadioLibInterface::cancelSending(NodeNum from, PacketId id)
/** radio helper thread callback. /** radio helper thread callback.
We never immediately transmit after any operation (either rx or tx). Instead we should start receiving and 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 wait a random delay of 100ms to 100ms+shortPacketMsec to make sure we are not stomping on someone else. The 100ms delay
beginning ensures all possible listeners have had time to finish processing the previous packet and now have their radio in RX at the beginning ensures all possible listeners have had time to finish processing the previous packet and now have their
state. The up to 100ms+shortPacketMsec random delay gives a chance for all possible senders to have high odds of detecting that radio in RX state. The up to 100ms+shortPacketMsec random delay gives a chance for all possible senders to have high odds
someone else started transmitting first and then they will wait until that packet finishes. 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 NOTE: the large flood rebroadcast delay might still be needed even with this approach. Because we might not be able to
transmitters that we are potentially stomping on. Requires further thought. 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. 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) 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); enableInterrupt(isrTxLevel0);
} }
} }