Skip to content

Commit 56af4a0

Browse files
committed
cleaned up the code and reduced the size of the diff by removing things like additional whitespaces
1 parent 5da6549 commit 56af4a0

6 files changed

Lines changed: 14 additions & 19 deletions

File tree

src/components/motor/MotorController.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ void MotorController::Init() {
2121
isBusy = false;
2222
}
2323

24-
void MotorController::RunForDuration(uint8_t motorDuration) {
24+
void MotorController::runForDuration(uint8_t motorDuration) {
2525

2626
if (settingsController.GetVibrationStatus() == Controllers::Settings::Vibration::OFF || isBusy)
2727
return;

src/components/motor/MotorController.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ namespace Pinetime {
1212
public:
1313
MotorController(Controllers::Settings& settingsController);
1414
void Init();
15-
void RunForDuration(uint8_t motorDuration);
15+
void runForDuration(uint8_t motorDuration);
1616
void startRunning(uint8_t motorDuration);
1717
void stopRunning();
1818

src/displayapp/screens/Notifications.cpp

Lines changed: 9 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,11 @@ Notifications::Notifications(DisplayApp* app,
1313
Pinetime::Controllers::AlertNotificationService& alertNotificationService,
1414
Controllers::MotorController& motorController,
1515
Modes mode)
16-
: Screen(app),
17-
notificationManager {notificationManager},
18-
alertNotificationService {alertNotificationService},
19-
motorController{motorController},
20-
mode {mode} {
16+
: Screen(app),
17+
notificationManager{notificationManager},
18+
alertNotificationService{alertNotificationService},
19+
motorController{motorController},
20+
mode{mode} {
2121
notificationManager.ClearNewNotificationFlag();
2222
auto notification = notificationManager.GetLastNotification();
2323
if (notification.valid) {
@@ -45,8 +45,6 @@ Notifications::Notifications(DisplayApp* app,
4545
}
4646

4747
if (mode == Modes::Preview) {
48-
49-
5048

5149
timeoutLine = lv_line_create(lv_scr_act(), nullptr);
5250

@@ -75,9 +73,8 @@ bool Notifications::Refresh() {
7573
lv_line_set_points(timeoutLine, timeoutLinePoints, 2);
7674
}
7775
//make sure we stop any vibrations before exiting
78-
if (!running) {
76+
if (!running)
7977
motorController.stopRunning();
80-
}
8178
return running;
8279
}
8380

@@ -173,9 +170,8 @@ Notifications::NotificationItem::NotificationItem(const char* title,
173170
Pinetime::Controllers::AlertNotificationService& alertNotificationService,
174171
Controllers::MotorController& motorController,
175172
uint32_t* timeoutEnd)
176-
: notifNr {notifNr}, notifNb {notifNb}, mode {mode}, alertNotificationService {alertNotificationService},
177-
motorController{motorController}, timeoutEnd{timeoutEnd} {
178-
173+
: notifNr{notifNr}, notifNb{notifNb}, mode{mode}, alertNotificationService{alertNotificationService},
174+
motorController{motorController}, timeoutEnd{timeoutEnd} {
179175
lv_obj_t* container1 = lv_cont_create(lv_scr_act(), NULL);
180176

181177
lv_obj_set_style_local_bg_color(container1, LV_CONT_PART_MAIN, LV_STATE_DEFAULT, lv_color_hex(0x222222));
@@ -260,7 +256,6 @@ Notifications::NotificationItem::NotificationItem(const char* title,
260256
timeoutOnHold = true;
261257
} break;
262258
}
263-
264259

265260
lv_obj_t* backgroundLabel = lv_label_create(lv_scr_act(), nullptr);
266261
lv_label_set_long_mode(backgroundLabel, LV_LABEL_LONG_CROP);
@@ -291,7 +286,7 @@ void Notifications::NotificationItem::OnRejectIncomingCall(lv_event_t event) {
291286
}
292287

293288
inline void Notifications::NotificationItem::callPreviewInteraction() {
294-
*timeoutEnd = xTaskGetTickCount() + (5 * 1024);
289+
*timeoutEnd = xTaskGetTickCount() + (5 * 1024);
295290
timeoutOnHold = false;
296291
motorController.stopRunning();
297292
}

src/displayapp/screens/Notifications.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@ namespace Pinetime {
4545
void OnAcceptIncomingCall(lv_event_t event);
4646
void OnMuteIncomingCall(lv_event_t event);
4747
void OnRejectIncomingCall(lv_event_t event);
48+
4849
bool timeoutOnHold = false;
4950
private:
5051
void callPreviewInteraction();
@@ -81,7 +82,6 @@ namespace Pinetime {
8182
std::unique_ptr<NotificationItem> currentItem;
8283
Controllers::NotificationManager::Notification::Id currentId;
8384
Controllers::MotorController& motorController;
84-
8585
bool validDisplay = false;
8686

8787
lv_point_t timeoutLinePoints[2] {{0, 1}, {239, 1}};

src/displayapp/screens/settings/QuickSettings.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,7 @@ void QuickSettings::OnButtonEvent(lv_obj_t* object, lv_event_t event) {
140140

141141
if (lv_obj_get_state(btn3, LV_BTN_PART_MAIN) & LV_STATE_CHECKED) {
142142
settingsController.SetVibrationStatus(Controllers::Settings::Vibration::ON);
143-
motorController.RunForDuration(35);
143+
motorController.runForDuration(35);
144144
lv_label_set_text_static(btn3_lvl, Symbols::notificationsOn);
145145
} else {
146146
settingsController.SetVibrationStatus(Controllers::Settings::Vibration::OFF);

src/systemtask/SystemTask.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -228,7 +228,7 @@ void SystemTask::Work() {
228228
if (notificationManager.GetLastNotification().category == Controllers::NotificationManager::Categories::IncomingCall) {
229229
motorController.startRunning(500);
230230
} else {
231-
motorController.RunForDuration(35);
231+
motorController.runForDuration(35);
232232
}
233233
displayApp->PushMessage(Pinetime::Applications::Display::Messages::NewNotification);
234234
break;

0 commit comments

Comments
 (0)