瀏覽代碼

PFW-1457 Do not unload at start of First Layer Cal

Fixes issue where First Layer Cal. triggers an unload before any
filament is loaded

The purpose of this if() statement is to handle the case where
a user or developer is sending T-codes to the printer directly
via Serial. Such as when one first sends T0 and then T4.
And unload must be triggered in-between, we can do this automatically
if FINDA detect filament.

Change in memory:
Flash: -10 bytes
SRAM: 0 bytes
Guðni Már Gilbert 2 年之前
父節點
當前提交
fee68b0f0d
共有 2 個文件被更改,包括 3 次插入3 次删除
  1. 1 0
      Firmware/Marlin.h
  2. 2 3
      Firmware/mmu2.cpp

+ 1 - 0
Firmware/Marlin.h

@@ -22,6 +22,7 @@
 #include "pins.h"
 #include "Timer.h"
 #include "mmu2.h"
+#include "cardreader.h" // for IS_SD_PRINTING
 extern uint8_t mbl_z_probe_nr;
 
 #ifndef AT90USB

+ 2 - 3
Firmware/mmu2.cpp

@@ -14,7 +14,6 @@
 #include "strlen_cx.h"
 #include "temperature.h"
 #include "ultralcd.h"
-#include "cardreader.h" // for IS_SD_PRINTING
 #include "SpoolJoin.h"
 
 // As of FW 3.12 we only support building the FW with only one extruder, all the multi-extruder infrastructure will be removed.
@@ -384,9 +383,9 @@ bool MMU2::tool_change(uint8_t slot) {
         return false;
 
     if (slot != extruder) {
-        if (!IS_SD_PRINTING && !usb_timer.running()) {
+        if (FindaDetectsFilament()) {
             // If Tcodes are used manually through the serial
-            // we need to unload manually as well
+            // we need to unload manually as well -- but only if FINDA detects filament
             unload();
         }