Переглянути джерело

TACH_1 must be defined to enable print fan error

PavelSindler 6 роки тому
батько
коміт
29978c4126
3 змінених файлів з 13 додано та 3 видалено
  1. 3 0
      Firmware/Marlin.h
  2. 6 1
      Firmware/Marlin_main.cpp
  3. 4 2
      Firmware/temperature.cpp

+ 3 - 0
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();

+ 6 - 1
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

+ 4 - 2
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