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"]
path = protobufs
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 "PowerFSM.h"
#include "RadioLibInterface.h"
#include "buzz.h"
#include "graphics/Screen.h"
#include "main.h"
#include "modules/ExternalNotificationModule.h"

View File

@ -895,7 +895,7 @@ Screen::Screen(ScanI2C::DeviceAddress address, meshtastic_Config_DisplayConfig_O
#elif defined(USE_SSD1306)
dispdev = new SSD1306Wire(address.address, -1, -1, geometry,
(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,
(address.port == ScanI2C::I2CPort::WIRE1) ? HW_I2C::I2C_TWO : HW_I2C::I2C_ONE);
#elif defined(USE_EINK) && !defined(USE_EINK_DYNAMICDISPLAY)

View File

@ -94,6 +94,11 @@ AudioThread *audioThread;
#include "sharedMem/PacketClient.h"
#endif
#ifdef LGFX_TDECK
#include "DeviceScreen.h"
DeviceScreen *screen = nullptr;
#endif
using namespace concurrency;
// We always create a screen object, but we only init it if we find the hardware
@ -352,13 +357,17 @@ void setup()
#endif
#endif
#ifdef T_DECK
#if defined(T_DECK)
// enable keyboard
pinMode(KB_POWERON, OUTPUT);
digitalWrite(KB_POWERON, HIGH);
// There needs to be a delay after power on, give LILYGO-KEYBOARD some startup time
// otherwise keyboard and touch screen will not work
delay(800);
delay(200);
#ifdef LGFX_TDECK
screen = &DeviceScreen::create();
screen->init();
#endif
#endif
// 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
powerFSMthread = new PowerFSMThread();
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)

View File

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

View File

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

View File

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

View File

@ -2,17 +2,29 @@
[env:t-deck]
extends = esp32s3_base
board = t-deck
upload_protocol = esptool
#upload_port = COM29
build_src_filter = ${esp32_base.build_src_filter} +<mesh/sharedMem/>
upload_protocol = esp-builtin
build_flags = ${esp32_base.build_flags}
-D T_DECK
-DBOARD_HAS_PSRAM
-D HAS_SCREEN=0
-D HAS_TFT=1
-D GPS_POWER_TOGGLE
-D LV_LVGL_H_INCLUDE_SIMPLE
-D LV_CONF_INCLUDE_SIMPLE
-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
lib_deps = ${esp32s3_base.lib_deps}
lovyan03/LovyanGFX@^1.1.9
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/ESP8266SAM@^1.0.1