From 07822894173bb5e78c4dd149345f7e578b7ff8bf Mon Sep 17 00:00:00 2001 From: richonguzman Date: Thu, 14 Nov 2024 18:08:11 -0300 Subject: [PATCH] validating all boards --- platformio.ini | 1 + src/LoRa_APRS_Tracker.cpp | 4 ++-- src/audio_utils.cpp | 3 +-- src/display.cpp | 26 +++++++++++++++----------- 4 files changed, 19 insertions(+), 15 deletions(-) diff --git a/platformio.ini b/platformio.ini index 7c555e9..01778f6 100644 --- a/platformio.ini +++ b/platformio.ini @@ -349,6 +349,7 @@ build_flags = lib_deps = ${common.lib_deps} bodmer/TFT_eSPI @ 2.5.43 + esphome/ESP32-audioI2S @ 2.0.7 [env:ttgo_t_deck_plus] extends = env diff --git a/src/LoRa_APRS_Tracker.cpp b/src/LoRa_APRS_Tracker.cpp index 0612805..7faa9f7 100644 --- a/src/LoRa_APRS_Tracker.cpp +++ b/src/LoRa_APRS_Tracker.cpp @@ -153,14 +153,14 @@ void setup() { #ifdef HAS_I2S AUDIO_Utils::setup(); + delay(500); + AUDIO_Utils::playMP3("bell.mp3"); #endif POWER_Utils::lowerCpuFrequency(); logger.log(logging::LoggerLevel::LOGGER_LEVEL_DEBUG, "Main", "Smart Beacon is: %s", Utils::getSmartBeaconState()); logger.log(logging::LoggerLevel::LOGGER_LEVEL_INFO, "Main", "Setup Done!"); menuDisplay = 0; - - AUDIO_Utils::playMP3("bell.mp3"); } void loop() { diff --git a/src/audio_utils.cpp b/src/audio_utils.cpp index 7e1250f..5592400 100644 --- a/src/audio_utils.cpp +++ b/src/audio_utils.cpp @@ -1,13 +1,12 @@ #include "boards_pinout.h" #include "audio_utils.h" +#ifdef HAS_I2S #include "Audio.h" #include #include "es7210.h" #include -#ifdef HAS_I2S - Audio audio; namespace AUDIO_Utils { diff --git a/src/display.cpp b/src/display.cpp index 27e5f70..51a55b6 100644 --- a/src/display.cpp +++ b/src/display.cpp @@ -14,6 +14,8 @@ String currentSymbol, lastSymbol, lastHeader; TFT_eSPI tft = TFT_eSPI(); TFT_eSprite sprite = TFT_eSprite(&tft); + #define red 0xB061 + #ifdef HELTEC_WIRELESS_TRACKER #define bigSizeFont 2 #define smallSizeFont 1 @@ -27,7 +29,7 @@ String currentSymbol, lastSymbol, lastHeader; #define color1 TFT_BLACK #define color2 0x0249 - #define red 0xB061 + #define green 0x1B08 #define bigSizeFont 4 @@ -81,6 +83,7 @@ bool symbolAvailable = true; extern logging::Logger logger; +#ifdef HAS_TFT void drawTop(const String& header, const String& datetime, const String& location) { sprite.fillSprite(TFT_BLACK); sprite.fillRect(0, 0, 320, 38, red); @@ -104,17 +107,18 @@ void drawTop(const String& header, const String& datetime, const String& locatio sprite.drawString(location, 8, 44); } - void drawBody(const String& linea1, const String& linea2, const String& linea3, const String& linea4, const String& linea5, const String& linea6) { - sprite.setTextSize(2); - sprite.setTextColor(TFT_WHITE, TFT_BLACK); +void drawBody(const String& linea1, const String& linea2, const String& linea3, const String& linea4, const String& linea5, const String& linea6) { + sprite.setTextSize(2); + sprite.setTextColor(TFT_WHITE, TFT_BLACK); - sprite.drawString(linea1, 3, 70); - sprite.drawString(linea2, 3, 90); - sprite.drawString(linea3, 3, 110); - sprite.drawString(linea4, 3, 130); - sprite.drawString(linea5, 3, 150); - sprite.drawString(linea6, 3, 170); - } + sprite.drawString(linea1, 3, 70); + sprite.drawString(linea2, 3, 90); + sprite.drawString(linea3, 3, 110); + sprite.drawString(linea4, 3, 130); + sprite.drawString(linea5, 3, 150); + sprite.drawString(linea6, 3, 170); +} +#endif /*String lat = location.substring(0, location.indexOf(" ")); sprite.drawString(lat, 3, 46);