Explorar el Código

Replace ftostr62sign with ftostr62rj

`ftostr62sign()` is used only when displaing/editing
Steps/mm. A sign is not needed - the value is always positive.
Because the number part is long there is no't much place for the values name.
With this PR the is one more char for the name possible.
AnHardt hace 8 años
padre
commit
cd2b74e88d
Se han modificado 5 ficheros con 17 adiciones y 18 borrados
  1. 1
    1
      Marlin/ultralcd.cpp
  2. 2
    2
      Marlin/ultralcd_impl_DOGM.h
  3. 2
    2
      Marlin/ultralcd_impl_HD44780.h
  4. 10
    11
      Marlin/utility.cpp
  5. 2
    2
      Marlin/utility.h

+ 1
- 1
Marlin/ultralcd.cpp Ver fichero

@@ -2475,7 +2475,7 @@ void kill_screen(const char* lcd_msg) {
2475 2475
   menu_edit_type(float, float5, ftostr5rj, 0.01);
2476 2476
   menu_edit_type(float, float51, ftostr51sign, 10.0);
2477 2477
   menu_edit_type(float, float52, ftostr52sign, 100.0);
2478
-  menu_edit_type(float, float62, ftostr62sign, 100.0);
2478
+  menu_edit_type(float, float62, ftostr62rj, 100.0);
2479 2479
   menu_edit_type(unsigned long, long5, ftostr5rj, 0.01);
2480 2480
 
2481 2481
   /**

+ 2
- 2
Marlin/ultralcd_impl_DOGM.h Ver fichero

@@ -741,7 +741,7 @@ static void lcd_implementation_status_screen() {
741 741
   #define lcd_implementation_drawmenu_setting_edit_float5(sel, row, pstr, pstr2, data, minValue, maxValue) lcd_implementation_drawmenu_setting_edit_generic(sel, row, pstr, ftostr5rj(*(data)))
742 742
   #define lcd_implementation_drawmenu_setting_edit_float52(sel, row, pstr, pstr2, data, minValue, maxValue) lcd_implementation_drawmenu_setting_edit_generic(sel, row, pstr, ftostr52sign(*(data)))
743 743
   #define lcd_implementation_drawmenu_setting_edit_float51(sel, row, pstr, pstr2, data, minValue, maxValue) lcd_implementation_drawmenu_setting_edit_generic(sel, row, pstr, ftostr51sign(*(data)))
744
-  #define lcd_implementation_drawmenu_setting_edit_float62(sel, row, pstr, pstr2, data, minValue, maxValue) lcd_implementation_drawmenu_setting_edit_generic(sel, row, pstr, ftostr62sign(*(data)))
744
+  #define lcd_implementation_drawmenu_setting_edit_float62(sel, row, pstr, pstr2, data, minValue, maxValue) lcd_implementation_drawmenu_setting_edit_generic(sel, row, pstr, ftostr62rj(*(data)))
745 745
   #define lcd_implementation_drawmenu_setting_edit_long5(sel, row, pstr, pstr2, data, minValue, maxValue) lcd_implementation_drawmenu_setting_edit_generic(sel, row, pstr, ftostr5rj(*(data)))
746 746
   #define lcd_implementation_drawmenu_setting_edit_bool(sel, row, pstr, pstr2, data) lcd_implementation_drawmenu_setting_edit_generic_P(sel, row, pstr, (*(data))?PSTR(MSG_ON):PSTR(MSG_OFF))
747 747
 
@@ -752,7 +752,7 @@ static void lcd_implementation_status_screen() {
752 752
   #define lcd_implementation_drawmenu_setting_edit_callback_float5(sel, row, pstr, pstr2, data, minValue, maxValue, callback) lcd_implementation_drawmenu_setting_edit_generic(sel, row, pstr, ftostr5rj(*(data)))
753 753
   #define lcd_implementation_drawmenu_setting_edit_callback_float52(sel, row, pstr, pstr2, data, minValue, maxValue, callback) lcd_implementation_drawmenu_setting_edit_generic(sel, row, pstr, ftostr52sign(*(data)))
754 754
   #define lcd_implementation_drawmenu_setting_edit_callback_float51(sel, row, pstr, pstr2, data, minValue, maxValue, callback) lcd_implementation_drawmenu_setting_edit_generic(sel, row, pstr, ftostr51sign(*(data)))
755
-  #define lcd_implementation_drawmenu_setting_edit_callback_float62(sel, row, pstr, pstr2, data, minValue, maxValue, callback) lcd_implementation_drawmenu_setting_edit_generic(sel, row, pstr, ftostr62sign(*(data)))
755
+  #define lcd_implementation_drawmenu_setting_edit_callback_float62(sel, row, pstr, pstr2, data, minValue, maxValue, callback) lcd_implementation_drawmenu_setting_edit_generic(sel, row, pstr, ftostr62rj(*(data)))
756 756
   #define lcd_implementation_drawmenu_setting_edit_callback_long5(sel, row, pstr, pstr2, data, minValue, maxValue, callback) lcd_implementation_drawmenu_setting_edit_generic(sel, row, pstr, ftostr5rj(*(data)))
757 757
   #define lcd_implementation_drawmenu_setting_edit_callback_bool(sel, row, pstr, pstr2, data, callback) lcd_implementation_drawmenu_setting_edit_generic_P(sel, row, pstr, (*(data))?PSTR(MSG_ON):PSTR(MSG_OFF))
758 758
 

+ 2
- 2
Marlin/ultralcd_impl_HD44780.h Ver fichero

@@ -863,7 +863,7 @@ static void lcd_implementation_status_screen() {
863 863
   #define lcd_implementation_drawmenu_setting_edit_float5(sel, row, pstr, pstr2, data, minValue, maxValue) lcd_implementation_drawmenu_setting_edit_generic(sel, row, pstr, '>', ftostr5rj(*(data)))
864 864
   #define lcd_implementation_drawmenu_setting_edit_float52(sel, row, pstr, pstr2, data, minValue, maxValue) lcd_implementation_drawmenu_setting_edit_generic(sel, row, pstr, '>', ftostr52sign(*(data)))
865 865
   #define lcd_implementation_drawmenu_setting_edit_float51(sel, row, pstr, pstr2, data, minValue, maxValue) lcd_implementation_drawmenu_setting_edit_generic(sel, row, pstr, '>', ftostr51sign(*(data)))
866
-  #define lcd_implementation_drawmenu_setting_edit_float62(sel, row, pstr, pstr2, data, minValue, maxValue) lcd_implementation_drawmenu_setting_edit_generic(sel, row, pstr, '>', ftostr62sign(*(data)))
866
+  #define lcd_implementation_drawmenu_setting_edit_float62(sel, row, pstr, pstr2, data, minValue, maxValue) lcd_implementation_drawmenu_setting_edit_generic(sel, row, pstr, '>', ftostr62rj(*(data)))
867 867
   #define lcd_implementation_drawmenu_setting_edit_long5(sel, row, pstr, pstr2, data, minValue, maxValue) lcd_implementation_drawmenu_setting_edit_generic(sel, row, pstr, '>', ftostr5rj(*(data)))
868 868
   #define lcd_implementation_drawmenu_setting_edit_bool(sel, row, pstr, pstr2, data) lcd_implementation_drawmenu_setting_edit_generic_P(sel, row, pstr, '>', (*(data))?PSTR(MSG_ON):PSTR(MSG_OFF))
869 869
 
@@ -875,7 +875,7 @@ static void lcd_implementation_status_screen() {
875 875
   #define lcd_implementation_drawmenu_setting_edit_callback_float5(sel, row, pstr, pstr2, data, minValue, maxValue, callback) lcd_implementation_drawmenu_setting_edit_generic(sel, row, pstr, '>', ftostr5rj(*(data)))
876 876
   #define lcd_implementation_drawmenu_setting_edit_callback_float52(sel, row, pstr, pstr2, data, minValue, maxValue, callback) lcd_implementation_drawmenu_setting_edit_generic(sel, row, pstr, '>', ftostr52sign(*(data)))
877 877
   #define lcd_implementation_drawmenu_setting_edit_callback_float51(sel, row, pstr, pstr2, data, minValue, maxValue, callback) lcd_implementation_drawmenu_setting_edit_generic(sel, row, pstr, '>', ftostr51sign(*(data)))
878
-  #define lcd_implementation_drawmenu_setting_edit_callback_float62(sel, row, pstr, pstr2, data, minValue, maxValue, callback) lcd_implementation_drawmenu_setting_edit_generic(sel, row, pstr, '>', ftostr62sign(*(data)))
878
+  #define lcd_implementation_drawmenu_setting_edit_callback_float62(sel, row, pstr, pstr2, data, minValue, maxValue, callback) lcd_implementation_drawmenu_setting_edit_generic(sel, row, pstr, '>', ftostr62rj(*(data)))
879 879
   #define lcd_implementation_drawmenu_setting_edit_callback_long5(sel, row, pstr, pstr2, data, minValue, maxValue, callback) lcd_implementation_drawmenu_setting_edit_generic(sel, row, pstr, '>', ftostr5rj(*(data)))
880 880
   #define lcd_implementation_drawmenu_setting_edit_callback_bool(sel, row, pstr, pstr2, data, callback) lcd_implementation_drawmenu_setting_edit_generic_P(sel, row, pstr, '>', (*(data))?PSTR(MSG_ON):PSTR(MSG_OFF))
881 881
 

+ 10
- 11
Marlin/utility.cpp Ver fichero

@@ -212,18 +212,17 @@ void safe_delay(millis_t ms) {
212 212
     return conv;
213 213
   }
214 214
 
215
-  // Convert signed float to string with +1234.56 format
216
-  char* ftostr62sign(const float& x) {
215
+  // Convert unsigned float to string with 1234.56 format omitting trailing zeros
216
+  char* ftostr62rj(const float& x) {
217 217
     long xx = abs(x * 100);
218
-    conv[0] = MINUSOR(xx, '+');
219
-    conv[1] = DIGIMOD(xx, 100000);
220
-    conv[2] = DIGIMOD(xx, 10000);
221
-    conv[3] = DIGIMOD(xx, 1000);
222
-    conv[4] = DIGIMOD(xx, 100);
223
-    conv[5] = '.';
224
-    conv[6] = DIGIMOD(xx, 10);
225
-    conv[7] = DIGIMOD(xx, 1);
226
-    conv[8] = '\0';
218
+    conv[0] = RJDIGIT(xx, 100000);
219
+    conv[1] = RJDIGIT(xx, 10000);
220
+    conv[2] = RJDIGIT(xx, 1000);
221
+    conv[3] = DIGIMOD(xx, 100);
222
+    conv[4] = '.';
223
+    conv[5] = DIGIMOD(xx, 10);
224
+    conv[6] = DIGIMOD(xx, 1);
225
+    conv[7] = '\0';
227 226
     return conv;
228 227
   }
229 228
 

+ 2
- 2
Marlin/utility.h Ver fichero

@@ -63,8 +63,8 @@ void safe_delay(millis_t ms);
63 63
   // Convert signed float to string with +123.45 format
64 64
   char* ftostr52sign(const float& x);
65 65
 
66
-  // Convert signed float to string with +1234.56 format
67
-  char* ftostr62sign(const float& x);
66
+  // Convert unsigned float to string with 1234.56 format omitting trailing zeros
67
+  char* ftostr62rj(const float& x);
68 68
 
69 69
   // Convert float to rj string with 123 or -12 format
70 70
   FORCE_INLINE char *ftostr3(const float& x) { return itostr3((int)x); }

Loading…
Cancelar
Guardar