From 2c259b8464263e294408fdcebf701280a88264e9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thomas=20G=C3=B6ttgens?= Date: Fri, 24 Mar 2023 16:57:30 +0100 Subject: [PATCH 1/2] Add Power Restraint for 1280 PA Model Add Debug Print for all module parameters Add RX/TX Switch to 1280 --- src/mesh/RF95Interface.cpp | 2 +- src/mesh/SX128xInterface.cpp | 8 ++++++++ variants/tlora_t3s3_v1/variant.h | 1 + 3 files changed, 10 insertions(+), 1 deletion(-) diff --git a/src/mesh/RF95Interface.cpp b/src/mesh/RF95Interface.cpp index 498727639..f57aaa055 100644 --- a/src/mesh/RF95Interface.cpp +++ b/src/mesh/RF95Interface.cpp @@ -15,7 +15,7 @@ RF95Interface::RF95Interface(RADIOLIB_PIN_TYPE cs, RADIOLIB_PIN_TYPE irq, RADIOL SPIClass &spi) : RadioLibInterface(cs, irq, rst, busy, spi) { - // FIXME - we assume devices never get destroyed + LOG_WARN("RF95Interface(cs=%d, irq=%d, rst=%d, busy=%d)\n", cs, irq, rst, busy); } /** Some boards require GPIO control of tx vs rx paths */ diff --git a/src/mesh/SX128xInterface.cpp b/src/mesh/SX128xInterface.cpp index aff4c1253..85e41f29f 100644 --- a/src/mesh/SX128xInterface.cpp +++ b/src/mesh/SX128xInterface.cpp @@ -13,6 +13,7 @@ SX128xInterface::SX128xInterface(RADIOLIB_PIN_TYPE cs, RADIOLIB_PIN_TYPE irq, SPIClass &spi) : RadioLibInterface(cs, irq, rst, busy, spi, &lora), lora(&module) { + LOG_WARN("SX128xInterface(cs=%d, irq=%d, rst=%d, busy=%d)\n", cs, irq, rst, busy); } /// Initialise the Driver transport hardware and software. @@ -73,6 +74,13 @@ template bool SX128xInterface::init() LOG_INFO("Bandwidth set to %f\n", bw); LOG_INFO("Power output set to %d\n", power); +#if defined(SX128X_TXEN) && (SX128X_TXEN != RADIOLIB_NC) && defined(SX128X_RXEN) && (SX128X_RXEN != RADIOLIB_NC) + // lora.begin sets Dio2 as RF switch control, which is not true if we are manually controlling RX and TX + if (res == RADIOLIB_ERR_NONE) { + lora.setRfSwitchPins(SX128X_RXEN, SX128X_TXEN); + } +#endif + if (res == RADIOLIB_ERR_NONE) res = lora.setCRC(2); diff --git a/variants/tlora_t3s3_v1/variant.h b/variants/tlora_t3s3_v1/variant.h index 0f88af819..768a7c2da 100644 --- a/variants/tlora_t3s3_v1/variant.h +++ b/variants/tlora_t3s3_v1/variant.h @@ -59,4 +59,5 @@ #define SX128X_RESET LORA_RESET #define SX128X_RXEN 21 #define SX128X_TXEN 10 +#define SX128X_MAX_POWER 3 #endif \ No newline at end of file From 5ac24bb33b612cd7005395995855260209a6814d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thomas=20G=C3=B6ttgens?= Date: Sat, 25 Mar 2023 14:23:30 +0100 Subject: [PATCH 2/2] Update SX128xInterface.cpp --- src/mesh/SX128xInterface.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/src/mesh/SX128xInterface.cpp b/src/mesh/SX128xInterface.cpp index 85e41f29f..e271cb718 100644 --- a/src/mesh/SX128xInterface.cpp +++ b/src/mesh/SX128xInterface.cpp @@ -75,7 +75,6 @@ template bool SX128xInterface::init() LOG_INFO("Power output set to %d\n", power); #if defined(SX128X_TXEN) && (SX128X_TXEN != RADIOLIB_NC) && defined(SX128X_RXEN) && (SX128X_RXEN != RADIOLIB_NC) - // lora.begin sets Dio2 as RF switch control, which is not true if we are manually controlling RX and TX if (res == RADIOLIB_ERR_NONE) { lora.setRfSwitchPins(SX128X_RXEN, SX128X_TXEN); }