File tree 1 file changed +6
-6
lines changed
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;
8
8
9
9
namespace {
10
10
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;
13
13
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 ;
18
18
return TimeSeparated {hours, mins, secs, hundredths};
19
19
}
20
20
You can’t perform that action at this time.
0 commit comments