mirror of
https://github.com/pelgraine/Meck.git
synced 2026-07-06 01:31:17 +02:00
”Amend mymesh.h to Meck v0.3 || ‘target.h’ - Added #include "variant.h" at the top to ensure HAS_GPS is always defined before the conditional includes || target.cpp - Added debug output to verify HAS_GPS is defined at compile and runtime || ‘TDeckBoard.h’ - Added #include "variant.h" for pin definitions || Added #include "variant.h" to ‘main.cpp’ to ensure HAS_GPS is defined || Added code to ‘main.cpp’ to enable GPS by default after sensors.begin() as longpress not currently functional for gps toggle || Changed battery icon size in ‘uitask.cpp’ from 24 to 22 width and 10 to 8 height.”
This commit is contained in:
@@ -31,6 +31,22 @@ void TDeckBoard::begin() {
|
||||
Serial.println("TDeckBoard::begin() - LoRa power enabled");
|
||||
#endif
|
||||
|
||||
// Enable GPS module power and initialize Serial2
|
||||
#if HAS_GPS
|
||||
#ifdef PIN_GPS_EN
|
||||
pinMode(PIN_GPS_EN, OUTPUT);
|
||||
digitalWrite(PIN_GPS_EN, GPS_EN_ACTIVE); // GPS_EN_ACTIVE is 1 (HIGH)
|
||||
delay(100); // Allow GPS to power up
|
||||
Serial.println("TDeckBoard::begin() - GPS power enabled");
|
||||
#endif
|
||||
|
||||
// Initialize Serial2 for GPS with correct pins
|
||||
Serial2.begin(GPS_BAUDRATE, SERIAL_8N1, GPS_RX_PIN, GPS_TX_PIN);
|
||||
Serial.print("TDeckBoard::begin() - GPS Serial2 initialized at ");
|
||||
Serial.print(GPS_BAUDRATE);
|
||||
Serial.println(" baud");
|
||||
#endif
|
||||
|
||||
// Configure user button
|
||||
pinMode(PIN_USER_BTN, INPUT);
|
||||
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
#pragma once
|
||||
|
||||
#include "variant.h" // Board-specific pin definitions
|
||||
#include <Wire.h>
|
||||
#include <Arduino.h>
|
||||
#include "helpers/ESP32Board.h"
|
||||
|
||||
@@ -31,6 +31,7 @@ build_flags =
|
||||
-D P_LORA_MOSI=33
|
||||
-D P_LORA_EN=46
|
||||
-D ENV_INCLUDE_GPS=1
|
||||
-D ENV_SKIP_GPS_DETECT=1
|
||||
-D PIN_GPS_RX=44
|
||||
-D PIN_GPS_TX=43
|
||||
-D GPS_BAUD_RATE=38400
|
||||
@@ -112,9 +113,9 @@ extends = LilyGo_TDeck_Pro
|
||||
build_flags =
|
||||
${LilyGo_TDeck_Pro.build_flags}
|
||||
-I examples/companion_radio/ui-new
|
||||
-D MAX_CONTACTS=400
|
||||
-D MAX_GROUP_CHANNELS=20
|
||||
-D BLE_PIN_CODE=123456
|
||||
-D MAX_CONTACTS=350
|
||||
-D MAX_GROUP_CHANNELS=40
|
||||
-D BLE_PIN_CODE=234567
|
||||
-D OFFLINE_QUEUE_SIZE=256
|
||||
build_src_filter = ${LilyGo_TDeck_Pro.build_src_filter}
|
||||
+<helpers/esp32/*.cpp>
|
||||
|
||||
@@ -19,8 +19,10 @@ AutoDiscoverRTCClock rtc_clock(fallback_clock);
|
||||
#if HAS_GPS
|
||||
MicroNMEALocationProvider gps(Serial2, &rtc_clock);
|
||||
EnvironmentSensorManager sensors(gps);
|
||||
#pragma message "GPS enabled - using EnvironmentSensorManager with MicroNMEALocationProvider"
|
||||
#else
|
||||
SensorManager sensors;
|
||||
#pragma message "GPS disabled - using basic SensorManager"
|
||||
#endif
|
||||
|
||||
#ifdef DISPLAY_CLASS
|
||||
@@ -41,6 +43,15 @@ bool radio_init() {
|
||||
rtc_clock.begin(Wire);
|
||||
Serial.println("radio_init() - rtc_clock started");
|
||||
|
||||
// Debug GPS status
|
||||
#if HAS_GPS
|
||||
Serial.println("radio_init() - HAS_GPS is defined");
|
||||
Serial.print("radio_init() - gps object address: ");
|
||||
Serial.println((uint32_t)&gps, HEX);
|
||||
#else
|
||||
Serial.println("radio_init() - HAS_GPS is NOT defined");
|
||||
#endif
|
||||
|
||||
#if defined(P_LORA_SCLK)
|
||||
Serial.println("radio_init() - initializing LoRa SPI...");
|
||||
loraSpi.begin(P_LORA_SCLK, P_LORA_MISO, P_LORA_MOSI, P_LORA_NSS);
|
||||
|
||||
@@ -1,5 +1,8 @@
|
||||
#pragma once
|
||||
|
||||
// Include variant.h first to ensure all board-specific defines are available
|
||||
#include "variant.h"
|
||||
|
||||
#define RADIOLIB_STATIC_ONLY 1
|
||||
#include <RadioLib.h>
|
||||
#include <helpers/radiolib/RadioLibWrappers.h>
|
||||
|
||||
Reference in New Issue
Block a user