mirror of
https://github.com/MarlinFirmware/Marlin.git
synced 2024-11-29 23:07:42 +00:00
Add parentheses to card macros
This commit is contained in:
parent
d8caa7ddf0
commit
86ac4683dd
@ -8217,7 +8217,7 @@ inline void gcode_M42() {
|
||||
* This has no effect during an SD print job
|
||||
*/
|
||||
inline void gcode_M73() {
|
||||
if (!IS_SD_PRINTING && parser.seen('P')) {
|
||||
if (!IS_SD_PRINTING() && parser.seen('P')) {
|
||||
progress_bar_percent = parser.value_byte();
|
||||
NOMORE(progress_bar_percent, 100);
|
||||
}
|
||||
@ -14786,7 +14786,7 @@ void manage_inactivity(const bool ignore_stepper_queue/*=false*/) {
|
||||
// ---------------------------------------------------------
|
||||
static int homeDebounceCount = 0; // poor man's debouncing count
|
||||
const int HOME_DEBOUNCE_DELAY = 2500;
|
||||
if (!IS_SD_PRINTING && !READ(HOME_PIN)) {
|
||||
if (!IS_SD_PRINTING() && !READ(HOME_PIN)) {
|
||||
if (!homeDebounceCount) {
|
||||
enqueue_and_echo_commands_P(PSTR("G28"));
|
||||
LCD_MESSAGEPGM(MSG_AUTO_HOME);
|
||||
|
@ -206,13 +206,13 @@ private:
|
||||
|
||||
#if PIN_EXISTS(SD_DETECT)
|
||||
#if ENABLED(SD_DETECT_INVERTED)
|
||||
#define IS_SD_INSERTED (READ(SD_DETECT_PIN) == HIGH)
|
||||
#define IS_SD_INSERTED() READ(SD_DETECT_PIN)
|
||||
#else
|
||||
#define IS_SD_INSERTED (READ(SD_DETECT_PIN) == LOW)
|
||||
#define IS_SD_INSERTED() !READ(SD_DETECT_PIN)
|
||||
#endif
|
||||
#else
|
||||
// No card detect line? Assume the card is inserted.
|
||||
#define IS_SD_INSERTED true
|
||||
#define IS_SD_INSERTED() true
|
||||
#endif
|
||||
|
||||
extern CardReader card;
|
||||
@ -220,11 +220,11 @@ extern CardReader card;
|
||||
#endif // SDSUPPORT
|
||||
|
||||
#if ENABLED(SDSUPPORT)
|
||||
#define IS_SD_PRINTING (card.sdprinting)
|
||||
#define IS_SD_FILE_OPEN (card.isFileOpen())
|
||||
#define IS_SD_PRINTING() card.sdprinting
|
||||
#define IS_SD_FILE_OPEN() card.isFileOpen()
|
||||
#else
|
||||
#define IS_SD_PRINTING (false)
|
||||
#define IS_SD_FILE_OPEN (false)
|
||||
#define IS_SD_PRINTING() false
|
||||
#define IS_SD_FILE_OPEN() false
|
||||
#endif
|
||||
|
||||
#endif // _CARDREADER_H_
|
||||
|
@ -884,7 +884,7 @@ void ST7920_Lite_Status_Screen::update_progress(const bool forceUpdate) {
|
||||
|
||||
#if ENABLED(SDSUPPORT)
|
||||
// Progress bar % comes from SD when actively printing
|
||||
if (IS_SD_PRINTING) progress_bar_percent = card.percentDone();
|
||||
if (IS_SD_PRINTING()) progress_bar_percent = card.percentDone();
|
||||
#endif
|
||||
|
||||
// Since the progress bar involves writing
|
||||
|
@ -505,7 +505,7 @@ uint16_t max_display_update_time = 0;
|
||||
if (currentScreen == lcd_status_screen)
|
||||
doubleclick_expire_ms = millis() + DOUBLECLICK_MAX_INTERVAL;
|
||||
}
|
||||
else if (screen == lcd_status_screen && currentScreen == lcd_main_menu && PENDING(millis(), doubleclick_expire_ms) && (planner.movesplanned() || IS_SD_PRINTING))
|
||||
else if (screen == lcd_status_screen && currentScreen == lcd_main_menu && PENDING(millis(), doubleclick_expire_ms) && (planner.movesplanned() || IS_SD_PRINTING()))
|
||||
screen =
|
||||
#if ENABLED(BABYSTEP_ZPROBE_OFFSET)
|
||||
lcd_babystep_zoffset
|
||||
@ -652,7 +652,7 @@ void lcd_status_screen() {
|
||||
|
||||
#if ENABLED(LCD_SET_PROGRESS_MANUALLY) && ENABLED(SDSUPPORT) && (ENABLED(LCD_PROGRESS_BAR) || ENABLED(DOGLCD))
|
||||
// Progress bar % comes from SD when actively printing
|
||||
if (IS_SD_PRINTING)
|
||||
if (IS_SD_PRINTING())
|
||||
progress_bar_percent = card.percentDone();
|
||||
#endif
|
||||
|
||||
@ -1109,7 +1109,7 @@ void lcd_quick_feedback(const bool clear_buttons) {
|
||||
MENU_ITEM_EDIT_CALLBACK(bool, MSG_CASE_LIGHT, (bool*)&case_light_on, update_case_light);
|
||||
#endif
|
||||
|
||||
if (planner.movesplanned() || IS_SD_PRINTING)
|
||||
if (planner.movesplanned() || IS_SD_PRINTING())
|
||||
MENU_ITEM(submenu, MSG_TUNE, lcd_tune_menu);
|
||||
else
|
||||
MENU_ITEM(submenu, MSG_PREPARE, lcd_prepare_menu);
|
||||
@ -2732,7 +2732,7 @@ void lcd_quick_feedback(const bool clear_buttons) {
|
||||
// Change filament
|
||||
//
|
||||
#if ENABLED(ADVANCED_PAUSE_FEATURE)
|
||||
if (!IS_SD_FILE_OPEN) {
|
||||
if (!IS_SD_FILE_OPEN()) {
|
||||
#if E_STEPPERS == 1 && !ENABLED(FILAMENT_LOAD_UNLOAD_GCODES)
|
||||
if (thermalManager.targetHotEnoughToExtrude(active_extruder))
|
||||
MENU_ITEM(gcode, MSG_FILAMENTCHANGE, PSTR("M600 B0"));
|
||||
@ -4411,7 +4411,7 @@ void lcd_quick_feedback(const bool clear_buttons) {
|
||||
#endif // E_STEPPERS == 1
|
||||
|
||||
#if ENABLED(FILAMENT_LOAD_UNLOAD_GCODES)
|
||||
if (!planner.movesplanned() && !IS_SD_FILE_OPEN) {
|
||||
if (!planner.movesplanned() && !IS_SD_FILE_OPEN()) {
|
||||
// Load filament
|
||||
#if E_STEPPERS == 1
|
||||
PGM_P msg0 = PSTR(MSG_FILAMENTLOAD);
|
||||
@ -5158,7 +5158,7 @@ void lcd_update() {
|
||||
|
||||
#if ENABLED(SDSUPPORT) && PIN_EXISTS(SD_DETECT)
|
||||
|
||||
const uint8_t sd_status = (uint8_t)IS_SD_INSERTED;
|
||||
const uint8_t sd_status = (uint8_t)IS_SD_INSERTED();
|
||||
if (sd_status != lcd_sd_status && lcd_detected()) {
|
||||
|
||||
uint8_t old_sd_status = lcd_sd_status; // prevent re-entry to this block!
|
||||
|
@ -803,7 +803,7 @@ static void lcd_implementation_status_screen() {
|
||||
#if ENABLED(SDSUPPORT)
|
||||
lcd.setCursor(0, 2);
|
||||
lcd_printPGM(PSTR("SD"));
|
||||
if (IS_SD_PRINTING)
|
||||
if (IS_SD_PRINTING())
|
||||
lcd.print(itostr3(card.percentDone()));
|
||||
else
|
||||
lcd_printPGM(PSTR("---"));
|
||||
@ -867,7 +867,7 @@ static void lcd_implementation_status_screen() {
|
||||
|
||||
lcd.setCursor(7, 2);
|
||||
lcd_printPGM(PSTR("SD"));
|
||||
if (IS_SD_PRINTING)
|
||||
if (IS_SD_PRINTING())
|
||||
lcd.print(itostr3(card.percentDone()));
|
||||
else
|
||||
lcd_printPGM(PSTR("---"));
|
||||
|
Loading…
Reference in New Issue
Block a user