lora32 correct name on definitions
This commit is contained in:
parent
29873b4fdc
commit
11e2131e1c
|
|
@ -61,13 +61,13 @@ build_flags = -Werror -Wall -DTTGO_T_Beam_V1_2
|
||||||
board = ttgo-t-beam
|
board = ttgo-t-beam
|
||||||
build_flags = -Werror -Wall -DTTGO_T_Beam_V1_0
|
build_flags = -Werror -Wall -DTTGO_T_Beam_V1_0
|
||||||
|
|
||||||
[env:ttgo-t-lora-v2_1_TNC]
|
[env:ttgo-t-lora32-v2_1_TNC]
|
||||||
board = ttgo-lora32-v21
|
board = ttgo-lora32-v21
|
||||||
build_flags = -Werror -Wall -DTTGO_T_LORA_V2_1_TNC
|
build_flags = -Werror -Wall -DTTGO_T_LORA32_V2_1_TNC
|
||||||
|
|
||||||
[env:ttgo-t-lora-v2_1_GPS]
|
[env:ttgo-t-lora32-v2_1_GPS]
|
||||||
board = ttgo-lora32-v21
|
board = ttgo-lora32-v21
|
||||||
build_flags = -Werror -Wall -DTTGO_T_LORA_V2_1_GPS
|
build_flags = -Werror -Wall -DTTGO_T_LORA32_V2_1_GPS
|
||||||
|
|
||||||
[env:ESP32_DIY_LoRa_GPS]
|
[env:ESP32_DIY_LoRa_GPS]
|
||||||
board = esp32dev
|
board = esp32dev
|
||||||
|
|
|
||||||
|
|
@ -32,7 +32,7 @@ extern uint32_t lastTx;
|
||||||
namespace GPS_Utils {
|
namespace GPS_Utils {
|
||||||
|
|
||||||
void setup() {
|
void setup() {
|
||||||
#ifdef TTGO_T_LORA_V2_1_TNC
|
#ifdef TTGO_T_LORA32_V2_1_TNC
|
||||||
disableGPS = true;
|
disableGPS = true;
|
||||||
#else
|
#else
|
||||||
disableGPS = Config.disableGPS;
|
disableGPS = Config.disableGPS;
|
||||||
|
|
|
||||||
|
|
@ -59,7 +59,7 @@ namespace LoRa_Utils {
|
||||||
while (true);
|
while (true);
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
#if defined(TTGO_T_Beam_V0_7) || defined(TTGO_T_Beam_V1_0) || defined(TTGO_T_LORA_V2_1_TNC) || defined(TTGO_T_Beam_V1_2) || defined(ESP32_DIY_LoRa_GPS) || defined(TTGO_T_LORA_V2_1_GPS)
|
#if defined(TTGO_T_Beam_V0_7) || defined(TTGO_T_Beam_V1_0) || defined(TTGO_T_LORA32_V2_1_TNC) || defined(TTGO_T_Beam_V1_2) || defined(ESP32_DIY_LoRa_GPS) || defined(TTGO_T_LORA32_V2_1_GPS)
|
||||||
logger.log(logging::LoggerLevel::LOGGER_LEVEL_INFO, "LoRa", "Set SPI pins!");
|
logger.log(logging::LoggerLevel::LOGGER_LEVEL_INFO, "LoRa", "Set SPI pins!");
|
||||||
SPI.begin(LORA_SCK, LORA_MISO, LORA_MOSI, LORA_CS);
|
SPI.begin(LORA_SCK, LORA_MISO, LORA_MOSI, LORA_CS);
|
||||||
LoRa.setPins(LORA_CS, LORA_RST, LORA_IRQ);
|
LoRa.setPins(LORA_CS, LORA_RST, LORA_IRQ);
|
||||||
|
|
@ -112,7 +112,7 @@ namespace LoRa_Utils {
|
||||||
Serial.println(state);
|
Serial.println(state);
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
#if defined(TTGO_T_Beam_V0_7) || defined(TTGO_T_Beam_V1_0) || defined(TTGO_T_LORA_V2_1_TNC) || defined(TTGO_T_Beam_V1_2) || defined(ESP32_DIY_LoRa_GPS) || defined(TTGO_T_LORA_V2_1_GPS)
|
#if defined(TTGO_T_Beam_V0_7) || defined(TTGO_T_Beam_V1_0) || defined(TTGO_T_LORA32_V2_1_TNC) || defined(TTGO_T_Beam_V1_2) || defined(ESP32_DIY_LoRa_GPS) || defined(TTGO_T_LORA32_V2_1_GPS)
|
||||||
LoRa.beginPacket();
|
LoRa.beginPacket();
|
||||||
LoRa.write('<');
|
LoRa.write('<');
|
||||||
LoRa.write(0xFF);
|
LoRa.write(0xFF);
|
||||||
|
|
@ -132,7 +132,7 @@ namespace LoRa_Utils {
|
||||||
ReceivedLoRaPacket receivePacket() {
|
ReceivedLoRaPacket receivePacket() {
|
||||||
ReceivedLoRaPacket receivedLoraPacket;
|
ReceivedLoRaPacket receivedLoraPacket;
|
||||||
String packet = "";
|
String packet = "";
|
||||||
#if defined(TTGO_T_Beam_V0_7) || defined(TTGO_T_Beam_V1_0) || defined(TTGO_T_LORA_V2_1_TNC) || defined(TTGO_T_Beam_V1_2) || defined(ESP32_DIY_LoRa_GPS) || defined(TTGO_T_LORA_V2_1_GPS)
|
#if defined(TTGO_T_Beam_V0_7) || defined(TTGO_T_Beam_V1_0) || defined(TTGO_T_LORA32_V2_1_TNC) || defined(TTGO_T_Beam_V1_2) || defined(ESP32_DIY_LoRa_GPS) || defined(TTGO_T_LORA32_V2_1_GPS)
|
||||||
int packetSize = LoRa.parsePacket();
|
int packetSize = LoRa.parsePacket();
|
||||||
if (packetSize) {
|
if (packetSize) {
|
||||||
while (LoRa.available()) {
|
while (LoRa.available()) {
|
||||||
|
|
|
||||||
|
|
@ -313,7 +313,7 @@ namespace MENU_Utils {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef TTGO_T_LORA_V2_1_TNC
|
#ifdef TTGO_T_LORA32_V2_1_TNC
|
||||||
secondRowMainMenu = "";
|
secondRowMainMenu = "";
|
||||||
thirdRowMainMenu = " LoRa APRS TNC";
|
thirdRowMainMenu = " LoRa APRS TNC";
|
||||||
fourthRowMainMenu = "";
|
fourthRowMainMenu = "";
|
||||||
|
|
@ -388,7 +388,7 @@ namespace MENU_Utils {
|
||||||
if (POWER_Utils::getBatteryInfoIsConnected()) {
|
if (POWER_Utils::getBatteryInfoIsConnected()) {
|
||||||
String batteryVoltage = POWER_Utils::getBatteryInfoVoltage();
|
String batteryVoltage = POWER_Utils::getBatteryInfoVoltage();
|
||||||
String batteryCharge = POWER_Utils::getBatteryInfoCurrent();
|
String batteryCharge = POWER_Utils::getBatteryInfoCurrent();
|
||||||
#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)
|
#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)
|
||||||
sixthRowMainMenu = "Bat: " + batteryVoltage + "V";
|
sixthRowMainMenu = "Bat: " + batteryVoltage + "V";
|
||||||
#endif
|
#endif
|
||||||
#if defined(TTGO_T_Beam_V1_0) || defined(TTGO_T_Beam_V1_0_SX1268)
|
#if defined(TTGO_T_Beam_V1_0) || defined(TTGO_T_Beam_V1_0_SX1268)
|
||||||
|
|
|
||||||
|
|
@ -17,7 +17,7 @@
|
||||||
#define BUTTON_PIN 38 // The middle button GPIO on the T-Beam
|
#define BUTTON_PIN 38 // The middle button GPIO on the T-Beam
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if defined(ESP32_DIY_LoRa_GPS) || defined(TTGO_T_LORA_V2_1_GPS)
|
#if defined(ESP32_DIY_LoRa_GPS) || defined(TTGO_T_LORA32_V2_1_GPS)
|
||||||
#define GPS_RX 12
|
#define GPS_RX 12
|
||||||
#define GPS_TX 34
|
#define GPS_TX 34
|
||||||
#define BUTTON_PIN -1
|
#define BUTTON_PIN -1
|
||||||
|
|
@ -61,7 +61,7 @@
|
||||||
#define BUTTON_PIN 39
|
#define BUTTON_PIN 39
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef TTGO_T_LORA_V2_1_TNC
|
#ifdef TTGO_T_LORA32_V2_1_TNC
|
||||||
#define GPS_RX -1
|
#define GPS_RX -1
|
||||||
#define GPS_TX -1
|
#define GPS_TX -1
|
||||||
#define BUTTON_PIN -1
|
#define BUTTON_PIN -1
|
||||||
|
|
|
||||||
|
|
@ -39,7 +39,7 @@ namespace POWER_Utils {
|
||||||
String batteryChargeDischargeCurrent = "";
|
String batteryChargeDischargeCurrent = "";
|
||||||
|
|
||||||
double getBatteryVoltage() {
|
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)
|
#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)
|
||||||
int adc_value;
|
int adc_value;
|
||||||
double voltage;
|
double voltage;
|
||||||
adc_value = analogRead(35);
|
adc_value = analogRead(35);
|
||||||
|
|
@ -79,7 +79,7 @@ namespace POWER_Utils {
|
||||||
}
|
}
|
||||||
|
|
||||||
bool isCharging() {
|
bool isCharging() {
|
||||||
#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) || defined(HELTEC_V3_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)
|
||||||
return 0;
|
return 0;
|
||||||
#endif
|
#endif
|
||||||
#if defined(TTGO_T_Beam_V1_0) || defined(TTGO_T_Beam_V1_0_SX1268) || 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_0) || defined(TTGO_T_Beam_V1_0_SX1268) || defined(TTGO_T_Beam_V1_2) || defined(TTGO_T_Beam_V1_2_SX1262) || defined(TTGO_T_Beam_S3_SUPREME_V3)
|
||||||
|
|
@ -96,7 +96,7 @@ namespace POWER_Utils {
|
||||||
}
|
}
|
||||||
|
|
||||||
double getBatteryChargeDischargeCurrent() {
|
double getBatteryChargeDischargeCurrent() {
|
||||||
#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) || defined(HELTEC_V3_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)
|
||||||
return 0;
|
return 0;
|
||||||
#endif
|
#endif
|
||||||
#if defined(TTGO_T_Beam_V1_0) || defined(TTGO_T_Beam_V1_0_SX1268)
|
#if defined(TTGO_T_Beam_V1_0) || defined(TTGO_T_Beam_V1_0_SX1268)
|
||||||
|
|
@ -111,7 +111,7 @@ namespace POWER_Utils {
|
||||||
}
|
}
|
||||||
|
|
||||||
bool isBatteryConnected() {
|
bool isBatteryConnected() {
|
||||||
#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) || defined(HELTEC_V3_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)
|
||||||
if(getBatteryVoltage() > 1.0) {
|
if(getBatteryVoltage() > 1.0) {
|
||||||
return true;
|
return true;
|
||||||
} else {
|
} else {
|
||||||
|
|
@ -128,7 +128,7 @@ namespace POWER_Utils {
|
||||||
if (!(rate_limit_check_battery++ % 60))
|
if (!(rate_limit_check_battery++ % 60))
|
||||||
BatteryIsConnected = isBatteryConnected();
|
BatteryIsConnected = isBatteryConnected();
|
||||||
if (BatteryIsConnected) {
|
if (BatteryIsConnected) {
|
||||||
#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(TTGO_T_Beam_V1_0) || defined(TTGO_T_Beam_V1_0_SX1268) || defined(ESP32_DIY_1W_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(TTGO_T_Beam_V1_0) || defined(TTGO_T_Beam_V1_0_SX1268) || defined(ESP32_DIY_1W_LoRa_GPS)
|
||||||
batteryVoltage = String(getBatteryVoltage(), 2);
|
batteryVoltage = String(getBatteryVoltage(), 2);
|
||||||
#endif
|
#endif
|
||||||
#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)
|
||||||
|
|
@ -210,7 +210,7 @@ namespace POWER_Utils {
|
||||||
}
|
}
|
||||||
|
|
||||||
bool begin(TwoWire &port) {
|
bool begin(TwoWire &port) {
|
||||||
#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) || defined(HELTEC_V3_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)
|
||||||
return true; // nor powerManagment chip for this boards (only a few measure battery voltage).
|
return true; // nor powerManagment chip for this boards (only a few measure battery voltage).
|
||||||
#endif
|
#endif
|
||||||
#if defined(TTGO_T_Beam_V1_0) || defined(TTGO_T_Beam_V1_0_SX1268)
|
#if defined(TTGO_T_Beam_V1_0) || defined(TTGO_T_Beam_V1_0_SX1268)
|
||||||
|
|
@ -325,7 +325,7 @@ namespace POWER_Utils {
|
||||||
}
|
}
|
||||||
|
|
||||||
void lowerCpuFrequency() {
|
void lowerCpuFrequency() {
|
||||||
#if defined(TTGO_T_Beam_V1_0) || defined(TTGO_T_Beam_V1_0_SX1268) || defined(TTGO_T_Beam_V1_2) || 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) || defined(TTGO_T_Beam_V1_2_SX1262) || defined(TTGO_T_Beam_S3_SUPREME_V3)
|
#if defined(TTGO_T_Beam_V1_0) || defined(TTGO_T_Beam_V1_0_SX1268) || defined(TTGO_T_Beam_V1_2) || 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(TTGO_T_Beam_V1_2_SX1262) || defined(TTGO_T_Beam_S3_SUPREME_V3)
|
||||||
if (setCpuFrequencyMhz(80)) {
|
if (setCpuFrequencyMhz(80)) {
|
||||||
logger.log(logging::LoggerLevel::LOGGER_LEVEL_INFO, "Main", "CPU frequency set to 80MHz");
|
logger.log(logging::LoggerLevel::LOGGER_LEVEL_INFO, "Main", "CPU frequency set to 80MHz");
|
||||||
} else {
|
} else {
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue