Distinct runout states (#19965)

Co-authored-by: Scott Lahteine <thinkyhead@users.noreply.github.com>
This commit is contained in:
Costas Basdekis
2020-11-11 06:39:23 +00:00
committed by Scott Lahteine
parent 45b242d5f7
commit dc144fb910
14 changed files with 202 additions and 45 deletions

View File

@ -76,8 +76,8 @@ namespace Anycubic {
#endif
// Filament runout is handled by Marlin settings in Configuration.h
// set FIL_RUNOUT_STATE HIGH // Pin state indicating that filament is NOT present.
// enable FIL_RUNOUT_PULLUP
// opt_set FIL_RUNOUT_STATE HIGH // Pin state indicating that filament is NOT present.
// opt_enable FIL_RUNOUT_PULL
TFTSer.begin(115200);

View File

@ -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

View File

@ -92,12 +92,12 @@ void EndstopStatesScreen::onRedraw(draw_mode_t) {
PIN_DISABLED(5, 3, PSTR(STR_Z_MIN), Z_MIN)
#endif
#if ENABLED(FILAMENT_RUNOUT_SENSOR) && PIN_EXISTS(FIL_RUNOUT)
PIN_ENABLED (1, 4, GET_TEXT_F(MSG_RUNOUT_1), FIL_RUNOUT, FIL_RUNOUT_STATE)
PIN_ENABLED (1, 4, GET_TEXT_F(MSG_RUNOUT_1), FIL_RUNOUT, FIL_RUNOUT1_STATE)
#else
PIN_DISABLED(1, 4, GET_TEXT_F(MSG_RUNOUT_1), FIL_RUNOUT)
#endif
#if BOTH(HAS_MULTI_EXTRUDER, FILAMENT_RUNOUT_SENSOR) && PIN_EXISTS(FIL_RUNOUT2)
PIN_ENABLED (3, 4, GET_TEXT_F(MSG_RUNOUT_2), FIL_RUNOUT2, FIL_RUNOUT_STATE)
PIN_ENABLED (3, 4, GET_TEXT_F(MSG_RUNOUT_2), FIL_RUNOUT2, FIL_RUNOUT2_STATE)
#else
PIN_DISABLED(3, 4, GET_TEXT_F(MSG_RUNOUT_2), FIL_RUNOUT2)
#endif