Browse Source

documentation + minor code cleanup based on code review

DRracer 5 years ago
parent
commit
83578c3389
2 changed files with 10 additions and 2 deletions
  1. 5 1
      Firmware/temperature.cpp
  2. 5 1
      Firmware/temperature.h

+ 5 - 1
Firmware/temperature.cpp

@@ -528,7 +528,11 @@ void checkFanSpeed()
 	}
 }
 
-void fanSpeedErrorBeep(const char *serialMsg, const char *lcdMsg){
+//! Prints serialMsg to serial port, displays lcdMsg onto the LCD and beeps.
+//! Extracted from fanSpeedError to save some space.
+//! @param serialMsg pointer into PROGMEM, this text will be printed to the serial port
+//! @param lcdMsg pointer into PROGMEM, this text will be printed onto the LCD
+static void fanSpeedErrorBeep(const char *serialMsg, const char *lcdMsg){
 	SERIAL_ECHOLNRPGM(serialMsg);
 	if (get_message_level() == 0) {
 		if((eSoundMode==e_SOUND_MODE_LOUD)||(eSoundMode==e_SOUND_MODE_ONCE)||(eSoundMode==e_SOUND_MODE_SILENT)){

+ 5 - 1
Firmware/temperature.h

@@ -238,7 +238,11 @@ void checkExtruderAutoFans();
 
 #if (defined(FANCHECK) && defined(TACH_0) && (TACH_0 > -1))
 
-enum { EFCE_OK = 0, EFCE_DETECTED, EFCE_REPORTED };
+enum { 
+	EFCE_OK = 0,   //!< normal operation, both fans are ok
+	EFCE_DETECTED, //!< fan error detected, but not reported yet
+	EFCE_REPORTED  //!< fan error detected and reported to LCD and serial
+};
 extern volatile uint8_t fan_check_error;
 
 void countFanSpeed();