start device-ui integration

This commit is contained in:
mverch67 2024-02-26 12:23:51 +01:00 committed by Manuel
parent 942b7d21a2
commit fbdfa92d4b
9 changed files with 48 additions and 19 deletions

3
.gitmodules vendored
View File

@ -1,3 +1,6 @@
[submodule "protobufs"] [submodule "protobufs"]
path = protobufs path = protobufs
url = https://github.com/meshtastic/protobufs.git url = https://github.com/meshtastic/protobufs.git
[submodule "lib/device-ui"]
path = lib/device-ui
url = https://github.com/mverch67/device-ui.git

1
lib/device-ui Submodule

@ -0,0 +1 @@
Subproject commit de3a8b6e2503cdc199b6dde9a90c34ffbda72cb6

View File

@ -3,7 +3,6 @@
#include "MeshService.h" #include "MeshService.h"
#include "PowerFSM.h" #include "PowerFSM.h"
#include "RadioLibInterface.h" #include "RadioLibInterface.h"
#include "buzz.h"
#include "graphics/Screen.h" #include "graphics/Screen.h"
#include "main.h" #include "main.h"
#include "modules/ExternalNotificationModule.h" #include "modules/ExternalNotificationModule.h"

View File

@ -895,7 +895,7 @@ Screen::Screen(ScanI2C::DeviceAddress address, meshtastic_Config_DisplayConfig_O
#elif defined(USE_SSD1306) #elif defined(USE_SSD1306)
dispdev = new SSD1306Wire(address.address, -1, -1, geometry, dispdev = new SSD1306Wire(address.address, -1, -1, geometry,
(address.port == ScanI2C::I2CPort::WIRE1) ? HW_I2C::I2C_TWO : HW_I2C::I2C_ONE); (address.port == ScanI2C::I2CPort::WIRE1) ? HW_I2C::I2C_TWO : HW_I2C::I2C_ONE);
#elif defined(ST7735_CS) || defined(ILI9341_DRIVER) || defined(ST7789_CS) || defined(RAK14014) #elif (defined(ST7735_CS) || defined(ILI9341_DRIVER) || defined(ST7789_CS) || defined(RAK14014)) && !HAS_TFT
dispdev = new TFTDisplay(address.address, -1, -1, geometry, dispdev = new TFTDisplay(address.address, -1, -1, geometry,
(address.port == ScanI2C::I2CPort::WIRE1) ? HW_I2C::I2C_TWO : HW_I2C::I2C_ONE); (address.port == ScanI2C::I2CPort::WIRE1) ? HW_I2C::I2C_TWO : HW_I2C::I2C_ONE);
#elif defined(USE_EINK) && !defined(USE_EINK_DYNAMICDISPLAY) #elif defined(USE_EINK) && !defined(USE_EINK_DYNAMICDISPLAY)

View File

@ -94,6 +94,11 @@ AudioThread *audioThread;
#include "sharedMem/PacketClient.h" #include "sharedMem/PacketClient.h"
#endif #endif
#ifdef LGFX_TDECK
#include "DeviceScreen.h"
DeviceScreen *screen = nullptr;
#endif
using namespace concurrency; using namespace concurrency;
// We always create a screen object, but we only init it if we find the hardware // We always create a screen object, but we only init it if we find the hardware
@ -352,13 +357,17 @@ void setup()
#endif #endif
#endif #endif
#ifdef T_DECK #if defined(T_DECK)
// enable keyboard // enable keyboard
pinMode(KB_POWERON, OUTPUT); pinMode(KB_POWERON, OUTPUT);
digitalWrite(KB_POWERON, HIGH); digitalWrite(KB_POWERON, HIGH);
// There needs to be a delay after power on, give LILYGO-KEYBOARD some startup time // There needs to be a delay after power on, give LILYGO-KEYBOARD some startup time
// otherwise keyboard and touch screen will not work // otherwise keyboard and touch screen will not work
delay(800); delay(200);
#ifdef LGFX_TDECK
screen = &DeviceScreen::create();
screen->init();
#endif
#endif #endif
// Currently only the tbeam has a PMU // Currently only the tbeam has a PMU
@ -888,6 +897,11 @@ void setup()
PowerFSM_setup(); // we will transition to ON in a couple of seconds, FIXME, only do this for cold boots, not waking from SDS PowerFSM_setup(); // we will transition to ON in a couple of seconds, FIXME, only do this for cold boots, not waking from SDS
powerFSMthread = new PowerFSMThread(); powerFSMthread = new PowerFSMThread();
setCPUFast(false); // 80MHz is fine for our slow peripherals setCPUFast(false); // 80MHz is fine for our slow peripherals
#ifdef ARDUINO_ARCH_ESP32
LOG_DEBUG("--- Free heap : %8d bytes ---\n", ESP.getFreeHeap());
LOG_DEBUG("--- PSRAM : %8d bytes ---\n", ESP.getFreePsram());
#endif
} }
uint32_t rebootAtMsec; // If not zero we will reboot at this time (used to reboot shortly after the update completes) uint32_t rebootAtMsec; // If not zero we will reboot at this time (used to reboot shortly after the update completes)

View File

@ -1,5 +1,5 @@
#include "sharedMem/PacketClient.h" #include "sharedMem/PacketClient.h"
#include "DebugConfiguration.h" #include "configuration.h"
#include "sharedMem/SharedQueue.h" #include "sharedMem/SharedQueue.h"
#include <assert.h> #include <assert.h>

View File

@ -1,5 +1,5 @@
#pragma once #pragma once
#if HAS_SCREEN #if HAS_SCREEN || HAS_TFT
#include "ProtobufModule.h" #include "ProtobufModule.h"
#include "input/InputBroker.h" #include "input/InputBroker.h"

View File

@ -94,7 +94,7 @@ void setupModules()
trackballInterruptImpl1 = new TrackballInterruptImpl1(); trackballInterruptImpl1 = new TrackballInterruptImpl1();
trackballInterruptImpl1->init(); trackballInterruptImpl1->init();
#endif #endif
#if HAS_SCREEN #if HAS_SCREEN || HAS_TFT
cannedMessageModule = new CannedMessageModule(); cannedMessageModule = new CannedMessageModule();
#endif #endif
#if HAS_TELEMETRY #if HAS_TELEMETRY

View File

@ -2,17 +2,29 @@
[env:t-deck] [env:t-deck]
extends = esp32s3_base extends = esp32s3_base
board = t-deck board = t-deck
upload_protocol = esptool upload_protocol = esp-builtin
#upload_port = COM29
build_src_filter = ${esp32_base.build_src_filter} +<mesh/sharedMem/>
build_flags = ${esp32_base.build_flags} build_flags = ${esp32_base.build_flags}
-DT_DECK -D T_DECK
-DBOARD_HAS_PSRAM -D HAS_SCREEN=0
-DGPS_POWER_TOGGLE -D HAS_TFT=1
-Ivariants/t-deck -D GPS_POWER_TOGGLE
-D LV_LVGL_H_INCLUDE_SIMPLE
lib_deps = ${esp32s3_base.lib_deps} -D LV_CONF_INCLUDE_SIMPLE
lovyan03/LovyanGFX@^1.1.9 -D LV_COMP_CONF_INCLUDE_SIMPLE
-D CALIBRATE_TOUCH
-D KB_POWERON=10
-D LGFX_DRIVER=LGFX_TDECK
-D LGFX_DRIVER_INC=\"LGFX_T_DECK.h\"
-D VIEW_320x240
-D VIEW_CLASS=TFTView_320x240
-D VIEW_CLASS_INC=\"TFTView_320x240.h\"
-D USE_DOUBLE_BUFFER
-I lib/device-ui/generated/ui_320x240
-I variants/t-deck
build_src_filter = ${esp32_base.build_src_filter} +<mesh/sharedMem/>
+<../lib/device-ui/generated/ui_320x240>
libdeps =
${esp32_base.lib_deps}
lovyan03/LovyanGFX@^1.1.12
earlephilhower/ESP8266Audio@^1.9.7 earlephilhower/ESP8266Audio@^1.9.7
earlephilhower/ESP8266SAM@^1.0.1 earlephilhower/ESP8266SAM@^1.0.1