Skip to content
This repository has been archived by the owner on Jul 1, 2022. It is now read-only.

Commit

Permalink
🔧 Chamber Fan index option (MarlinFirmware#23262)
Browse files Browse the repository at this point in the history
  • Loading branch information
ladismrkolj authored and 0xk1f0 committed Dec 26, 2021
1 parent d79c58d commit bc85a3a
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 4 deletions.
3 changes: 2 additions & 1 deletion Marlin/Configuration_adv.h
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,8 @@

//#define CHAMBER_FAN // Enable a fan on the chamber
#if ENABLED(CHAMBER_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_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.
#if CHAMBER_FAN_MODE == 0
#define CHAMBER_FAN_BASE 255 // Chamber fan PWM (0-255)
#elif CHAMBER_FAN_MODE == 1
Expand Down
4 changes: 2 additions & 2 deletions Marlin/src/inc/SanityCheck.h
Original file line number Diff line number Diff line change
Expand Up @@ -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."
#endif

#if ENABLED(CHAMBER_FAN) && !(defined(CHAMBER_FAN_MODE) && WITHIN(CHAMBER_FAN_MODE, 0, 2))
#error "CHAMBER_FAN_MODE must be between 0 and 2."
#if ENABLED(CHAMBER_FAN) && !(defined(CHAMBER_FAN_MODE) && WITHIN(CHAMBER_FAN_MODE, 0, 3))
#error "CHAMBER_FAN_MODE must be between 0 and 3."
#endif

#if ENABLED(CHAMBER_VENT)
Expand Down
4 changes: 4 additions & 0 deletions Marlin/src/inc/Warnings.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -524,6 +524,10 @@
#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
#warning "Don't forget to update your TFT settings in Configuration.h."
#endif
Expand Down
4 changes: 3 additions & 1 deletion Marlin/src/module/temperature.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -865,7 +865,9 @@ int16_t Temperature::getHeaterPower(const heater_id_t heater_id) {
#define INIT_CHAMBER_AUTO_FAN_PIN(P) SET_OUTPUT(P)
#endif

#define CHAMBER_FAN_INDEX HOTENDS
#ifndef CHAMBER_FAN_INDEX
#define CHAMBER_FAN_INDEX HOTENDS
#endif

void Temperature::update_autofans() {
#define _EFAN(B,A) _EFANOVERLAP(A,B) ? B :
Expand Down

0 comments on commit bc85a3a

Please sign in to comment.