mirror of
https://github.com/meshtastic/firmware.git
synced 2025-06-08 06:02:05 +00:00
Get t-deck working with both UIs for tft build
This commit is contained in:
parent
f1440a27d7
commit
61ebce5241
@ -953,9 +953,11 @@ void setup()
|
|||||||
// the current region name)
|
// the current region name)
|
||||||
#if defined(ST7701_CS) || defined(ST7735_CS) || defined(USE_EINK) || defined(ILI9341_DRIVER) || defined(ILI9342_DRIVER) || \
|
#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)
|
defined(ST7789_CS) || defined(HX8357_CS) || defined(USE_ST7789) || defined(ILI9488_CS)
|
||||||
|
if (screen)
|
||||||
screen->setup();
|
screen->setup();
|
||||||
#elif defined(ARCH_PORTDUINO)
|
#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();
|
screen->setup();
|
||||||
}
|
}
|
||||||
#else
|
#else
|
||||||
|
@ -104,7 +104,9 @@ void setupModules()
|
|||||||
{
|
{
|
||||||
if (config.device.role != meshtastic_Config_DeviceConfig_Role_REPEATER) {
|
if (config.device.role != meshtastic_Config_DeviceConfig_Role_REPEATER) {
|
||||||
#if (HAS_BUTTON || ARCH_PORTDUINO) && !MESHTASTIC_EXCLUDE_INPUTBROKER
|
#if (HAS_BUTTON || ARCH_PORTDUINO) && !MESHTASTIC_EXCLUDE_INPUTBROKER
|
||||||
|
if (config.display.displaymode != meshtastic_Config_DisplayConfig_DisplayMode_COLOR) {
|
||||||
inputBroker = new InputBroker();
|
inputBroker = new InputBroker();
|
||||||
|
}
|
||||||
#endif
|
#endif
|
||||||
#if !MESHTASTIC_EXCLUDE_ADMIN
|
#if !MESHTASTIC_EXCLUDE_ADMIN
|
||||||
adminModule = new AdminModule();
|
adminModule = new AdminModule();
|
||||||
@ -152,6 +154,8 @@ void setupModules()
|
|||||||
// Example: Put your module here
|
// Example: Put your module here
|
||||||
// new ReplyModule();
|
// new ReplyModule();
|
||||||
#if (HAS_BUTTON || ARCH_PORTDUINO) && !MESHTASTIC_EXCLUDE_INPUTBROKER
|
#if (HAS_BUTTON || ARCH_PORTDUINO) && !MESHTASTIC_EXCLUDE_INPUTBROKER
|
||||||
|
|
||||||
|
if (config.display.displaymode != meshtastic_Config_DisplayConfig_DisplayMode_COLOR) {
|
||||||
rotaryEncoderInterruptImpl1 = new RotaryEncoderInterruptImpl1();
|
rotaryEncoderInterruptImpl1 = new RotaryEncoderInterruptImpl1();
|
||||||
if (!rotaryEncoderInterruptImpl1->init()) {
|
if (!rotaryEncoderInterruptImpl1->init()) {
|
||||||
delete rotaryEncoderInterruptImpl1;
|
delete rotaryEncoderInterruptImpl1;
|
||||||
@ -164,7 +168,8 @@ void setupModules()
|
|||||||
}
|
}
|
||||||
|
|
||||||
#if HAS_SCREEN
|
#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();
|
scanAndSelectInput = new ScanAndSelectInput();
|
||||||
if (!scanAndSelectInput->init()) {
|
if (!scanAndSelectInput->init()) {
|
||||||
delete scanAndSelectInput;
|
delete scanAndSelectInput;
|
||||||
@ -182,6 +187,7 @@ void setupModules()
|
|||||||
aSerialKeyboardImpl = new SerialKeyboardImpl();
|
aSerialKeyboardImpl = new SerialKeyboardImpl();
|
||||||
aSerialKeyboardImpl->init();
|
aSerialKeyboardImpl->init();
|
||||||
#endif // INPUTBROKER_MATRIX_TYPE
|
#endif // INPUTBROKER_MATRIX_TYPE
|
||||||
|
}
|
||||||
#endif // HAS_BUTTON
|
#endif // HAS_BUTTON
|
||||||
#if ARCH_PORTDUINO
|
#if ARCH_PORTDUINO
|
||||||
if (config.display.displaymode != meshtastic_Config_DisplayConfig_DisplayMode_COLOR) {
|
if (config.display.displaymode != meshtastic_Config_DisplayConfig_DisplayMode_COLOR) {
|
||||||
@ -190,14 +196,19 @@ void setupModules()
|
|||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
#if HAS_TRACKBALL && !MESHTASTIC_EXCLUDE_INPUTBROKER
|
#if HAS_TRACKBALL && !MESHTASTIC_EXCLUDE_INPUTBROKER
|
||||||
|
if (config.display.displaymode != meshtastic_Config_DisplayConfig_DisplayMode_COLOR) {
|
||||||
trackballInterruptImpl1 = new TrackballInterruptImpl1();
|
trackballInterruptImpl1 = new TrackballInterruptImpl1();
|
||||||
trackballInterruptImpl1->init();
|
trackballInterruptImpl1->init();
|
||||||
|
}
|
||||||
#endif
|
#endif
|
||||||
|
LOG_DEBUG("location5");
|
||||||
#ifdef INPUTBROKER_EXPRESSLRSFIVEWAY_TYPE
|
#ifdef INPUTBROKER_EXPRESSLRSFIVEWAY_TYPE
|
||||||
expressLRSFiveWayInput = new ExpressLRSFiveWay();
|
expressLRSFiveWayInput = new ExpressLRSFiveWay();
|
||||||
#endif
|
#endif
|
||||||
#if HAS_SCREEN && !MESHTASTIC_EXCLUDE_CANNEDMESSAGES
|
#if HAS_SCREEN && !MESHTASTIC_EXCLUDE_CANNEDMESSAGES
|
||||||
|
if (config.display.displaymode != meshtastic_Config_DisplayConfig_DisplayMode_COLOR) {
|
||||||
cannedMessageModule = new CannedMessageModule();
|
cannedMessageModule = new CannedMessageModule();
|
||||||
|
}
|
||||||
#endif
|
#endif
|
||||||
#if ARCH_PORTDUINO
|
#if ARCH_PORTDUINO
|
||||||
new HostMetricsModule();
|
new HostMetricsModule();
|
||||||
|
@ -56,7 +56,7 @@ build_flags = ${native_base.build_flags} -Os -ffunction-sections -fdata-sections
|
|||||||
-D USE_FRAMEBUFFER=1
|
-D USE_FRAMEBUFFER=1
|
||||||
-D LV_COLOR_DEPTH=32
|
-D LV_COLOR_DEPTH=32
|
||||||
-D HAS_TFT=1
|
-D HAS_TFT=1
|
||||||
-D HAS_SCREEN=0
|
-D HAS_SCREEN=1
|
||||||
-D LV_BUILD_TEST=0
|
-D LV_BUILD_TEST=0
|
||||||
-D LV_USE_LOG=0
|
-D LV_USE_LOG=0
|
||||||
-D LV_USE_EVDEV=1
|
-D LV_USE_EVDEV=1
|
||||||
|
@ -26,7 +26,6 @@ build_flags =
|
|||||||
${env:t-deck.build_flags}
|
${env:t-deck.build_flags}
|
||||||
-D CONFIG_DISABLE_HAL_LOCKS=1 ; "feels" to be a bit more stable without locks
|
-D CONFIG_DISABLE_HAL_LOCKS=1 ; "feels" to be a bit more stable without locks
|
||||||
-D MESHTASTIC_EXCLUDE_CANNEDMESSAGES=1
|
-D MESHTASTIC_EXCLUDE_CANNEDMESSAGES=1
|
||||||
-D MESHTASTIC_EXCLUDE_INPUTBROKER=1
|
|
||||||
-D MESHTASTIC_EXCLUDE_WEBSERVER=1
|
-D MESHTASTIC_EXCLUDE_WEBSERVER=1
|
||||||
-D MESHTASTIC_EXCLUDE_SERIAL=1
|
-D MESHTASTIC_EXCLUDE_SERIAL=1
|
||||||
-D MESHTASTIC_EXCLUDE_SOCKETAPI=1
|
-D MESHTASTIC_EXCLUDE_SOCKETAPI=1
|
||||||
@ -39,7 +38,7 @@ build_flags =
|
|||||||
-D INPUTDRIVER_ENCODER_BTN=0
|
-D INPUTDRIVER_ENCODER_BTN=0
|
||||||
-D INPUTDRIVER_BUTTON_TYPE=0
|
-D INPUTDRIVER_BUTTON_TYPE=0
|
||||||
-D HAS_SDCARD
|
-D HAS_SDCARD
|
||||||
-D HAS_SCREEN=0
|
-D HAS_SCREEN=1
|
||||||
-D HAS_TFT=1
|
-D HAS_TFT=1
|
||||||
-D USE_I2S_BUZZER
|
-D USE_I2S_BUZZER
|
||||||
-D RAM_SIZE=5120
|
-D RAM_SIZE=5120
|
||||||
|
@ -1,6 +1,5 @@
|
|||||||
|
|
||||||
#define TFT_CS 12
|
#define TFT_CS 12
|
||||||
#ifndef HAS_TFT // for TFT-UI the definitions are in device-ui
|
|
||||||
#define BUTTON_PIN 0
|
#define BUTTON_PIN 0
|
||||||
|
|
||||||
// ST7789 TFT LCD
|
// ST7789 TFT LCD
|
||||||
@ -24,7 +23,6 @@
|
|||||||
#define SCREEN_ROTATE
|
#define SCREEN_ROTATE
|
||||||
#define SCREEN_TRANSITION_FRAMERATE 5
|
#define SCREEN_TRANSITION_FRAMERATE 5
|
||||||
#define BRIGHTNESS_DEFAULT 130 // Medium Low Brightness
|
#define BRIGHTNESS_DEFAULT 130 // Medium Low Brightness
|
||||||
#endif
|
|
||||||
|
|
||||||
#define HAS_TOUCHSCREEN 1
|
#define HAS_TOUCHSCREEN 1
|
||||||
#define SCREEN_TOUCH_INT 16
|
#define SCREEN_TOUCH_INT 16
|
||||||
@ -34,10 +32,9 @@
|
|||||||
#define USE_POWERSAVE
|
#define USE_POWERSAVE
|
||||||
#define SLEEP_TIME 120
|
#define SLEEP_TIME 120
|
||||||
|
|
||||||
#ifndef HAS_TFT
|
|
||||||
#define BUTTON_PIN 0
|
#define BUTTON_PIN 0
|
||||||
// #define BUTTON_NEED_PULLUP
|
// #define BUTTON_NEED_PULLUP
|
||||||
#endif
|
|
||||||
#define GPS_DEFAULT_NOT_PRESENT 1
|
#define GPS_DEFAULT_NOT_PRESENT 1
|
||||||
#define GPS_RX_PIN 44
|
#define GPS_RX_PIN 44
|
||||||
#define GPS_TX_PIN 43
|
#define GPS_TX_PIN 43
|
||||||
|
Loading…
Reference in New Issue
Block a user