core/health/step_hours.c
| Line | Branch | Exec | Source |
|---|---|---|---|
| 1 | /** | ||
| 2 | * @file step_hours.c | ||
| 3 | * @brief The hour arithmetic behind the step chart's buckets. | ||
| 4 | * | ||
| 5 | * @ingroup lib_core | ||
| 6 | */ | ||
| 7 | #include "health/step_hours.h" | ||
| 8 | |||
| 9 | 4 | int step_hours_settled(int cur_hour, int cur_min) | |
| 10 | { | ||
| 11 |
2/2✓ Branch 0 taken 2 times.
✓ Branch 1 taken 2 times.
|
4 | int settled = (cur_min > 0) ? cur_hour : cur_hour - 1; |
| 12 | |||
| 13 | // midnight's first minute would ask for the hour before the day started | ||
| 14 | 4 | return (settled < 0) ? 0 : settled; | |
| 15 | } | ||
| 16 |