mirror of
https://github.com/meshcore-dev/MeshCore.git
synced 2026-10-24 14:59:19 +00:00
Merge pull request #3606 from amdoolittle/feature/ble-conditional-display
Remove BLE screen when BLE not available
This commit is contained in:
1 file changed
+6
@@ -91,7 +91,9 @@ class HomeScreen : public UIScreen {
|
|||||||
FIRST,
|
FIRST,
|
||||||
RECENT,
|
RECENT,
|
||||||
RADIO,
|
RADIO,
|
||||||
|
#ifdef BLE_PIN_CODE
|
||||||
BLUETOOTH,
|
BLUETOOTH,
|
||||||
|
#endif
|
||||||
ADVERT,
|
ADVERT,
|
||||||
#if ENV_INCLUDE_GPS == 1
|
#if ENV_INCLUDE_GPS == 1
|
||||||
GPS,
|
GPS,
|
||||||
@@ -372,6 +374,7 @@ public:
|
|||||||
display.setCursor(0, 53);
|
display.setCursor(0, 53);
|
||||||
sprintf(tmp, "Noise floor: %d", radio_driver.getNoiseFloor());
|
sprintf(tmp, "Noise floor: %d", radio_driver.getNoiseFloor());
|
||||||
display.print(tmp);
|
display.print(tmp);
|
||||||
|
#ifdef BLE_PIN_CODE
|
||||||
} else if (_page == HomePage::BLUETOOTH) {
|
} else if (_page == HomePage::BLUETOOTH) {
|
||||||
display.setColor(UIColor::corp_blue);
|
display.setColor(UIColor::corp_blue);
|
||||||
display.drawXbm((display.width() - 32) / 2, 18,
|
display.drawXbm((display.width() - 32) / 2, 18,
|
||||||
@@ -380,6 +383,7 @@ public:
|
|||||||
display.setColor(UIColor::secondary_txt);
|
display.setColor(UIColor::secondary_txt);
|
||||||
display.setTextSize(1);
|
display.setTextSize(1);
|
||||||
display.drawTextCentered(display.width() / 2, 64 - 11, "toggle: " PRESS_LABEL);
|
display.drawTextCentered(display.width() / 2, 64 - 11, "toggle: " PRESS_LABEL);
|
||||||
|
#endif
|
||||||
} else if (_page == HomePage::ADVERT) {
|
} else if (_page == HomePage::ADVERT) {
|
||||||
display.setColor(UIColor::corp_blue);
|
display.setColor(UIColor::corp_blue);
|
||||||
display.drawXbm((display.width() - 32) / 2, 18, advert_icon, 32, 32);
|
display.drawXbm((display.width() - 32) / 2, 18, advert_icon, 32, 32);
|
||||||
@@ -575,6 +579,7 @@ public:
|
|||||||
#endif
|
#endif
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
#ifdef BLE_PIN_CODE
|
||||||
if (c == KEY_ENTER && _page == HomePage::BLUETOOTH) {
|
if (c == KEY_ENTER && _page == HomePage::BLUETOOTH) {
|
||||||
if (_task->isBluetoothEnabled()) { // toggle Bluetooth on/off
|
if (_task->isBluetoothEnabled()) { // toggle Bluetooth on/off
|
||||||
_task->disableBluetooth();
|
_task->disableBluetooth();
|
||||||
@@ -583,6 +588,7 @@ public:
|
|||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
if (c == KEY_ENTER && _page == HomePage::ADVERT) {
|
if (c == KEY_ENTER && _page == HomePage::ADVERT) {
|
||||||
_task->notify(UIEventType::ack);
|
_task->notify(UIEventType::ack);
|
||||||
if (the_mesh.advert()) {
|
if (the_mesh.advert()) {
|
||||||
|
|||||||
Reference in new issue
Block a user