Browse Source

Rename LCD menus according to variable types (#12892)

Scott Lahteine 6 years ago
parent
commit
eb78aed863
No account linked to committer's email address

+ 39
- 12
Marlin/src/core/utility.cpp View File

57
   #define RJDIGIT(n, f) ((n) >= (f) ? DIGIMOD(n, f) : ' ')
57
   #define RJDIGIT(n, f) ((n) >= (f) ? DIGIMOD(n, f) : ' ')
58
   #define MINUSOR(n, alt) (n >= 0 ? (alt) : (n = -n, '-'))
58
   #define MINUSOR(n, alt) (n >= 0 ? (alt) : (n = -n, '-'))
59
 
59
 
60
-  // Convert unsigned int to string 123 format
61
-  char* i8tostr3(const uint8_t i) {
60
+  // Convert unsigned 8bit int to string 123 format
61
+  char* ui8tostr3(const uint8_t i) {
62
     conv[4] = RJDIGIT(i, 100);
62
     conv[4] = RJDIGIT(i, 100);
63
     conv[5] = RJDIGIT(i, 10);
63
     conv[5] = RJDIGIT(i, 10);
64
     conv[6] = DIGIMOD(i, 1);
64
     conv[6] = DIGIMOD(i, 1);
65
     return &conv[4];
65
     return &conv[4];
66
   }
66
   }
67
 
67
 
68
-  // Convert signed int to rj string with 123 or -12 format
69
-  char* itostr3(int i) {
70
-    conv[4] = MINUSOR(i, RJDIGIT(i, 100));
71
-    conv[5] = RJDIGIT(i, 10);
72
-    conv[6] = DIGIMOD(i, 1);
68
+  // Convert signed 8bit int to rj string with 123 or -12 format
69
+  char* i8tostr3(const int8_t x) {
70
+    int xx = x;
71
+    conv[4] = MINUSOR(xx, RJDIGIT(xx, 100));
72
+    conv[5] = RJDIGIT(xx, 10);
73
+    conv[6] = DIGIMOD(xx, 1);
74
+    return &conv[4];
75
+  }
76
+
77
+  // Convert unsigned 16bit int to string 123 format
78
+  char* ui16tostr3(const uint16_t xx) {
79
+    conv[4] = RJDIGIT(xx, 100);
80
+    conv[5] = RJDIGIT(xx, 10);
81
+    conv[6] = DIGIMOD(xx, 1);
82
+    return &conv[4];
83
+  }
84
+
85
+  // Convert unsigned 16bit int to string 1234 format
86
+  char* ui16tostr4(const uint16_t xx) {
87
+    conv[3] = RJDIGIT(xx, 1000);
88
+    conv[4] = RJDIGIT(xx, 100);
89
+    conv[5] = RJDIGIT(xx, 10);
90
+    conv[6] = DIGIMOD(xx, 1);
91
+    return &conv[3];
92
+  }
93
+
94
+  // Convert signed 16bit int to rj string with 123 or -12 format
95
+  char* i16tostr3(const int16_t x) {
96
+    int xx = x;
97
+    conv[4] = MINUSOR(xx, RJDIGIT(xx, 100));
98
+    conv[5] = RJDIGIT(xx, 10);
99
+    conv[6] = DIGIMOD(xx, 1);
73
     return &conv[4];
100
     return &conv[4];
74
   }
101
   }
75
 
102
 
76
-  // Convert unsigned int to lj string with 123 format
77
-  char* itostr3left(const int i) {
103
+  // Convert unsigned 16bit int to lj string with 123 format
104
+  char* i16tostr3left(const int16_t i) {
78
     char *str = &conv[6];
105
     char *str = &conv[6];
79
     *str = DIGIMOD(i, 1);
106
     *str = DIGIMOD(i, 1);
80
     if (i >= 10) {
107
     if (i >= 10) {
85
     return str;
112
     return str;
86
   }
113
   }
87
 
114
 
88
-  // Convert signed int to rj string with 1234, _123, -123, _-12, or __-1 format
89
-  char* itostr4sign(const int i) {
115
+  // Convert signed 16bit int to rj string with 1234, _123, -123, _-12, or __-1 format
116
+  char* i16tostr4sign(const int16_t i) {
90
     const bool neg = i < 0;
117
     const bool neg = i < 0;
91
     const int ii = neg ? -i : i;
118
     const int ii = neg ? -i : i;
92
     if (i >= 1000) {
119
     if (i >= 1000) {
141
     // Convert float to rj string with 1234, _123, -123, _-12, 12.3, _1.2, or -1.2 format
168
     // Convert float to rj string with 1234, _123, -123, _-12, 12.3, _1.2, or -1.2 format
142
     char* ftostr4sign(const float &f) {
169
     char* ftostr4sign(const float &f) {
143
       const int i = (f * 100 + (f < 0 ? -5: 5)) / 10;
170
       const int i = (f * 100 + (f < 0 ? -5: 5)) / 10;
144
-      if (!WITHIN(i, -99, 999)) return itostr4sign((int)f);
171
+      if (!WITHIN(i, -99, 999)) return i16tostr4sign((int)f);
145
       const bool neg = i < 0;
172
       const bool neg = i < 0;
146
       const int ii = neg ? -i : i;
173
       const int ii = neg ? -i : i;
147
       conv[3] = neg ? '-' : (ii >= 100 ? DIGIMOD(ii, 100) : ' ');
174
       conv[3] = neg ? '-' : (ii >= 100 ? DIGIMOD(ii, 100) : ' ');

+ 16
- 7
Marlin/src/core/utility.h View File

56
 #if ENABLED(ULTRA_LCD) || ENABLED(DEBUG_LEVELING_FEATURE) || ENABLED(EXTENSIBLE_UI)
56
 #if ENABLED(ULTRA_LCD) || ENABLED(DEBUG_LEVELING_FEATURE) || ENABLED(EXTENSIBLE_UI)
57
 
57
 
58
   // Convert uint8_t to string with 123 format
58
   // Convert uint8_t to string with 123 format
59
-  char* i8tostr3(const uint8_t x);
59
+  char* ui8tostr3(const uint8_t x);
60
 
60
 
61
-  // Convert signed int to rj string with 123 or -12 format
62
-  char* itostr3(const int x);
61
+  // Convert int8_t to string with 123 format
62
+  char* i8tostr3(const int8_t x);
63
+
64
+  // Convert uint16_t to string with 123 format
65
+  char* ui16tostr3(const uint16_t x);
66
+
67
+  // Convert uint16_t to string with 1234 format
68
+  char* ui16tostr4(const uint16_t x);
69
+
70
+  // Convert int16_t to string with 123 format
71
+  char* i16tostr3(const int16_t x);
63
 
72
 
64
   // Convert unsigned int to lj string with 123 format
73
   // Convert unsigned int to lj string with 123 format
65
-  char* itostr3left(const int xx);
74
+  char* i16tostr3left(const int16_t xx);
66
 
75
 
67
   // Convert signed int to rj string with _123, -123, _-12, or __-1 format
76
   // Convert signed int to rj string with _123, -123, _-12, or __-1 format
68
-  char* itostr4sign(const int x);
77
+  char* i16tostr4sign(const int16_t x);
69
 
78
 
70
   // Convert unsigned float to string with 1.23 format
79
   // Convert unsigned float to string with 1.23 format
71
   char* ftostr12ns(const float &x);
80
   char* ftostr12ns(const float &x);
95
   char* ftostr62rj(const float &x);
104
   char* ftostr62rj(const float &x);
96
 
105
 
97
   // Convert float to rj string with 123 or -12 format
106
   // Convert float to rj string with 123 or -12 format
98
-  FORCE_INLINE char* ftostr3(const float &x) { return itostr3(int(x + (x < 0 ? -0.5f : 0.5f))); }
107
+  FORCE_INLINE char* ftostr3(const float &x) { return i16tostr3(int16_t(x + (x < 0 ? -0.5f : 0.5f))); }
99
 
108
 
100
   #if ENABLED(LCD_DECIMAL_SMALL_XY)
109
   #if ENABLED(LCD_DECIMAL_SMALL_XY)
101
     // Convert float to rj string with 1234, _123, 12.3, _1.2, -123, _-12, or -1.2 format
110
     // Convert float to rj string with 1234, _123, 12.3, _1.2, -123, _-12, or -1.2 format
102
     char* ftostr4sign(const float &fx);
111
     char* ftostr4sign(const float &fx);
103
   #else
112
   #else
104
     // Convert float to rj string with 1234, _123, -123, __12, _-12, ___1, or __-1 format
113
     // Convert float to rj string with 1234, _123, -123, __12, _-12, ___1, or __-1 format
105
-    FORCE_INLINE char* ftostr4sign(const float &x) { return itostr4sign(int(x + (x < 0 ? -0.5f : 0.5f))); }
114
+    FORCE_INLINE char* ftostr4sign(const float &x) { return i16tostr4sign(int16_t(x + (x < 0 ? -0.5f : 0.5f))); }
106
   #endif
115
   #endif
107
 
116
 
108
 #endif // ULTRA_LCD
117
 #endif // ULTRA_LCD

+ 9
- 9
Marlin/src/lcd/HD44780/ultralcd_HD44780.cpp View File

528
 
528
 
529
   if (prefix >= 0) lcd_put_wchar(prefix);
529
   if (prefix >= 0) lcd_put_wchar(prefix);
530
 
530
 
531
-  lcd_put_u8str(itostr3(t1 + 0.5));
531
+  lcd_put_u8str(i16tostr3(t1 + 0.5));
532
   lcd_put_wchar('/');
532
   lcd_put_wchar('/');
533
 
533
 
534
   #if !HEATER_IDLE_HANDLER
534
   #if !HEATER_IDLE_HANDLER
548
     }
548
     }
549
     else
549
     else
550
   #endif
550
   #endif
551
-      lcd_put_u8str(itostr3left(t2 + 0.5));
551
+      lcd_put_u8str(i16tostr3left(t2 + 0.5));
552
 
552
 
553
   if (prefix >= 0) {
553
   if (prefix >= 0) {
554
     lcd_put_wchar(LCD_STR_DEGREE[0]);
554
     lcd_put_wchar(LCD_STR_DEGREE[0]);
578
       #endif
578
       #endif
579
     ));
579
     ));
580
     if (progress)
580
     if (progress)
581
-      lcd_put_u8str(itostr3(progress));
581
+      lcd_put_u8str(ui8tostr3(progress));
582
     else
582
     else
583
       lcd_put_u8str_P(PSTR("---"));
583
       lcd_put_u8str_P(PSTR("---"));
584
     lcd_put_wchar('%');
584
     lcd_put_wchar('%');
627
       lcd_put_u8str_P(PSTR("Dia "));
627
       lcd_put_u8str_P(PSTR("Dia "));
628
       lcd_put_u8str(ftostr12ns(filament_width_meas));
628
       lcd_put_u8str(ftostr12ns(filament_width_meas));
629
       lcd_put_u8str_P(PSTR(" V"));
629
       lcd_put_u8str_P(PSTR(" V"));
630
-      lcd_put_u8str(itostr3(100.0 * (
630
+      lcd_put_u8str(i16tostr3(100.0 * (
631
           parser.volumetric_enabled
631
           parser.volumetric_enabled
632
             ? planner.volumetric_area_nominal / planner.volumetric_multiplier[FILAMENT_SENSOR_EXTRUDER_NUM]
632
             ? planner.volumetric_area_nominal / planner.volumetric_multiplier[FILAMENT_SENSOR_EXTRUDER_NUM]
633
             : planner.volumetric_multiplier[FILAMENT_SENSOR_EXTRUDER_NUM]
633
             : planner.volumetric_multiplier[FILAMENT_SENSOR_EXTRUDER_NUM]
849
 
849
 
850
       lcd_moveto(0, 2);
850
       lcd_moveto(0, 2);
851
       lcd_put_wchar(LCD_STR_FEEDRATE[0]);
851
       lcd_put_wchar(LCD_STR_FEEDRATE[0]);
852
-      lcd_put_u8str(itostr3(feedrate_percentage));
852
+      lcd_put_u8str(i16tostr3(feedrate_percentage));
853
       lcd_put_wchar('%');
853
       lcd_put_wchar('%');
854
 
854
 
855
       char buffer[14];
855
       char buffer[14];
883
               per = planner.flow_percentage[0];
883
               per = planner.flow_percentage[0];
884
             }
884
             }
885
           lcd_put_wchar(c);
885
           lcd_put_wchar(c);
886
-          lcd_put_u8str(itostr3(per));
886
+          lcd_put_u8str(i16tostr3(per));
887
           lcd_put_wchar('%');
887
           lcd_put_wchar('%');
888
         #endif
888
         #endif
889
       #endif
889
       #endif
924
 
924
 
925
     lcd_moveto(LCD_WIDTH - 9, 1);
925
     lcd_moveto(LCD_WIDTH - 9, 1);
926
     lcd_put_wchar(LCD_STR_FEEDRATE[0]);
926
     lcd_put_wchar(LCD_STR_FEEDRATE[0]);
927
-    lcd_put_u8str(itostr3(feedrate_percentage));
927
+    lcd_put_u8str(i16tostr3(feedrate_percentage));
928
     lcd_put_wchar('%');
928
     lcd_put_wchar('%');
929
 
929
 
930
     // ========== Line 3 ==========
930
     // ========== Line 3 ==========
1378
        */
1378
        */
1379
       lcd_moveto(_LCD_W_POS, 0);
1379
       lcd_moveto(_LCD_W_POS, 0);
1380
       lcd_put_wchar('(');
1380
       lcd_put_wchar('(');
1381
-      lcd_put_u8str(itostr3(x));
1381
+      lcd_put_u8str(ui8tostr3(x));
1382
       lcd_put_wchar(',');
1382
       lcd_put_wchar(',');
1383
-      lcd_put_u8str(itostr3(inverted_y));
1383
+      lcd_put_u8str(ui8tostr3(inverted_y));
1384
       lcd_put_wchar(')');
1384
       lcd_put_wchar(')');
1385
 
1385
 
1386
       #if LCD_HEIGHT <= 3   // 16x2 or 20x2 display
1386
       #if LCD_HEIGHT <= 3   // 16x2 or 20x2 display

+ 5
- 5
Marlin/src/lcd/dogm/status_screen_DOGM.cpp View File

52
 #endif
52
 #endif
53
 
53
 
54
 FORCE_INLINE void _draw_centered_temp(const int16_t temp, const uint8_t tx, const uint8_t ty) {
54
 FORCE_INLINE void _draw_centered_temp(const int16_t temp, const uint8_t tx, const uint8_t ty) {
55
-  const char *str = itostr3(temp);
55
+  const char *str = i16tostr3(temp);
56
   const uint8_t len = str[0] != ' ' ? 3 : str[1] != ' ' ? 2 : 1;
56
   const uint8_t len = str[0] != ' ' ? 3 : str[1] != ' ' ? 2 : 1;
57
   lcd_moveto(tx - len * (INFO_FONT_WIDTH) / 2 + 1, ty);
57
   lcd_moveto(tx - len * (INFO_FONT_WIDTH) / 2 + 1, ty);
58
   lcd_put_u8str(&str[3-len]);
58
   lcd_put_u8str(&str[3-len]);
249
     strcpy(zstring, ftostr52sp(LOGICAL_Z_POSITION(current_position[Z_AXIS])));
249
     strcpy(zstring, ftostr52sp(LOGICAL_Z_POSITION(current_position[Z_AXIS])));
250
     #if ENABLED(FILAMENT_LCD_DISPLAY)
250
     #if ENABLED(FILAMENT_LCD_DISPLAY)
251
       strcpy(wstring, ftostr12ns(filament_width_meas));
251
       strcpy(wstring, ftostr12ns(filament_width_meas));
252
-      strcpy(mstring, itostr3(100.0 * (
252
+      strcpy(mstring, i16tostr3(100.0 * (
253
           parser.volumetric_enabled
253
           parser.volumetric_enabled
254
             ? planner.volumetric_area_nominal / planner.volumetric_multiplier[FILAMENT_SENSOR_EXTRUDER_NUM]
254
             ? planner.volumetric_area_nominal / planner.volumetric_multiplier[FILAMENT_SENSOR_EXTRUDER_NUM]
255
             : planner.volumetric_multiplier[FILAMENT_SENSOR_EXTRUDER_NUM]
255
             : planner.volumetric_multiplier[FILAMENT_SENSOR_EXTRUDER_NUM]
338
             }
338
             }
339
           #endif
339
           #endif
340
           lcd_moveto(STATUS_FAN_TEXT_X, STATUS_FAN_TEXT_Y);
340
           lcd_moveto(STATUS_FAN_TEXT_X, STATUS_FAN_TEXT_Y);
341
-          lcd_put_u8str(itostr3(thermalManager.fanPercent(spd)));
341
+          lcd_put_u8str(i16tostr3(thermalManager.fanPercent(spd)));
342
           lcd_put_wchar(c);
342
           lcd_put_wchar(c);
343
         }
343
         }
344
       }
344
       }
393
         if (PAGE_CONTAINS(41, 48)) {
393
         if (PAGE_CONTAINS(41, 48)) {
394
           // Percent complete
394
           // Percent complete
395
           lcd_moveto(55, 48);
395
           lcd_moveto(55, 48);
396
-          lcd_put_u8str(itostr3(progress));
396
+          lcd_put_u8str(ui8tostr3(progress));
397
           lcd_put_wchar('%');
397
           lcd_put_wchar('%');
398
         }
398
         }
399
       #endif
399
       #endif
484
 
484
 
485
     set_font(FONT_STATUSMENU);
485
     set_font(FONT_STATUSMENU);
486
     lcd_moveto(12, EXTRAS_2_BASELINE);
486
     lcd_moveto(12, EXTRAS_2_BASELINE);
487
-    lcd_put_u8str(itostr3(feedrate_percentage));
487
+    lcd_put_u8str(i16tostr3(feedrate_percentage));
488
     lcd_put_wchar('%');
488
     lcd_put_wchar('%');
489
 
489
 
490
     //
490
     //

+ 2
- 2
Marlin/src/lcd/dogm/ultralcd_DOGM.cpp View File

258
       lcd_put_wchar('E');
258
       lcd_put_wchar('E');
259
       lcd_put_wchar((char)('1' + extruder));
259
       lcd_put_wchar((char)('1' + extruder));
260
       lcd_put_wchar(' ');
260
       lcd_put_wchar(' ');
261
-      lcd_put_u8str(itostr3(thermalManager.degHotend(extruder)));
261
+      lcd_put_u8str(i16tostr3(thermalManager.degHotend(extruder)));
262
       lcd_put_wchar('/');
262
       lcd_put_wchar('/');
263
 
263
 
264
       if (get_blink() || !thermalManager.is_heater_idle(extruder))
264
       if (get_blink() || !thermalManager.is_heater_idle(extruder))
265
-        lcd_put_u8str(itostr3(thermalManager.degTargetHotend(extruder)));
265
+        lcd_put_u8str(i16tostr3(thermalManager.degTargetHotend(extruder)));
266
     }
266
     }
267
 
267
 
268
   #endif // ADVANCED_PAUSE_FEATURE
268
   #endif // ADVANCED_PAUSE_FEATURE

+ 4
- 4
Marlin/src/lcd/extensible_ui/ui_api.cpp View File

523
   }
523
   }
524
 
524
 
525
   #if ENABLED(PRINTCOUNTER)
525
   #if ENABLED(PRINTCOUNTER)
526
-    char* getTotalPrints_str(char buffer[21])    { strcpy(buffer,itostr3left(print_job_timer.getStats().totalPrints));    return buffer; }
527
-    char* getFinishedPrints_str(char buffer[21]) { strcpy(buffer,itostr3left(print_job_timer.getStats().finishedPrints)); return buffer; }
528
-    char* getTotalPrintTime_str(char buffer[21]) { duration_t(print_job_timer.getStats().printTime).toString(buffer);     return buffer; }
529
-    char* getLongestPrint_str(char buffer[21])   { duration_t(print_job_timer.getStats().printTime).toString(buffer);     return buffer; }
526
+    char* getTotalPrints_str(char buffer[21])    { strcpy(buffer,i16tostr3left(print_job_timer.getStats().totalPrints));    return buffer; }
527
+    char* getFinishedPrints_str(char buffer[21]) { strcpy(buffer,i16tostr3left(print_job_timer.getStats().finishedPrints)); return buffer; }
528
+    char* getTotalPrintTime_str(char buffer[21]) { duration_t(print_job_timer.getStats().printTime).toString(buffer);       return buffer; }
529
+    char* getLongestPrint_str(char buffer[21])   { duration_t(print_job_timer.getStats().printTime).toString(buffer);       return buffer; }
530
     char* getFilamentUsed_str(char buffer[21])   {
530
     char* getFilamentUsed_str(char buffer[21])   {
531
       printStatistics stats = print_job_timer.getStats();
531
       printStatistics stats = print_job_timer.getStats();
532
       sprintf_P(buffer, PSTR("%ld.%im"), long(stats.filamentUsed / 1000), int16_t(stats.filamentUsed / 100) % 10);
532
       sprintf_P(buffer, PSTR("%ld.%im"), long(stats.filamentUsed / 1000), int16_t(stats.filamentUsed / 100) % 10);

+ 3
- 1
Marlin/src/lcd/menu/menu.cpp View File

115
  *
115
  *
116
  * The prerequisite is that in the header the type was already declared:
116
  * The prerequisite is that in the header the type was already declared:
117
  *
117
  *
118
- *   DECLARE_MENU_EDIT_TYPE(int16_t, int3, itostr3, 1)
118
+ *   DECLARE_MENU_EDIT_TYPE(int16_t, int3, i16tostr3, 1)
119
  *
119
  *
120
  * For example, DEFINE_MENU_EDIT_ITEM(int3) expands into these functions:
120
  * For example, DEFINE_MENU_EDIT_ITEM(int3) expands into these functions:
121
  *
121
  *
163
 DEFINE_MENU_EDIT_ITEM(int3);
163
 DEFINE_MENU_EDIT_ITEM(int3);
164
 DEFINE_MENU_EDIT_ITEM(int4);
164
 DEFINE_MENU_EDIT_ITEM(int4);
165
 DEFINE_MENU_EDIT_ITEM(int8);
165
 DEFINE_MENU_EDIT_ITEM(int8);
166
+DEFINE_MENU_EDIT_ITEM(uint8);
167
+DEFINE_MENU_EDIT_ITEM(uint16);
166
 DEFINE_MENU_EDIT_ITEM(float3);
168
 DEFINE_MENU_EDIT_ITEM(float3);
167
 DEFINE_MENU_EDIT_ITEM(float52);
169
 DEFINE_MENU_EDIT_ITEM(float52);
168
 DEFINE_MENU_EDIT_ITEM(float43);
170
 DEFINE_MENU_EDIT_ITEM(float43);

+ 9
- 3
Marlin/src/lcd/menu/menu.h View File

43
     static inline char* strfunc(const float value) { return STRFUNC((TYPE) value); } \
43
     static inline char* strfunc(const float value) { return STRFUNC((TYPE) value); } \
44
   };
44
   };
45
 
45
 
46
-DECLARE_MENU_EDIT_TYPE(int16_t,  int3,        itostr3,         1     );
47
-DECLARE_MENU_EDIT_TYPE(int16_t,  int4,        itostr4sign,     1     );
48
-DECLARE_MENU_EDIT_TYPE(uint8_t,  int8,        i8tostr3,        1     );
46
+DECLARE_MENU_EDIT_TYPE(int16_t,  int3,        i16tostr3,       1     );
47
+DECLARE_MENU_EDIT_TYPE(int16_t,  int4,        i16tostr4sign,   1     );
48
+DECLARE_MENU_EDIT_TYPE(int8_t,   int8,        i8tostr3,        1     );
49
+DECLARE_MENU_EDIT_TYPE(uint8_t,  uint8,       ui8tostr3,       1     );
50
+DECLARE_MENU_EDIT_TYPE(uint16_t, uint16,      ui16tostr3,      1     );
49
 DECLARE_MENU_EDIT_TYPE(float,    float3,      ftostr3,         1     );
51
 DECLARE_MENU_EDIT_TYPE(float,    float3,      ftostr3,         1     );
50
 DECLARE_MENU_EDIT_TYPE(float,    float52,     ftostr52,      100     );
52
 DECLARE_MENU_EDIT_TYPE(float,    float52,     ftostr52,      100     );
51
 DECLARE_MENU_EDIT_TYPE(float,    float43,     ftostr43sign, 1000     );
53
 DECLARE_MENU_EDIT_TYPE(float,    float43,     ftostr43sign, 1000     );
102
 DEFINE_DRAW_MENU_ITEM_SETTING_EDIT(int3);
104
 DEFINE_DRAW_MENU_ITEM_SETTING_EDIT(int3);
103
 DEFINE_DRAW_MENU_ITEM_SETTING_EDIT(int4);
105
 DEFINE_DRAW_MENU_ITEM_SETTING_EDIT(int4);
104
 DEFINE_DRAW_MENU_ITEM_SETTING_EDIT(int8);
106
 DEFINE_DRAW_MENU_ITEM_SETTING_EDIT(int8);
107
+DEFINE_DRAW_MENU_ITEM_SETTING_EDIT(uint8);
108
+DEFINE_DRAW_MENU_ITEM_SETTING_EDIT(uint16);
105
 DEFINE_DRAW_MENU_ITEM_SETTING_EDIT(float3);
109
 DEFINE_DRAW_MENU_ITEM_SETTING_EDIT(float3);
106
 DEFINE_DRAW_MENU_ITEM_SETTING_EDIT(float52);
110
 DEFINE_DRAW_MENU_ITEM_SETTING_EDIT(float52);
107
 DEFINE_DRAW_MENU_ITEM_SETTING_EDIT(float43);
111
 DEFINE_DRAW_MENU_ITEM_SETTING_EDIT(float43);
171
 DECLARE_MENU_EDIT_ITEM(int3);
175
 DECLARE_MENU_EDIT_ITEM(int3);
172
 DECLARE_MENU_EDIT_ITEM(int4);
176
 DECLARE_MENU_EDIT_ITEM(int4);
173
 DECLARE_MENU_EDIT_ITEM(int8);
177
 DECLARE_MENU_EDIT_ITEM(int8);
178
+DECLARE_MENU_EDIT_ITEM(uint8);
179
+DECLARE_MENU_EDIT_ITEM(uint16);
174
 DECLARE_MENU_EDIT_ITEM(float3);
180
 DECLARE_MENU_EDIT_ITEM(float3);
175
 DECLARE_MENU_EDIT_ITEM(float52);
181
 DECLARE_MENU_EDIT_ITEM(float52);
176
 DECLARE_MENU_EDIT_ITEM(float43);
182
 DECLARE_MENU_EDIT_ITEM(float43);

+ 3
- 3
Marlin/src/lcd/menu/menu_configuration.cpp View File

169
   void menu_case_light() {
169
   void menu_case_light() {
170
     START_MENU();
170
     START_MENU();
171
     MENU_BACK(MSG_MAIN);
171
     MENU_BACK(MSG_MAIN);
172
-    MENU_ITEM_EDIT_CALLBACK(int8, MSG_CASE_LIGHT_BRIGHTNESS, &case_light_brightness, 0, 255, update_case_light, true);
172
+    MENU_ITEM_EDIT_CALLBACK(uint8, MSG_CASE_LIGHT_BRIGHTNESS, &case_light_brightness, 0, 255, update_case_light, true);
173
     MENU_ITEM_EDIT_CALLBACK(bool, MSG_CASE_LIGHT, (bool*)&case_light_on, update_case_light);
173
     MENU_ITEM_EDIT_CALLBACK(bool, MSG_CASE_LIGHT, (bool*)&case_light_on, update_case_light);
174
     END_MENU();
174
     END_MENU();
175
   }
175
   }
217
     dac_driver_getValues();
217
     dac_driver_getValues();
218
     START_MENU();
218
     START_MENU();
219
     MENU_BACK(MSG_CONTROL);
219
     MENU_BACK(MSG_CONTROL);
220
-    #define EDIT_DAC_PERCENT(N) MENU_ITEM_EDIT_CALLBACK(int8, MSG_##N " " MSG_DAC_PERCENT, &driverPercent[_AXIS(N)], 0, 100, dac_driver_commit)
220
+    #define EDIT_DAC_PERCENT(N) MENU_ITEM_EDIT_CALLBACK(uint8, MSG_##N " " MSG_DAC_PERCENT, &driverPercent[_AXIS(N)], 0, 100, dac_driver_commit)
221
     EDIT_DAC_PERCENT(X);
221
     EDIT_DAC_PERCENT(X);
222
     EDIT_DAC_PERCENT(Y);
222
     EDIT_DAC_PERCENT(Y);
223
     EDIT_DAC_PERCENT(Z);
223
     EDIT_DAC_PERCENT(Z);
274
     #endif
274
     #endif
275
     START_MENU();
275
     START_MENU();
276
     MENU_BACK(MSG_CONFIGURATION);
276
     MENU_BACK(MSG_CONFIGURATION);
277
-    MENU_ITEM_EDIT(int8, MSG_FAN_SPEED, &ui.preheat_fan_speed[material], 0, 255);
277
+    MENU_ITEM_EDIT(uint8, MSG_FAN_SPEED, &ui.preheat_fan_speed[material], 0, 255);
278
     #if HAS_TEMP_HOTEND
278
     #if HAS_TEMP_HOTEND
279
       MENU_ITEM_EDIT(int3, MSG_NOZZLE, &ui.preheat_hotend_temp[material], MINTEMP_ALL, MAXTEMP_ALL - 15);
279
       MENU_ITEM_EDIT(int3, MSG_NOZZLE, &ui.preheat_hotend_temp[material], MINTEMP_ALL, MAXTEMP_ALL - 15);
280
     #endif
280
     #endif

+ 2
- 2
Marlin/src/lcd/menu/menu_info.cpp View File

53
     printStatistics stats = print_job_timer.getStats();
53
     printStatistics stats = print_job_timer.getStats();
54
 
54
 
55
     START_SCREEN();                                                                                // 12345678901234567890
55
     START_SCREEN();                                                                                // 12345678901234567890
56
-    STATIC_ITEM(MSG_INFO_PRINT_COUNT ": ", false, false, itostr3left(stats.totalPrints));          // Print Count: 999
57
-    STATIC_ITEM(MSG_INFO_COMPLETED_PRINTS": ", false, false, itostr3left(stats.finishedPrints));   // Completed  : 666
56
+    STATIC_ITEM(MSG_INFO_PRINT_COUNT ": ", false, false, i16tostr3left(stats.totalPrints));        // Print Count: 999
57
+    STATIC_ITEM(MSG_INFO_COMPLETED_PRINTS": ", false, false, i16tostr3left(stats.finishedPrints)); // Completed  : 666
58
 
58
 
59
     duration_t elapsed = stats.printTime;
59
     duration_t elapsed = stats.printTime;
60
     elapsed.toString(buffer);
60
     elapsed.toString(buffer);

+ 5
- 5
Marlin/src/lcd/menu/menu_led.cpp View File

55
 void menu_led_custom() {
55
 void menu_led_custom() {
56
   START_MENU();
56
   START_MENU();
57
   MENU_BACK(MSG_LED_CONTROL);
57
   MENU_BACK(MSG_LED_CONTROL);
58
-  MENU_ITEM_EDIT_CALLBACK(int8, MSG_INTENSITY_R, &leds.color.r, 0, 255, leds.update, true);
59
-  MENU_ITEM_EDIT_CALLBACK(int8, MSG_INTENSITY_G, &leds.color.g, 0, 255, leds.update, true);
60
-  MENU_ITEM_EDIT_CALLBACK(int8, MSG_INTENSITY_B, &leds.color.b, 0, 255, leds.update, true);
58
+  MENU_ITEM_EDIT_CALLBACK(uint8, MSG_INTENSITY_R, &leds.color.r, 0, 255, leds.update, true);
59
+  MENU_ITEM_EDIT_CALLBACK(uint8, MSG_INTENSITY_G, &leds.color.g, 0, 255, leds.update, true);
60
+  MENU_ITEM_EDIT_CALLBACK(uint8, MSG_INTENSITY_B, &leds.color.b, 0, 255, leds.update, true);
61
   #if ENABLED(RGBW_LED) || ENABLED(NEOPIXEL_LED)
61
   #if ENABLED(RGBW_LED) || ENABLED(NEOPIXEL_LED)
62
-    MENU_ITEM_EDIT_CALLBACK(int8, MSG_INTENSITY_W, &leds.color.w, 0, 255, leds.update, true);
62
+    MENU_ITEM_EDIT_CALLBACK(uint8, MSG_INTENSITY_W, &leds.color.w, 0, 255, leds.update, true);
63
     #if ENABLED(NEOPIXEL_LED)
63
     #if ENABLED(NEOPIXEL_LED)
64
-      MENU_ITEM_EDIT_CALLBACK(int8, MSG_LED_BRIGHTNESS, &leds.color.i, 0, 255, leds.update, true);
64
+      MENU_ITEM_EDIT_CALLBACK(uint8, MSG_LED_BRIGHTNESS, &leds.color.i, 0, 255, leds.update, true);
65
     #endif
65
     #endif
66
   #endif
66
   #endif
67
   END_MENU();
67
   END_MENU();

+ 6
- 6
Marlin/src/lcd/menu/menu_temperature.cpp View File

339
   //
339
   //
340
   #if FAN_COUNT > 0
340
   #if FAN_COUNT > 0
341
     #if HAS_FAN0
341
     #if HAS_FAN0
342
-      MENU_MULTIPLIER_ITEM_EDIT_CALLBACK(int8, MSG_FAN_SPEED FAN_SPEED_1_SUFFIX, &thermalManager.lcd_tmpfan_speed[0], 0, 255, thermalManager.lcd_setFanSpeed0);
342
+      MENU_MULTIPLIER_ITEM_EDIT_CALLBACK(uint8, MSG_FAN_SPEED FAN_SPEED_1_SUFFIX, &thermalManager.lcd_tmpfan_speed[0], 0, 255, thermalManager.lcd_setFanSpeed0);
343
       #if ENABLED(EXTRA_FAN_SPEED)
343
       #if ENABLED(EXTRA_FAN_SPEED)
344
-        MENU_MULTIPLIER_ITEM_EDIT(int8, MSG_EXTRA_FAN_SPEED FAN_SPEED_1_SUFFIX, &thermalManager.new_fan_speed[0], 3, 255);
344
+        MENU_MULTIPLIER_ITEM_EDIT(uint8, MSG_EXTRA_FAN_SPEED FAN_SPEED_1_SUFFIX, &thermalManager.new_fan_speed[0], 3, 255);
345
       #endif
345
       #endif
346
     #endif
346
     #endif
347
     #if HAS_FAN1 || (ENABLED(SINGLENOZZLE) && EXTRUDERS > 1)
347
     #if HAS_FAN1 || (ENABLED(SINGLENOZZLE) && EXTRUDERS > 1)
348
-      MENU_MULTIPLIER_ITEM_EDIT_CALLBACK(int8, MSG_FAN_SPEED " 2", &thermalManager.lcd_tmpfan_speed[1], 0, 255, thermalManager.lcd_setFanSpeed1);
348
+      MENU_MULTIPLIER_ITEM_EDIT_CALLBACK(uint8, MSG_FAN_SPEED " 2", &thermalManager.lcd_tmpfan_speed[1], 0, 255, thermalManager.lcd_setFanSpeed1);
349
       #if ENABLED(EXTRA_FAN_SPEED)
349
       #if ENABLED(EXTRA_FAN_SPEED)
350
-        MENU_MULTIPLIER_ITEM_EDIT(int8, MSG_EXTRA_FAN_SPEED " 2", &thermalManager.new_fan_speed[1], 3, 255);
350
+        MENU_MULTIPLIER_ITEM_EDIT(uint8, MSG_EXTRA_FAN_SPEED " 2", &thermalManager.new_fan_speed[1], 3, 255);
351
       #endif
351
       #endif
352
     #endif
352
     #endif
353
     #if HAS_FAN2 || (ENABLED(SINGLENOZZLE) && EXTRUDERS > 2)
353
     #if HAS_FAN2 || (ENABLED(SINGLENOZZLE) && EXTRUDERS > 2)
354
-      MENU_MULTIPLIER_ITEM_EDIT_CALLBACK(int8, MSG_FAN_SPEED " 3", &thermalManager.lcd_tmpfan_speed[2], 0, 255, thermalManager.lcd_setFanSpeed2);
354
+      MENU_MULTIPLIER_ITEM_EDIT_CALLBACK(uint8, MSG_FAN_SPEED " 3", &thermalManager.lcd_tmpfan_speed[2], 0, 255, thermalManager.lcd_setFanSpeed2);
355
       #if ENABLED(EXTRA_FAN_SPEED)
355
       #if ENABLED(EXTRA_FAN_SPEED)
356
-        MENU_MULTIPLIER_ITEM_EDIT(int8, MSG_EXTRA_FAN_SPEED " 3", &thermalManager.new_fan_speed[2], 3, 255);
356
+        MENU_MULTIPLIER_ITEM_EDIT(uint8, MSG_EXTRA_FAN_SPEED " 3", &thermalManager.new_fan_speed[2], 3, 255);
357
       #endif
357
       #endif
358
     #endif
358
     #endif
359
   #endif // FAN_COUNT > 0
359
   #endif // FAN_COUNT > 0

+ 6
- 6
Marlin/src/lcd/menu/menu_tune.cpp View File

141
   //
141
   //
142
   #if FAN_COUNT > 0
142
   #if FAN_COUNT > 0
143
     #if HAS_FAN0
143
     #if HAS_FAN0
144
-      MENU_MULTIPLIER_ITEM_EDIT_CALLBACK(int8, MSG_FAN_SPEED FAN_SPEED_1_SUFFIX, &thermalManager.lcd_tmpfan_speed[0], 0, 255, thermalManager.lcd_setFanSpeed0);
144
+      MENU_MULTIPLIER_ITEM_EDIT_CALLBACK(uint8, MSG_FAN_SPEED FAN_SPEED_1_SUFFIX, &thermalManager.lcd_tmpfan_speed[0], 0, 255, thermalManager.lcd_setFanSpeed0);
145
       #if ENABLED(EXTRA_FAN_SPEED)
145
       #if ENABLED(EXTRA_FAN_SPEED)
146
-        MENU_MULTIPLIER_ITEM_EDIT(int8, MSG_EXTRA_FAN_SPEED FAN_SPEED_1_SUFFIX, &thermalManager.new_fan_speed[0], 3, 255);
146
+        MENU_MULTIPLIER_ITEM_EDIT(uint8, MSG_EXTRA_FAN_SPEED FAN_SPEED_1_SUFFIX, &thermalManager.new_fan_speed[0], 3, 255);
147
       #endif
147
       #endif
148
     #endif
148
     #endif
149
     #if HAS_FAN1 || (ENABLED(SINGLENOZZLE) && EXTRUDERS > 1)
149
     #if HAS_FAN1 || (ENABLED(SINGLENOZZLE) && EXTRUDERS > 1)
150
-      MENU_MULTIPLIER_ITEM_EDIT_CALLBACK(int8, MSG_FAN_SPEED " 2", &thermalManager.lcd_tmpfan_speed[1], 0, 255, thermalManager.lcd_setFanSpeed1);
150
+      MENU_MULTIPLIER_ITEM_EDIT_CALLBACK(uint8, MSG_FAN_SPEED " 2", &thermalManager.lcd_tmpfan_speed[1], 0, 255, thermalManager.lcd_setFanSpeed1);
151
       #if ENABLED(EXTRA_FAN_SPEED)
151
       #if ENABLED(EXTRA_FAN_SPEED)
152
-        MENU_MULTIPLIER_ITEM_EDIT(int8, MSG_EXTRA_FAN_SPEED " 2", &thermalManager.new_fan_speed[1], 3, 255);
152
+        MENU_MULTIPLIER_ITEM_EDIT(uint8, MSG_EXTRA_FAN_SPEED " 2", &thermalManager.new_fan_speed[1], 3, 255);
153
       #endif
153
       #endif
154
     #endif
154
     #endif
155
     #if HAS_FAN2 || (ENABLED(SINGLENOZZLE) && EXTRUDERS > 2)
155
     #if HAS_FAN2 || (ENABLED(SINGLENOZZLE) && EXTRUDERS > 2)
156
-      MENU_MULTIPLIER_ITEM_EDIT_CALLBACK(int8, MSG_FAN_SPEED " 3", &thermalManager.lcd_tmpfan_speed[2], 0, 255, thermalManager.lcd_setFanSpeed2);
156
+      MENU_MULTIPLIER_ITEM_EDIT_CALLBACK(uint8, MSG_FAN_SPEED " 3", &thermalManager.lcd_tmpfan_speed[2], 0, 255, thermalManager.lcd_setFanSpeed2);
157
       #if ENABLED(EXTRA_FAN_SPEED)
157
       #if ENABLED(EXTRA_FAN_SPEED)
158
-        MENU_MULTIPLIER_ITEM_EDIT(int8, MSG_EXTRA_FAN_SPEED " 3", &thermalManager.new_fan_speed[2], 3, 255);
158
+        MENU_MULTIPLIER_ITEM_EDIT(uint8, MSG_EXTRA_FAN_SPEED " 3", &thermalManager.new_fan_speed[2], 3, 255);
159
       #endif
159
       #endif
160
     #endif
160
     #endif
161
   #endif // FAN_COUNT > 0
161
   #endif // FAN_COUNT > 0

Loading…
Cancel
Save