Skip to content

Commit a0cf008

Browse files
committed
Increase reliability of filament runout MarlinFirmware#7
Temporary stopgap until we get this spaghetti cleaned up.
1 parent 71ed695 commit a0cf008

File tree

2 files changed

+9
-4
lines changed

2 files changed

+9
-4
lines changed

Marlin/Configuration.h

+3-3
Original file line numberDiff line numberDiff line change
@@ -1179,9 +1179,9 @@
11791179
#if ENABLED(FILAMENT_RUNOUT_SENSOR)
11801180
#define FIL_RUNOUT_ENABLED_DEFAULT true // Enable the sensor on startup. Override with M412 followed by M500.
11811181
#define NUM_RUNOUT_SENSORS 1 // Number of sensors, up to one per extruder. Define a FIL_RUNOUT#_PIN for each.
1182-
#define FIL_RUNOUT_STATE LOW // Pin state indicating that filament is NOT present.
1183-
#define FIL_RUNOUT_PULLUP // Use internal pullup for filament runout pins.
1184-
//#define FIL_RUNOUT_PULLDOWN // Use internal pulldown for filament runout pins.
1182+
#define FIL_RUNOUT_STATE HIGH // Pin state indicating that filament is NOT present.
1183+
//#define FIL_RUNOUT_PULLUP // Use internal pullup for filament runout pins.
1184+
#define FIL_RUNOUT_PULLDOWN // Use internal pulldown for filament runout pins.
11851185

11861186
// Set one or more commands to execute on filament runout.
11871187
// (After 'M412 H' Marlin will ask the host to handle the process.)

Marlin/src/lcd/dwin/cr6/touch_lcd.cpp

+6-1
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,7 @@ float pause_z = 0;
8686
float pause_e = 0;
8787
bool sdcard_pause_check = true;
8888
bool pause_action_flag = false;
89+
bool had_filament_runout = false;
8990
bool probe_offset_flag = false;
9091

9192
millis_t next_rts_update_ms = 0;
@@ -822,6 +823,7 @@ void RTSSHOW::RTS_HandleData()
822823
rtscheck.change_page(DWINTouchPage::PRINT_PROGRESS_RUNNING);
823824
}
824825
break;
826+
825827
case ResumePrintKey:
826828
// This is apparently triggered when the resume option is pressed
827829
if (recdat.data[0] == 1 /*Resume*/) {
@@ -846,8 +848,10 @@ void RTSSHOW::RTS_HandleData()
846848
thermalManager.setTargetHotend(temphot, 0);
847849
}
848850

851+
had_filament_runout = false;
849852

850853
break;
854+
851855
case ZoffsetEnterKey:
852856
last_zoffset = probe.offset.z;
853857
if(recdat.data[0] >= 32768)
@@ -1530,6 +1534,7 @@ void RTSSHOW::RTS_FilamentRunout() {
15301534

15311535
sdcard_pause_check = false;
15321536
pause_action_flag = true;
1537+
had_filament_runout = true;
15331538

15341539
pause_z = current_position[Z_AXIS];
15351540
pause_e = current_position[E_AXIS] - 5;
@@ -1544,7 +1549,7 @@ void RTSSHOW::RTS_FilamentRunout() {
15441549

15451550
void RTSSHOW::RTS_FilamentLoaded() {
15461551
// "Filament load, please confirm resume print or stop print"
1547-
if (pause_action_flag == true && sdcard_pause_check == false) {
1552+
if (pause_action_flag == true && sdcard_pause_check == false && had_filament_runout == true) {
15481553
rtscheck.change_page(DWINTouchPage::ERR_FILAMENTRUNOUT_FILAMENT_LOADED);
15491554

15501555
// Update icon?

0 commit comments

Comments
 (0)