From e33657eb75ec0f70cb7b958de9aef55bb9af8068 Mon Sep 17 00:00:00 2001 From: Jm Casler Date: Mon, 9 Nov 2020 19:47:31 -0800 Subject: [PATCH] Toggle GPIO2 to HIGH when transmitting a packet out the LORA radio. --- src/configuration.h | 4 ++++ src/main.cpp | 7 +++++++ src/mesh/RadioLibInterface.cpp | 4 ++++ 3 files changed, 15 insertions(+) diff --git a/src/configuration.h b/src/configuration.h index 5e8964d22..3fadf9a6b 100644 --- a/src/configuration.h +++ b/src/configuration.h @@ -162,6 +162,10 @@ along with this program. If not, see . // This string must exactly match the case used in release file names or the android updater won't work #define HW_VENDOR "tbeam" +// Jm's TXRX Deduplexer +#define RADIO_TXRX 2 + + // #define BUTTON_NEED_PULLUP // if set we need to turn on the internal CPU pullup during sleep #define I2C_SDA 21 diff --git a/src/main.cpp b/src/main.cpp index 0f24e1bc4..99a197555 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -233,6 +233,13 @@ RadioInterface *rIf = NULL; void setup() { + +// Jm's TXRX Deduplexer +// if 0 - receive +// 1 - transmit +pinMode(RADIO_TXRX, OUTPUT); +digitalWrite(RADIO_TXRX, 0); + #ifdef USE_SEGGER SEGGER_RTT_ConfigUpBuffer(0, NULL, NULL, 0, SEGGER_RTT_MODE_NO_BLOCK_TRIM); #endif diff --git a/src/mesh/RadioLibInterface.cpp b/src/mesh/RadioLibInterface.cpp index 41d000d69..7d5aa10b2 100644 --- a/src/mesh/RadioLibInterface.cpp +++ b/src/mesh/RadioLibInterface.cpp @@ -247,6 +247,8 @@ void RadioLibInterface::completeSending() txGood++; printPacket("Completed sending", sendingPacket); + digitalWrite(RADIO_TXRX, 0); + // We are done sending that packet, release it packetPool.release(sendingPacket); sendingPacket = NULL; @@ -309,6 +311,8 @@ void RadioLibInterface::handleReceiveInterrupt() /** start an immediate transmit */ void RadioLibInterface::startSend(MeshPacket *txp) { + digitalWrite(RADIO_TXRX, 1); + printPacket("Starting low level send", txp); setStandby(); // Cancel any already in process receives