testing more boards
This commit is contained in:
parent
e359275e61
commit
1ec4c678be
|
|
@ -6,7 +6,7 @@
|
|||
#undef OLED_RST
|
||||
|
||||
|
||||
#if defined(TTGO_T_Beam_V1_2) || defined(TTGO_T_Beam_V1_0)
|
||||
#if defined(TTGO_T_Beam_V1_2) || defined(TTGO_T_Beam_V1_2_915) || defined(TTGO_T_Beam_V1_0) || defined(TTGO_T_Beam_V1_0_915)
|
||||
#define OLED_SDA 21
|
||||
#define OLED_SCL 22
|
||||
#define OLED_RST 16
|
||||
|
|
@ -57,11 +57,11 @@
|
|||
#endif
|
||||
|
||||
|
||||
#if defined(TTGO_T_LORA32_V2_1_GPS) || defined(TTGO_T_LORA32_V2_1_TNC) || defined(ESP32_DIY_LoRa_GPS)
|
||||
#if defined(TTGO_T_LORA32_V2_1_GPS) || defined(TTGO_T_LORA32_V2_1_GPS_915) || defined(TTGO_T_LORA32_V2_1_TNC) || defined(TTGO_T_LORA32_V2_1_TNC_915) || defined(ESP32_DIY_LoRa_GPS) || defined(ESP32_DIY_LoRa_GPS_915)
|
||||
#define OLED_SDA 21
|
||||
#define OLED_SCL 22
|
||||
#define OLED_RST 16
|
||||
#ifdef TTGO_T_LORA32_V2_1_TNC
|
||||
#if defined(TTGO_T_LORA32_V2_1_TNC) || defined(TTGO_T_LORA32_V2_1_TNC_915)
|
||||
#define GPS_RX -1
|
||||
#define GPS_TX -1
|
||||
#else
|
||||
|
|
@ -165,7 +165,7 @@
|
|||
#endif
|
||||
|
||||
|
||||
#ifdef ESP32_DIY_1W_LoRa_GPS
|
||||
#if defined(ESP32_DIY_1W_LoRa_GPS) || defined(ESP32_DIY_1W_LoRa_GPS_915)
|
||||
#define OLED_SDA 21
|
||||
#define OLED_SCL 22
|
||||
#define OLED_RST 16
|
||||
|
|
@ -223,7 +223,7 @@
|
|||
#endif
|
||||
|
||||
|
||||
#ifdef ESP32_C3_DIY_LoRa_GPS
|
||||
#if defined(ESP32_C3_DIY_LoRa_GPS) || defined(ESP32_C3_DIY_LoRa_GPS_915)
|
||||
#define OLED_SDA 8
|
||||
#define OLED_SCL 9
|
||||
#define OLED_RST 10
|
||||
|
|
|
|||
|
|
@ -37,7 +37,7 @@ double previousHeading = 0;
|
|||
namespace GPS_Utils {
|
||||
|
||||
void setup() {
|
||||
#ifdef TTGO_T_LORA32_V2_1_TNC
|
||||
#if defined(TTGO_T_LORA32_V2_1_TNC) || defined(TTGO_T_LORA32_V2_1_TNC_915)
|
||||
disableGPS = true;
|
||||
#else
|
||||
disableGPS = Config.disableGPS;
|
||||
|
|
|
|||
|
|
@ -509,7 +509,7 @@ namespace MENU_Utils {
|
|||
}
|
||||
}
|
||||
|
||||
#ifdef TTGO_T_LORA32_V2_1_TNC
|
||||
#if defined(TTGO_T_LORA32_V2_1_TNC) || defined(TTGO_T_LORA32_V2_1_TNC_915)
|
||||
secondRowMainMenu = "";
|
||||
thirdRowMainMenu = " LoRa APRS TNC";
|
||||
fourthRowMainMenu = "";
|
||||
|
|
@ -598,12 +598,12 @@ namespace MENU_Utils {
|
|||
if (POWER_Utils::getBatteryInfoIsConnected()) {
|
||||
String batteryVoltage = POWER_Utils::getBatteryInfoVoltage();
|
||||
String batteryCharge = POWER_Utils::getBatteryInfoCurrent();
|
||||
#if defined(TTGO_T_Beam_V0_7) || defined(TTGO_T_LORA32_V2_1_GPS) || defined(TTGO_T_LORA32_V2_1_TNC) || defined(HELTEC_V3_GPS) || defined(HELTEC_WIRELESS_TRACKER) || defined(TTGO_T_DECK_GPS)
|
||||
#if defined(TTGO_T_Beam_V0_7) || defined(TTGO_T_LORA32_V2_1_GPS) || defined(TTGO_T_LORA32_V2_1_GPS_915) || defined(TTGO_T_LORA32_V2_1_TNC) || defined(TTGO_T_LORA32_V2_1_TNC_915) || defined(HELTEC_V3_GPS) || defined(HELTEC_WIRELESS_TRACKER) || defined(TTGO_T_DECK_GPS)
|
||||
sixthRowMainMenu = "Bat: ";
|
||||
sixthRowMainMenu += batteryVoltage;
|
||||
sixthRowMainMenu += "V";
|
||||
#endif
|
||||
#if defined(TTGO_T_Beam_V1_0) || defined(TTGO_T_Beam_V1_0_SX1268)
|
||||
#ifdef HAS_AXP192
|
||||
if (batteryCharge.toInt() == 0) {
|
||||
sixthRowMainMenu = "Battery Charged ";
|
||||
sixthRowMainMenu += batteryVoltage;
|
||||
|
|
@ -620,7 +620,7 @@ namespace MENU_Utils {
|
|||
sixthRowMainMenu += "mA";
|
||||
}
|
||||
#endif
|
||||
#if defined(TTGO_T_Beam_V1_2) || defined(TTGO_T_Beam_V1_2_SX1262) || defined(TTGO_T_Beam_S3_SUPREME_V3)
|
||||
#ifdef HAS_AXP2101
|
||||
if (Config.notification.lowBatteryBeep && !POWER_Utils::isCharging() && batteryCharge.toInt() < lowBatteryPercent) {
|
||||
lowBatteryPercent = batteryCharge.toInt();
|
||||
NOTIFICATION_Utils::lowBatteryBeep();
|
||||
|
|
|
|||
|
|
@ -73,10 +73,10 @@ namespace POWER_Utils {
|
|||
batteryMeasurmentTime = millis();
|
||||
#endif
|
||||
double voltage = (adc_value * 3.3 ) / 4095.0;
|
||||
#if defined(TTGO_T_Beam_V0_7) || defined(TTGO_T_LORA32_V2_1_GPS) || defined(TTGO_T_LORA32_V2_1_TNC) || defined(ESP32_DIY_LoRa_GPS) || defined(ESP32_DIY_1W_LoRa_GPS) || defined(OE5HWN_MeshCom) || defined(TTGO_T_DECK_GPS)
|
||||
#if defined(TTGO_T_Beam_V0_7) || defined(TTGO_T_LORA32_V2_1_GPS) || defined(TTGO_T_LORA32_V2_1_GPS_915) || defined(TTGO_T_LORA32_V2_1_TNC) || defined(TTGO_T_LORA32_V2_1_TNC_915) || defined(ESP32_DIY_LoRa_GPS) || defined(ESP32_DIY_LoRa_GPS_915) || defined(ESP32_DIY_1W_LoRa_GPS) || defined(ESP32_DIY_1W_LoRa_GPS_915) || defined(OE5HWN_MeshCom) || defined(TTGO_T_DECK_GPS)
|
||||
return (2 * (voltage + 0.1)) * (1 + (lora32BatReadingCorr/100)); // (2 x 100k voltage divider) 2 x voltage divider/+0.1 because ESP32 nonlinearity ~100mV ADC offset/extra correction
|
||||
#endif
|
||||
#if defined(HELTEC_V3_GPS) || defined(HELTEC_WIRELESS_TRACKER) || defined(ESP32_C3_DIY_LoRa_GPS) || defined(WEMOS_ESP32_Bat_LoRa_GPS)
|
||||
#if defined(HELTEC_V3_GPS) || defined(HELTEC_WIRELESS_TRACKER) || defined(ESP32_C3_DIY_LoRa_GPS) || defined(ESP32_C3_DIY_LoRa_GPS_915) || defined(WEMOS_ESP32_Bat_LoRa_GPS)
|
||||
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.285; // Yes, this offset is excessive, but the ADC on the ESP32s3 is quite inaccurate and noisy. Adjust to own measurements.
|
||||
#endif
|
||||
|
|
@ -111,7 +111,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) || defined(HELTEC_WIRELESS_TRACKER) || defined(TTGO_T_DECK_GPS) || defined(WEMOS_ESP32_Bat_LoRa_GPS)
|
||||
#if defined(TTGO_T_Beam_V0_7) || defined(TTGO_T_LORA32_V2_1_GPS) || defined(TTGO_T_LORA32_V2_1_GPS_915) || defined(TTGO_T_LORA32_V2_1_TNC) || defined(TTGO_T_LORA32_V2_1_TNC_915) || defined(ESP32_DIY_LoRa_GPS) || defined(ESP32_DIY_LoRa_GPS_915) || defined(ESP32_DIY_1W_LoRa_GPS) || defined(ESP32_DIY_1W_LoRa_GPS_915) || defined(HELTEC_V3_GPS) || defined(OE5HWN_MeshCom) || defined(ESP32_C3_DIY_LoRa_GPS) || defined(ESP32_C3_DIY_LoRa_GPS_915) || defined(HELTEC_WIRELESS_TRACKER) || defined(TTGO_T_DECK_GPS) || defined(WEMOS_ESP32_Bat_LoRa_GPS)
|
||||
return 0;
|
||||
#endif
|
||||
#if defined(HAS_AXP192) || defined(HAS_AXP2101)
|
||||
|
|
@ -128,7 +128,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) || defined(HELTEC_WIRELESS_TRACKER) || defined(TTGO_T_DECK_GPS) || defined(WEMOS_ESP32_Bat_LoRa_GPS)
|
||||
#if defined(TTGO_T_Beam_V0_7) || defined(TTGO_T_LORA32_V2_1_GPS) || defined(TTGO_T_LORA32_V2_1_GPS_915) || defined(TTGO_T_LORA32_V2_1_TNC) || defined(TTGO_T_LORA32_V2_1_TNC_915) || defined(ESP32_DIY_LoRa_GPS) || defined(ESP32_DIY_LoRa_GPS_915) || defined(ESP32_DIY_1W_LoRa_GPS) || defined(ESP32_DIY_1W_LoRa_GPS_915) || defined(HELTEC_V3_GPS) || defined(OE5HWN_MeshCom) || defined(ESP32_C3_DIY_LoRa_GPS) || defined(ESP32_C3_DIY_LoRa_GPS_915) || defined(HELTEC_WIRELESS_TRACKER) || defined(TTGO_T_DECK_GPS) || defined(WEMOS_ESP32_Bat_LoRa_GPS)
|
||||
return 0;
|
||||
#endif
|
||||
#ifdef HAS_AXP192
|
||||
|
|
@ -143,7 +143,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) || defined(HELTEC_WIRELESS_TRACKER) || defined(TTGO_T_DECK_GPS) || defined(WEMOS_ESP32_Bat_LoRa_GPS)
|
||||
#if defined(TTGO_T_Beam_V0_7) || defined(TTGO_T_LORA32_V2_1_GPS) || defined(TTGO_T_LORA32_V2_1_GPS_915) || defined(TTGO_T_LORA32_V2_1_TNC) || defined(TTGO_T_LORA32_V2_1_TNC_915) || defined(ESP32_DIY_LoRa_GPS) || defined(ESP32_DIY_LoRa_GPS_915) || defined(ESP32_DIY_1W_LoRa_GPS) || defined(ESP32_DIY_1W_LoRa_GPS_915) || defined(HELTEC_V3_GPS) || defined(OE5HWN_MeshCom) || defined(ESP32_C3_DIY_LoRa_GPS) || defined(ESP32_C3_DIY_LoRa_GPS_915) || defined(HELTEC_WIRELESS_TRACKER) || defined(TTGO_T_DECK_GPS) || defined(WEMOS_ESP32_Bat_LoRa_GPS)
|
||||
if(getBatteryVoltage() > 1.0) {
|
||||
return true;
|
||||
} else {
|
||||
|
|
@ -160,7 +160,7 @@ namespace POWER_Utils {
|
|||
if (!(rate_limit_check_battery++ % 60))
|
||||
BatteryIsConnected = isBatteryConnected();
|
||||
if (BatteryIsConnected) {
|
||||
#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(TTGO_T_Beam_V1_0) || defined(TTGO_T_Beam_V1_0_SX1268) || defined(ESP32_DIY_1W_LoRa_GPS) || defined(HELTEC_V3_GPS) || defined(HELTEC_WIRELESS_TRACKER) || defined(OE5HWN_MeshCom) || defined(TTGO_T_DECK_GPS) || defined(WEMOS_ESP32_Bat_LoRa_GPS)
|
||||
#if defined(HAS_AXP192) || defined(TTGO_T_Beam_V0_7) || defined(TTGO_T_LORA32_V2_1_GPS) || defined(TTGO_T_LORA32_V2_1_GPS_915) || defined(TTGO_T_LORA32_V2_1_TNC) || defined(TTGO_T_LORA32_V2_1_TNC_915) || defined(ESP32_DIY_LoRa_GPS) || defined(ESP32_DIY_LoRa_GPS_915) || defined(ESP32_DIY_1W_LoRa_GPS) || defined(ESP32_DIY_1W_LoRa_GPS_915) || defined(HELTEC_V3_GPS) || defined(HELTEC_WIRELESS_TRACKER) || defined(OE5HWN_MeshCom) || defined(TTGO_T_DECK_GPS) || defined(WEMOS_ESP32_Bat_LoRa_GPS)
|
||||
batteryVoltage = String(getBatteryVoltage(), 2);
|
||||
#endif
|
||||
#ifdef HAS_AXP2101
|
||||
|
|
@ -196,7 +196,7 @@ namespace POWER_Utils {
|
|||
PMU.setLDO3Voltage(3300);
|
||||
PMU.enableLDO3();
|
||||
#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_915) || defined(TTGO_T_Beam_V1_2_SX1262)
|
||||
PMU.setALDO3Voltage(3300);
|
||||
PMU.enableALDO3();
|
||||
#endif
|
||||
|
|
@ -210,7 +210,7 @@ namespace POWER_Utils {
|
|||
#ifdef HAS_AXP192
|
||||
PMU.disableLDO3();
|
||||
#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_915) || defined(TTGO_T_Beam_V1_2_SX1262)
|
||||
PMU.disableALDO3();
|
||||
#endif
|
||||
#if defined(TTGO_T_Beam_S3_SUPREME_V3)
|
||||
|
|
@ -223,7 +223,7 @@ namespace POWER_Utils {
|
|||
PMU.setLDO2Voltage(3300);
|
||||
PMU.enableLDO2();
|
||||
#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_915) || defined(TTGO_T_Beam_V1_2_SX1262)
|
||||
PMU.setALDO2Voltage(3300);
|
||||
PMU.enableALDO2();
|
||||
#endif
|
||||
|
|
@ -237,7 +237,7 @@ namespace POWER_Utils {
|
|||
#ifdef HAS_AXP192
|
||||
PMU.disableLDO2();
|
||||
#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_915) || defined(TTGO_T_Beam_V1_2_SX1262)
|
||||
PMU.disableALDO2();
|
||||
#endif
|
||||
#if defined(TTGO_T_Beam_S3_SUPREME_V3)
|
||||
|
|
@ -286,7 +286,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) || defined(HELTEC_WIRELESS_TRACKER) || defined(TTGO_T_DECK_GPS) || defined(WEMOS_ESP32_Bat_LoRa_GPS)
|
||||
#if defined(TTGO_T_Beam_V0_7) || defined(TTGO_T_LORA32_V2_1_GPS) || defined(TTGO_T_LORA32_V2_1_GPS_915) || defined(TTGO_T_LORA32_V2_1_TNC) || defined(TTGO_T_LORA32_V2_1_TNC_915) || defined(ESP32_DIY_LoRa_GPS) || defined(ESP32_DIY_LoRa_GPS_915) || defined(ESP32_DIY_1W_LoRa_GPS) || defined(ESP32_DIY_1W_LoRa_GPS_915) || defined(HELTEC_V3_GPS) || defined(OE5HWN_MeshCom) || defined(ESP32_C3_DIY_LoRa_GPS) || defined(ESP32_C3_DIY_LoRa_GPS_915) || defined(HELTEC_WIRELESS_TRACKER) || defined(TTGO_T_DECK_GPS) || defined(WEMOS_ESP32_Bat_LoRa_GPS)
|
||||
return true; // no powerManagment chip for this boards (only a few measure battery voltage).
|
||||
#endif
|
||||
#ifdef HAS_AXP192
|
||||
|
|
@ -303,7 +303,7 @@ namespace POWER_Utils {
|
|||
return result;
|
||||
#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_915) || defined(TTGO_T_Beam_V1_2_SX1262)
|
||||
bool result = PMU.begin(Wire, AXP2101_SLAVE_ADDRESS, I2C_SDA, I2C_SCL);
|
||||
if (result) {
|
||||
PMU.disableDC2();
|
||||
|
|
@ -368,7 +368,7 @@ namespace POWER_Utils {
|
|||
PMU.setSysPowerDownVoltage(2600);
|
||||
#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_915) || defined(TTGO_T_Beam_V1_2_SX1262)
|
||||
Wire.begin(SDA, SCL);
|
||||
if (begin(Wire)) {
|
||||
logger.log(logging::LoggerLevel::LOGGER_LEVEL_INFO, "AXP2101", "init done!");
|
||||
|
|
@ -449,7 +449,7 @@ namespace POWER_Utils {
|
|||
|
||||
void lowerCpuFrequency() {
|
||||
// later for all boards!
|
||||
#if defined(HAS_AXP192) || defined(HAS_AXP2101) || 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) || defined(TTGO_T_DECK_GPS)
|
||||
#if defined(HAS_AXP192) || defined(HAS_AXP2101) || defined(TTGO_T_LORA32_V2_1_GPS) || defined(TTGO_T_LORA32_V2_1_GPS_915) || defined(TTGO_T_LORA32_V2_1_TNC) || defined(TTGO_T_LORA32_V2_1_TNC_915) || defined(ESP32_DIY_LoRa_GPS) || defined(ESP32_DIY_LoRa_GPS_915) || defined(ESP32_DIY_1W_LoRa_GPS) || defined(ESP32_DIY_1W_LoRa_GPS_915) || defined(HELTEC_V3_GPS) || defined(OE5HWN_MeshCom) || defined(ESP32_C3_DIY_LoRa_GPS) || defined(ESP32_C3_DIY_LoRa_GPS_915) || defined(HELTEC_WIRELESS_TRACKER) || defined(TTGO_T_DECK_GPS)
|
||||
if (setCpuFrequencyMhz(80)) {
|
||||
logger.log(logging::LoggerLevel::LOGGER_LEVEL_DEBUG, "Main", "CPU frequency set to 80MHz");
|
||||
} else {
|
||||
|
|
|
|||
|
|
@ -431,14 +431,14 @@ namespace STATION_Utils {
|
|||
if (Config.sendBatteryInfo) {
|
||||
String batteryVoltage = POWER_Utils::getBatteryInfoVoltage();
|
||||
String batteryChargeCurrent = POWER_Utils::getBatteryInfoCurrent();
|
||||
#if defined(TTGO_T_Beam_V1_0) || defined(TTGO_T_Beam_V1_0_SX1268)
|
||||
#ifdef HAS_AXP192
|
||||
comment += " Bat=";
|
||||
comment += batteryVoltage;
|
||||
comment += "V (";
|
||||
comment += batteryChargeCurrent;
|
||||
comment += "mA)";
|
||||
#endif
|
||||
#if defined(TTGO_T_Beam_V1_2) || defined(TTGO_T_Beam_V1_2_SX1262) || defined(TTGO_T_Beam_S3_SUPREME_V3)
|
||||
#ifdef HAS_AXP2101
|
||||
comment += " Bat=";
|
||||
comment += String(batteryVoltage.toFloat()/1000,2);
|
||||
comment += "V (";
|
||||
|
|
|
|||
Loading…
Reference in New Issue