Преглед на файлове

Add status_printf to print messages to the lcd status line.

Also add a hotend indicator to the heating message displayed on the lcd status line.
dot-bob преди 8 години
родител
ревизия
cd68380ce6
променени са 3 файла, в които са добавени 14 реда и са изтрити 2 реда
  1. 2
    2
      Marlin/Marlin_main.cpp
  2. 10
    0
      Marlin/ultralcd.cpp
  3. 2
    0
      Marlin/ultralcd.h

+ 2
- 2
Marlin/Marlin_main.cpp Целия файл

@@ -5308,7 +5308,7 @@ inline void gcode_M104() {
5308 5308
       }
5309 5309
     #endif
5310 5310
 
5311
-    if (code_value_temp_abs() > thermalManager.degHotend(target_extruder)) LCD_MESSAGEPGM(MSG_HEATING);
5311
+    if (code_value_temp_abs() > thermalManager.degHotend(target_extruder)) status_printf(0, "E%i %s", target_extruder + 1, MSG_HEATING);
5312 5312
   }
5313 5313
 
5314 5314
   #if ENABLED(AUTOTEMP)
@@ -5506,7 +5506,7 @@ inline void gcode_M109() {
5506 5506
       else print_job_timer.start();
5507 5507
     #endif
5508 5508
 
5509
-    if (thermalManager.isHeatingHotend(target_extruder)) LCD_MESSAGEPGM(MSG_HEATING);
5509
+    if (thermalManager.isHeatingHotend(target_extruder)) status_printf(0, "E%i %s", target_extruder + 1, MSG_HEATING);
5510 5510
   }
5511 5511
 
5512 5512
   #if ENABLED(AUTOTEMP)

+ 10
- 0
Marlin/ultralcd.cpp Целия файл

@@ -3272,6 +3272,16 @@ void lcd_setstatuspgm(const char* const message, uint8_t level) {
3272 3272
   lcd_finishstatus(level > 0);
3273 3273
 }
3274 3274
 
3275
+void status_printf(uint8_t level, const char *status, ...) {
3276
+  if (level < lcd_status_message_level) return;
3277
+  lcd_status_message_level = level;
3278
+  va_list args;
3279
+  va_start(args, status);
3280
+  vsnprintf(lcd_status_message, 3 * (LCD_WIDTH), status, args);
3281
+  va_end(args);
3282
+  lcd_finishstatus(level > 0);
3283
+}
3284
+
3275 3285
 void lcd_setalertstatuspgm(const char* const message) {
3276 3286
   lcd_setstatuspgm(message, 1);
3277 3287
   #if ENABLED(ULTIPANEL)

+ 2
- 0
Marlin/ultralcd.h Целия файл

@@ -39,6 +39,7 @@
39 39
   bool lcd_hasstatus();
40 40
   void lcd_setstatus(const char* message, const bool persist=false);
41 41
   void lcd_setstatuspgm(const char* message, const uint8_t level=0);
42
+  void status_printf(uint8_t level, const char *Status, ...);
42 43
   void lcd_setalertstatuspgm(const char* message);
43 44
   void lcd_reset_alert_level();
44 45
   void lcd_kill_screen();
@@ -153,6 +154,7 @@
153 154
   inline bool lcd_hasstatus() { return false; }
154 155
   inline void lcd_setstatus(const char* const message, const bool persist=false) { UNUSED(message); UNUSED(persist); }
155 156
   inline void lcd_setstatuspgm(const char* const message, const uint8_t level=0) { UNUSED(message); UNUSED(level); }
157
+  inline void status_printf(uint8_t level, const char *status, ...) { UNUSED(level); UNUSED(status); }
156 158
   inline void lcd_buttons_update() {}
157 159
   inline void lcd_reset_alert_level() {}
158 160
   inline bool lcd_detected() { return true; }

Loading…
Отказ
Запис