From 28d53c61b44d88f4062cc0f00b05c3402a4ea4f7 Mon Sep 17 00:00:00 2001 From: Linar Yusupov Date: Mon, 13 May 2024 17:13:16 +0300 Subject: [PATCH] a minor update of LilyGO T3-C6 GPIO pins map --- .../source/SoftRF/src/driver/radio/radiolib.cpp | 7 +++++-- .../source/SoftRF/src/platform/iomap/LilyGO_T3C6.h | 13 ++++++++----- 2 files changed, 13 insertions(+), 7 deletions(-) diff --git a/software/firmware/source/SoftRF/src/driver/radio/radiolib.cpp b/software/firmware/source/SoftRF/src/driver/radio/radiolib.cpp index 794c70a62..5d34bd46a 100644 --- a/software/firmware/source/SoftRF/src/driver/radio/radiolib.cpp +++ b/software/firmware/source/SoftRF/src/driver/radio/radiolib.cpp @@ -305,9 +305,7 @@ static void lr112x_setup() state = radio->setSyncWord((uint8_t) rl_protocol->syncword[0]); state = radio->setPreambleLength(8); -#if USE_SX1262 state = radio->explicitHeader(); -#endif state = radio->setCRC(true); break; @@ -481,6 +479,11 @@ static bool lr112x_receive() rxPacket.len = radio->getPacketLength(); if (rxPacket.len > 0) { + + if (rxPacket.len > sizeof(rxPacket.payload)) { + rxPacket.len = sizeof(rxPacket.payload); + } + state = radio->readData(rxPacket.payload, rxPacket.len); lr112x_receive_active = false; diff --git a/software/firmware/source/SoftRF/src/platform/iomap/LilyGO_T3C6.h b/software/firmware/source/SoftRF/src/platform/iomap/LilyGO_T3C6.h index b4e551107..df83f4f37 100644 --- a/software/firmware/source/SoftRF/src/platform/iomap/LilyGO_T3C6.h +++ b/software/firmware/source/SoftRF/src/platform/iomap/LilyGO_T3C6.h @@ -27,10 +27,13 @@ #define SOC_GPIO_PIN_T3C6_ANT_TX 14 // I2C (ext.) -#define SOC_GPIO_PIN_T3C6_SDA 2 -#define SOC_GPIO_PIN_T3C6_SCL 3 +#define SOC_GPIO_PIN_T3C6_SDA 8 +#define SOC_GPIO_PIN_T3C6_SCL 9 + +// status LED +#define SOC_GPIO_PIN_T3C6_LED 7 // NRF905 (NC) -#define SOC_GPIO_PIN_T3C6_TXE 7 /* TBD */ -#define SOC_GPIO_PIN_T3C6_CE 8 /* TBD */ -#define SOC_GPIO_PIN_T3C6_PWR 9 /* TBD */ +#define SOC_GPIO_PIN_T3C6_TXE 2 /* TBD */ +#define SOC_GPIO_PIN_T3C6_CE 3 /* TBD */ +#define SOC_GPIO_PIN_T3C6_PWR 10 /* TBD */