Use LORA_DIO1 as RadioLib GPIO for SX127x chips (#2290)

* When channel is active, first try receiving that packet
Afterwards we'll try transmitting again

* Remove setStandby in startSend
Already done in isChannelActive()

* Set LORA_DIO1 as RadioLib GPIO for SX127x

* LORA_DIO1 for Heltec v1, overlaps with GPS_TX
Set to RADIOLIB_NC for now

* If receive was not successful, startReceive doesn't trigger the interrupt
So we have to go back to transmitting anyway

---------

Co-authored-by: Ben Meadors <benmmeadors@gmail.com>
This commit is contained in:
GUVWAF
2023-02-20 14:40:44 +01:00
committed by GitHub
parent 187f3969c2
commit 95bbcd2cb7
13 changed files with 22 additions and 20 deletions

View File

@@ -218,8 +218,9 @@ void RadioLibInterface::onNotify(uint32_t notification)
setTransmitDelay(); // currently Rx/Tx-ing: reset random delay
} else {
if (isChannelActive()) { // check if there is currently a LoRa packet on the channel
// LOG_DEBUG("Channel is active: set random delay\n");
setTransmitDelay(); // reset random delay
// LOG_DEBUG("Channel is active, try receiving first.\n");
startReceive(); // try receiving this packet, afterwards we'll be trying to transmit again
setTransmitDelay();
} else {
// Send any outgoing packets we have ready
meshtastic_MeshPacket *txp = txQueue.dequeue();
@@ -388,8 +389,6 @@ void RadioLibInterface::startSend(meshtastic_MeshPacket *txp)
LOG_WARN("startSend is dropping tx packet because we are disabled\n");
packetPool.release(txp);
} else {
setStandby(); // Cancel any already in process receives
configHardwareForSend(); // must be after setStandby
size_t numbytes = beginSending(txp);