Allow ExtUI to use LCD_SET_PROGRESS_MANUALLY (#12628)
This commit is contained in:
parent
9a4a463ec4
commit
902d5b0f8b
6 changed files with 20 additions and 20 deletions
|
@ -336,7 +336,7 @@ void GcodeSuite::process_parsed_command(
|
||||||
case 49: M49(); break; // M49: Turn on or off G26 debug flag for verbose output
|
case 49: M49(); break; // M49: Turn on or off G26 debug flag for verbose output
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if ENABLED(ULTRA_LCD) && ENABLED(LCD_SET_PROGRESS_MANUALLY)
|
#if ENABLED(LCD_SET_PROGRESS_MANUALLY) && (ENABLED(ULTRA_LCD) || ENABLED(EXTENSIBLE_UI))
|
||||||
case 73: M73(); break; // M73: Set progress percentage (for display on LCD)
|
case 73: M73(); break; // M73: Set progress percentage (for display on LCD)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
|
@ -488,7 +488,7 @@ private:
|
||||||
static void M49();
|
static void M49();
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if ENABLED(ULTRA_LCD) && ENABLED(LCD_SET_PROGRESS_MANUALLY)
|
#if ENABLED(LCD_SET_PROGRESS_MANUALLY) && (ENABLED(ULTRA_LCD) || ENABLED(EXTENSIBLE_UI))
|
||||||
static void M73();
|
static void M73();
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
|
@ -22,7 +22,7 @@
|
||||||
|
|
||||||
#include "../../inc/MarlinConfig.h"
|
#include "../../inc/MarlinConfig.h"
|
||||||
|
|
||||||
#if ENABLED(ULTRA_LCD) && ENABLED(LCD_SET_PROGRESS_MANUALLY)
|
#if ENABLED(LCD_SET_PROGRESS_MANUALLY) && (ENABLED(EXTENSIBLE_UI) || ENABLED(ULTRA_LCD))
|
||||||
|
|
||||||
#include "../gcode.h"
|
#include "../gcode.h"
|
||||||
#include "../../lcd/ultralcd.h"
|
#include "../../lcd/ultralcd.h"
|
||||||
|
@ -42,4 +42,4 @@ void GcodeSuite::M73() {
|
||||||
ui.set_progress(parser.value_byte());
|
ui.set_progress(parser.value_byte());
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif // ULTRA_LCD && LCD_SET_PROGRESS_MANUALLY
|
#endif // LCD_SET_PROGRESS_MANUALLY && (ENABLED(EXTENSIBLE_UI) || ENABLED(ULTRA_LCD))
|
||||||
|
|
|
@ -500,8 +500,8 @@ static_assert(X_MAX_LENGTH >= X_BED_SIZE && Y_MAX_LENGTH >= Y_BED_SIZE,
|
||||||
#elif PROGRESS_MSG_EXPIRE < 0
|
#elif PROGRESS_MSG_EXPIRE < 0
|
||||||
#error "PROGRESS_MSG_EXPIRE must be greater than or equal to 0."
|
#error "PROGRESS_MSG_EXPIRE must be greater than or equal to 0."
|
||||||
#endif
|
#endif
|
||||||
#elif ENABLED(LCD_SET_PROGRESS_MANUALLY) && !HAS_GRAPHICAL_LCD
|
#elif ENABLED(LCD_SET_PROGRESS_MANUALLY) && !HAS_GRAPHICAL_LCD && DISABLED(EXTENSIBLE_UI)
|
||||||
#error "LCD_SET_PROGRESS_MANUALLY requires LCD_PROGRESS_BAR or Graphical LCD."
|
#error "LCD_SET_PROGRESS_MANUALLY requires LCD_PROGRESS_BAR, Graphical LCD, or EXTENSIBLE_UI."
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -52,6 +52,10 @@
|
||||||
char MarlinUI::status_message[MAX_MESSAGE_LENGTH + 1];
|
char MarlinUI::status_message[MAX_MESSAGE_LENGTH + 1];
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#if ENABLED(LCD_SET_PROGRESS_MANUALLY)
|
||||||
|
uint8_t MarlinUI::progress_bar_percent; // = 0
|
||||||
|
#endif
|
||||||
|
|
||||||
#if HAS_SPI_LCD
|
#if HAS_SPI_LCD
|
||||||
|
|
||||||
#if HAS_GRAPHICAL_LCD
|
#if HAS_GRAPHICAL_LCD
|
||||||
|
@ -102,10 +106,6 @@ uint8_t MarlinUI::lcd_status_update_delay = 1; // First update one loop delayed
|
||||||
millis_t MarlinUI::next_filament_display; // = 0
|
millis_t MarlinUI::next_filament_display; // = 0
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if ENABLED(LCD_SET_PROGRESS_MANUALLY)
|
|
||||||
uint8_t MarlinUI::progress_bar_percent; // = 0
|
|
||||||
#endif
|
|
||||||
|
|
||||||
millis_t next_button_update_ms;
|
millis_t next_button_update_ms;
|
||||||
|
|
||||||
#if HAS_GRAPHICAL_LCD
|
#if HAS_GRAPHICAL_LCD
|
||||||
|
|
|
@ -271,6 +271,16 @@ public:
|
||||||
static uint8_t status_message_level; // Higher levels block lower levels
|
static uint8_t status_message_level; // Higher levels block lower levels
|
||||||
static inline void reset_alert_level() { status_message_level = 0; }
|
static inline void reset_alert_level() { status_message_level = 0; }
|
||||||
|
|
||||||
|
#if HAS_PRINT_PROGRESS
|
||||||
|
#if ENABLED(LCD_SET_PROGRESS_MANUALLY)
|
||||||
|
static uint8_t progress_bar_percent;
|
||||||
|
static void set_progress(const uint8_t progress) { progress_bar_percent = MIN(progress, 100); }
|
||||||
|
#endif
|
||||||
|
static uint8_t get_progress();
|
||||||
|
#else
|
||||||
|
static constexpr uint8_t get_progress() { return 0; }
|
||||||
|
#endif
|
||||||
|
|
||||||
#if HAS_SPI_LCD
|
#if HAS_SPI_LCD
|
||||||
|
|
||||||
static bool detected();
|
static bool detected();
|
||||||
|
@ -312,16 +322,6 @@ public:
|
||||||
#endif
|
#endif
|
||||||
static uint8_t lcd_status_update_delay;
|
static uint8_t lcd_status_update_delay;
|
||||||
|
|
||||||
#if HAS_PRINT_PROGRESS
|
|
||||||
#if ENABLED(LCD_SET_PROGRESS_MANUALLY)
|
|
||||||
static uint8_t progress_bar_percent;
|
|
||||||
static void set_progress(const uint8_t progress) { progress_bar_percent = MIN(progress, 100); }
|
|
||||||
#endif
|
|
||||||
static uint8_t get_progress();
|
|
||||||
#else
|
|
||||||
static constexpr uint8_t get_progress() { return 0; }
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#if HAS_LCD_CONTRAST
|
#if HAS_LCD_CONTRAST
|
||||||
static int16_t contrast;
|
static int16_t contrast;
|
||||||
static void set_contrast(const int16_t value);
|
static void set_contrast(const int16_t value);
|
||||||
|
|
Reference in a new issue