From 2bb92fe65060f86f6ffca05fea4f35b36735e35d Mon Sep 17 00:00:00 2001 From: richonguzman Date: Wed, 3 Jan 2024 19:43:45 -0300 Subject: [PATCH] T_Beam Supreme Added --- src/LoRa_APRS_Tracker.cpp | 4 +-- src/configuration.cpp | 16 ++++++------ src/menu_utils.cpp | 3 +-- src/pins_config.h | 54 ++------------------------------------- src/power_utils.cpp | 11 ++------ src/utils.cpp | 3 +-- 6 files changed, 16 insertions(+), 75 deletions(-) diff --git a/src/LoRa_APRS_Tracker.cpp b/src/LoRa_APRS_Tracker.cpp index 1edf07d..f02f5f6 100644 --- a/src/LoRa_APRS_Tracker.cpp +++ b/src/LoRa_APRS_Tracker.cpp @@ -34,7 +34,7 @@ BluetoothSerial SerialBT; OneButton userButton = OneButton(BUTTON_PIN, true, true); #endif -String versionDate = "2024.01.02"; +String versionDate = "2024.01.04"; int myBeaconsIndex = 0; int myBeaconsSize = Config.beacons.size(); @@ -171,7 +171,7 @@ void loop() { POWER_Utils::batteryManager(); if (!Config.simplifiedTrackerMode) { - #if defined(TTGO_T_Beam_V0_7) || defined(TTGO_T_Beam_V1_0) || defined(TTGO_T_Beam_V1_2) || defined(TTGO_T_Beam_V1_0_SX1268) || defined(ESP32_DIY_1W_LoRa_GPS) || defined(TTGO_T_Beam_V1_2_SX1262) + #if defined(TTGO_T_Beam_V0_7) || defined(TTGO_T_Beam_V1_0) || defined(TTGO_T_Beam_V1_2) || defined(TTGO_T_Beam_V1_0_SX1268) || defined(ESP32_DIY_1W_LoRa_GPS) || defined(TTGO_T_Beam_V1_2_SX1262) || defined(TTGO_T_Beam_S3_SUPREME_V3) userButton.tick(); #endif } diff --git a/src/configuration.cpp b/src/configuration.cpp index 046088e..385455d 100644 --- a/src/configuration.cpp +++ b/src/configuration.cpp @@ -65,16 +65,16 @@ void Configuration::readFile(fs::FS &fs, const char *fileName) { notification.ledTx = data["notification"]["ledTx"].as(); notification.ledTxPin = data["notification"]["ledTxPin"].as(); notification.ledMessage = data["notification"]["ledMessage"].as(); - notification.ledMessagePin = data["notification"]["ledMessagePin"].as(); + notification.ledMessagePin = data["notification"]["ledMessagePin"].as(); notification.ledFlashlight = data["notification"]["ledFlashlight"].as(); - notification.ledFlashlightPin = data["notification"]["ledFlashlightPin"].as(); - notification.buzzerActive = data["notification"]["buzzerActive"].as(); - notification.buzzerPinTone = data["notification"]["buzzerPinTone"].as(); + notification.ledFlashlightPin = data["notification"]["ledFlashlightPin"].as(); + notification.buzzerActive = data["notification"]["buzzerActive"].as(); + notification.buzzerPinTone = data["notification"]["buzzerPinTone"].as(); notification.buzzerPinVcc = data["notification"]["buzzerPinVcc"].as(); - notification.bootUpBeep = data["notification"]["bootUpBeep"].as(); - notification.txBeep = data["notification"]["txBeep"].as(); - notification.messageRxBeep = data["notification"]["messageRxBeep"].as(); - notification.stationBeep = data["notification"]["stationBeep"].as(); + notification.bootUpBeep = data["notification"]["bootUpBeep"].as(); + notification.txBeep = data["notification"]["txBeep"].as(); + notification.messageRxBeep = data["notification"]["messageRxBeep"].as(); + notification.stationBeep = data["notification"]["stationBeep"].as(); notification.lowBatteryBeep = data["notification"]["lowBatteryBeep"].as(); simplifiedTrackerMode = data["other"]["simplifiedTrackerMode"].as(); diff --git a/src/menu_utils.cpp b/src/menu_utils.cpp index b0e904b..4b60159 100644 --- a/src/menu_utils.cpp +++ b/src/menu_utils.cpp @@ -400,8 +400,7 @@ namespace MENU_Utils { sixthRowMainMenu = "Battery " + batteryVoltage + "V " + batteryCharge + "mA"; } #endif - #if defined(TTGO_T_Beam_V1_2) || defined(TTGO_T_Beam_V1_2_SX1262) - //#if defined(TTGO_T_Beam_V1_2) || defined(TTGO_T_Beam_V1_2_SX1262) || defined(TTGO_T_Beam_S3_SUPREME_V3) //??????? + #if defined(TTGO_T_Beam_V1_2) || defined(TTGO_T_Beam_V1_2_SX1262) || defined(TTGO_T_Beam_S3_SUPREME_V3) if (Config.notification.lowBatteryBeep && !POWER_Utils::isCharging() && batteryCharge.toInt() < lowBatteryPercent) { lowBatteryPercent = batteryCharge.toInt(); NOTIFICATION_Utils::lowBatteryBeep(); diff --git a/src/pins_config.h b/src/pins_config.h index 86dd6be..6bacddb 100644 --- a/src/pins_config.h +++ b/src/pins_config.h @@ -72,29 +72,12 @@ #define OLED_SDA 17 #define OLED_SCL 18 #define OLED_RST 16 - -//#define SDA 17 // writen in power_utils.cpp variable definitions -//#define SCL 18 -//#define I2C1_SDA 42 // double defined in power_utils.cpp -//#define I2C1_SCL 41 // double defined in power_utils.cpp -//#define PMU_IRQ 40 // double defined in power_utils.cpp -//#define IRQ_PIN 40 // double defined in power_utils.cpp - -#define GPS_RX 8 // changed to maintain the same "neo6m_gps.begin(9600, SERIAL_8N1, GPS_TX, GPS_RX);" -#define GPS_TX 9 // 8 for 9 and 9 for 8 - -/* NOT USED???? -//#define GPS_WAKEUP_PIN 7 // ?? -//#define GPS_1PPS_PIN 6 // ??*/ +#define GPS_RX 8 +#define GPS_TX 9 #define BUTTON_PIN 0 -/* NOT USED???? -//#define BUTTON_PIN_MASK GPIO_SEL_0 // ?? -//#define BUTTON_CONUT 1 // ?? -//#define BUTTON_ARRAY BUTTON_PIN // ??*/ - #define RADIO_SCLK_PIN 12 #define RADIO_MISO_PIN 13 #define RADIO_MOSI_PIN 11 @@ -104,39 +87,6 @@ #define RADIO_DIO1_PIN 1 #define RADIO_BUSY_PIN 4 -/* NOT USED???? -#define SPI_MOSI 35 // ?? -#define SPI_SCK 36 // ?? -#define SPI_MISO 37 // ?? -#define SPI_CS 47 // ?? -#define IMU_CS 34 // ?? -#define IMU_INT 33 // ??*/ - -/* NOT USED???? -#define SDCARD_MOSI SPI_MOSI // ?? -#define SDCARD_MISO SPI_MISO // ?? -#define SDCARD_SCLK SPI_SCK // ?? -#define SDCARD_CS SPI_CS // ??*/ - -/* NOT USED???? -#define PIN_NONE -1 // ?? -#define RTC_INT 14 // ??*/ - -//#define GPS_BAUD_RATE 9600 // not used!! - -/* NOT USED???? -#define HAS_SDCARD // ?? -#define HAS_GPS // ?? -#define HAS_DISPLAY // ?? -#define HAS_PMU // ??*/ - -/* NOT USED???? -#define __HAS_SPI1__ // ?? -#define __HAS_SENSOR__ // ??*/ - -//#define PMU_WIRE_PORT Wire1 // ?? -//#define DISPLAY_MODEL U8G2_SH1106_128X64_NONAME_F_HW_I2C - #endif diff --git a/src/power_utils.cpp b/src/power_utils.cpp index 3840dfd..c6eb20e 100644 --- a/src/power_utils.cpp +++ b/src/power_utils.cpp @@ -1,4 +1,4 @@ -#include "configuration.h" + #include "configuration.h" #include "power_utils.h" #include "pins_config.h" #include "logger.h" @@ -37,11 +37,6 @@ namespace POWER_Utils { String batteryVoltage = ""; String batteryChargeDischargeCurrent = ""; - /* NOT USED???? - void setPMUFlag() { - pmuInterrupt = true; - }*/ - double getBatteryVoltage() { #if defined(TTGO_T_Beam_V0_7) || defined(ESP32_DIY_LoRa_GPS) || defined(TTGO_T_LORA_V2_1_GPS) || defined(TTGO_T_LORA_V2_1_TNC) || defined(ESP32_DIY_1W_LoRa_GPS) int adc_value; @@ -261,7 +256,7 @@ namespace POWER_Utils { PMU.disableDLDO2(); PMU.setDC1Voltage(3300); PMU.enableDC1(); - PMU.setALDO1Voltage(2300); // screen brightness??? + PMU.setALDO1Voltage(3300); PMU.disableIRQ(XPOWERS_AXP2101_ALL_IRQ); } return result; @@ -300,9 +295,7 @@ namespace POWER_Utils { #endif #if defined(TTGO_T_Beam_S3_SUPREME_V3) - #ifdef I2C1_SDA // what is this validating? Wire1.begin(I2C1_SDA, I2C1_SCL); - #endif Wire.begin(I2C0_SDA, I2C0_SCL); if (begin(Wire1)) { logger.log(logging::LoggerLevel::LOGGER_LEVEL_INFO, "AXP2101", "init done!"); diff --git a/src/utils.cpp b/src/utils.cpp index 319bdf9..bad40d1 100644 --- a/src/utils.cpp +++ b/src/utils.cpp @@ -20,8 +20,7 @@ extern bool flashlight; namespace Utils { - static char locator[11]; - // The letterize and getMaidenheadLocator functions are Copyright (c) 2021 Mateusz Salwach - MIT License + static char locator[11]; // letterize and getMaidenheadLocator functions are Copyright (c) 2021 Mateusz Salwach - MIT License static char letterize(int x) { return (char) x + 65;