diff --git a/Marlin/src/module/temperature.cpp b/Marlin/src/module/temperature.cpp
index 1c4d101e996eef1bf7d326eee0571efb89c3f716..67c30d0c05adcf1e5c9689bbb7a409675a65f5a2 100644
--- a/Marlin/src/module/temperature.cpp
+++ b/Marlin/src/module/temperature.cpp
@@ -1679,6 +1679,10 @@ void Temperature::set_current_temp_raw() {
   temp_meas_ready = true;
 }
 
+#if ENABLED(FILAMENT_WIDTH_SENSOR)
+  uint32_t raw_filwidth_value; // = 0
+#endif
+
 void Temperature::readings_ready() {
   // Update the raw values if they've been read. Else we could be updating them during reading.
   if (!temp_meas_ready) set_current_temp_raw();
@@ -1819,10 +1823,6 @@ void Temperature::isr() {
     ISR_STATICS(BED);
   #endif
 
-  #if ENABLED(FILAMENT_WIDTH_SENSOR)
-    static unsigned long raw_filwidth_value = 0;
-  #endif
-
   #if DISABLED(SLOW_PWM_HEATERS)
     constexpr uint8_t pwm_mask =
       #if ENABLED(SOFT_PWM_DITHER)
@@ -2177,8 +2177,8 @@ void Temperature::isr() {
         if (!HAL_ADC_READY())
           next_sensor_state = adc_sensor_state; // redo this state
         else if (HAL_READ_ADC() > 102) { // Make sure ADC is reading > 0.5 volts, otherwise don't read.
-          raw_filwidth_value -= (raw_filwidth_value >> 7); // Subtract 1/128th of the raw_filwidth_value
-          raw_filwidth_value += ((unsigned long)HAL_READ_ADC() << 7); // Add new ADC reading, scaled by 128
+          raw_filwidth_value -= raw_filwidth_value >> 7; // Subtract 1/128th of the raw_filwidth_value
+          raw_filwidth_value += uint32_t(HAL_READ_ADC()) << 7; // Add new ADC reading, scaled by 128
         }
       break;
     #endif