Fix formatting issue on the lap counter in Stopwatch (display lap counter on 2 characters).

This commit is contained in:
Jean-François Milants 2021-04-20 21:01:38 +02:00
parent 410cc821f4
commit fefb429fb4

View File

@ -145,10 +145,10 @@ bool StopWatch::Refresh() {
if (lapPressed == true) { if (lapPressed == true) {
if (lapBuffer[1]) { if (lapBuffer[1]) {
lv_label_set_text_fmt(lapOneText, "#%d %2d:%02d.%02d", (lapNr - 1), lapBuffer[1]->mins, lapBuffer[1]->secs, lapBuffer[1]->hundredths); lv_label_set_text_fmt(lapOneText, "#%2d %2d:%02d.%02d", (lapNr - 1), lapBuffer[1]->mins, lapBuffer[1]->secs, lapBuffer[1]->hundredths);
} }
if (lapBuffer[0]) { if (lapBuffer[0]) {
lv_label_set_text_fmt(lapTwoText, "#%d %2d:%02d.%02d", lapNr, lapBuffer[0]->mins, lapBuffer[0]->secs, lapBuffer[0]->hundredths); lv_label_set_text_fmt(lapTwoText, "#%2d %2d:%02d.%02d", lapNr, lapBuffer[0]->mins, lapBuffer[0]->secs, lapBuffer[0]->hundredths);
} }
// Reset the bool to avoid setting the text in each cycle until there is a change // Reset the bool to avoid setting the text in each cycle until there is a change
lapPressed = false; lapPressed = false;