Kaynağa Gözat

Adjustments to ui8tostr_percent

Scott Lahteine 5 yıl önce
ebeveyn
işleme
9cb5c57b84

+ 5
- 5
Marlin/src/core/utility.cpp Dosyayı Görüntüle

@@ -58,11 +58,11 @@ void safe_delay(millis_t ms) {
58 58
   #define MINUSOR(n, alt) (n >= 0 ? (alt) : (n = -n, '-'))
59 59
 
60 60
   // Convert a full-range unsigned 8bit int to a percentage
61
-  char* ui8tostr_percent(const uint8_t i) {
62
-    const uint8_t percent = ui8_to_percent(i);
63
-    conv[3] = RJDIGIT(percent, 100);
64
-    conv[4] = RJDIGIT(percent, 10);
65
-    conv[5] = DIGIMOD(percent, 1);
61
+  char* ui8tostr4pct(const uint8_t i) {
62
+    const uint8_t n = ui8_to_percent(i);
63
+    conv[3] = RJDIGIT(n, 100);
64
+    conv[4] = RJDIGIT(n, 10);
65
+    conv[5] = DIGIMOD(n, 1);
66 66
     conv[6] = '%';
67 67
     return &conv[3];
68 68
   }

+ 1
- 1
Marlin/src/core/utility.h Dosyayı Görüntüle

@@ -56,7 +56,7 @@ inline void serial_delay(const millis_t ms) {
56 56
 #if ANY(ULTRA_LCD, DEBUG_LEVELING_FEATURE, EXTENSIBLE_UI)
57 57
 
58 58
   // Convert a full-range unsigned 8bit int to a percentage
59
-  char* ui8tostr_percent(const uint8_t i);
59
+  char* ui8tostr4pct(const uint8_t i);
60 60
 
61 61
   // Convert uint8_t to string with 123 format
62 62
   char* ui8tostr3(const uint8_t x);

+ 1
- 1
Marlin/src/lcd/menu/menu.h Dosyayı Görüntüle

@@ -43,7 +43,7 @@ bool printer_busy();
43 43
     static inline char* strfunc(const float value) { return STRFUNC((TYPE) value); } \
44 44
   };
45 45
 
46
-DECLARE_MENU_EDIT_TYPE(uint8_t,  percent,     ui8tostr_percent,1     );   // 100%       right-justified
46
+DECLARE_MENU_EDIT_TYPE(uint8_t,  percent,     ui8tostr4pct,    1     );   // 100%       right-justified
47 47
 DECLARE_MENU_EDIT_TYPE(int16_t,  int3,        i16tostr3,       1     );   // 123, -12   right-justified
48 48
 DECLARE_MENU_EDIT_TYPE(int16_t,  int4,        i16tostr4sign,   1     );   // 1234, -123 right-justified
49 49
 DECLARE_MENU_EDIT_TYPE(int8_t,   int8,        i8tostr3,        1     );   // 123, -12   right-justified

Loading…
İptal
Kaydet