fanSpeed -> fanSpeedSoftPwm (fixes fan speed menu)
This commit is contained in:
parent
903028e574
commit
62e253edd0
|
|
@ -8520,8 +8520,7 @@ void setup_fan_interrupt() {
|
||||||
ISR(INT7_vect) {
|
ISR(INT7_vect) {
|
||||||
//measuring speed now works for fanSpeed > 18 (approximately), which is sufficient because MIN_PRINT_FAN_SPEED is higher
|
//measuring speed now works for fanSpeed > 18 (approximately), which is sufficient because MIN_PRINT_FAN_SPEED is higher
|
||||||
#ifdef FAN_SOFT_PWM
|
#ifdef FAN_SOFT_PWM
|
||||||
//if (fanSpeedSoftPwm != 255) return;
|
if (!fan_measuring || (fanSpeedSoftPwm < MIN_PRINT_FAN_SPEED)) return;
|
||||||
if (!fan_measuring || (fanSpeed < MIN_PRINT_FAN_SPEED)) return;
|
|
||||||
#else //FAN_SOFT_PWM
|
#else //FAN_SOFT_PWM
|
||||||
if (fanSpeed < MIN_PRINT_FAN_SPEED) return;
|
if (fanSpeed < MIN_PRINT_FAN_SPEED) return;
|
||||||
#endif //FAN_SOFT_PWM
|
#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_under_pressure = extruder_under_pressure; //extruder under pressure flag - currently unused
|
||||||
saved_extruder_relative_mode = axis_relative_modes[E_AXIS];
|
saved_extruder_relative_mode = axis_relative_modes[E_AXIS];
|
||||||
saved_fanSpeed = fanSpeed;
|
saved_fanSpeed = fanSpeed;
|
||||||
#ifdef FAN_SOFT_PWM
|
|
||||||
if (fan_measuring) saved_fanSpeed = fanSpeedBckp;
|
|
||||||
#endif //FAN_SOFT_PWM
|
|
||||||
cmdqueue_reset(); //empty cmdqueue
|
cmdqueue_reset(); //empty cmdqueue
|
||||||
card.sdprinting = false;
|
card.sdprinting = false;
|
||||||
// card.closefile();
|
// card.closefile();
|
||||||
|
|
|
||||||
|
|
@ -758,19 +758,16 @@ void manage_heater()
|
||||||
#ifdef FAN_SOFT_PWM
|
#ifdef FAN_SOFT_PWM
|
||||||
if ((_millis() - extruder_autofan_last_check > FAN_CHECK_PERIOD) && (!fan_measuring)) {
|
if ((_millis() - extruder_autofan_last_check > FAN_CHECK_PERIOD) && (!fan_measuring)) {
|
||||||
extruder_autofan_last_check = _millis();
|
extruder_autofan_last_check = _millis();
|
||||||
fanSpeedBckp = fanSpeed;
|
fanSpeedBckp = fanSpeedSoftPwm;
|
||||||
if (fanSpeed > MIN_PRINT_FAN_SPEED) {
|
if (fanSpeedSoftPwm > MIN_PRINT_FAN_SPEED) {
|
||||||
fanSpeed = 255;
|
fanSpeedSoftPwm = 255;
|
||||||
}
|
}
|
||||||
// fanSpeedBckp = fanSpeedSoftPwm;
|
|
||||||
// fanSpeedSoftPwm = 255;
|
|
||||||
fan_measuring = true;
|
fan_measuring = true;
|
||||||
}
|
}
|
||||||
if ((_millis() - extruder_autofan_last_check > FAN_CHECK_DURATION) && (fan_measuring)) {
|
if ((_millis() - extruder_autofan_last_check > FAN_CHECK_DURATION) && (fan_measuring)) {
|
||||||
countFanSpeed();
|
countFanSpeed();
|
||||||
checkFanSpeed();
|
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]);
|
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();
|
extruder_autofan_last_check = _millis();
|
||||||
fan_measuring = false;
|
fan_measuring = false;
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue