From b16160bf26401fef7a37e322b86f69fd9ecc8c03 Mon Sep 17 00:00:00 2001 From: Ruffalo Lavoisier Date: Sat, 14 Sep 2024 11:54:05 +0900 Subject: [PATCH 1/4] Remove unused param - replace to nullptr --- src/hal/environment.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/hal/environment.cpp b/src/hal/environment.cpp index b233e94cb..8637149eb 100644 --- a/src/hal/environment.cpp +++ b/src/hal/environment.cpp @@ -132,9 +132,8 @@ void OswHal::Environment::setupStepStatistics() { * @param alwaysPrintStepStatistics Set to true to print the step history to the console */ void OswHal::Environment::commitStepStatistics(const bool& alwaysPrintStepStatistics) { - uint32_t currDoM = 0; // Unused, but required by function signature uint32_t currDoW = 0; - OswHal::getInstance()->getLocalDate(&currDoM, &currDoW); + OswHal::getInstance()->getLocalDate(nullptr, &currDoW); bool changedDoW = currDoW != this->_stepsLastDoW; if(changedDoW) { Preferences prefs; From 112ab6129629e027cd846c7e9f5993e7fa6b5367 Mon Sep 17 00:00:00 2001 From: Ruffalo Lavoisier Date: Sat, 14 Sep 2024 11:56:15 +0900 Subject: [PATCH 2/4] Remote unsed pram --- src/hal/environment.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/hal/environment.cpp b/src/hal/environment.cpp index 8637149eb..14f111cb1 100644 --- a/src/hal/environment.cpp +++ b/src/hal/environment.cpp @@ -224,9 +224,8 @@ uint32_t OswHal::Environment::getStepsTotalWeek() { #ifdef OSW_FEATURE_STATS_STEPS this->commitStepStatistics(); uint32_t sum = 0; - uint32_t currDoM = 0; // Unused, but required by function signature uint32_t currDoW = 0; - OswHal::getInstance()->getLocalDate(&currDoM, &currDoW); + OswHal::getInstance()->getLocalDate(nullptr, &currDoW); for (uint8_t i = 0; i < 7; i++) { if (i == currDoW) { sum = sum + this->getStepsToday(); From fada5bcb30502fa0ee609a811a38086bf35dc0a4 Mon Sep 17 00:00:00 2001 From: Ruffalo Lavoisier Date: Sat, 14 Sep 2024 11:57:30 +0900 Subject: [PATCH 3/4] Remote dead comment --- src/apps/watchfaces/OswAppWatchfaceMix.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/apps/watchfaces/OswAppWatchfaceMix.cpp b/src/apps/watchfaces/OswAppWatchfaceMix.cpp index 51633f877..3879b30f1 100644 --- a/src/apps/watchfaces/OswAppWatchfaceMix.cpp +++ b/src/apps/watchfaces/OswAppWatchfaceMix.cpp @@ -24,8 +24,8 @@ const char* OswAppWatchfaceMix::getAppName() { void OswAppWatchfaceMix::analogWatchDisplay() { OswHal* hal = OswHal::getInstance(); uint32_t second = 0; - uint32_t minute = 0; // Unused, but required by function signature - uint32_t hour = 0; // Unused, but required by function signature + uint32_t minute = 0; + uint32_t hour = 0; hal->getLocalTime(&hour, &minute, &second); hal->gfx()->drawCircle((int)(DISP_W*0.5)-OFF_SET_ANALOG_WATCH_X_COORD, 100, 50, ui->getForegroundColor()); From 8ac5bbb3ced2684b036c2b62b5ae17e379cdc71c Mon Sep 17 00:00:00 2001 From: Ruffalo Lavoisier Date: Sat, 14 Sep 2024 12:04:41 +0900 Subject: [PATCH 4/4] Fix getDate function, for unused param - To prevent declaring dummy(unused) variables, give 'nullptr' to make condition. --- src/hal/time.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/hal/time.cpp b/src/hal/time.cpp index d0ce9cb71..b1fecf484 100644 --- a/src/hal/time.cpp +++ b/src/hal/time.cpp @@ -126,7 +126,9 @@ void OswHal::getDate(time_t& offset, uint32_t* day, uint32_t* weekDay) { RtcDateTime d = RtcDateTime(); d.InitWithUnix32Time(this->getTime(offset)); *weekDay = d.DayOfWeek(); - *day = d.Day(); + if (day != nullptr){ + *day = d.Day(); + } } void OswHal::getDate(time_t& offset, uint32_t* day, uint32_t* month, uint32_t* year) {