1
0
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:
Scott Lahteine 2018-10-19 14:19:51 -05:00
parent d8caa7ddf0
commit 86ac4683dd
5 changed files with 18 additions and 18 deletions

View File

@ -8217,7 +8217,7 @@ inline void gcode_M42() {
* This has no effect during an SD print job * This has no effect during an SD print job
*/ */
inline void gcode_M73() { inline void gcode_M73() {
if (!IS_SD_PRINTING && parser.seen('P')) { if (!IS_SD_PRINTING() && parser.seen('P')) {
progress_bar_percent = parser.value_byte(); progress_bar_percent = parser.value_byte();
NOMORE(progress_bar_percent, 100); 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 static int homeDebounceCount = 0; // poor man's debouncing count
const int HOME_DEBOUNCE_DELAY = 2500; const int HOME_DEBOUNCE_DELAY = 2500;
if (!IS_SD_PRINTING && !READ(HOME_PIN)) { if (!IS_SD_PRINTING() && !READ(HOME_PIN)) {
if (!homeDebounceCount) { if (!homeDebounceCount) {
enqueue_and_echo_commands_P(PSTR("G28")); enqueue_and_echo_commands_P(PSTR("G28"));
LCD_MESSAGEPGM(MSG_AUTO_HOME); LCD_MESSAGEPGM(MSG_AUTO_HOME);

View File

@ -206,13 +206,13 @@ private:
#if PIN_EXISTS(SD_DETECT) #if PIN_EXISTS(SD_DETECT)
#if ENABLED(SD_DETECT_INVERTED) #if ENABLED(SD_DETECT_INVERTED)
#define IS_SD_INSERTED (READ(SD_DETECT_PIN) == HIGH) #define IS_SD_INSERTED() READ(SD_DETECT_PIN)
#else #else
#define IS_SD_INSERTED (READ(SD_DETECT_PIN) == LOW) #define IS_SD_INSERTED() !READ(SD_DETECT_PIN)
#endif #endif
#else #else
// No card detect line? Assume the card is inserted. // No card detect line? Assume the card is inserted.
#define IS_SD_INSERTED true #define IS_SD_INSERTED() true
#endif #endif
extern CardReader card; extern CardReader card;
@ -220,11 +220,11 @@ extern CardReader card;
#endif // SDSUPPORT #endif // SDSUPPORT
#if ENABLED(SDSUPPORT) #if ENABLED(SDSUPPORT)
#define IS_SD_PRINTING (card.sdprinting) #define IS_SD_PRINTING() card.sdprinting
#define IS_SD_FILE_OPEN (card.isFileOpen()) #define IS_SD_FILE_OPEN() card.isFileOpen()
#else #else
#define IS_SD_PRINTING (false) #define IS_SD_PRINTING() false
#define IS_SD_FILE_OPEN (false) #define IS_SD_FILE_OPEN() false
#endif #endif
#endif // _CARDREADER_H_ #endif // _CARDREADER_H_

View File

@ -884,7 +884,7 @@ void ST7920_Lite_Status_Screen::update_progress(const bool forceUpdate) {
#if ENABLED(SDSUPPORT) #if ENABLED(SDSUPPORT)
// Progress bar % comes from SD when actively printing // 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 #endif
// Since the progress bar involves writing // Since the progress bar involves writing

View File

@ -505,7 +505,7 @@ uint16_t max_display_update_time = 0;
if (currentScreen == lcd_status_screen) if (currentScreen == lcd_status_screen)
doubleclick_expire_ms = millis() + DOUBLECLICK_MAX_INTERVAL; 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 = screen =
#if ENABLED(BABYSTEP_ZPROBE_OFFSET) #if ENABLED(BABYSTEP_ZPROBE_OFFSET)
lcd_babystep_zoffset 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)) #if ENABLED(LCD_SET_PROGRESS_MANUALLY) && ENABLED(SDSUPPORT) && (ENABLED(LCD_PROGRESS_BAR) || ENABLED(DOGLCD))
// Progress bar % comes from SD when actively printing // Progress bar % comes from SD when actively printing
if (IS_SD_PRINTING) if (IS_SD_PRINTING())
progress_bar_percent = card.percentDone(); progress_bar_percent = card.percentDone();
#endif #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); MENU_ITEM_EDIT_CALLBACK(bool, MSG_CASE_LIGHT, (bool*)&case_light_on, update_case_light);
#endif #endif
if (planner.movesplanned() || IS_SD_PRINTING) if (planner.movesplanned() || IS_SD_PRINTING())
MENU_ITEM(submenu, MSG_TUNE, lcd_tune_menu); MENU_ITEM(submenu, MSG_TUNE, lcd_tune_menu);
else else
MENU_ITEM(submenu, MSG_PREPARE, lcd_prepare_menu); MENU_ITEM(submenu, MSG_PREPARE, lcd_prepare_menu);
@ -2732,7 +2732,7 @@ void lcd_quick_feedback(const bool clear_buttons) {
// Change filament // Change filament
// //
#if ENABLED(ADVANCED_PAUSE_FEATURE) #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 E_STEPPERS == 1 && !ENABLED(FILAMENT_LOAD_UNLOAD_GCODES)
if (thermalManager.targetHotEnoughToExtrude(active_extruder)) if (thermalManager.targetHotEnoughToExtrude(active_extruder))
MENU_ITEM(gcode, MSG_FILAMENTCHANGE, PSTR("M600 B0")); MENU_ITEM(gcode, MSG_FILAMENTCHANGE, PSTR("M600 B0"));
@ -4411,7 +4411,7 @@ void lcd_quick_feedback(const bool clear_buttons) {
#endif // E_STEPPERS == 1 #endif // E_STEPPERS == 1
#if ENABLED(FILAMENT_LOAD_UNLOAD_GCODES) #if ENABLED(FILAMENT_LOAD_UNLOAD_GCODES)
if (!planner.movesplanned() && !IS_SD_FILE_OPEN) { if (!planner.movesplanned() && !IS_SD_FILE_OPEN()) {
// Load filament // Load filament
#if E_STEPPERS == 1 #if E_STEPPERS == 1
PGM_P msg0 = PSTR(MSG_FILAMENTLOAD); PGM_P msg0 = PSTR(MSG_FILAMENTLOAD);
@ -5158,7 +5158,7 @@ void lcd_update() {
#if ENABLED(SDSUPPORT) && PIN_EXISTS(SD_DETECT) #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()) { if (sd_status != lcd_sd_status && lcd_detected()) {
uint8_t old_sd_status = lcd_sd_status; // prevent re-entry to this block! uint8_t old_sd_status = lcd_sd_status; // prevent re-entry to this block!

View File

@ -803,7 +803,7 @@ static void lcd_implementation_status_screen() {
#if ENABLED(SDSUPPORT) #if ENABLED(SDSUPPORT)
lcd.setCursor(0, 2); lcd.setCursor(0, 2);
lcd_printPGM(PSTR("SD")); lcd_printPGM(PSTR("SD"));
if (IS_SD_PRINTING) if (IS_SD_PRINTING())
lcd.print(itostr3(card.percentDone())); lcd.print(itostr3(card.percentDone()));
else else
lcd_printPGM(PSTR("---")); lcd_printPGM(PSTR("---"));
@ -867,7 +867,7 @@ static void lcd_implementation_status_screen() {
lcd.setCursor(7, 2); lcd.setCursor(7, 2);
lcd_printPGM(PSTR("SD")); lcd_printPGM(PSTR("SD"));
if (IS_SD_PRINTING) if (IS_SD_PRINTING())
lcd.print(itostr3(card.percentDone())); lcd.print(itostr3(card.percentDone()));
else else
lcd_printPGM(PSTR("---")); lcd_printPGM(PSTR("---"));