refactored companion interfaces to allow for multiple active connection modes

This commit is contained in:
liamcottle
2026-07-28 03:18:54 +12:00
parent b4143a4402
commit e672679d6e
13 changed files with 595 additions and 353 deletions
+4 -4
View File
@@ -289,7 +289,7 @@ public:
} else if (_page == HomePage::BLUETOOTH) {
display.setColor(UIColor::corp_blue);
display.drawXbm((display.width() - 32) / 2, 18,
_task->isSerialEnabled() ? bluetooth_on : bluetooth_off,
_task->isBluetoothEnabled() ? bluetooth_on : bluetooth_off,
32, 32);
display.setColor(UIColor::secondary_txt);
display.setTextSize(1);
@@ -449,10 +449,10 @@ public:
return true;
}
if (c == KEY_ENTER && _page == HomePage::BLUETOOTH) {
if (_task->isSerialEnabled()) { // toggle Bluetooth on/off
_task->disableSerial();
if (_task->isBluetoothEnabled()) { // toggle Bluetooth on/off
_task->disableBluetooth();
} else {
_task->enableSerial();
_task->enableBluetooth();
}
return true;
}