almost working1
This commit is contained in:
parent
5466761772
commit
8874f34cfa
|
|
@ -1,7 +1,7 @@
|
|||
{
|
||||
"beacons": [
|
||||
{
|
||||
"callsign": "NOCALL-7",
|
||||
"callsign": "CA2RXU-4",
|
||||
"symbol": "[",
|
||||
"overlay": "/",
|
||||
"micE": "",
|
||||
|
|
@ -19,7 +19,7 @@
|
|||
}
|
||||
},
|
||||
{
|
||||
"callsign": "NOCALL-7",
|
||||
"callsign": "CA2RXU-4",
|
||||
"symbol": ">",
|
||||
"overlay": "/",
|
||||
"micE": "",
|
||||
|
|
@ -37,7 +37,7 @@
|
|||
}
|
||||
},
|
||||
{
|
||||
"callsign": "NOCALL-7",
|
||||
"callsign": "CA2RXU-4",
|
||||
"symbol": "b",
|
||||
"overlay": "/",
|
||||
"micE": "",
|
||||
|
|
|
|||
|
|
@ -35,13 +35,9 @@ lib_deps =
|
|||
adafruit/Adafruit BME280 Library@^2.2.2
|
||||
adafruit/Adafruit BMP280 Library@^2.6.8
|
||||
adafruit/Adafruit BME680 Library@^2.0.4
|
||||
adafruit/Adafruit SH110X@^2.1.8
|
||||
adafruit/Adafruit SH110X@^2.1.8
|
||||
bodmer/TFT_eSPI@^2.5.43
|
||||
|
||||
;check_tool = cppcheck
|
||||
;check_flags =
|
||||
; cppcheck: --suppress=*:*.pio\* --inline-suppr -DCPPCHECK
|
||||
;check_skip_packages = yes
|
||||
|
||||
|
||||
[esp32dev_base]
|
||||
build_flags =
|
||||
|
|
@ -170,4 +166,40 @@ build_flags =
|
|||
-DESP32_C3_DIY_LoRa_GPS
|
||||
-DHAS_SX127X
|
||||
-DARDUINO_USB_MODE=1
|
||||
-DARDUINO_USB_CDC_ON_BOOT=1
|
||||
-DARDUINO_USB_CDC_ON_BOOT=1
|
||||
|
||||
[env:heltec_wireless_tracker]
|
||||
board = esp32-s3-devkitc-1
|
||||
board_build.mcu = esp32s3
|
||||
build_flags =
|
||||
-DHELTEC_WIRELESS_TRACKER
|
||||
-DHAS_SX126X
|
||||
-DHAS_BUTTON
|
||||
-DHIGH_GPS_BAUDRATE
|
||||
-DHAS_TFT
|
||||
-DARDUINO_USB_MODE=1
|
||||
-DARDUINO_USB_CDC_ON_BOOT=1
|
||||
-D USER_SETUP_LOADED
|
||||
-D TFT_WIDTH=80
|
||||
-D TFT_HEIGHT=160
|
||||
-D ST7735_DRIVER
|
||||
-D ST7735_GREENTAB160x80
|
||||
-D TFT_RGB_ORDER=TFT_BGR
|
||||
-D TFT_MOSI=42
|
||||
-D TFT_SCLK=41
|
||||
-D TFT_CS=38
|
||||
-D TFT_DC=40
|
||||
-D TFT_RST=39
|
||||
-D TFT_BL=21
|
||||
-D TFT_BACKLIGHT_ON=1
|
||||
-D TOUCH_CS=-1
|
||||
-D LOAD_GLCD
|
||||
-D LOAD_FONT2
|
||||
-D LOAD_FONT4
|
||||
-D LOAD_FONT6
|
||||
-D LOAD_FONT7
|
||||
-D LOAD_FONT8
|
||||
-D SPI_FREQUENCY=27000000
|
||||
-D USE_HSPI_PORT
|
||||
;-D LOAD_GFXFF
|
||||
;-D SMOOTH_FONT
|
||||
|
|
@ -49,7 +49,7 @@ BluetoothSerial SerialBT;
|
|||
OneButton userButton = OneButton(BUTTON_PIN, true, true);
|
||||
#endif
|
||||
|
||||
String versionDate = "2024.03.28";
|
||||
String versionDate = "2024.04.12";
|
||||
|
||||
uint8_t myBeaconsIndex = 0;
|
||||
int myBeaconsSize = Config.beacons.size();
|
||||
|
|
@ -134,14 +134,18 @@ logging::Logger logger;
|
|||
|
||||
void setup() {
|
||||
Serial.begin(115200);
|
||||
|
||||
#ifndef DEBUG
|
||||
logger.setDebugLevel(logging::LoggerLevel::LOGGER_LEVEL_INFO);
|
||||
#endif
|
||||
|
||||
POWER_Utils::setup();
|
||||
|
||||
/* para HELTEC WIRELESS TRACKER!
|
||||
pinMode(internalLedPin ,OUTPUT);
|
||||
digitalWrite(internalLedPin, LOW);*/
|
||||
|
||||
setup_display();
|
||||
|
||||
if (Config.notification.buzzerActive) {
|
||||
pinMode(Config.notification.buzzerPinTone, OUTPUT);
|
||||
pinMode(Config.notification.buzzerPinVcc, OUTPUT);
|
||||
|
|
@ -163,6 +167,9 @@ void setup() {
|
|||
}
|
||||
|
||||
show_display(" LoRa APRS", " (TRACKER)", workingFreq, "", "Richonguzman / CA2RXU", " " + versionDate, 4000);
|
||||
/*#ifdef HAS_TFT
|
||||
cleanTFT();
|
||||
#endif*/
|
||||
logger.log(logging::LoggerLevel::LOGGER_LEVEL_INFO, "Main", "RichonGuzman (CA2RXU) --> LoRa APRS Tracker/Station");
|
||||
logger.log(logging::LoggerLevel::LOGGER_LEVEL_INFO, "Main", "Version: %s", versionDate);
|
||||
|
||||
|
|
@ -181,6 +188,7 @@ void setup() {
|
|||
|
||||
WiFi.mode(WIFI_OFF);
|
||||
logger.log(logging::LoggerLevel::LOGGER_LEVEL_INFO, "Main", "WiFi controller stopped");
|
||||
|
||||
if (Config.bluetoothType==0) {
|
||||
BLE_Utils::setup();
|
||||
} else {
|
||||
|
|
|
|||
120
src/display.cpp
120
src/display.cpp
|
|
@ -1,4 +1,3 @@
|
|||
#include <Adafruit_GFX.h>
|
||||
#include <logger.h>
|
||||
#include <Wire.h>
|
||||
#include "custom_characters.h"
|
||||
|
|
@ -7,6 +6,14 @@
|
|||
#include "display.h"
|
||||
#include "TimeLib.h"
|
||||
|
||||
#ifdef HAS_TFT
|
||||
#include <TFT_eSPI.h>
|
||||
|
||||
TFT_eSPI tft = TFT_eSPI();
|
||||
|
||||
#else
|
||||
#include <Adafruit_GFX.h>
|
||||
|
||||
#define ssd1306 //comment this line with "//" when using SH1106 screen instead of SSD1306
|
||||
|
||||
#if defined(TTGO_T_Beam_S3_SUPREME_V3)
|
||||
|
|
@ -18,13 +25,17 @@
|
|||
|
||||
#ifdef ssd1306
|
||||
#include <Adafruit_SSD1306.h>
|
||||
Adafruit_SSD1306 display(128, 64, &Wire, OLED_RST);
|
||||
#else
|
||||
#include <Adafruit_SH110X.h>
|
||||
Adafruit_SH1106G display(128, 64, &Wire, OLED_RST);
|
||||
#endif
|
||||
|
||||
#define SYM_HEIGHT 14
|
||||
#define SYM_WIDTH 16
|
||||
|
||||
#endif
|
||||
|
||||
extern Configuration Config;
|
||||
extern Beacon *currentBeacon;
|
||||
extern int menuDisplay;
|
||||
|
|
@ -46,16 +57,23 @@ const uint8_t *symbolsAPRS[] = {runnerSymbol, carSymbol, jeepSymbol, bikeSymbol
|
|||
|
||||
extern logging::Logger logger;
|
||||
|
||||
#ifdef ssd1306
|
||||
Adafruit_SSD1306 display(128, 64, &Wire, OLED_RST);
|
||||
#else
|
||||
Adafruit_SH1106G display(128, 64, &Wire, OLED_RST);
|
||||
#endif
|
||||
void cleanTFT() {
|
||||
#ifdef HAS_TFT
|
||||
tft.fillScreen(TFT_BLACK);
|
||||
#endif
|
||||
}
|
||||
|
||||
// cppcheck-suppress unusedFunction
|
||||
void setup_display() {
|
||||
delay(500);
|
||||
#ifdef OLED_DISPLAY_HAS_RST_PIN //
|
||||
#ifdef HAS_TFT
|
||||
tft.init();
|
||||
tft.begin();
|
||||
tft.setRotation(1);
|
||||
tft.setTextFont(0);
|
||||
tft.fillScreen(TFT_BLACK);
|
||||
#else
|
||||
#ifdef OLED_DISPLAY_HAS_RST_PIN
|
||||
pinMode(OLED_RST, OUTPUT);
|
||||
digitalWrite(OLED_RST, LOW);
|
||||
delay(20);
|
||||
|
|
@ -92,10 +110,14 @@ void setup_display() {
|
|||
display.ssd1306_command(screenBrightness);
|
||||
#endif
|
||||
display.display();
|
||||
#endif
|
||||
}
|
||||
|
||||
// cppcheck-suppress unusedFunction
|
||||
void display_toggle(bool toggle) {
|
||||
#ifdef HAS_TFT
|
||||
//algo
|
||||
#else
|
||||
if (toggle) {
|
||||
#ifdef ssd1306
|
||||
display.ssd1306_command(SSD1306_DISPLAYON);
|
||||
|
|
@ -105,10 +127,18 @@ void display_toggle(bool toggle) {
|
|||
display.ssd1306_command(SSD1306_DISPLAYOFF);
|
||||
#endif
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
// cppcheck-suppress unusedFunction
|
||||
void show_display(String header, int wait) {
|
||||
#ifdef HAS_TFT
|
||||
cleanTFT();
|
||||
tft.setTextColor(TFT_WHITE,TFT_BLACK);
|
||||
tft.setTextSize(2);
|
||||
tft.setCursor(0, 0);
|
||||
tft.print(header);
|
||||
#else
|
||||
display.clearDisplay();
|
||||
#ifdef ssd1306
|
||||
display.setTextColor(WHITE);
|
||||
|
|
@ -123,11 +153,22 @@ void show_display(String header, int wait) {
|
|||
display.ssd1306_command(screenBrightness);
|
||||
#endif
|
||||
display.display();
|
||||
#endif
|
||||
delay(wait);
|
||||
}
|
||||
|
||||
// cppcheck-suppress unusedFunction
|
||||
void show_display(String header, String line1, int wait) {
|
||||
#ifdef HAS_TFT
|
||||
cleanTFT();
|
||||
tft.setTextColor(TFT_WHITE,TFT_BLACK);
|
||||
tft.setTextSize(2);
|
||||
tft.setCursor(0, 0);
|
||||
tft.print(header);
|
||||
tft.setTextSize(1);
|
||||
tft.setCursor(0, 16);
|
||||
tft.print(line1);
|
||||
#else
|
||||
display.clearDisplay();
|
||||
#ifdef ssd1306
|
||||
display.setTextColor(WHITE);
|
||||
|
|
@ -145,11 +186,24 @@ void show_display(String header, String line1, int wait) {
|
|||
display.ssd1306_command(screenBrightness);
|
||||
#endif
|
||||
display.display();
|
||||
#endif
|
||||
delay(wait);
|
||||
}
|
||||
|
||||
// cppcheck-suppress unusedFunction
|
||||
void show_display(String header, String line1, String line2, int wait) {
|
||||
#ifdef HAS_TFT
|
||||
cleanTFT();
|
||||
tft.setTextColor(TFT_WHITE,TFT_BLACK);
|
||||
tft.setTextSize(2);
|
||||
tft.setCursor(0, 0);
|
||||
tft.print(header);
|
||||
tft.setTextSize(1);
|
||||
tft.setCursor(0, 16);
|
||||
tft.print(line1);
|
||||
tft.setCursor(0, 25);
|
||||
tft.print(line2);
|
||||
#else
|
||||
display.clearDisplay();
|
||||
#ifdef ssd1306
|
||||
display.setTextColor(WHITE);
|
||||
|
|
@ -169,11 +223,26 @@ void show_display(String header, String line1, String line2, int wait) {
|
|||
display.ssd1306_command(screenBrightness);
|
||||
#endif
|
||||
display.display();
|
||||
#endif
|
||||
delay(wait);
|
||||
}
|
||||
|
||||
// cppcheck-suppress unusedFunction
|
||||
void show_display(String header, String line1, String line2, String line3, int wait) {
|
||||
#ifdef HAS_TFT
|
||||
cleanTFT();
|
||||
tft.setTextColor(TFT_WHITE,TFT_BLACK);
|
||||
tft.setTextSize(2);
|
||||
tft.setCursor(0, 0);
|
||||
tft.print(header);
|
||||
tft.setTextSize(1);
|
||||
tft.setCursor(0, 16);
|
||||
tft.print(line1);
|
||||
tft.setCursor(0, 25);
|
||||
tft.print(line2);
|
||||
tft.setCursor(0, 34);
|
||||
tft.print(line3);
|
||||
#else
|
||||
display.clearDisplay();
|
||||
#ifdef ssd1306
|
||||
display.setTextColor(WHITE);
|
||||
|
|
@ -195,11 +264,28 @@ void show_display(String header, String line1, String line2, String line3, int w
|
|||
display.ssd1306_command(screenBrightness);
|
||||
#endif
|
||||
display.display();
|
||||
#endif
|
||||
delay(wait);
|
||||
}
|
||||
|
||||
// cppcheck-suppress unusedFunction
|
||||
void show_display(String header, String line1, String line2, String line3, String line4, int wait) {
|
||||
#ifdef HAS_TFT
|
||||
cleanTFT();
|
||||
tft.setTextColor(TFT_WHITE,TFT_BLACK);
|
||||
tft.setTextSize(2);
|
||||
tft.setCursor(0, 0);
|
||||
tft.print(header);
|
||||
tft.setTextSize(1);
|
||||
tft.setCursor(0, 16);
|
||||
tft.print(line1);
|
||||
tft.setCursor(0, 25);
|
||||
tft.print(line2);
|
||||
tft.setCursor(0, 34);
|
||||
tft.print(line3);
|
||||
tft.setCursor(0, 43);
|
||||
tft.print(line4);
|
||||
#else
|
||||
display.clearDisplay();
|
||||
#ifdef ssd1306
|
||||
display.setTextColor(WHITE);
|
||||
|
|
@ -223,11 +309,30 @@ void show_display(String header, String line1, String line2, String line3, Strin
|
|||
display.ssd1306_command(screenBrightness);
|
||||
#endif
|
||||
display.display();
|
||||
#endif
|
||||
delay(wait);
|
||||
}
|
||||
|
||||
// cppcheck-suppress unusedFunction
|
||||
void show_display(String header, String line1, String line2, String line3, String line4, String line5, int wait) {
|
||||
#ifdef HAS_TFT
|
||||
cleanTFT();
|
||||
tft.setTextColor(TFT_WHITE,TFT_BLACK);
|
||||
tft.setTextSize(2);
|
||||
tft.setCursor(0, 0);
|
||||
tft.print(header);
|
||||
tft.setTextSize(1);
|
||||
tft.setCursor(0, 16);
|
||||
tft.print(line1);
|
||||
tft.setCursor(0, 25);
|
||||
tft.print(line2);
|
||||
tft.setCursor(0, 34);
|
||||
tft.print(line3);
|
||||
tft.setCursor(0, 43);
|
||||
tft.print(line4);
|
||||
tft.setCursor(0, 52);
|
||||
tft.print(line5);
|
||||
#else
|
||||
display.clearDisplay();
|
||||
#ifdef ssd1306
|
||||
display.setTextColor(WHITE);
|
||||
|
|
@ -281,5 +386,6 @@ void show_display(String header, String line1, String line2, String line3, Strin
|
|||
}
|
||||
|
||||
display.display();
|
||||
#endif
|
||||
delay(wait);
|
||||
}
|
||||
|
|
@ -3,6 +3,7 @@
|
|||
|
||||
void setup_display();
|
||||
void display_toggle(bool toggle);
|
||||
void cleanTFT();
|
||||
|
||||
void show_display(String header, int wait = 0);
|
||||
void show_display(String header, String line1, int wait = 0);
|
||||
|
|
|
|||
|
|
@ -10,8 +10,14 @@
|
|||
|
||||
#include "APRSPacketLib.h"
|
||||
|
||||
#ifdef HIGH_GPS_BAUDRATE
|
||||
#define GPS_BAUD 115200
|
||||
#else
|
||||
#define GPS_BAUD 9600
|
||||
#endif
|
||||
|
||||
extern Configuration Config;
|
||||
extern HardwareSerial neo6m_gps;
|
||||
extern HardwareSerial neo6m_gps; // cambiar a gpsSerial
|
||||
extern TinyGPSPlus gps;
|
||||
extern Beacon *currentBeacon;
|
||||
extern logging::Logger logger;
|
||||
|
|
@ -41,7 +47,7 @@ namespace GPS_Utils {
|
|||
logger.log(logging::LoggerLevel::LOGGER_LEVEL_INFO, "Main", "GPS disabled");
|
||||
return;
|
||||
}
|
||||
neo6m_gps.begin(9600, SERIAL_8N1, GPS_TX, GPS_RX);
|
||||
neo6m_gps.begin(GPS_BAUD, SERIAL_8N1, GPS_TX, GPS_RX);
|
||||
}
|
||||
|
||||
void calculateDistanceCourse(String Callsign, double checkpointLatitude, double checkPointLongitude) {
|
||||
|
|
|
|||
|
|
@ -760,6 +760,7 @@ namespace KEYBOARD_Utils {
|
|||
}
|
||||
|
||||
void setup() {
|
||||
#ifndef HELTEC_WIRELESS_TRACKER
|
||||
Wire.beginTransmission(CARDKB_ADDR);
|
||||
if (Wire.endTransmission() == 0) {
|
||||
keyboardConnected = true;
|
||||
|
|
@ -767,6 +768,7 @@ namespace KEYBOARD_Utils {
|
|||
} else {
|
||||
logger.log(logging::LoggerLevel::LOGGER_LEVEL_INFO, "Main", "No Keyboard Connected to I2C");
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -20,7 +20,7 @@ SX1268 radio = new Module(RADIO_CS_PIN, RADIO_DIO1_PIN, RADIO_RST_PIN, RADIO_BUS
|
|||
bool transmissionFlag = true;
|
||||
bool enableInterrupt = true;
|
||||
#endif
|
||||
#if defined(TTGO_T_Beam_V1_2_SX1262) || defined(TTGO_T_Beam_S3_SUPREME_V3) || defined(HELTEC_V3_GPS)
|
||||
#if defined(TTGO_T_Beam_V1_2_SX1262) || defined(TTGO_T_Beam_S3_SUPREME_V3) || defined(HELTEC_V3_GPS) || defined(HELTEC_WIRELESS_TRACKER)
|
||||
SX1262 radio = new Module(RADIO_CS_PIN, RADIO_DIO1_PIN, RADIO_RST_PIN, RADIO_BUSY_PIN);
|
||||
bool transmissionFlag = true;
|
||||
bool enableInterrupt = true;
|
||||
|
|
@ -48,7 +48,7 @@ namespace LoRa_Utils {
|
|||
float signalBandwidth = currentLoRaType->signalBandwidth/1000;
|
||||
radio.setBandwidth(signalBandwidth);
|
||||
radio.setCodingRate(currentLoRaType->codingRate4);
|
||||
#if defined(TTGO_T_Beam_V1_0_SX1268) || defined(TTGO_T_Beam_V1_2_SX1262) || defined(TTGO_T_Beam_S3_SUPREME_V3) || defined(HELTEC_V3_GPS)
|
||||
#if defined(TTGO_T_Beam_V1_0_SX1268) || defined(TTGO_T_Beam_V1_2_SX1262) || defined(TTGO_T_Beam_S3_SUPREME_V3) || defined(HELTEC_V3_GPS) || defined(HELTEC_WIRELESS_TRACKER)
|
||||
radio.setOutputPower(currentLoRaType->power + 2); // values available: 10, 17, 22 --> if 20 in tracker_conf.json it will be updated to 22.
|
||||
#endif
|
||||
#if defined(ESP32_DIY_1W_LoRa_GPS) || defined(OE5HWN_MeshCom)
|
||||
|
|
@ -100,7 +100,7 @@ namespace LoRa_Utils {
|
|||
#if defined(ESP32_DIY_1W_LoRa_GPS) || defined(OE5HWN_MeshCom)
|
||||
radio.setRfSwitchPins(RADIO_RXEN, RADIO_TXEN);
|
||||
#endif
|
||||
#if defined(TTGO_T_Beam_V1_0_SX1268) || defined(TTGO_T_Beam_V1_2_SX1262) || defined(TTGO_T_Beam_S3_SUPREME_V3) || defined(HELTEC_V3_GPS)
|
||||
#if defined(TTGO_T_Beam_V1_0_SX1268) || defined(TTGO_T_Beam_V1_2_SX1262) || defined(TTGO_T_Beam_S3_SUPREME_V3) || defined(HELTEC_V3_GPS) || defined(HELTEC_WIRELESS_TRACKER)
|
||||
state = radio.setOutputPower(currentLoRaType->power + 2); // values available: 10, 17, 22 --> if 20 in tracker_conf.json it will be updated to 22.
|
||||
#endif
|
||||
#if defined(ESP32_DIY_1W_LoRa_GPS) || defined(OE5HWN_MeshCom)
|
||||
|
|
|
|||
|
|
@ -134,4 +134,22 @@
|
|||
#define BATTERY_PIN 1
|
||||
#endif
|
||||
|
||||
#ifdef HELTEC_WIRELESS_TRACKER
|
||||
#define VGNSS_CTRL 3 // Heltec Tracker needs this (pulled low?) for GPS and TFT
|
||||
#define GPS_RX 34
|
||||
#define GPS_TX 33
|
||||
#define GPS_PPS 36
|
||||
#define GPS_RESET 35
|
||||
#define BUTTON_PIN 0
|
||||
//#define BATTERY_PIN 1
|
||||
//#define ADC_CTRL 2 // active HIGH, powers the voltage divider. Only on V05 = V1.1
|
||||
#define RADIO_SCLK_PIN 9
|
||||
#define RADIO_MISO_PIN 11
|
||||
#define RADIO_MOSI_PIN 10
|
||||
#define RADIO_CS_PIN 8
|
||||
#define RADIO_RST_PIN 12
|
||||
#define RADIO_DIO1_PIN 14 // SX1262 IRQ
|
||||
#define RADIO_BUSY_PIN 13 // SX1262 BUSY
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
|
@ -5,10 +5,12 @@
|
|||
#include "logger.h"
|
||||
|
||||
#ifndef TTGO_T_Beam_S3_SUPREME_V3
|
||||
#ifndef HELTEC_WIRELESS_TRACKER
|
||||
#define I2C_SDA 21
|
||||
#define I2C_SCL 22
|
||||
#define IRQ_PIN 35
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifdef TTGO_T_Beam_S3_SUPREME_V3
|
||||
#define I2C0_SDA 17
|
||||
|
|
@ -54,6 +56,9 @@ namespace POWER_Utils {
|
|||
double inputDivider = (1.0 / (390.0 + 100.0)) * 100.0; // The voltage divider is a 390k + 100k resistor in series, 100k on the low side.
|
||||
return (voltage / inputDivider) + 0.3; // Yes, this offset is excessive, but the ADC on the ESP32s3 is quite inaccurate and noisy. Adjust to own measurements.
|
||||
#endif
|
||||
#ifdef HELTEC_WIRELESS_TRACKER
|
||||
return 0;
|
||||
#endif
|
||||
}
|
||||
|
||||
String getBatteryInfoVoltage() {
|
||||
|
|
@ -81,7 +86,7 @@ namespace POWER_Utils {
|
|||
}
|
||||
|
||||
bool isCharging() {
|
||||
#if defined(TTGO_T_Beam_V0_7) || defined(ESP32_DIY_LoRa_GPS) || defined(TTGO_T_LORA32_V2_1_GPS) || defined(TTGO_T_LORA32_V2_1_TNC) || defined(ESP32_DIY_1W_LoRa_GPS) || defined(HELTEC_V3_GPS) || defined(OE5HWN_MeshCom) || defined(ESP32_C3_DIY_LoRa_GPS)
|
||||
#if defined(TTGO_T_Beam_V0_7) || defined(ESP32_DIY_LoRa_GPS) || defined(TTGO_T_LORA32_V2_1_GPS) || defined(TTGO_T_LORA32_V2_1_TNC) || defined(ESP32_DIY_1W_LoRa_GPS) || defined(HELTEC_V3_GPS) || defined(OE5HWN_MeshCom) || defined(ESP32_C3_DIY_LoRa_GPS) || defined(HELTEC_WIRELESS_TRACKER)
|
||||
return 0;
|
||||
#endif
|
||||
#if defined(HAS_AXP192) || defined(HAS_AXP2101)
|
||||
|
|
@ -98,7 +103,7 @@ namespace POWER_Utils {
|
|||
}
|
||||
|
||||
double getBatteryChargeDischargeCurrent() {
|
||||
#if defined(TTGO_T_Beam_V0_7) || defined(ESP32_DIY_LoRa_GPS) || defined(TTGO_T_LORA32_V2_1_GPS) || defined(TTGO_T_LORA32_V2_1_TNC) || defined(ESP32_DIY_1W_LoRa_GPS) || defined(HELTEC_V3_GPS) || defined(OE5HWN_MeshCom) || defined(ESP32_C3_DIY_LoRa_GPS)
|
||||
#if defined(TTGO_T_Beam_V0_7) || defined(ESP32_DIY_LoRa_GPS) || defined(TTGO_T_LORA32_V2_1_GPS) || defined(TTGO_T_LORA32_V2_1_TNC) || defined(ESP32_DIY_1W_LoRa_GPS) || defined(HELTEC_V3_GPS) || defined(OE5HWN_MeshCom) || defined(ESP32_C3_DIY_LoRa_GPS) || defined(HELTEC_WIRELESS_TRACKER)
|
||||
return 0;
|
||||
#endif
|
||||
#ifdef HAS_AXP192
|
||||
|
|
@ -113,7 +118,7 @@ namespace POWER_Utils {
|
|||
}
|
||||
|
||||
bool isBatteryConnected() {
|
||||
#if defined(TTGO_T_Beam_V0_7) || defined(ESP32_DIY_LoRa_GPS) || defined(TTGO_T_LORA32_V2_1_GPS) || defined(TTGO_T_LORA32_V2_1_TNC) || defined(ESP32_DIY_1W_LoRa_GPS) || defined(HELTEC_V3_GPS) || defined(OE5HWN_MeshCom) || defined(ESP32_C3_DIY_LoRa_GPS)
|
||||
#if defined(TTGO_T_Beam_V0_7) || defined(ESP32_DIY_LoRa_GPS) || defined(TTGO_T_LORA32_V2_1_GPS) || defined(TTGO_T_LORA32_V2_1_TNC) || defined(ESP32_DIY_1W_LoRa_GPS) || defined(HELTEC_V3_GPS) || defined(OE5HWN_MeshCom) || defined(ESP32_C3_DIY_LoRa_GPS) || defined(HELTEC_WIRELESS_TRACKER)
|
||||
if(getBatteryVoltage() > 1.0) {
|
||||
return true;
|
||||
} else {
|
||||
|
|
@ -212,7 +217,7 @@ namespace POWER_Utils {
|
|||
}
|
||||
|
||||
bool begin(TwoWire &port) {
|
||||
#if defined(TTGO_T_Beam_V0_7) || defined(ESP32_DIY_LoRa_GPS) || defined(TTGO_T_LORA32_V2_1_GPS) || defined(TTGO_T_LORA32_V2_1_TNC) || defined(ESP32_DIY_1W_LoRa_GPS) || defined(HELTEC_V3_GPS) || defined(OE5HWN_MeshCom) || defined(ESP32_C3_DIY_LoRa_GPS)
|
||||
#if defined(TTGO_T_Beam_V0_7) || defined(ESP32_DIY_LoRa_GPS) || defined(TTGO_T_LORA32_V2_1_GPS) || defined(TTGO_T_LORA32_V2_1_TNC) || defined(ESP32_DIY_1W_LoRa_GPS) || defined(HELTEC_V3_GPS) || defined(OE5HWN_MeshCom) || defined(ESP32_C3_DIY_LoRa_GPS) || defined(HELTEC_WIRELESS_TRACKER)
|
||||
return true; // no powerManagment chip for this boards (only a few measure battery voltage).
|
||||
#endif
|
||||
#ifdef HAS_AXP192
|
||||
|
|
@ -331,6 +336,10 @@ namespace POWER_Utils {
|
|||
#ifdef HELTEC_V3_GPS
|
||||
pinMode(BATTERY_PIN, INPUT); // This could or should be elsewhere, but this was my point of entry.
|
||||
#endif
|
||||
#ifdef HELTEC_WIRELESS_TRACKER
|
||||
pinMode(VGNSS_CTRL,OUTPUT); // this is for GPS and TFT screen
|
||||
digitalWrite(VGNSS_CTRL, HIGH);
|
||||
#endif
|
||||
}
|
||||
|
||||
void lowerCpuFrequency() {
|
||||
|
|
|
|||
Loading…
Reference in New Issue