瀏覽代碼

fanSpeed -> fanSpeedSoftPwm (fixes fan speed menu)

PavelSindler 5 年之前
父節點
當前提交
62e253edd0
共有 2 個文件被更改,包括 5 次插入12 次删除
  1. 1 5
      Firmware/Marlin_main.cpp
  2. 4 7
      Firmware/temperature.cpp

+ 1 - 5
Firmware/Marlin_main.cpp

@@ -8520,8 +8520,7 @@ void setup_fan_interrupt() {
 ISR(INT7_vect) {
 	//measuring speed now works for fanSpeed > 18 (approximately), which is sufficient because MIN_PRINT_FAN_SPEED is higher
 #ifdef FAN_SOFT_PWM
-	//if (fanSpeedSoftPwm != 255) return;
-	if (!fan_measuring || (fanSpeed < MIN_PRINT_FAN_SPEED)) return;
+	if (!fan_measuring || (fanSpeedSoftPwm < MIN_PRINT_FAN_SPEED)) return;
 #else //FAN_SOFT_PWM
 	if (fanSpeed < MIN_PRINT_FAN_SPEED) return;
 #endif //FAN_SOFT_PWM
@@ -8892,9 +8891,6 @@ void stop_and_save_print_to_ram(float z_move, float e_move)
 	saved_extruder_under_pressure = extruder_under_pressure; //extruder under pressure flag - currently unused
 	saved_extruder_relative_mode = axis_relative_modes[E_AXIS];
 	saved_fanSpeed = fanSpeed;
-#ifdef FAN_SOFT_PWM
-	if (fan_measuring) saved_fanSpeed = fanSpeedBckp;
-#endif //FAN_SOFT_PWM
 	cmdqueue_reset(); //empty cmdqueue
 	card.sdprinting = false;
 //	card.closefile();

+ 4 - 7
Firmware/temperature.cpp

@@ -758,19 +758,16 @@ void manage_heater()
 #ifdef FAN_SOFT_PWM
   if ((_millis() - extruder_autofan_last_check > FAN_CHECK_PERIOD) && (!fan_measuring)) {
 	  extruder_autofan_last_check = _millis();
-	  fanSpeedBckp = fanSpeed;
-	  if (fanSpeed > MIN_PRINT_FAN_SPEED) {
-		  fanSpeed = 255;
+	  fanSpeedBckp = fanSpeedSoftPwm;
+	  if (fanSpeedSoftPwm > MIN_PRINT_FAN_SPEED) {
+		  fanSpeedSoftPwm = 255;
 	  }
-	 // fanSpeedBckp = fanSpeedSoftPwm;
-	 // fanSpeedSoftPwm = 255;
 	  fan_measuring = true;
   }
   if ((_millis() - extruder_autofan_last_check > FAN_CHECK_DURATION) && (fan_measuring)) {
 	  countFanSpeed();
 	  checkFanSpeed();
-	  fanSpeed = fanSpeedBckp;
-	 // fanSpeedSoftPwm = fanSpeedBckp;
+	  fanSpeedSoftPwm = fanSpeedBckp;
 	  printf_P(PSTR("fan PWM: %d; extr fanSpeed measured: %d; print fan speed measured: %d \n"), fanSpeedBckp, fan_speed[0], fan_speed[1]);
 	  extruder_autofan_last_check = _millis();
 	  fan_measuring = false;