Get MUI and legacy screen co-existing on Portduino

This commit is contained in:
Jonathan Bennett 2025-05-17 18:25:22 -05:00
parent e7352cada4
commit afc5d1fdeb
2 changed files with 14 additions and 11 deletions

View File

@ -198,7 +198,8 @@ static void powerEnter()
LOG_INFO("Loss of power in Powered"); LOG_INFO("Loss of power in Powered");
powerFSM.trigger(EVENT_POWER_DISCONNECTED); powerFSM.trigger(EVENT_POWER_DISCONNECTED);
} else { } else {
screen->setOn(true); if (config.display.displaymode != meshtastic_Config_DisplayConfig_DisplayMode_COLOR )
screen->setOn(true);
setBluetoothEnable(true); setBluetoothEnable(true);
// within enter() the function getState() returns the state we came from // within enter() the function getState() returns the state we came from
@ -221,7 +222,8 @@ static void powerIdle()
static void powerExit() static void powerExit()
{ {
screen->setOn(true); if (screen)
screen->setOn(true);
setBluetoothEnable(true); setBluetoothEnable(true);
// Mothballed: print change of power-state to device screen // Mothballed: print change of power-state to device screen

View File

@ -537,12 +537,6 @@ void setup()
digitalWrite(AQ_SET_PIN, HIGH); digitalWrite(AQ_SET_PIN, HIGH);
#endif #endif
#if HAS_TFT
if (config.display.displaymode == meshtastic_Config_DisplayConfig_DisplayMode_COLOR) {
tftSetup();
}
#endif
// Currently only the tbeam has a PMU // Currently only the tbeam has a PMU
// PMU initialization needs to be placed before i2c scanning // PMU initialization needs to be placed before i2c scanning
power = new Power(); power = new Power();
@ -767,6 +761,12 @@ void setup()
// but we need to do this after main cpu init (esp32setup), because we need the random seed set // but we need to do this after main cpu init (esp32setup), because we need the random seed set
nodeDB = new NodeDB; nodeDB = new NodeDB;
#if HAS_TFT
if (config.display.displaymode == meshtastic_Config_DisplayConfig_DisplayMode_COLOR) {
tftSetup();
}
#endif
// If we're taking on the repeater role, use NextHopRouter and turn off 3V3_S rail because peripherals are not needed // If we're taking on the repeater role, use NextHopRouter and turn off 3V3_S rail because peripherals are not needed
if (config.device.role == meshtastic_Config_DeviceConfig_Role_REPEATER) { if (config.device.role == meshtastic_Config_DeviceConfig_Role_REPEATER) {
router = new NextHopRouter(); router = new NextHopRouter();
@ -955,7 +955,7 @@ void setup()
defined(ST7789_CS) || defined(HX8357_CS) || defined(USE_ST7789) || defined(ILI9488_CS) defined(ST7789_CS) || defined(HX8357_CS) || defined(USE_ST7789) || defined(ILI9488_CS)
screen->setup(); screen->setup();
#elif defined(ARCH_PORTDUINO) #elif defined(ARCH_PORTDUINO)
if (screen_found.port != ScanI2C::I2CPort::NO_I2C || settingsMap[displayPanel]) { if ((screen_found.port != ScanI2C::I2CPort::NO_I2C || settingsMap[displayPanel]) && config.display.displaymode != meshtastic_Config_DisplayConfig_DisplayMode_COLOR) {
screen->setup(); screen->setup();
} }
#else #else
@ -963,8 +963,9 @@ void setup()
screen->setup(); screen->setup();
#endif #endif
#endif #endif
if (screen) {
screen->print("Started...\n"); screen->print("Started...\n");
}
#ifdef PIN_PWR_DELAY_MS #ifdef PIN_PWR_DELAY_MS
// This may be required to give the peripherals time to power up. // This may be required to give the peripherals time to power up.