Get t-deck working with both UIs for tft build

This commit is contained in:
Jonathan Bennett 2025-05-18 19:46:48 -05:00
parent f1440a27d7
commit 61ebce5241
5 changed files with 46 additions and 37 deletions

View File

@ -953,9 +953,11 @@ void setup()
// the current region name)
#if defined(ST7701_CS) || defined(ST7735_CS) || defined(USE_EINK) || defined(ILI9341_DRIVER) || defined(ILI9342_DRIVER) || \
defined(ST7789_CS) || defined(HX8357_CS) || defined(USE_ST7789) || defined(ILI9488_CS)
if (screen)
screen->setup();
#elif defined(ARCH_PORTDUINO)
if ((screen_found.port != ScanI2C::I2CPort::NO_I2C || settingsMap[displayPanel]) && config.display.displaymode != meshtastic_Config_DisplayConfig_DisplayMode_COLOR) {
if ((screen_found.port != ScanI2C::I2CPort::NO_I2C || settingsMap[displayPanel]) &&
config.display.displaymode != meshtastic_Config_DisplayConfig_DisplayMode_COLOR) {
screen->setup();
}
#else

View File

@ -104,7 +104,9 @@ void setupModules()
{
if (config.device.role != meshtastic_Config_DeviceConfig_Role_REPEATER) {
#if (HAS_BUTTON || ARCH_PORTDUINO) && !MESHTASTIC_EXCLUDE_INPUTBROKER
if (config.display.displaymode != meshtastic_Config_DisplayConfig_DisplayMode_COLOR) {
inputBroker = new InputBroker();
}
#endif
#if !MESHTASTIC_EXCLUDE_ADMIN
adminModule = new AdminModule();
@ -152,6 +154,8 @@ void setupModules()
// Example: Put your module here
// new ReplyModule();
#if (HAS_BUTTON || ARCH_PORTDUINO) && !MESHTASTIC_EXCLUDE_INPUTBROKER
if (config.display.displaymode != meshtastic_Config_DisplayConfig_DisplayMode_COLOR) {
rotaryEncoderInterruptImpl1 = new RotaryEncoderInterruptImpl1();
if (!rotaryEncoderInterruptImpl1->init()) {
delete rotaryEncoderInterruptImpl1;
@ -164,7 +168,8 @@ void setupModules()
}
#if HAS_SCREEN
// In order to have the user button dismiss the canned message frame, this class lightly interacts with the Screen class
// In order to have the user button dismiss the canned message frame, this class lightly interacts with the Screen
// class
scanAndSelectInput = new ScanAndSelectInput();
if (!scanAndSelectInput->init()) {
delete scanAndSelectInput;
@ -182,6 +187,7 @@ void setupModules()
aSerialKeyboardImpl = new SerialKeyboardImpl();
aSerialKeyboardImpl->init();
#endif // INPUTBROKER_MATRIX_TYPE
}
#endif // HAS_BUTTON
#if ARCH_PORTDUINO
if (config.display.displaymode != meshtastic_Config_DisplayConfig_DisplayMode_COLOR) {
@ -190,14 +196,19 @@ void setupModules()
}
#endif
#if HAS_TRACKBALL && !MESHTASTIC_EXCLUDE_INPUTBROKER
if (config.display.displaymode != meshtastic_Config_DisplayConfig_DisplayMode_COLOR) {
trackballInterruptImpl1 = new TrackballInterruptImpl1();
trackballInterruptImpl1->init();
}
#endif
LOG_DEBUG("location5");
#ifdef INPUTBROKER_EXPRESSLRSFIVEWAY_TYPE
expressLRSFiveWayInput = new ExpressLRSFiveWay();
#endif
#if HAS_SCREEN && !MESHTASTIC_EXCLUDE_CANNEDMESSAGES
if (config.display.displaymode != meshtastic_Config_DisplayConfig_DisplayMode_COLOR) {
cannedMessageModule = new CannedMessageModule();
}
#endif
#if ARCH_PORTDUINO
new HostMetricsModule();

View File

@ -56,7 +56,7 @@ build_flags = ${native_base.build_flags} -Os -ffunction-sections -fdata-sections
-D USE_FRAMEBUFFER=1
-D LV_COLOR_DEPTH=32
-D HAS_TFT=1
-D HAS_SCREEN=0
-D HAS_SCREEN=1
-D LV_BUILD_TEST=0
-D LV_USE_LOG=0
-D LV_USE_EVDEV=1

View File

@ -26,7 +26,6 @@ build_flags =
${env:t-deck.build_flags}
-D CONFIG_DISABLE_HAL_LOCKS=1 ; "feels" to be a bit more stable without locks
-D MESHTASTIC_EXCLUDE_CANNEDMESSAGES=1
-D MESHTASTIC_EXCLUDE_INPUTBROKER=1
-D MESHTASTIC_EXCLUDE_WEBSERVER=1
-D MESHTASTIC_EXCLUDE_SERIAL=1
-D MESHTASTIC_EXCLUDE_SOCKETAPI=1
@ -39,7 +38,7 @@ build_flags =
-D INPUTDRIVER_ENCODER_BTN=0
-D INPUTDRIVER_BUTTON_TYPE=0
-D HAS_SDCARD
-D HAS_SCREEN=0
-D HAS_SCREEN=1
-D HAS_TFT=1
-D USE_I2S_BUZZER
-D RAM_SIZE=5120

View File

@ -1,6 +1,5 @@
#define TFT_CS 12
#ifndef HAS_TFT // for TFT-UI the definitions are in device-ui
#define BUTTON_PIN 0
// ST7789 TFT LCD
@ -24,7 +23,6 @@
#define SCREEN_ROTATE
#define SCREEN_TRANSITION_FRAMERATE 5
#define BRIGHTNESS_DEFAULT 130 // Medium Low Brightness
#endif
#define HAS_TOUCHSCREEN 1
#define SCREEN_TOUCH_INT 16
@ -34,10 +32,9 @@
#define USE_POWERSAVE
#define SLEEP_TIME 120
#ifndef HAS_TFT
#define BUTTON_PIN 0
// #define BUTTON_NEED_PULLUP
#endif
#define GPS_DEFAULT_NOT_PRESENT 1
#define GPS_RX_PIN 44
#define GPS_TX_PIN 43