Added basic support for Station G2

This commit is contained in:
Rastislav Vysoky
2025-03-07 15:34:00 +01:00
parent ae7bf7eae2
commit acac20dc89
5 changed files with 328 additions and 111 deletions

View File

@@ -59,7 +59,7 @@
#define ADMIN_PASSWORD "password"
#endif
#ifndef MAX_CLIENTS
#ifndef MAX_CLIENTS
#define MAX_CLIENTS 32
#endif
@@ -84,6 +84,10 @@
#include <helpers/LilyGoTLoraBoard.h>
#include <helpers/CustomSX1276Wrapper.h>
static LilyGoTLoraBoard board;
#elif defined(STATION_G2)
#include <helpers/StationG2Board.h>
#include <helpers/CustomSX1262Wrapper.h>
static StationG2Board board;
#elif defined(RAK_4631)
#include <helpers/nrf52/RAK4631Board.h>
#include <helpers/CustomSX1262Wrapper.h>
@@ -265,7 +269,7 @@ protected:
return (int) ((pow(_prefs.rx_delay_base, 0.85f - score) - 1.0) * air_time);
}
const char* getLogDateTime() override {
const char* getLogDateTime() override {
static char tmp[32];
uint32_t now = getRTCClock()->getCurrentTime();
DateTime dt = DateTime(now);
@@ -470,7 +474,7 @@ protected:
} else {
memcpy(&data[5], &forceSince, 4); // make sure there are zeroes in payload (for ack_hash calc below)
}
if (forceSince > 0) {
if (forceSince > 0) {
client->sync_since = forceSince; // force-update the 'sync since'
}
@@ -525,7 +529,7 @@ protected:
public:
MyMesh(RADIO_CLASS& phy, mesh::MainBoard& board, RadioLibWrapper& radio, mesh::MillisecondClock& ms, mesh::RNG& rng, mesh::RTCClock& rtc, mesh::MeshTables& tables)
: mesh::Mesh(radio, ms, rng, rtc, *new StaticPoolPacketManager(32), tables),
: mesh::Mesh(radio, ms, rng, rtc, *new StaticPoolPacketManager(32), tables),
_phy(&phy), _board(&board), _cli(board, this, &_prefs, this)
{
my_radio = &radio;
@@ -593,7 +597,7 @@ public:
return false;
#endif
}
void sendSelfAdvertisement(int delay_millis) override {
mesh::Packet* pkt = createSelfAdvert();
if (pkt) {
@@ -688,7 +692,7 @@ SimpleMeshTables tables;
#ifdef ESP32
ESP32RTCClock fallback_clock;
#else
VolatileRTCClock fallback_clock;
VolatileRTCClock fallback_clock;
#endif
AutoDiscoverRTCClock rtc_clock(fallback_clock);
@@ -780,7 +784,7 @@ void loop() {
int len = strlen(command);
while (Serial.available() && len < sizeof(command)-1) {
char c = Serial.read();
if (c != '\n') {
if (c != '\n') {
command[len++] = c;
command[len] = 0;
}