Merge branch 'airplane-mode' of https://github.com/evergreen22/InfiniTime into evergreen22-airplane-mode

Apply a few changes that were requested in the PR during the review.

# Conflicts:
#	src/CMakeLists.txt
#	src/displayapp/Apps.h
#	src/displayapp/DisplayApp.cpp
#	src/displayapp/Messages.h
#	src/displayapp/screens/settings/Settings.cpp
This commit is contained in:
Jean-François Milants
2022-02-20 15:40:49 +01:00
parent 40cdb54772
commit ef44b763d9
21 changed files with 179 additions and 124 deletions

View File

@@ -254,7 +254,7 @@ void SystemTask::Work() {
displayApp.PushMessage(Pinetime::Applications::Display::Messages::GoToRunning);
heartRateApp.PushMessage(Pinetime::Applications::HeartRateTask::Messages::WakeUp);
if (bleController.GetConnectState() == Controllers::Ble::ConnectStates::Disconnected) {
if (bleController.IsRadioEnabled() && !bleController.IsConnected()) {
nimbleController.RestartFastAdv();
}
@@ -440,8 +440,12 @@ void SystemTask::Work() {
motorController.RunForDuration(35);
displayApp.PushMessage(Pinetime::Applications::Display::Messages::ShowPairingKey);
break;
case Messages::AirplaneModeToggle:
nimbleController.SwitchAirplaneMode(settingsController.GetAirplaneMode());
case Messages::BleRadioEnableToggle:
if(settingsController.GetBleRadioEnabled()) {
nimbleController.EnableRadio();
} else {
nimbleController.DisableRadio();
}
break;
default:
break;