From 14f9b3ce2dd46531baaab338a4f6ae7091c6fcd4 Mon Sep 17 00:00:00 2001 From: Alain Sanguinetti Date: Wed, 28 Aug 2024 10:16:02 +0200 Subject: [PATCH] fix: make targets build, except e-ink because of fSPI --- include/ui.h | 11 ++++------- platformio.ini | 3 +++ src/main.cpp | 1 + src/ui.cpp | 17 ++++------------- src_eink/main.cpp | 4 +++- src_sa/main.cpp | 7 ++++--- src_trans/main.cpp | 2 ++ 7 files changed, 21 insertions(+), 24 deletions(-) diff --git a/include/ui.h b/include/ui.h index 2ca7525..913a4b8 100644 --- a/include/ui.h +++ b/include/ui.h @@ -1,11 +1,10 @@ #pragma once -#ifdef Vision_Master_E290 -#include "HT_DEPG0290BxS800FxX_BW.h" -#else +#include + +#ifndef Vision_Master_E290 #include "OLEDDisplayUi.h" #include "SSD1306Wire.h" -#include #endif // #include @@ -32,9 +31,7 @@ #define SCREEN_HEIGHT 64 // ???? not used // publish functions -#ifdef Vision_Master_E290 -extern void UI_Init(DEPG0290BxS800FxX_BW *); -#else +#ifndef Vision_Master_E290 extern void UI_Init(SSD1306Wire *); #endif extern void UI_displayDecorate(int, int, bool); diff --git a/platformio.ini b/platformio.ini index 232ec2b..f7460d7 100644 --- a/platformio.ini +++ b/platformio.ini @@ -23,6 +23,7 @@ monitor_speed = 115200 board_build.f_cpu = 240000000 lib_deps = ropg/Heltec_ESP32_LoRa_v3@^0.9.1 + ropg/HotButton@^0.1.1 build_flags = -DAPP_HELTEC_V3_SA -DHELTEC_POWER_BUTTON @@ -36,6 +37,7 @@ monitor_speed = 115200 board_build.f_cpu = 240000000 lib_deps = ropg/Heltec_ESP32_LoRa_v3@^0.9.1 + ropg/HotButton@^0.1.1 build_flags = -DAPP_HELTEC_V3_TRANS -DHELTEC_POWER_BUTTON @@ -72,3 +74,4 @@ lib_deps = https://github.com/HelTecAutomation/Heltec_ESP32/ adafruit/Adafruit GFX Library@^1.11.10 ropg/Heltec_ESP32_LoRa_v3@^0.9.1 + ropg/HotButton@^0.1.1 diff --git a/src/main.cpp b/src/main.cpp index 9c8522e..d49cf5e 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -1,3 +1,4 @@ + // Main Spectrum Analyzer for Heltec V3 Boards #ifdef APP_HELTEC_V3_SA #include "../src_sa/main.cpp" diff --git a/src/ui.cpp b/src/ui.cpp index 48a7bf1..fd7fbed 100644 --- a/src/ui.cpp +++ b/src/ui.cpp @@ -3,6 +3,10 @@ #include "global_config.h" #include "images.h" +#ifdef Vision_Master_E290 +#include "HT_DEPG0290BxS800FxX_BW.h" +#endif + // ------------------------------------------------- // LOCAL DEFINES // Height of the plotter area @@ -53,19 +57,6 @@ void UI_Init(SSD1306Wire *display_ptr) } #endif -#ifdef Vision_Master_E290 -void UI_Init(DEPG0290BxS800FxX_BW *display_ptr) -{ - // init pointer to display instance. - display_instance = display_ptr; - // check for null ??? - display_instance->clear(); - // draw the UCOG welcome logo - display_instance->drawXbm(0, 2, 128, 64, epd_bitmap_ucog); - display_instance->display(); -} -#endif - void UI_setLedFlag(bool new_status) { led_flag = new_status; } void clearStatus(void) diff --git a/src_eink/main.cpp b/src_eink/main.cpp index 03c515f..988a840 100644 --- a/src_eink/main.cpp +++ b/src_eink/main.cpp @@ -7,6 +7,9 @@ * * All code e link examples you cand find here: * */ + +#include + // Variables required to boot Heltec E290 defined at platformio.ini // #define HELTEC_BOARD 37 // #define SLOW_CLK_TPYE 1 @@ -16,7 +19,6 @@ #include "global_config.h" #include "images.h" #include "ui.h" -#include // Disabling default Heltec lib OLED display #define HELTEC_NO_DISPLAY diff --git a/src_sa/main.cpp b/src_sa/main.cpp index 59cde10..6f0ee65 100644 --- a/src_sa/main.cpp +++ b/src_sa/main.cpp @@ -27,6 +27,10 @@ #include // This file contains a binary patch for the SX1262 #include "modules/SX126x/patches/SX126x_patch_scan.h" + +#include "global_config.h" +#include "ui.h" + // #define OSD_ENABLED true // #define WIFI_SCANNING_ENABLED true // #define BT_SCANNING_ENABLED true @@ -140,9 +144,6 @@ static const int buf0[36] = {0x02, 0x80, 0x02, 0x40, 0x7F, 0xE0, 0x42, 0x00, #include #endif -#include "global_config.h" -#include "ui.h" - // ----------------------------------------------------------------- // CONFIGURATION OPTIONS // ----------------------------------------------------------------- diff --git a/src_trans/main.cpp b/src_trans/main.cpp index 2010f48..272cb8e 100644 --- a/src_trans/main.cpp +++ b/src_trans/main.cpp @@ -8,6 +8,8 @@ * This works on the stick, but the output on the screen gets cut off. */ +#include // must be first + // Turns the 'PRG' button into the power button, long press is off #define HELTEC_POWER_BUTTON // must be before "#include " #include