🔧 Chamber Fan index option (#23262)

This commit is contained in:
ladismrkolj 2021-12-05 22:41:39 +01:00 committed by Scott Lahteine
parent 48358d6a5c
commit 15204470a8
4 changed files with 11 additions and 4 deletions

View File

@ -186,6 +186,7 @@
//#define CHAMBER_FAN // Enable a fan on the chamber //#define CHAMBER_FAN // Enable a fan on the chamber
#if ENABLED(CHAMBER_FAN) #if ENABLED(CHAMBER_FAN)
//#define CHAMBER_FAN_INDEX 2 // Index of a fan to repurpose as the chamber fan. (Default: first unused fan)
#define CHAMBER_FAN_MODE 2 // Fan control mode: 0=Static; 1=Linear increase when temp is higher than target; 2=V-shaped curve; 3=similar to 1 but fan is always on. #define CHAMBER_FAN_MODE 2 // Fan control mode: 0=Static; 1=Linear increase when temp is higher than target; 2=V-shaped curve; 3=similar to 1 but fan is always on.
#if CHAMBER_FAN_MODE == 0 #if CHAMBER_FAN_MODE == 0
#define CHAMBER_FAN_BASE 255 // Chamber fan PWM (0-255) #define CHAMBER_FAN_BASE 255 // Chamber fan PWM (0-255)

View File

@ -2272,8 +2272,8 @@ static_assert(Y_MAX_LENGTH >= Y_BED_SIZE, "Movement bounds (Y_MIN_POS, Y_MAX_POS
#error "LASER_COOLANT_FLOW_METER requires FLOWMETER_PIN and LASER_FEATURE." #error "LASER_COOLANT_FLOW_METER requires FLOWMETER_PIN and LASER_FEATURE."
#endif #endif
#if ENABLED(CHAMBER_FAN) && !(defined(CHAMBER_FAN_MODE) && WITHIN(CHAMBER_FAN_MODE, 0, 2)) #if ENABLED(CHAMBER_FAN) && !(defined(CHAMBER_FAN_MODE) && WITHIN(CHAMBER_FAN_MODE, 0, 3))
#error "CHAMBER_FAN_MODE must be between 0 and 2." #error "CHAMBER_FAN_MODE must be between 0 and 3."
#endif #endif
#if ENABLED(CHAMBER_VENT) #if ENABLED(CHAMBER_VENT)

View File

@ -524,6 +524,10 @@
#endif #endif
#endif #endif
#if ENABLED(CHAMBER_FAN) && !defined(CHAMBER_FAN_INDEX)
#warning "Auto-assigned CHAMBER_FAN_INDEX to the first free FAN pin."
#endif
#if IS_LEGACY_TFT #if IS_LEGACY_TFT
#warning "Don't forget to update your TFT settings in Configuration.h." #warning "Don't forget to update your TFT settings in Configuration.h."
#endif #endif

View File

@ -865,7 +865,9 @@ int16_t Temperature::getHeaterPower(const heater_id_t heater_id) {
#define INIT_CHAMBER_AUTO_FAN_PIN(P) SET_OUTPUT(P) #define INIT_CHAMBER_AUTO_FAN_PIN(P) SET_OUTPUT(P)
#endif #endif
#ifndef CHAMBER_FAN_INDEX
#define CHAMBER_FAN_INDEX HOTENDS #define CHAMBER_FAN_INDEX HOTENDS
#endif
void Temperature::update_autofans() { void Temperature::update_autofans() {
#define _EFAN(B,A) _EFANOVERLAP(A,B) ? B : #define _EFAN(B,A) _EFANOVERLAP(A,B) ? B :