From 9ec763dc072ca97a808114bbf2d003be1ca7a848 Mon Sep 17 00:00:00 2001 From: Malko Gindrat Date: Wed, 20 May 2026 08:20:52 +0200 Subject: [PATCH] Comments Changed --- src/main.cpp | 27 +++++---------------------- 1 file changed, 5 insertions(+), 22 deletions(-) diff --git a/src/main.cpp b/src/main.cpp index ef7963b..e75cec6 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -5,9 +5,8 @@ #include #include -// ========================= + // LoRa pins - LilyGO T3S3 SX1262 -// ========================= static const int PIN_LORA_SCK = 5; static const int PIN_LORA_MISO = 3; static const int PIN_LORA_MOSI = 6; @@ -16,22 +15,19 @@ static const int PIN_LORA_RST = 8; static const int PIN_LORA_DIO1 = 33; static const int PIN_LORA_BUSY = 34; -// ========================= + // OLED pins - LilyGO T3S3 OLED -// ========================= static const int OLED_SDA = 18; static const int OLED_SCL = 17; static const int OLED_ADDR = 0x3C; static const int SCREEN_WIDTH = 128; static const int SCREEN_HEIGHT = 64; -// ========================= // ACTIVE PROFILE (Shelly / custom LoRa) -// ========================= static const float LORA_FREQ_MHZ = 865.000; static const float LORA_BW_KHZ = 125.0; static const uint8_t LORA_SF = 12; -static const uint8_t LORA_CR = 5; // 4/5 +static const uint8_t LORA_CR = 5; static const uint8_t LORA_SYNC_WORD = 0x12; static const int8_t LORA_TX_POWER = 10; static const uint16_t LORA_PREAMBLE = 10; @@ -41,14 +37,12 @@ static const bool LORA_USE_CRC = false; static const bool LORA_EXPLICIT_HDR = true; -// ========================= // MESHCORE SWITZERLAND PROFILE (COMMENTED) -// ========================= /* static const float LORA_FREQ_MHZ = 869.618; static const float LORA_BW_KHZ = 62.5; static const uint8_t LORA_SF = 8; -static const uint8_t LORA_CR = 8; // 4/8 +static const uint8_t LORA_CR = 8; static const uint8_t LORA_SYNC_WORD = 0x34; static const int8_t LORA_TX_POWER = 10; static const uint16_t LORA_PREAMBLE = 10; @@ -58,15 +52,12 @@ static const bool LORA_USE_CRC = true; static const bool LORA_EXPLICIT_HDR = true; */ -// ========================= + // Objects -// ========================= Adafruit_SSD1306 display(SCREEN_WIDTH, SCREEN_HEIGHT, &Wire, -1); SX1262 radio = new Module(PIN_LORA_CS, PIN_LORA_DIO1, PIN_LORA_RST, PIN_LORA_BUSY); -// ========================= // Runtime state -// ========================= String lastMsg = "none"; float lastRssi = 0.0; float lastSnr = 0.0; @@ -74,9 +65,7 @@ unsigned long rxCount = 0; unsigned long lastIdleRefresh = 0; unsigned long showPacketUntil = 0; -// ========================= // Helpers -// ========================= String formatCR(uint8_t cr) { return "4/" + String(cr); } @@ -152,9 +141,6 @@ void drawErrorScreen(const String& title, int code) { display.display(); } -// ========================= -// Setup -// ========================= void setup() { Serial.begin(115200); delay(1500); @@ -221,9 +207,6 @@ void setup() { drawListeningScreen(); } -// ========================= -// Loop -// ========================= void loop() { String str; int state = radio.receive(str);