Skip to content

Commit

Permalink
HAL : add getStepsAverage
Browse files Browse the repository at this point in the history
  • Loading branch information
RuffaloLavoisier committed Jul 16, 2022
1 parent 8b96945 commit 1719b50
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
1 change: 1 addition & 0 deletions include/hal/environment.h
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ class OswHal::Environment {
uint32_t getStepsTotal();
uint32_t getStepsTotalWeek();
#ifdef OSW_FEATURE_STATS_STEPS
uint32_t getStepsAverage();
uint32_t getStepsOnDay(uint8_t dayOfWeek, bool lastWeek = false);
#endif
#endif
Expand Down
5 changes: 5 additions & 0 deletions src/hal/environment.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -213,6 +213,11 @@ uint32_t OswHal::Environment::getStepsTotalWeek() {
return this->getStepsTotal();
#endif
}
#ifdef OSW_FEATURE_STATS_STEPS
uint32_t OswHal::Environment::getStepsAverage() {
return this->getStepsTotalWeek() / 7;
}
#endif
#endif

#if OSW_PLATFORM_ENVIRONMENT_PRESSURE == 1
Expand Down

0 comments on commit 1719b50

Please sign in to comment.