new startupScreen
This commit is contained in:
parent
e0373dbc15
commit
3e73e89d08
|
|
@ -149,40 +149,13 @@ void setup() {
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
POWER_Utils::setup();
|
POWER_Utils::setup();
|
||||||
|
|
||||||
setup_display();
|
setup_display();
|
||||||
|
POWER_Utils::externalPinSetup();
|
||||||
|
|
||||||
if (Config.notification.buzzerActive) {
|
|
||||||
pinMode(Config.notification.buzzerPinTone, OUTPUT);
|
|
||||||
pinMode(Config.notification.buzzerPinVcc, OUTPUT);
|
|
||||||
if (Config.notification.bootUpBeep) NOTIFICATION_Utils::start();
|
|
||||||
}
|
|
||||||
if (Config.notification.ledTx) pinMode(Config.notification.ledTxPin, OUTPUT);
|
|
||||||
if (Config.notification.ledMessage) pinMode(Config.notification.ledMessagePin, OUTPUT);
|
|
||||||
if (Config.notification.ledFlashlight) pinMode(Config.notification.ledFlashlightPin, OUTPUT);
|
|
||||||
|
|
||||||
STATION_Utils::loadIndex(0);
|
STATION_Utils::loadIndex(0);
|
||||||
STATION_Utils::loadIndex(1);
|
STATION_Utils::loadIndex(1);
|
||||||
String workingFreq = " LoRa Freq [";
|
startupScreen(loraIndex, versionDate);
|
||||||
if (loraIndex == 0) {
|
|
||||||
workingFreq += "Eu]";
|
|
||||||
} else if (loraIndex == 1) {
|
|
||||||
workingFreq += "PL]";
|
|
||||||
} else if (loraIndex == 2) {
|
|
||||||
workingFreq += "UK]";
|
|
||||||
}
|
|
||||||
|
|
||||||
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);
|
|
||||||
|
|
||||||
if (Config.ptt.active) {
|
|
||||||
pinMode(Config.ptt.io_pin, OUTPUT);
|
|
||||||
digitalWrite(Config.ptt.io_pin, Config.ptt.reverse ? HIGH : LOW);
|
|
||||||
}
|
|
||||||
MSG_Utils::loadNumMessages();
|
MSG_Utils::loadNumMessages();
|
||||||
GPS_Utils::setup();
|
GPS_Utils::setup();
|
||||||
currentLoRaType = &Config.loraTypes[loraIndex];
|
currentLoRaType = &Config.loraTypes[loraIndex];
|
||||||
|
|
|
||||||
|
|
@ -434,4 +434,21 @@ void show_display(String header, String line1, String line2, String line3, Strin
|
||||||
display.display();
|
display.display();
|
||||||
#endif
|
#endif
|
||||||
delay(wait);
|
delay(wait);
|
||||||
|
}
|
||||||
|
|
||||||
|
void startupScreen(uint8_t index, String version) {
|
||||||
|
String workingFreq = " LoRa Freq [";
|
||||||
|
if (index == 0) {
|
||||||
|
workingFreq += "Eu]";
|
||||||
|
} else if (index == 1) {
|
||||||
|
workingFreq += "PL]";
|
||||||
|
} else if (index == 2) {
|
||||||
|
workingFreq += "UK]";
|
||||||
|
}
|
||||||
|
show_display(" LoRa APRS", " (TRACKER)", workingFreq, "", "Richonguzman / CA2RXU", " " + version, 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", version);
|
||||||
}
|
}
|
||||||
|
|
@ -12,4 +12,6 @@ void show_display(String header, String line1, String line2, String line3, int w
|
||||||
void show_display(String header, String line1, String line2, String line3, String line4, int wait = 0);
|
void show_display(String header, String line1, String line2, String line3, String line4, int wait = 0);
|
||||||
void show_display(String header, String line1, String line2, String line3, String line4, String line5, int wait = 0);
|
void show_display(String header, String line1, String line2, String line3, String line4, String line5, int wait = 0);
|
||||||
|
|
||||||
|
void startupScreen(uint8_t index, String version);
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
@ -232,6 +232,46 @@ namespace POWER_Utils {
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void externalPinSetup() {
|
||||||
|
if (Config.notification.buzzerActive && Config.notification.buzzerPinTone >= 0 && Config.notification.buzzerPinVcc >= 0) {
|
||||||
|
pinMode(Config.notification.buzzerPinTone, OUTPUT);
|
||||||
|
pinMode(Config.notification.buzzerPinVcc, OUTPUT);
|
||||||
|
if (Config.notification.bootUpBeep) NOTIFICATION_Utils::start();
|
||||||
|
} else if (Config.notification.buzzerActive && (Config.notification.buzzerPinTone < 0 || Config.notification.buzzerPinVcc < 0)) {
|
||||||
|
logger.log(logging::LoggerLevel::LOGGER_LEVEL_WARN, "PINOUT", "Buzzer Pins bad/not defined");
|
||||||
|
while (1);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (Config.notification.ledTx && Config.notification.ledTxPin >= 0) {
|
||||||
|
pinMode(Config.notification.ledTxPin, OUTPUT);
|
||||||
|
} else if (Config.notification.ledTx && Config.notification.ledTxPin < 0) {
|
||||||
|
logger.log(logging::LoggerLevel::LOGGER_LEVEL_WARN, "PINOUT", "Led Tx Pin bad/not defined");
|
||||||
|
while (1);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (Config.notification.ledMessage && Config.notification.ledMessagePin >= 0) {
|
||||||
|
pinMode(Config.notification.ledMessagePin, OUTPUT);
|
||||||
|
} else if (Config.notification.ledMessage && Config.notification.ledMessagePin < 0) {
|
||||||
|
logger.log(logging::LoggerLevel::LOGGER_LEVEL_WARN, "PINOUT", "Led Message Pin bad/not defined");
|
||||||
|
while (1);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (Config.notification.ledFlashlight && Config.notification.ledFlashlightPin >= 0) {
|
||||||
|
pinMode(Config.notification.ledFlashlightPin, OUTPUT);
|
||||||
|
} else if (Config.notification.ledFlashlight && Config.notification.ledFlashlightPin < 0) {
|
||||||
|
logger.log(logging::LoggerLevel::LOGGER_LEVEL_WARN, "PINOUT", "Led Flashlight Pin bad/not defined");
|
||||||
|
while (1);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (Config.ptt.active && Config.ptt.io_pin >= 0) {
|
||||||
|
pinMode(Config.ptt.io_pin, OUTPUT);
|
||||||
|
digitalWrite(Config.ptt.io_pin, Config.ptt.reverse ? HIGH : LOW);
|
||||||
|
} else if (Config.ptt.active && Config.ptt.io_pin < 0) {
|
||||||
|
logger.log(logging::LoggerLevel::LOGGER_LEVEL_WARN, "PINOUT", "PTT Pin bad/not defined");
|
||||||
|
while (1);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
bool begin(TwoWire &port) {
|
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)
|
#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)
|
||||||
return true; // no powerManagment chip for this boards (only a few measure battery voltage).
|
return true; // no powerManagment chip for this boards (only a few measure battery voltage).
|
||||||
|
|
@ -404,6 +444,11 @@ namespace POWER_Utils {
|
||||||
#if defined(HAS_AXP192) || defined(HAS_AXP2101)
|
#if defined(HAS_AXP192) || defined(HAS_AXP2101)
|
||||||
if (Config.notification.shutDownBeep) NOTIFICATION_Utils::shutDownBeep();
|
if (Config.notification.shutDownBeep) NOTIFICATION_Utils::shutDownBeep();
|
||||||
PMU.shutdown();
|
PMU.shutdown();
|
||||||
|
//#endif
|
||||||
|
#else
|
||||||
|
esp_sleep_enable_timer_wakeup(10 * 1000000); // 10 seconds
|
||||||
|
esp_deep_sleep_start();
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -33,6 +33,8 @@ namespace POWER_Utils {
|
||||||
void activateLoRa();
|
void activateLoRa();
|
||||||
void deactivateLoRa();
|
void deactivateLoRa();
|
||||||
|
|
||||||
|
void externalPinSetup();
|
||||||
|
|
||||||
bool begin(TwoWire &port);
|
bool begin(TwoWire &port);
|
||||||
void setup();
|
void setup();
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue