File tree Expand file tree Collapse file tree 1 file changed +6
-6
lines changed
Expand file tree Collapse file tree 1 file changed +6
-6
lines changed Original file line number Diff line number Diff line change @@ -8,13 +8,13 @@ using namespace Pinetime::Controllers;
88
99namespace {
1010 TimeSeparated ConvertTicksToTimeSegments (const TickType_t timeElapsed) {
11- // Centiseconds
12- const int timeElapsedCentis = timeElapsed * 100 / configTICK_RATE_HZ;
11+ const int timeElapsedSecs = timeElapsed / configTICK_RATE_HZ;
12+ const int timeElapsedFraction = timeElapsed % configTICK_RATE_HZ;
1313
14- const int hundredths = (timeElapsedCentis % 100 ) ;
15- const int secs = (timeElapsedCentis / 100 ) % 60 ;
16- const int mins = ((timeElapsedCentis / 100 ) / 60 ) % 60 ;
17- const int hours = ((timeElapsedCentis / 100 ) / 60 ) / 60 ;
14+ const int hundredths = timeElapsedFraction * 100 / configTICK_RATE_HZ ;
15+ const int secs = (timeElapsedSecs ) % 60 ;
16+ const int mins = (timeElapsedSecs / 60 ) % 60 ;
17+ const int hours = (timeElapsedSecs / 60 ) / 60 ;
1818 return TimeSeparated {hours, mins, secs, hundredths};
1919 }
2020
You can’t perform that action at this time.
0 commit comments