@@ -16,10 +16,10 @@ namespace {
1616 TimeSeparated_t convertTicksToTimeSegments (const TickType_t timeElapsed) {
1717 const int timeElapsedMillis = (static_cast <float >(timeElapsed) / static_cast <float >(configTICK_RATE_HZ)) * 1000 ;
1818
19- const int milliSecs = (timeElapsedMillis % 1000 ) / 10 ; // Get only the first two digits and ignore the last
19+ const int hundredths = (timeElapsedMillis % 1000 ) / 10 ; // Get only the first two digits and ignore the last
2020 const int secs = (timeElapsedMillis / 1000 ) % 60 ;
2121 const int mins = (timeElapsedMillis / 1000 ) / 60 ;
22- return TimeSeparated_t {mins, secs, milliSecs };
22+ return TimeSeparated_t {mins, secs, hundredths };
2323 }
2424
2525 TickType_t calculateDelta (const TickType_t startTime, const TickType_t currentTime) {
@@ -53,13 +53,13 @@ StopWatch::StopWatch(DisplayApp* app)
5353 lv_obj_set_style_local_text_font (time, LV_LABEL_PART_MAIN, LV_STATE_DEFAULT, &jetbrains_mono_76);
5454 lv_obj_set_style_local_text_color (time, LV_LABEL_PART_MAIN, LV_STATE_DEFAULT, LV_COLOR_GRAY);
5555 lv_label_set_text (time, " 00:00" );
56- lv_obj_align (time, lv_scr_act (), LV_ALIGN_IN_LEFT_MID, 0 , -45 );
56+ lv_obj_align (time, lv_scr_act (), LV_ALIGN_IN_LEFT_MID, 0 , -45 );
5757
5858 msecTime = lv_label_create (lv_scr_act (), nullptr );
5959 // lv_obj_set_style_local_text_font(msecTime, LV_LABEL_PART_MAIN, LV_STATE_DEFAULT, &jetbrains_mono_bold_20);
6060 lv_obj_set_style_local_text_color (msecTime, LV_LABEL_PART_MAIN, LV_STATE_DEFAULT, LV_COLOR_GRAY);
6161 lv_label_set_text (msecTime, " 00" );
62- lv_obj_align (msecTime, lv_scr_act (), LV_ALIGN_IN_LEFT_MID, 108 , 3 );
62+ lv_obj_align (msecTime, lv_scr_act (), LV_ALIGN_IN_LEFT_MID, 108 , 3 );
6363
6464 btnPlayPause = lv_btn_create (lv_scr_act (), nullptr );
6565 btnPlayPause->user_data = this ;
@@ -141,14 +141,14 @@ bool StopWatch::Refresh() {
141141 currentTimeSeparated = convertTicksToTimeSegments ((oldTimeElapsed + timeElapsed));
142142
143143 lv_label_set_text_fmt (time, " %02d:%02d" , currentTimeSeparated.mins , currentTimeSeparated.secs );
144- lv_label_set_text_fmt (msecTime, " %02d" , currentTimeSeparated.msecs );
144+ lv_label_set_text_fmt (msecTime, " %02d" , currentTimeSeparated.hundredths );
145145
146146 if (lapPressed == true ) {
147147 if (lapBuffer[1 ]) {
148- lv_label_set_text_fmt (lapOneText, " #%d %d:%d:%d " , (lapNr - 1 ), lapBuffer[1 ]->mins , lapBuffer[1 ]->secs , lapBuffer[1 ]->msecs );
148+ lv_label_set_text_fmt (lapOneText, " #2 %d %2d:%02d.%02d " , (lapNr - 1 ), lapBuffer[1 ]->mins , lapBuffer[1 ]->secs , lapBuffer[1 ]->hundredths );
149149 }
150150 if (lapBuffer[0 ]) {
151- lv_label_set_text_fmt (lapTwoText, " #%d %d:%d:%d " , lapNr, lapBuffer[0 ]->mins , lapBuffer[0 ]->secs , lapBuffer[0 ]->msecs );
151+ lv_label_set_text_fmt (lapTwoText, " #2 %d %2d:%02d.%02d " , lapNr, lapBuffer[0 ]->mins , lapBuffer[0 ]->secs , lapBuffer[0 ]->hundredths );
152152 }
153153 // Reset the bool to avoid setting the text in each cycle until there is a change
154154 lapPressed = false ;
0 commit comments