diff --git a/Firmware/Marlin.h b/Firmware/Marlin.h index 68ad18f6..94181632 100644 --- a/Firmware/Marlin.h +++ b/Firmware/Marlin.h @@ -392,7 +392,10 @@ bool check_commands(); void uvlo_(); void recover_print(uint8_t automatic); void setup_uvlo_interrupt(); + +#if defined(TACH_1) && TACH_1 >-1 void setup_fan_interrupt(); +#endif extern void recover_machine_state_after_power_panic(); extern void restore_print_from_eeprom(); diff --git a/Firmware/Marlin_main.cpp b/Firmware/Marlin_main.cpp index 195e2bb4..cd601620 100644 --- a/Firmware/Marlin_main.cpp +++ b/Firmware/Marlin_main.cpp @@ -1179,9 +1179,10 @@ void setup() setup_uvlo_interrupt(); #endif //UVLO_SUPPORT -#ifndef DEBUG_DISABLE_FANCHECK +#if !defined(DEBUG_DISABLE_FANCHECK) && defined(TACH_1) && TACH_1 >-1 setup_fan_interrupt(); #endif //DEBUG_DISABLE_FANCHECK + #ifndef DEBUG_DISABLE_FSENSORCHECK fsensor_setup_interrupt(); #endif //DEBUG_DISABLE_FSENSORCHECK @@ -7648,6 +7649,8 @@ void uvlo_() } #endif //UVLO_SUPPORT +#if defined(TACH_1) && TACH_1 >-1 + void setup_fan_interrupt() { //INT7 DDRE &= ~(1 << 7); //input pin @@ -7678,6 +7681,8 @@ ISR(INT7_vect) { EICRB ^= (1 << 6); //change edge } +#endif + #ifdef UVLO_SUPPORT void setup_uvlo_interrupt() { DDRE &= ~(1 << 4); //input pin diff --git a/Firmware/temperature.cpp b/Firmware/temperature.cpp index 6458df35..81144a2d 100644 --- a/Firmware/temperature.cpp +++ b/Firmware/temperature.cpp @@ -475,12 +475,14 @@ void checkFanSpeed() { fans_check_enabled = (eeprom_read_byte((uint8_t*)EEPROM_FAN_CHECK_ENABLED) > 0); static unsigned char fan_speed_errors[2] = { 0,0 }; - +#if defined(TACH_0) && TACH_0 >-1 if (fan_speed[0] == 0 && (current_temperature[0] > EXTRUDER_AUTO_FAN_TEMPERATURE)) fan_speed_errors[0]++; else fan_speed_errors[0] = 0; - +#endif +#if defined(TACH_1) && TACH_1 >-1 if ((fan_speed[1] == 0)&& (fanSpeed > MIN_PRINT_FAN_SPEED)) fan_speed_errors[1]++; else fan_speed_errors[1] = 0; +#endif if ((fan_speed_errors[0] > 5) && fans_check_enabled) fanSpeedError(0); //extruder fan if ((fan_speed_errors[1] > 15) && fans_check_enabled) fanSpeedError(1); //print fan