diff --git a/boards/t-beam-1w.json b/boards/t-beam-1w.json index ac1d1f15e..40f16195d 100644 --- a/boards/t-beam-1w.json +++ b/boards/t-beam-1w.json @@ -1,50 +1,39 @@ { - "build": { - "arduino": { - "ldscript": "esp32s3_out.ld", - "memory_type": "qio_opi" - }, - "core": "esp32", - "extra_flags": [ - "-DBOARD_HAS_PSRAM", - "-DLILYGO_TBEAM_1W", - "-DARDUINO_USB_CDC_ON_BOOT=1", - "-DARDUINO_USB_MODE=0", - "-DARDUINO_RUNNING_CORE=1", - "-DARDUINO_EVENT_RUNNING_CORE=1" - ], - "f_cpu": "240000000L", - "f_flash": "80000000L", - "flash_mode": "qio", - "psram_type": "opi", - "hwids": [ - [ - "0x303A", - "0x1001" - ] - ], - "mcu": "esp32s3", - "variant": "t-beam-1w" + "build": { + "arduino": { + "ldscript": "esp32s3_out.ld", + "memory_type": "qio_opi" }, - "connectivity": [ - "wifi", - "bluetooth", - "lora" + "core": "esp32", + "extra_flags": [ + "-DBOARD_HAS_PSRAM", + "-DLILYGO_TBEAM_1W", + "-DARDUINO_USB_CDC_ON_BOOT=1", + "-DARDUINO_USB_MODE=0", + "-DARDUINO_RUNNING_CORE=1", + "-DARDUINO_EVENT_RUNNING_CORE=1" ], - "debug": { - "openocd_target": "esp32s3.cfg" - }, - "frameworks": [ - "arduino" - ], - "name": "LilyGo TBeam-1W", - "upload": { - "flash_size": "16MB", - "maximum_ram_size": 327680, - "maximum_size": 16777216, - "require_upload_port": true, - "speed": 921600 - }, - "url": "http://www.lilygo.cn/", - "vendor": "LilyGo" -} \ No newline at end of file + "f_cpu": "240000000L", + "f_flash": "80000000L", + "flash_mode": "qio", + "psram_type": "opi", + "hwids": [["0x303A", "0x1001"]], + "mcu": "esp32s3", + "variant": "t-beam-1w" + }, + "connectivity": ["wifi", "bluetooth", "lora"], + "debug": { + "openocd_target": "esp32s3.cfg" + }, + "frameworks": ["arduino"], + "name": "LilyGo TBeam-1W", + "upload": { + "flash_size": "16MB", + "maximum_ram_size": 327680, + "maximum_size": 16777216, + "require_upload_port": true, + "speed": 921600 + }, + "url": "http://www.lilygo.cn/", + "vendor": "LilyGo" +} diff --git a/src/mesh/RadioInterface.cpp b/src/mesh/RadioInterface.cpp index 6660549eb..aaaca719e 100644 --- a/src/mesh/RadioInterface.cpp +++ b/src/mesh/RadioInterface.cpp @@ -246,8 +246,9 @@ uint32_t RadioInterface::getPacketTime(const meshtastic_MeshPacket *p, bool rece /** The delay to use for retransmitting dropped packets */ uint32_t RadioInterface::getRetransmissionMsec(const meshtastic_MeshPacket *p) { - size_t numbytes =p->which_payload_variant == meshtastic_MeshPacket_decoded_tag ? - pb_encode_to_bytes(bytes, sizeof(bytes), &meshtastic_Data_msg, &p->decoded) : p->encrypted.size+MESHTASTIC_HEADER_LENGTH; + size_t numbytes = p->which_payload_variant == meshtastic_MeshPacket_decoded_tag + ? pb_encode_to_bytes(bytes, sizeof(bytes), &meshtastic_Data_msg, &p->decoded) + : p->encrypted.size + MESHTASTIC_HEADER_LENGTH; uint32_t packetAirtime = getPacketTime(numbytes + sizeof(PacketHeader)); // Make sure enough time has elapsed for this packet to be sent and an ACK is received. // LOG_DEBUG("Waiting for flooding message with airtime %d and slotTime is %d", packetAirtime, slotTimeMsec); diff --git a/src/mesh/SX126xInterface.cpp b/src/mesh/SX126xInterface.cpp index 53cf3154e..0e3069c14 100644 --- a/src/mesh/SX126xInterface.cpp +++ b/src/mesh/SX126xInterface.cpp @@ -389,9 +389,9 @@ template bool SX126xInterface::sleep() template void SX126xInterface::setTransmitEnable(bool txon) { #if defined(USE_GC1109_PA) - digitalWrite(LORA_PA_POWER, HIGH); // Ensure LDO is on - digitalWrite(LORA_PA_EN, HIGH); // CSD=1: Chip enabled - digitalWrite(LORA_PA_TX_EN, txon ? 1 : 0); // CPS: 1=full PA, 0=bypass (for RX, CPS is don't care) + digitalWrite(LORA_PA_POWER, HIGH); // Ensure LDO is on + digitalWrite(LORA_PA_EN, HIGH); // CSD=1: Chip enabled + digitalWrite(LORA_PA_TX_EN, txon ? 1 : 0); // CPS: 1=full PA, 0=bypass (for RX, CPS is don't care) #endif } diff --git a/variants/esp32s3/t-beam-1w/pins_arduino.h b/variants/esp32s3/t-beam-1w/pins_arduino.h index 92b74615d..c4591878b 100644 --- a/variants/esp32s3/t-beam-1w/pins_arduino.h +++ b/variants/esp32s3/t-beam-1w/pins_arduino.h @@ -14,7 +14,7 @@ static const uint8_t SDA = 8; static const uint8_t SCL = 9; // Default SPI mapped to Radio/SD -static const uint8_t SS = 15; // LoRa CS +static const uint8_t SS = 15; // LoRa CS static const uint8_t MOSI = 11; static const uint8_t MISO = 12; static const uint8_t SCK = 13; diff --git a/variants/esp32s3/t-beam-1w/variant.h b/variants/esp32s3/t-beam-1w/variant.h index 01404afcb..00301fdfd 100644 --- a/variants/esp32s3/t-beam-1w/variant.h +++ b/variants/esp32s3/t-beam-1w/variant.h @@ -1,4 +1,4 @@ -// LilyGo T-Beam-1W variant.h +// LilyGo T-Beam-1W variant.h // Configuration based on LilyGO utilities.h and RF documentation // I2C for OLED display (SH1106 at 0x3C) @@ -9,13 +9,13 @@ #define GPS_RX_PIN 5 #define GPS_TX_PIN 6 #define GPS_1PPS_PIN 7 -#define GPS_WAKEUP_PIN 16 // GPS_EN_PIN in LilyGO code +#define GPS_WAKEUP_PIN 16 // GPS_EN_PIN in LilyGO code #define HAS_GPS 1 #define GPS_BAUDRATE 9600 // Buttons -#define BUTTON_PIN 0 // BUTTON 1 -#define BUTTON_PIN_ALT 17 // BUTTON 2 +#define BUTTON_PIN 0 // BUTTON 1 +#define BUTTON_PIN_ALT 17 // BUTTON 2 // SPI (shared by LoRa and SD) #define SPI_MOSI 11 @@ -32,7 +32,7 @@ #define USE_SX1262 #define LORA_SCK SPI_SCK -#define LORA_MISO SPI_MISO +#define LORA_MISO SPI_MISO #define LORA_MOSI SPI_MOSI #define LORA_CS 15 #define LORA_RESET 3 @@ -58,7 +58,7 @@ // Truth table: DIO2=1,CTRL=0 → TX (PA on, LNA off) // DIO2=0,CTRL=1 → RX (PA off, LNA on) #define SX126X_DIO2_AS_RF_SWITCH -#define SX126X_RXEN 21 // LNA enable - HIGH during RX +#define SX126X_RXEN 21 // LNA enable - HIGH during RX // TCXO voltage - required for radio init #define SX126X_DIO3_TCXO_VOLTAGE 1.8 @@ -68,7 +68,7 @@ // LED #define LED_PIN 18 -#define LED_STATE_ON 1 // HIGH = ON +#define LED_STATE_ON 1 // HIGH = ON // Battery ADC #define BATTERY_PIN 4 @@ -89,7 +89,7 @@ #define SX126X_PA_RAMP_US 0x05 // Display - SH1106 OLED (128x64) -#define USE_SH1106 +#define USE_SH1106 #define OLED_WIDTH 128 #define OLED_HEIGHT 64