print board name on startup

pull/344/head
Peter Buchegger 2023-10-22 12:39:20 +02:00
rodzic 4dca83c2cc
commit a6e8085f31
7 zmienionych plików z 52 dodań i 13 usunięć

Wyświetl plik

@ -16,7 +16,7 @@
;default_envs = heltec-v2_1
;default_envs = tlora-v1
;default_envs = tlora_v1_3
default_envs = tlora-v2
;default_envs = tlora-v2
;default_envs = tlora-v2-1-1_6
extra_configs =

26
src/Board.cpp 100644
Wyświetl plik

@ -0,0 +1,26 @@
#include "Board.h"
String getBoardName() {
#if defined(HELTEC_V1)
return "Heltec V1";
#elif defined(HELTEC_V2_0)
return "Heltec V2";
#elif defined(HELTEC_V3)
return "Heltec V3";
#elif defined(T_INTERNET_POE)
return "T-Internet PoE";
#elif defined(TBEAM_V10)
return "T-Beam V1.0 and V1.1";
#elif defined(TBEAM_V12_AXP2101)
return "T-Beam V1.2 AXP2101";
#elif defined(TBEAM_S3_CORE)
return "T-Beam S3 Core";
#elif defined(TLORA_V1)
return "T-LoRa32 V1";
#elif defined(TLORA_V2)
return "T-LoRa32 V2";
#else
#error "Board not defined!"
#endif
return "";
}

8
src/Board.h 100644
Wyświetl plik

@ -0,0 +1,8 @@
#ifndef BOARD_H_
#define BOARD_H_
#include <Arduino.h>
String getBoardName();
#endif

Wyświetl plik

@ -95,12 +95,14 @@ void Display::setStatusFrame(std::shared_ptr<StatusFrame> frame) {
_statusFrame = frame;
}
void Display::showSpashScreen(String firmwareTitle, String version) {
void Display::showSpashScreen(String firmwareTitle, String version, String boardname) {
Bitmap bitmap(_disp);
bitmap.drawString(0, 10, firmwareTitle);
bitmap.drawString(0, 20, version);
bitmap.drawString(0, 35, "by Peter Buchegger");
bitmap.drawString(30, 45, "OE5BPA");
bitmap.drawString(0, 55, "for board");
bitmap.drawString(0, 65, boardname);
_disp->display(&bitmap);
}

Wyświetl plik

@ -28,7 +28,7 @@ public:
void setup();
// setup functions
void showSpashScreen(String firmwareTitle, String version);
void showSpashScreen(String firmwareTitle, String version, String boardname);
void setStatusFrame(std::shared_ptr<StatusFrame> frame);
void showStatusScreen(String header, String text);

Wyświetl plik

@ -1,12 +1,14 @@
#ifndef UNIT_TEST
#include <map>
#include <esp_task_wdt.h>
#include <logger.h>
#include "APRS-IS/APRS-IS.h"
#include "Board.h"
#include "PowerManagement/power_management.h"
#include "System/System.h"
#include "System/TaskManager.h"
#include <esp_task_wdt.h>
#include <logger.h>
#include "TaskAprsIs.h"
#include "TaskBeacon.h"
@ -61,21 +63,22 @@ void setup() {
Serial.begin(115200);
LoRaSystem.getLogger().setSerial(&Serial);
setWiFiLogger(&LoRaSystem.getLogger());
delay(500);
delay(1000);
LoRaSystem.getLogger().log(logging::LoggerLevel::LOGGER_LEVEL_INFO, MODULE_NAME, "LoRa APRS iGate by OE5BPA (Peter Buchegger)");
LoRaSystem.getLogger().log(logging::LoggerLevel::LOGGER_LEVEL_INFO, MODULE_NAME, "Version: %s", VERSION);
LoRaSystem.getLogger().log(logging::LoggerLevel::LOGGER_LEVEL_INFO, MODULE_NAME, "Board: %s", getBoardName().c_str());
ProjectConfigurationManagement confmg(LoRaSystem.getLogger());
confmg.readConfiguration(LoRaSystem.getLogger(), userConfig);
/*LoRaSystem.getLogger().log(logging::LoggerLevel::LOGGER_LEVEL_INFO, MODULE_NAME, "Will start watchdog now...");
LoRaSystem.getLogger().log(logging::LoggerLevel::LOGGER_LEVEL_INFO, MODULE_NAME, "Will start watchdog now...");
if (esp_task_wdt_init(10, true) != ESP_OK) {
LoRaSystem.getLogger().log(logging::LoggerLevel::LOGGER_LEVEL_WARN, MODULE_NAME, "Watchdog init failed!");
} else {
if (esp_task_wdt_add(NULL) != ESP_OK) {
LoRaSystem.getLogger().log(logging::LoggerLevel::LOGGER_LEVEL_WARN, MODULE_NAME, "Watchdog add failed!");
}
}*/
}
#if defined(HAS_AXP192) || defined(HAS_AXP2101)
Wire.begin(SDA, SCL);
@ -128,16 +131,16 @@ void setup() {
}
}
// esp_task_wdt_reset();
esp_task_wdt_reset();
LoRaSystem.getTaskManager().setup(LoRaSystem);
LoRaSystem.getDisplay().showSpashScreen("LoRa APRS iGate", VERSION);
LoRaSystem.getDisplay().showSpashScreen("LoRa APRS iGate", VERSION, getBoardName());
if (userConfig.callsign == "NOCALL-10") {
LoRaSystem.getLogger().log(logging::LoggerLevel::LOGGER_LEVEL_ERROR, MODULE_NAME, "You have to change your settings in 'data/is-cfg.json' and upload it via 'Upload File System image'!");
LoRaSystem.getDisplay().showStatusScreen("ERROR", "You have to change your settings in 'data/is-cfg.json' and upload it via \"Upload File System image\"!");
while (true) {
// esp_task_wdt_reset();
esp_task_wdt_reset();
}
}
if ((!userConfig.aprs_is.active) && !(userConfig.digi.active)) {
@ -158,7 +161,7 @@ void setup() {
volatile bool syslogSet = false;
void loop() {
// esp_task_wdt_reset();
esp_task_wdt_reset();
LoRaSystem.getTaskManager().loop(LoRaSystem);
if (LoRaSystem.isWifiOrEthConnected() && LoRaSystem.getUserConfig()->syslog.active && !syslogSet) {
LoRaSystem.getLogger().setSyslogServer(LoRaSystem.getUserConfig()->syslog.server, LoRaSystem.getUserConfig()->syslog.port, LoRaSystem.getUserConfig()->callsign);

Wyświetl plik

@ -2,7 +2,7 @@
extends = esp32s3_base
board = tbeam-s3-core
build_flags =
${esp32s3_base.build_flags} -Ivariants/tbeam-s3-core -DUSE_SX1268 -DHAS_AXP2101 -DGPS_RX_PIN=9 -DGPS_TX_PIN=8
${esp32s3_base.build_flags} -Ivariants/tbeam-s3-core -DTBEAM_S3_CORE -DUSE_SX1268 -DHAS_AXP2101 -DGPS_RX_PIN=9 -DGPS_TX_PIN=8
#-DI2C_SDA=17 -DI2C_SCL=18 -DI2C_SDA1=42 -DI2C_SCL1=41
# I2C_SDA1 and I2C_SCL1 - Used for PMU management and PCF8563