From e86213f2a9fabb5326ae97461e69a269d99271a2 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Tue, 10 Nov 2020 23:59:32 -0600 Subject: [PATCH] Refer to runout 1 --- Marlin/src/feature/mmu2/mmu2.cpp | 2 +- Marlin/src/inc/Conditionals_LCD.h | 1 - Marlin/src/inc/SanityCheck.h | 1 - .../lcd/extui/lib/anycubic_i3mega/anycubic_i3mega_lcd.cpp | 6 +++--- Marlin/src/module/endstops.cpp | 2 +- 5 files changed, 5 insertions(+), 7 deletions(-) diff --git a/Marlin/src/feature/mmu2/mmu2.cpp b/Marlin/src/feature/mmu2/mmu2.cpp index c5cf485850..d76476e719 100644 --- a/Marlin/src/feature/mmu2/mmu2.cpp +++ b/Marlin/src/feature/mmu2/mmu2.cpp @@ -163,7 +163,7 @@ uint8_t MMU2::get_current_tool() { } #if EITHER(PRUSA_MMU2_S_MODE, MMU_EXTRUDER_SENSOR) - #define FILAMENT_PRESENT() (READ(FIL_RUNOUT_PIN) != FIL_RUNOUT_STATE) + #define FILAMENT_PRESENT() (READ(FIL_RUNOUT1_PIN) != FIL_RUNOUT1_STATE) #endif void MMU2::mmu_loop() { diff --git a/Marlin/src/inc/Conditionals_LCD.h b/Marlin/src/inc/Conditionals_LCD.h index c14731172a..865365c0ee 100644 --- a/Marlin/src/inc/Conditionals_LCD.h +++ b/Marlin/src/inc/Conditionals_LCD.h @@ -677,7 +677,6 @@ #if ENABLED(FILAMENT_RUNOUT_SENSOR) #if NUM_RUNOUT_SENSORS >= 1 - #define FIL_RUNOUT1_PIN FIL_RUNOUT_PIN #ifndef FIL_RUNOUT1_STATE #define FIL_RUNOUT1_STATE FIL_RUNOUT_STATE #endif diff --git a/Marlin/src/inc/SanityCheck.h b/Marlin/src/inc/SanityCheck.h index f5827ba0b2..e2a79cd5ea 100644 --- a/Marlin/src/inc/SanityCheck.h +++ b/Marlin/src/inc/SanityCheck.h @@ -808,7 +808,6 @@ static_assert(Y_MAX_LENGTH >= Y_BED_SIZE, "Movement bounds (Y_MIN_POS, Y_MAX_POS * Filament Runout needs one or more pins and either SD Support or Auto print start detection */ #if HAS_FILAMENT_SENSOR - #if !PIN_EXISTS(FIL_RUNOUT) #error "FILAMENT_RUNOUT_SENSOR requires FIL_RUNOUT_PIN." #elif NUM_RUNOUT_SENSORS > E_STEPPERS diff --git a/Marlin/src/lcd/extui/lib/anycubic_i3mega/anycubic_i3mega_lcd.cpp b/Marlin/src/lcd/extui/lib/anycubic_i3mega/anycubic_i3mega_lcd.cpp index 2aaa0d0e33..6d15d937b9 100644 --- a/Marlin/src/lcd/extui/lib/anycubic_i3mega/anycubic_i3mega_lcd.cpp +++ b/Marlin/src/lcd/extui/lib/anycubic_i3mega/anycubic_i3mega_lcd.cpp @@ -87,7 +87,7 @@ void AnycubicTFTClass::OnSetup() { SET_INPUT_PULLUP(SD_DETECT_PIN); #endif #if ENABLED(FILAMENT_RUNOUT_SENSOR) - SET_INPUT_PULLUP(FIL_RUNOUT_PIN); + SET_INPUT_PULLUP(FIL_RUNOUT1_PIN); #endif mediaPrintingState = AMPRINTSTATE_NOT_PRINTING; @@ -935,7 +935,7 @@ void AnycubicTFTClass::DoFilamentRunoutCheck() { #if ENABLED(FILAMENT_RUNOUT_SENSOR) // NOTE: ExtUI::getFilamentRunoutState() only returns the runout state if the job is printing // we want to actually check the status of the pin here, regardless of printstate - if (READ(FIL_RUNOUT_PIN)) { + if (READ(FIL_RUNOUT1_PIN)) { if (mediaPrintingState == AMPRINTSTATE_PRINTING || mediaPrintingState == AMPRINTSTATE_PAUSED || mediaPrintingState == AMPRINTSTATE_PAUSE_REQUESTED) { // play tone to indicate filament is out ExtUI::injectCommands_P(PSTR("\nM300 P200 S1567\nM300 P200 S1174\nM300 P200 S1567\nM300 P200 S1174\nM300 P2000 S1567")); @@ -983,7 +983,7 @@ void AnycubicTFTClass::PausePrint() { void AnycubicTFTClass::ResumePrint() { #if ENABLED(SDSUPPORT) #if ENABLED(FILAMENT_RUNOUT_SENSOR) - if (READ(FIL_RUNOUT_PIN)) { + if (READ(FIL_RUNOUT1_PIN)) { #if ENABLED(ANYCUBIC_LCD_DEBUG) SERIAL_ECHOLNPGM("TFT Serial Debug: Resume Print with filament sensor still tripped... "); #endif diff --git a/Marlin/src/module/endstops.cpp b/Marlin/src/module/endstops.cpp index cbc3ab2ffe..697ced7833 100644 --- a/Marlin/src/module/endstops.cpp +++ b/Marlin/src/module/endstops.cpp @@ -459,7 +459,7 @@ void _O2 Endstops::report_states() { #endif #if HAS_FILAMENT_SENSOR #if NUM_RUNOUT_SENSORS == 1 - print_es_state(READ(FIL_RUNOUT_PIN) != FIL_RUNOUT_STATE, PSTR(STR_FILAMENT_RUNOUT_SENSOR)); + print_es_state(READ(FIL_RUNOUT1_PIN) != FIL_RUNOUT1_STATE, PSTR(STR_FILAMENT_RUNOUT_SENSOR)); #else #define _CASE_RUNOUT(N) case N: pin = FIL_RUNOUT##N##_PIN; state = FIL_RUNOUT##N##_STATE; break; LOOP_S_LE_N(i, 1, NUM_RUNOUT_SENSORS) {