Fix formatting

This commit is contained in:
Tomas Groth 2023-05-04 17:18:22 +02:00
parent 6f6d870167
commit 1da33443fc
3 changed files with 14 additions and 17 deletions

View file

@ -215,7 +215,9 @@ void SystemTask::Work() {
break;
case Messages::TouchWakeUp: {
Pinetime::Controllers::TouchHandler::TouchProcessReply reply;
reply = touchHandler.ProcessTouchInfo(touchPanel.GetTouchInfo(), settingsController.isWakeUpModeOn(Pinetime::Controllers::Settings::WakeUpMode::ButtonUnlocks));
reply =
touchHandler.ProcessTouchInfo(touchPanel.GetTouchInfo(),
settingsController.isWakeUpModeOn(Pinetime::Controllers::Settings::WakeUpMode::ButtonUnlocks));
if (reply == Pinetime::Controllers::TouchHandler::TouchProcessReply::TouchEvent) {
auto gesture = touchHandler.GestureGet();
if (settingsController.GetNotificationStatus() != Controllers::Settings::Notification::Sleep &&
@ -298,7 +300,9 @@ void SystemTask::Work() {
break;
case Messages::OnTouchEvent:
Pinetime::Controllers::TouchHandler::TouchProcessReply reply;
reply = touchHandler.ProcessTouchInfo(touchPanel.GetTouchInfo(), settingsController.isWakeUpModeOn(Pinetime::Controllers::Settings::WakeUpMode::ButtonUnlocks));
reply =
touchHandler.ProcessTouchInfo(touchPanel.GetTouchInfo(),
settingsController.isWakeUpModeOn(Pinetime::Controllers::Settings::WakeUpMode::ButtonUnlocks));
NRF_LOG_INFO("[systemtask] OnTouchEvent, reply %d", reply);
if (reply == Pinetime::Controllers::TouchHandler::TouchProcessReply::TouchEvent) {
@ -315,8 +319,7 @@ void SystemTask::Work() {
touchHandler.SetIfButtonUnlocksIgnoreTouch(false);
touchHandler.SetIgnoreTouchPopupHidden(true);
displayApp.PushMessage(Pinetime::Applications::Display::Messages::HideIgnoreTouchPopup);
}
else {
} else {
Controllers::ButtonActions action = Controllers::ButtonActions::None;
if (nrf_gpio_pin_read(Pinetime::PinMap::Button) == 0) {
action = buttonHandler.HandleEvent(Controllers::ButtonHandler::Events::Release);

View file

@ -44,8 +44,7 @@ TouchHandler::TouchProcessReply TouchHandler::ProcessTouchInfo(Drivers::Cst816S:
ignoreNextTouchEvent = false;
return TouchHandler::TouchProcessReply::NoAction;
} else if (!buttonUnlocksOn || wokenBy != WokenBy::WakeUpAction)
{
} else if (!buttonUnlocksOn || wokenBy != WokenBy::WakeUpAction) {
// if we get to here TouchEvents is allowed and the "ButtonUnlocks" requirement can be overridden
wokenBy = WokenBy::Other;
@ -75,9 +74,7 @@ TouchHandler::TouchProcessReply TouchHandler::ProcessTouchInfo(Drivers::Cst816S:
currentTouchPoint = {info.x, info.y, info.touching};
return TouchHandler::TouchProcessReply::TouchEvent;
}
else
{
} else {
return TouchHandler::TouchProcessReply::IgnoreTouchPopup;
}
}

View file

@ -38,22 +38,19 @@ namespace Pinetime {
return currentTouchPoint.y;
}
void SetIfButtonUnlocksIgnoreTouch(bool ignore)
{
void SetIfButtonUnlocksIgnoreTouch(bool ignore) {
ignoreNextTouchEvent = ignore;
}
void SetIgnoreTouchPopupHidden(bool hidden)
{
void SetIgnoreTouchPopupHidden(bool hidden) {
ignoreTouchPopupHidden = hidden;
}
bool IsIgnoreTouchPopupHidden()
{
bool IsIgnoreTouchPopupHidden() {
return ignoreTouchPopupHidden;
}
void SetWokenBy(WokenBy woken)
{
void SetWokenBy(WokenBy woken) {
wokenBy = woken;
}