Add LCD_SET_PROGRESS_MANUALLY

2.0.x
Scott Lahteine 7 years ago
parent 014a83fe09
commit 5c4f3e0107

@ -549,6 +549,9 @@
//#define LCD_PROGRESS_BAR_TEST //#define LCD_PROGRESS_BAR_TEST
#endif #endif
// Add an 'M73' G-code to set the current percentage
//#define LCD_SET_PROGRESS_MANUALLY
// This allows hosts to request long names for files and folders with M33 // This allows hosts to request long names for files and folders with M33
//#define LONG_FILENAME_HOST_SUPPORT //#define LONG_FILENAME_HOST_SUPPORT

@ -549,6 +549,9 @@
//#define LCD_PROGRESS_BAR_TEST //#define LCD_PROGRESS_BAR_TEST
#endif #endif
// Add an 'M73' G-code to set the current percentage
//#define LCD_SET_PROGRESS_MANUALLY
// This allows hosts to request long names for files and folders with M33 // This allows hosts to request long names for files and folders with M33
//#define LONG_FILENAME_HOST_SUPPORT //#define LONG_FILENAME_HOST_SUPPORT

@ -549,6 +549,9 @@
//#define LCD_PROGRESS_BAR_TEST //#define LCD_PROGRESS_BAR_TEST
#endif #endif
// Add an 'M73' G-code to set the current percentage
//#define LCD_SET_PROGRESS_MANUALLY
// This allows hosts to request long names for files and folders with M33 // This allows hosts to request long names for files and folders with M33
//#define LONG_FILENAME_HOST_SUPPORT //#define LONG_FILENAME_HOST_SUPPORT

@ -549,6 +549,9 @@
//#define LCD_PROGRESS_BAR_TEST //#define LCD_PROGRESS_BAR_TEST
#endif #endif
// Add an 'M73' G-code to set the current percentage
//#define LCD_SET_PROGRESS_MANUALLY
// This allows hosts to request long names for files and folders with M33 // This allows hosts to request long names for files and folders with M33
//#define LONG_FILENAME_HOST_SUPPORT //#define LONG_FILENAME_HOST_SUPPORT

@ -549,6 +549,9 @@
//#define LCD_PROGRESS_BAR_TEST //#define LCD_PROGRESS_BAR_TEST
#endif #endif
// Add an 'M73' G-code to set the current percentage
//#define LCD_SET_PROGRESS_MANUALLY
// This allows hosts to request long names for files and folders with M33 // This allows hosts to request long names for files and folders with M33
//#define LONG_FILENAME_HOST_SUPPORT //#define LONG_FILENAME_HOST_SUPPORT

@ -549,6 +549,9 @@
//#define LCD_PROGRESS_BAR_TEST //#define LCD_PROGRESS_BAR_TEST
#endif #endif
// Add an 'M73' G-code to set the current percentage
//#define LCD_SET_PROGRESS_MANUALLY
// This allows hosts to request long names for files and folders with M33 // This allows hosts to request long names for files and folders with M33
//#define LONG_FILENAME_HOST_SUPPORT //#define LONG_FILENAME_HOST_SUPPORT

@ -549,6 +549,9 @@
//#define LCD_PROGRESS_BAR_TEST //#define LCD_PROGRESS_BAR_TEST
#endif #endif
// Add an 'M73' G-code to set the current percentage
//#define LCD_SET_PROGRESS_MANUALLY
// This allows hosts to request long names for files and folders with M33 // This allows hosts to request long names for files and folders with M33
//#define LONG_FILENAME_HOST_SUPPORT //#define LONG_FILENAME_HOST_SUPPORT

@ -549,6 +549,9 @@
//#define LCD_PROGRESS_BAR_TEST //#define LCD_PROGRESS_BAR_TEST
#endif #endif
// Add an 'M73' G-code to set the current percentage
//#define LCD_SET_PROGRESS_MANUALLY
// This allows hosts to request long names for files and folders with M33 // This allows hosts to request long names for files and folders with M33
//#define LONG_FILENAME_HOST_SUPPORT //#define LONG_FILENAME_HOST_SUPPORT

@ -549,6 +549,9 @@
//#define LCD_PROGRESS_BAR_TEST //#define LCD_PROGRESS_BAR_TEST
#endif #endif
// Add an 'M73' G-code to set the current percentage
//#define LCD_SET_PROGRESS_MANUALLY
// This allows hosts to request long names for files and folders with M33 // This allows hosts to request long names for files and folders with M33
//#define LONG_FILENAME_HOST_SUPPORT //#define LONG_FILENAME_HOST_SUPPORT

@ -549,6 +549,9 @@
//#define LCD_PROGRESS_BAR_TEST //#define LCD_PROGRESS_BAR_TEST
#endif #endif
// Add an 'M73' G-code to set the current percentage
//#define LCD_SET_PROGRESS_MANUALLY
// This allows hosts to request long names for files and folders with M33 // This allows hosts to request long names for files and folders with M33
//#define LONG_FILENAME_HOST_SUPPORT //#define LONG_FILENAME_HOST_SUPPORT

@ -549,6 +549,9 @@
//#define LCD_PROGRESS_BAR_TEST //#define LCD_PROGRESS_BAR_TEST
#endif #endif
// Add an 'M73' G-code to set the current percentage
//#define LCD_SET_PROGRESS_MANUALLY
// This allows hosts to request long names for files and folders with M33 // This allows hosts to request long names for files and folders with M33
//#define LONG_FILENAME_HOST_SUPPORT //#define LONG_FILENAME_HOST_SUPPORT

@ -549,6 +549,9 @@
//#define LCD_PROGRESS_BAR_TEST //#define LCD_PROGRESS_BAR_TEST
#endif #endif
// Add an 'M73' G-code to set the current percentage
//#define LCD_SET_PROGRESS_MANUALLY
// This allows hosts to request long names for files and folders with M33 // This allows hosts to request long names for files and folders with M33
//#define LONG_FILENAME_HOST_SUPPORT //#define LONG_FILENAME_HOST_SUPPORT

@ -549,6 +549,9 @@
//#define LCD_PROGRESS_BAR_TEST //#define LCD_PROGRESS_BAR_TEST
#endif #endif
// Add an 'M73' G-code to set the current percentage
//#define LCD_SET_PROGRESS_MANUALLY
// This allows hosts to request long names for files and folders with M33 // This allows hosts to request long names for files and folders with M33
//#define LONG_FILENAME_HOST_SUPPORT //#define LONG_FILENAME_HOST_SUPPORT

@ -549,6 +549,9 @@
//#define LCD_PROGRESS_BAR_TEST //#define LCD_PROGRESS_BAR_TEST
#endif #endif
// Add an 'M73' G-code to set the current percentage
//#define LCD_SET_PROGRESS_MANUALLY
// This allows hosts to request long names for files and folders with M33 // This allows hosts to request long names for files and folders with M33
//#define LONG_FILENAME_HOST_SUPPORT //#define LONG_FILENAME_HOST_SUPPORT

@ -549,6 +549,9 @@
//#define LCD_PROGRESS_BAR_TEST //#define LCD_PROGRESS_BAR_TEST
#endif #endif
// Add an 'M73' G-code to set the current percentage
//#define LCD_SET_PROGRESS_MANUALLY
// This allows hosts to request long names for files and folders with M33 // This allows hosts to request long names for files and folders with M33
//#define LONG_FILENAME_HOST_SUPPORT //#define LONG_FILENAME_HOST_SUPPORT

@ -538,6 +538,9 @@
//#define LCD_PROGRESS_BAR_TEST //#define LCD_PROGRESS_BAR_TEST
#endif #endif
// Add an 'M73' G-code to set the current percentage
//#define LCD_SET_PROGRESS_MANUALLY
// This allows hosts to request long names for files and folders with M33 // This allows hosts to request long names for files and folders with M33
//#define LONG_FILENAME_HOST_SUPPORT //#define LONG_FILENAME_HOST_SUPPORT

@ -549,6 +549,9 @@
//#define LCD_PROGRESS_BAR_TEST //#define LCD_PROGRESS_BAR_TEST
#endif #endif
// Add an 'M73' G-code to set the current percentage
//#define LCD_SET_PROGRESS_MANUALLY
// This allows hosts to request long names for files and folders with M33 // This allows hosts to request long names for files and folders with M33
//#define LONG_FILENAME_HOST_SUPPORT //#define LONG_FILENAME_HOST_SUPPORT

@ -549,6 +549,9 @@
//#define LCD_PROGRESS_BAR_TEST //#define LCD_PROGRESS_BAR_TEST
#endif #endif
// Add an 'M73' G-code to set the current percentage
//#define LCD_SET_PROGRESS_MANUALLY
// This allows hosts to request long names for files and folders with M33 // This allows hosts to request long names for files and folders with M33
//#define LONG_FILENAME_HOST_SUPPORT //#define LONG_FILENAME_HOST_SUPPORT

@ -551,6 +551,9 @@
//#define LCD_PROGRESS_BAR_TEST //#define LCD_PROGRESS_BAR_TEST
#endif #endif
// Add an 'M73' G-code to set the current percentage
//#define LCD_SET_PROGRESS_MANUALLY
// This allows hosts to request long names for files and folders with M33 // This allows hosts to request long names for files and folders with M33
//#define LONG_FILENAME_HOST_SUPPORT //#define LONG_FILENAME_HOST_SUPPORT

@ -551,6 +551,9 @@
//#define LCD_PROGRESS_BAR_TEST //#define LCD_PROGRESS_BAR_TEST
#endif #endif
// Add an 'M73' G-code to set the current percentage
//#define LCD_SET_PROGRESS_MANUALLY
// This allows hosts to request long names for files and folders with M33 // This allows hosts to request long names for files and folders with M33
//#define LONG_FILENAME_HOST_SUPPORT //#define LONG_FILENAME_HOST_SUPPORT

@ -551,6 +551,9 @@
//#define LCD_PROGRESS_BAR_TEST //#define LCD_PROGRESS_BAR_TEST
#endif #endif
// Add an 'M73' G-code to set the current percentage
//#define LCD_SET_PROGRESS_MANUALLY
// This allows hosts to request long names for files and folders with M33 // This allows hosts to request long names for files and folders with M33
//#define LONG_FILENAME_HOST_SUPPORT //#define LONG_FILENAME_HOST_SUPPORT

@ -551,6 +551,9 @@
//#define LCD_PROGRESS_BAR_TEST //#define LCD_PROGRESS_BAR_TEST
#endif #endif
// Add an 'M73' G-code to set the current percentage
//#define LCD_SET_PROGRESS_MANUALLY
// This allows hosts to request long names for files and folders with M33 // This allows hosts to request long names for files and folders with M33
//#define LONG_FILENAME_HOST_SUPPORT //#define LONG_FILENAME_HOST_SUPPORT

@ -556,6 +556,9 @@
//#define LCD_PROGRESS_BAR_TEST //#define LCD_PROGRESS_BAR_TEST
#endif #endif
// Add an 'M73' G-code to set the current percentage
//#define LCD_SET_PROGRESS_MANUALLY
// This allows hosts to request long names for files and folders with M33 // This allows hosts to request long names for files and folders with M33
//#define LONG_FILENAME_HOST_SUPPORT //#define LONG_FILENAME_HOST_SUPPORT

@ -551,6 +551,9 @@
//#define LCD_PROGRESS_BAR_TEST //#define LCD_PROGRESS_BAR_TEST
#endif #endif
// Add an 'M73' G-code to set the current percentage
//#define LCD_SET_PROGRESS_MANUALLY
// This allows hosts to request long names for files and folders with M33 // This allows hosts to request long names for files and folders with M33
//#define LONG_FILENAME_HOST_SUPPORT //#define LONG_FILENAME_HOST_SUPPORT

@ -549,6 +549,9 @@
//#define LCD_PROGRESS_BAR_TEST //#define LCD_PROGRESS_BAR_TEST
#endif #endif
// Add an 'M73' G-code to set the current percentage
//#define LCD_SET_PROGRESS_MANUALLY
// This allows hosts to request long names for files and folders with M33 // This allows hosts to request long names for files and folders with M33
//#define LONG_FILENAME_HOST_SUPPORT //#define LONG_FILENAME_HOST_SUPPORT

@ -549,6 +549,9 @@
//#define LCD_PROGRESS_BAR_TEST //#define LCD_PROGRESS_BAR_TEST
#endif #endif
// Add an 'M73' G-code to set the current percentage
//#define LCD_SET_PROGRESS_MANUALLY
// This allows hosts to request long names for files and folders with M33 // This allows hosts to request long names for files and folders with M33
//#define LONG_FILENAME_HOST_SUPPORT //#define LONG_FILENAME_HOST_SUPPORT

@ -549,6 +549,9 @@
//#define LCD_PROGRESS_BAR_TEST //#define LCD_PROGRESS_BAR_TEST
#endif #endif
// Add an 'M73' G-code to set the current percentage
//#define LCD_SET_PROGRESS_MANUALLY
// This allows hosts to request long names for files and folders with M33 // This allows hosts to request long names for files and folders with M33
//#define LONG_FILENAME_HOST_SUPPORT //#define LONG_FILENAME_HOST_SUPPORT

@ -549,6 +549,9 @@
//#define LCD_PROGRESS_BAR_TEST //#define LCD_PROGRESS_BAR_TEST
#endif #endif
// Add an 'M73' G-code to set the current percentage
//#define LCD_SET_PROGRESS_MANUALLY
// This allows hosts to request long names for files and folders with M33 // This allows hosts to request long names for files and folders with M33
//#define LONG_FILENAME_HOST_SUPPORT //#define LONG_FILENAME_HOST_SUPPORT

@ -354,6 +354,10 @@ void GcodeSuite::process_next_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)
case 73: M73(); break; // M73: Set progress percentage (for display on LCD)
#endif
case 75: M75(); break; // M75: Start print timer case 75: M75(); break; // M75: Start print timer
case 76: M76(); break; // M76: Pause print timer case 76: M76(); break; // M76: Pause print timer
case 77: M77(); break; // M77: Stop print timer case 77: M77(); break; // M77: Stop print timer

@ -437,6 +437,10 @@ private:
static void M49(); static void M49();
#endif #endif
#if ENABLED(ULTRA_LCD) && ENABLED(LCD_SET_PROGRESS_MANUALLY)
static void M73();
#endif
static void M75(); static void M75();
static void M76(); static void M76();
static void M77(); static void M77();

@ -72,6 +72,13 @@ void GcodeSuite::M115() {
SERIAL_PROTOCOLLNPGM("Cap:LEVELING_DATA:0"); SERIAL_PROTOCOLLNPGM("Cap:LEVELING_DATA:0");
#endif #endif
// BUILD_PERCENT (M73)
#if ENABLED(LCD_SET_PROGRESS_MANUALLY)
SERIAL_PROTOCOLLNPGM("Cap:BUILD_PERCENT:1");
#else
SERIAL_PROTOCOLLNPGM("Cap:BUILD_PERCENT:0");
#endif
// SOFTWARE_POWER (M80, M81) // SOFTWARE_POWER (M80, M81)
#if HAS_POWER_SWITCH #if HAS_POWER_SWITCH
SERIAL_PROTOCOLLNPGM("Cap:SOFTWARE_POWER:1"); SERIAL_PROTOCOLLNPGM("Cap:SOFTWARE_POWER:1");

@ -0,0 +1,48 @@
/**
* Marlin 3D Printer Firmware
* Copyright (C) 2016 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
*
* Based on Sprinter and grbl.
* Copyright (C) 2011 Camiel Gubbels / Erik van der Zalm
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/
#include "../../inc/MarlinConfig.h"
#if ENABLED(ULTRA_LCD) && ENABLED(LCD_SET_PROGRESS_MANUALLY)
#include "../gcode.h"
#include "../../module/parser.h"
#include "../../lcd/ultralcd.h"
#include "../../sd/cardreader.h"
/**
* M73: Set percentage complete (for display on LCD)
*
* Example:
* M73 P25 ; Set progress to 25%
*
* Notes:
* This has no effect during an SD print job
*/
void GcodeSuite::M73() {
if (!IS_SD_PRINTING && parser.seen('P')) {
progress_bar_percent = parser.value_byte();
NOMORE(progress_bar_percent, 100);
}
}
#endif // ULTRA_LCD && LCD_SET_PROGRESS_MANUALLY

@ -83,6 +83,10 @@ char lcd_status_message[3 * (LCD_WIDTH) + 1] = WELCOME_MSG; // worst case is kan
uint8_t status_scroll_pos = 0; uint8_t status_scroll_pos = 0;
#endif #endif
#if ENABLED(LCD_SET_PROGRESS_MANUALLY)
uint8_t progress_bar_percent;
#endif
#if ENABLED(DOGLCD) #if ENABLED(DOGLCD)
#include "ultralcd_impl_DOGM.h" #include "ultralcd_impl_DOGM.h"
#include <U8glib.h> #include <U8glib.h>
@ -604,36 +608,52 @@ void lcd_status_screen() {
#endif #endif
#if ENABLED(LCD_PROGRESS_BAR) #if ENABLED(LCD_PROGRESS_BAR)
//
// HD44780 implements the following message blinking and
// message expiration because Status Line and Progress Bar
// share the same line on the display.
//
// Set current percentage from SD when actively printing
#if ENABLED(LCD_SET_PROGRESS_MANUALLY)
if (IS_SD_PRINTING)
progress_bar_percent = card.percentDone();
#endif
millis_t ms = millis(); millis_t ms = millis();
// If the message will blink rather than expire...
#if DISABLED(PROGRESS_MSG_ONCE) #if DISABLED(PROGRESS_MSG_ONCE)
if (ELAPSED(ms, progress_bar_ms + PROGRESS_BAR_MSG_TIME + PROGRESS_BAR_BAR_TIME)) { if (ELAPSED(ms, progress_bar_ms + PROGRESS_BAR_MSG_TIME + PROGRESS_BAR_BAR_TIME))
progress_bar_ms = ms; progress_bar_ms = ms;
}
#endif #endif
#if PROGRESS_MSG_EXPIRE > 0 #if PROGRESS_MSG_EXPIRE > 0
// Handle message expire // Handle message expire
if (expire_status_ms > 0) { if (expire_status_ms > 0) {
#if ENABLED(SDSUPPORT)
if (card.isFileOpen()) { #if DISABLED(LCD_SET_PROGRESS_MANUALLY)
// Expire the message when printing is active const uint8_t progress_bar_percent = card.percentDone();
if (IS_SD_PRINTING) { #endif
// Expire the message if a job is active and the bar has ticks
if (progress_bar_percent > 2 && !print_job_timer.isPaused()) {
if (ELAPSED(ms, expire_status_ms)) { if (ELAPSED(ms, expire_status_ms)) {
lcd_status_message[0] = '\0'; lcd_status_message[0] = '\0';
expire_status_ms = 0; expire_status_ms = 0;
} }
} }
else { else {
// Defer message expiration before bar appears
// and during any pause (not just SD)
expire_status_ms += LCD_UPDATE_INTERVAL; expire_status_ms += LCD_UPDATE_INTERVAL;
} }
} }
else {
expire_status_ms = 0; #endif // PROGRESS_MSG_EXPIRE
}
#else
expire_status_ms = 0;
#endif // SDSUPPORT
}
#endif
#endif // LCD_PROGRESS_BAR #endif // LCD_PROGRESS_BAR
#if ENABLED(ULTIPANEL) #if ENABLED(ULTIPANEL)
@ -2860,7 +2880,7 @@ void kill_screen(const char* lcd_msg) {
#if ENABLED(MAX_SOFTWARE_ENDSTOP_Z) #if ENABLED(MAX_SOFTWARE_ENDSTOP_Z)
max = soft_endstop_max[Z_AXIS]; max = soft_endstop_max[Z_AXIS];
#endif #endif
break; default: break;
} }
#endif // MIN_SOFTWARE_ENDSTOPS || MAX_SOFTWARE_ENDSTOPS #endif // MIN_SOFTWARE_ENDSTOPS || MAX_SOFTWARE_ENDSTOPS

@ -63,6 +63,10 @@
void dontExpireStatus(); void dontExpireStatus();
#endif #endif
#if ENABLED(LCD_SET_PROGRESS_MANUALLY)
extern uint8_t progress_bar_percent;
#endif
#if ENABLED(ADC_KEYPAD) #if ENABLED(ADC_KEYPAD)
uint8_t get_ADC_keyValue(); uint8_t get_ADC_keyValue();
#endif #endif

@ -536,7 +536,7 @@ static void lcd_implementation_status_screen() {
// SD Card Symbol // SD Card Symbol
// //
if (PAGE_CONTAINS(42 - (TALL_FONT_CORRECTION), 51 - (TALL_FONT_CORRECTION))) { if (card.isFileOpen() && PAGE_CONTAINS(42 - (TALL_FONT_CORRECTION), 51 - (TALL_FONT_CORRECTION))) {
// Upper box // Upper box
u8g.drawBox(42, 42 - (TALL_FONT_CORRECTION), 8, 7); // 42-48 (or 41-47) u8g.drawBox(42, 42 - (TALL_FONT_CORRECTION), 8, 7); // 42-48 (or 41-47)
// Right edge // Right edge
@ -560,7 +560,11 @@ static void lcd_implementation_status_screen() {
PROGRESS_BAR_WIDTH, 4 - (TALL_FONT_CORRECTION) PROGRESS_BAR_WIDTH, 4 - (TALL_FONT_CORRECTION)
); );
if (IS_SD_PRINTING) { #if DISABLED(LCD_SET_PROGRESS_MANUALLY)
const uint8_t progress_bar_percent = card.percentDone();
#endif
if (progress_bar_percent > 1) {
// //
// Progress bar solid part // Progress bar solid part
@ -569,7 +573,7 @@ static void lcd_implementation_status_screen() {
if (PAGE_CONTAINS(50, 51 - (TALL_FONT_CORRECTION))) // 50-51 (or just 50) if (PAGE_CONTAINS(50, 51 - (TALL_FONT_CORRECTION))) // 50-51 (or just 50)
u8g.drawBox( u8g.drawBox(
PROGRESS_BAR_X + 1, 50, PROGRESS_BAR_X + 1, 50,
(uint16_t)((PROGRESS_BAR_WIDTH - 2) * card.percentDone() * 0.01), 2 - (TALL_FONT_CORRECTION) (uint16_t)((PROGRESS_BAR_WIDTH - 2) * progress_bar_percent * 0.01), 2 - (TALL_FONT_CORRECTION)
); );
// //
@ -580,7 +584,7 @@ static void lcd_implementation_status_screen() {
if (PAGE_CONTAINS(41, 48)) { if (PAGE_CONTAINS(41, 48)) {
// Percent complete // Percent complete
u8g.setPrintPos(55, 48); u8g.setPrintPos(55, 48);
u8g.print(itostr3(card.percentDone())); u8g.print(itostr3(progress_bar_percent));
u8g.print('%'); u8g.print('%');
} }
#endif #endif

@ -203,9 +203,9 @@ extern volatile uint8_t buttons; //an extended version of the last checked butt
#include "utf_mapper.h" #include "utf_mapper.h"
#if ENABLED(LCD_PROGRESS_BAR) #if ENABLED(LCD_PROGRESS_BAR)
static millis_t progress_bar_ms = 0; static millis_t progress_bar_ms = 0; // Start millis of the current progress bar cycle
#if PROGRESS_MSG_EXPIRE > 0 #if PROGRESS_MSG_EXPIRE > 0
static millis_t expire_status_ms = 0; static millis_t expire_status_ms = 0; // millis at which to expire the status message
#endif #endif
#define LCD_STR_PROGRESS "\x03\x04\x05" #define LCD_STR_PROGRESS "\x03\x04\x05"
#endif #endif
@ -842,12 +842,13 @@ static void lcd_implementation_status_screen() {
#if ENABLED(LCD_PROGRESS_BAR) #if ENABLED(LCD_PROGRESS_BAR)
#if DISABLED(LCD_SET_PROGRESS_MANUALLY)
const uint8_t progress_bar_percent = card.percentDone();
#endif
// Draw the progress bar if the message has shown long enough // Draw the progress bar if the message has shown long enough
// or if there is no message set. // or if there is no message set.
if (card.isFileOpen() && (ELAPSED(millis(), progress_bar_ms + PROGRESS_BAR_MSG_TIME) || !lcd_status_message[0])) { if (progress_bar_percent > 2 && (ELAPSED(millis(), progress_bar_ms + PROGRESS_BAR_MSG_TIME) || !lcd_status_message[0]))
const uint8_t percent = card.percentDone(); return lcd_draw_progress_bar(progress_bar_percent);
if (percent) return lcd_draw_progress_bar(percent);
}
#elif ENABLED(FILAMENT_LCD_DISPLAY) && ENABLED(SDSUPPORT) #elif ENABLED(FILAMENT_LCD_DISPLAY) && ENABLED(SDSUPPORT)

Loading…
Cancel
Save