Browse Source

G4 shows status message only if no message is set already

- Address issue raised in #1961
pull/1/head
Scott Lahteine 10 years ago
parent
commit
ce142afdda
  1. 5
      Marlin/Marlin_main.cpp
  2. 2
      Marlin/ultralcd.cpp
  3. 1
      Marlin/ultralcd.h

5
Marlin/Marlin_main.cpp

@ -1740,14 +1740,15 @@ inline void gcode_G2_G3(bool clockwise) {
inline void gcode_G4() { inline void gcode_G4() {
millis_t codenum = 0; millis_t codenum = 0;
LCD_MESSAGEPGM(MSG_DWELL);
if (code_seen('P')) codenum = code_value_long(); // milliseconds to wait if (code_seen('P')) codenum = code_value_long(); // milliseconds to wait
if (code_seen('S')) codenum = code_value_long() * 1000; // seconds to wait if (code_seen('S')) codenum = code_value_long() * 1000; // seconds to wait
st_synchronize(); st_synchronize();
refresh_cmd_timeout(); refresh_cmd_timeout();
codenum += previous_cmd_ms; // keep track of when we started waiting codenum += previous_cmd_ms; // keep track of when we started waiting
if (!lcd_hasstatus()) LCD_MESSAGEPGM(MSG_DWELL);
while (millis() < codenum) { while (millis() < codenum) {
manage_heater(); manage_heater();
manage_inactivity(); manage_inactivity();

2
Marlin/ultralcd.cpp

@ -1418,6 +1418,8 @@ void set_utf_strlen(char *s, uint8_t n) {
s[i] = 0; s[i] = 0;
} }
bool lcd_hasstatus() { return (lcd_status_message[0] != '\0'); }
void lcd_setstatus(const char* message, bool persist) { void lcd_setstatus(const char* message, bool persist) {
if (lcd_status_message_level > 0) return; if (lcd_status_message_level > 0) return;
strncpy(lcd_status_message, message, 3*LCD_WIDTH); strncpy(lcd_status_message, message, 3*LCD_WIDTH);

1
Marlin/ultralcd.h

@ -8,6 +8,7 @@
int lcd_strlen_P(const char *s); int lcd_strlen_P(const char *s);
void lcd_update(); void lcd_update();
void lcd_init(); void lcd_init();
bool lcd_hasstatus();
void lcd_setstatus(const char* message, const bool persist=false); void lcd_setstatus(const char* message, const bool persist=false);
void lcd_setstatuspgm(const char* message, const uint8_t level=0); void lcd_setstatuspgm(const char* message, const uint8_t level=0);
void lcd_setalertstatuspgm(const char* message); void lcd_setalertstatuspgm(const char* message);

Loading…
Cancel
Save