diff --git a/src/graphics/Screen.cpp b/src/graphics/Screen.cpp index 22bd2acfb..ca48647a4 100644 --- a/src/graphics/Screen.cpp +++ b/src/graphics/Screen.cpp @@ -112,9 +112,6 @@ static uint16_t displayWidth, displayHeight; #define getStringCenteredX(s) ((SCREEN_WIDTH - display->getStringWidth(s)) / 2) -#ifndef SCREEN_TRANSITION_MSECS -#define SCREEN_TRANSITION_MSECS 300 -#endif /** * Draw the icon with extra info printed around the corners @@ -902,7 +899,7 @@ void Screen::setup() displayWidth = dispdev.width(); displayHeight = dispdev.height(); - ui.setTimePerTransition(SCREEN_TRANSITION_MSECS); + ui.setTimePerTransition(0); ui.setIndicatorPosition(BOTTOM); // Defines where the first frame is located in the bar. @@ -1069,10 +1066,6 @@ int32_t Screen::runOnce() DEBUG_MSG("Setting idle framerate\n"); targetFramerate = IDLE_FRAMERATE; -#ifdef ARCH_ESP32 - setCPUFast(false); // Turn up the CPU to improve screen animations -#endif - ui.setTargetFPS(targetFramerate); forceDisplay(); } @@ -1313,10 +1306,6 @@ void Screen::setFastFramerate() // We are about to start a transition so speed up fps targetFramerate = SCREEN_TRANSITION_FRAMERATE; -#ifdef ARCH_ESP32 - setCPUFast(true); // Turn up the CPU to improve screen animations -#endif - ui.setTargetFPS(targetFramerate); setInterval(0); // redraw ASAP runASAP = true; diff --git a/src/mesh/NodeDB.cpp b/src/mesh/NodeDB.cpp index 8145fe1e8..f26db75db 100644 --- a/src/mesh/NodeDB.cpp +++ b/src/mesh/NodeDB.cpp @@ -159,7 +159,12 @@ void NodeDB::installDefaultConfig() // FIXME: Default to bluetooth capability of platform as default config.bluetooth.enabled = true; config.bluetooth.fixed_pin = defaultBLEPin; - config.bluetooth.mode = screen_found ? Config_BluetoothConfig_PairingMode_RandomPin : Config_BluetoothConfig_PairingMode_FixedPin; +#if defined(ST7735_CS) || defined(USE_EINK) || defined(ILI9341_DRIVER) + bool hasScreen = true; +#else + bool hasScreen = screen_found; +#endif + config.bluetooth.mode = hasScreen ? Config_BluetoothConfig_PairingMode_RandomPin : Config_BluetoothConfig_PairingMode_FixedPin; // for backward compat, default position flags are ALT+MSL config.position.position_flags = (Config_PositionConfig_PositionFlags_POS_ALTITUDE | Config_PositionConfig_PositionFlags_POS_ALT_MSL); } diff --git a/src/nimble/NimbleBluetooth.cpp b/src/nimble/NimbleBluetooth.cpp index 501262f83..741d0d14d 100644 --- a/src/nimble/NimbleBluetooth.cpp +++ b/src/nimble/NimbleBluetooth.cpp @@ -122,8 +122,7 @@ void NimbleBluetooth::shutdown() bool NimbleBluetooth::isActive() { - NimBLEAdvertising *pAdvertising = NimBLEDevice::getAdvertising(); - return bleServer && (bleServer->getConnectedCount() > 0 || pAdvertising->isAdvertising()); + return bleServer; } void NimbleBluetooth::setup() diff --git a/src/platform/esp32/main-esp32.cpp b/src/platform/esp32/main-esp32.cpp index cd370e9ac..134d89332 100644 --- a/src/platform/esp32/main-esp32.cpp +++ b/src/platform/esp32/main-esp32.cpp @@ -29,7 +29,7 @@ void setBluetoothEnable(bool on) { } if (on && !nimbleBluetooth->isActive()) { nimbleBluetooth->setup(); - } else { + } else if (!on) { nimbleBluetooth->shutdown(); } } diff --git a/variants/m5stack_core/variant.h b/variants/m5stack_core/variant.h index 0fd294c60..f33ab08a8 100644 --- a/variants/m5stack_core/variant.h +++ b/variants/m5stack_core/variant.h @@ -39,5 +39,4 @@ #define SCREEN_ROTATE // LCD screens are slow, so slowdown the wipe so it looks better -#define SCREEN_TRANSITION_MSECS 1 #define SCREEN_TRANSITION_FRAMERATE 1 // fps diff --git a/variants/ppr1/variant.h b/variants/ppr1/variant.h index 8b9bc7c13..a7ee07701 100644 --- a/variants/ppr1/variant.h +++ b/variants/ppr1/variant.h @@ -126,7 +126,6 @@ static const uint8_t AREF = PIN_AREF; #define SCREEN_MIRROR // LCD screens are slow, so slowdown the wipe so it looks better -#define SCREEN_TRANSITION_MSECS 1000 #define SCREEN_TRANSITION_FRAMERATE 10 // fps /* diff --git a/variants/t-echo/variant.h b/variants/t-echo/variant.h index f74a19c9b..52c034c24 100644 --- a/variants/t-echo/variant.h +++ b/variants/t-echo/variant.h @@ -158,9 +158,6 @@ External serial flash WP25R1635FZUIL0 #define USE_EINK -// No screen wipes on eink -#define SCREEN_TRANSITION_MSECS 0 - #define PIN_SPI1_MISO \ (32 + 7) // FIXME not really needed, but for now the SPI code requires something to be defined, pick an used GPIO #define PIN_SPI1_MOSI PIN_EINK_MOSI