Comments Changed

This commit is contained in:
2026-05-20 08:20:52 +02:00
parent 637117240d
commit 9ec763dc07
+5 -22
View File
@@ -5,9 +5,8 @@
#include <Adafruit_GFX.h>
#include <Adafruit_SSD1306.h>
// =========================
// 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);