Skip to content

Commit

Permalink
Ran formatter
Browse files Browse the repository at this point in the history
  • Loading branch information
cyberneel committed Nov 30, 2024
1 parent 560b118 commit d51c319
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 17 deletions.
6 changes: 3 additions & 3 deletions src/components/infinisleep/InfiniSleepController.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -230,9 +230,9 @@ void InfiniSleepController::UpdateBPM() {
NRF_LOG_INFO("BPM: %d at %02d:%02d:%02d", rollingBpm, hours, minutes, seconds);

// Write data to CSV
//const int motion = 0; // Placeholder for motion data
//std::tuple<int, int, int, int, int> data[1] = {std::make_tuple(hours, minutes, seconds, bpm, motion)};
//WriteDataCSV(TRACKER_DATA_FILE_NAME, data, 1);
// const int motion = 0; // Placeholder for motion data
// std::tuple<int, int, int, int, int> data[1] = {std::make_tuple(hours, minutes, seconds, bpm, motion)};
// WriteDataCSV(TRACKER_DATA_FILE_NAME, data, 1);
}

void InfiniSleepController::WriteDataCSV(const char* fileName, const std::tuple<int, int, int, int, int>* data, int dataSize) const {
Expand Down
2 changes: 1 addition & 1 deletion src/components/infinisleep/InfiniSleepController.h
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,7 @@ namespace Pinetime {
SavePrevSessionData();
DisableTracker();
} else {
//ClearDataCSV(TRACKER_DATA_FILE_NAME);
// ClearDataCSV(TRACKER_DATA_FILE_NAME);
prevSessionData.startTimeHours = GetCurrentHour();
prevSessionData.startTimeMinutes = GetCurrentMinute();
EnableTracker();
Expand Down
21 changes: 11 additions & 10 deletions src/displayapp/screens/Sleep.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,11 @@ Sleep::Sleep(Controllers::InfiniSleepController& infiniSleepController,
System::SystemTask& systemTask,
Controllers::MotorController& motorController,
DisplayApp& displayApp)
: infiniSleepController {infiniSleepController}, wakeLock(systemTask), motorController {motorController}, clockType {clockType}, displayApp {displayApp} {
: infiniSleepController {infiniSleepController},
wakeLock(systemTask),
motorController {motorController},
clockType {clockType},
displayApp {displayApp} {

infiniSleepController.SetHeartRateTrackingEnabled(false);
infiniSleepController.SetSettingsChanged();
Expand Down Expand Up @@ -192,20 +196,18 @@ void Sleep::DrawAlarmScreen() {
lv_obj_set_event_cb(btnSuggestedAlarm, btnEventHandler);
lv_obj_set_size(btnSuggestedAlarm, 115, 50);
lv_obj_align(btnSuggestedAlarm, lv_scr_act(), LV_ALIGN_IN_BOTTOM_RIGHT, 0, 0);
//txtSuggestedAlarm = lv_label_create(btnSuggestedAlarm, nullptr);
//lv_label_set_text_static(txtSuggestedAlarm, "Use Sugg.\nAlarmTime");
// txtSuggestedAlarm = lv_label_create(btnSuggestedAlarm, nullptr);
// lv_label_set_text_static(txtSuggestedAlarm, "Use Sugg.\nAlarmTime");

txtSuggestedAlarm = lv_label_create(lv_scr_act(), nullptr);
lv_obj_align(txtSuggestedAlarm, lv_scr_act(), LV_ALIGN_IN_BOTTOM_RIGHT, -15, -10);
lv_label_set_text_static(txtSuggestedAlarm, "Auto");


iconSuggestedAlarm = lv_label_create(lv_scr_act(), nullptr);
lv_obj_set_style_local_text_color(iconSuggestedAlarm, LV_LABEL_PART_MAIN, LV_STATE_DEFAULT, LV_COLOR_WHITE);
lv_obj_align(iconSuggestedAlarm, lv_scr_act(), LV_ALIGN_IN_BOTTOM_RIGHT, -50, -10);
lv_label_set_text_static(iconSuggestedAlarm, Symbols::sun);


enableSwitch = lv_switch_create(lv_scr_act(), nullptr);
enableSwitch->user_data = this;
lv_obj_set_event_cb(enableSwitch, btnEventHandler);
Expand Down Expand Up @@ -290,9 +292,9 @@ void Sleep::DrawInfoScreen() {
infiniSleepController.GetWakeAlarm().minutes);
} else {
lv_label_set_text_fmt(label_alarm_time,
"Alarm at: %02d:%02d",
(infiniSleepController.GetWakeAlarm().hours % 12 == 0) ? 12 : infiniSleepController.GetWakeAlarm().hours % 12,
infiniSleepController.GetWakeAlarm().minutes);
"Alarm at: %02d:%02d",
(infiniSleepController.GetWakeAlarm().hours % 12 == 0) ? 12 : infiniSleepController.GetWakeAlarm().hours % 12,
infiniSleepController.GetWakeAlarm().minutes);
}
} else {
lv_label_set_text_static(label_alarm_time, "Alarm is not set.");
Expand All @@ -305,8 +307,7 @@ void Sleep::DrawInfoScreen() {

// Gradual Wake info
label_gradual_wake = lv_label_create(lv_scr_act(), nullptr);
if (infiniSleepController.GetInfiniSleepSettings().graddualWake &&
infiniSleepController.gradualWakeStep >= 0) {
if (infiniSleepController.GetInfiniSleepSettings().graddualWake && infiniSleepController.gradualWakeStep >= 0) {
lv_label_set_text_fmt(label_gradual_wake, "Gradual Wake: ON");
} else {
lv_label_set_text_static(label_gradual_wake, "Gradual Wake: OFF");
Expand Down
6 changes: 3 additions & 3 deletions src/displayapp/screens/Sleep.h
Original file line number Diff line number Diff line change
Expand Up @@ -80,9 +80,9 @@ namespace Pinetime {
lv_obj_t* label_sleep_cycles;
lv_obj_t *btnSuggestedAlarm, *txtSuggestedAlarm, *iconSuggestedAlarm;

Widgets::PageIndicator pageIndicator1 = Widgets::PageIndicator(0,3);
Widgets::PageIndicator pageIndicator2 = Widgets::PageIndicator(1,3);
Widgets::PageIndicator pageIndicator3 = Widgets::PageIndicator(2,3);
Widgets::PageIndicator pageIndicator1 = Widgets::PageIndicator(0, 3);
Widgets::PageIndicator pageIndicator2 = Widgets::PageIndicator(1, 3);
Widgets::PageIndicator pageIndicator3 = Widgets::PageIndicator(2, 3);
};
}

Expand Down

0 comments on commit d51c319

Please sign in to comment.