From 0067bb2840619acde1d32d487b7799a0ae0a1a2f Mon Sep 17 00:00:00 2001
From: GMagician <GMagician@users.noreply.github.com>
Date: Thu, 24 Aug 2017 22:04:49 +0200
Subject: [PATCH] Addressing #7552

When M405 is used it changes 'volumetric_multiplier[FILAMENT_SENSOR_EXTRUDER_NUM]' value. When M406 disables M405 it leaves the value unchanged.
This PR applies 'calculate_volumetric_multipliers' in M406 instead of resetting it to 1.0 because M200 may not be compatible with M405 hence I'm sure to restore anyway with correct value.
---
 Marlin/Marlin_main.cpp | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/Marlin/Marlin_main.cpp b/Marlin/Marlin_main.cpp
index f6b7fd7557..5196bca81f 100644
--- a/Marlin/Marlin_main.cpp
+++ b/Marlin/Marlin_main.cpp
@@ -9241,7 +9241,10 @@ inline void gcode_M400() { stepper.synchronize(); }
   /**
    * M406: Turn off filament sensor for control
    */
-  inline void gcode_M406() { filament_sensor = false; }
+  inline void gcode_M406() {
+    filament_sensor = false;
+    calculate_volumetric_multipliers();   // Restore correct 'volumetric_multiplier' value
+  }
 
   /**
    * M407: Get measured filament diameter on serial output