Skip to content
Snippets Groups Projects
Commit d992dfe7 authored by Marcio Teixeira's avatar Marcio Teixeira Committed by Scott Lahteine
Browse files

Use the percent util func in the string func. (#13523)

parent b1f739e2
Branches
No related tags found
No related merge requests found
...@@ -59,7 +59,7 @@ void safe_delay(millis_t ms) { ...@@ -59,7 +59,7 @@ void safe_delay(millis_t ms) {
// Convert a full-range unsigned 8bit int to a percentage // Convert a full-range unsigned 8bit int to a percentage
char* ui8tostr_percent(const uint8_t i) { char* ui8tostr_percent(const uint8_t i) {
const uint16_t percent = 100 * i / 255; const uint8_t percent = ui8_to_percent(i);
conv[3] = RJDIGIT(percent, 100); conv[3] = RJDIGIT(percent, 100);
conv[4] = RJDIGIT(percent, 10); conv[4] = RJDIGIT(percent, 10);
conv[5] = DIGIMOD(percent, 1); conv[5] = DIGIMOD(percent, 1);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment