Skip to content

Commit

Permalink
fewer options
Browse files Browse the repository at this point in the history
  • Loading branch information
thinkyhead authored and slowbro committed Jul 8, 2021
1 parent 0087d59 commit 1e6876a
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 20 deletions.
6 changes: 2 additions & 4 deletions Marlin/Configuration_adv.h
Original file line number Diff line number Diff line change
Expand Up @@ -506,10 +506,8 @@
#define CONTROLLERFAN_SPEED_IDLE 0 // (0-255) Idle speed, used when motors are disabled
#define CONTROLLERFAN_IDLE_TIME 60 // (seconds) Extra time to keep the fan running after disabling motors

//#define CONTROLLER_FAN_USE_BOARD_TEMP // Use TEMP_SENSOR_BOARD as a trigger for enabling the controller fan
#if ENABLED(CONTROLLER_FAN_USE_BOARD_TEMP)
#define CONTROLLER_FAN_TRIGGER_TEMP 30 // (°C) Enable the fan when the temperature reaches this temperature
#endif
// Use TEMP_SENSOR_BOARD as a trigger for enabling the controller fan
//#define CONTROLLER_FAN_MIN_BOARD_TEMP 40 // (°C) Turn on the fan if the board reaches this temperature

//#define CONTROLLER_FAN_EDITABLE // Enable M710 configurable settings
#if ENABLED(CONTROLLER_FAN_EDITABLE)
Expand Down
12 changes: 5 additions & 7 deletions Marlin/src/feature/controllerfan.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -77,15 +77,13 @@ void ControllerFan::update() {
);

// If any triggers for the controller fan are true...
// - any of the drivers are enabled
// - the heated bed is enabled
// - TEMP_SENSOR_BOARD is reporting >= CONTROLLER_FAN_TRIGGER_TEMP
// - At least one stepper driver is enabled
// - The heated bed is enabled
// - TEMP_SENSOR_BOARD is reporting >= CONTROLLER_FAN_MIN_BOARD_TEMP
if ( motor_on
|| TERN0(HAS_HEATED_BED, thermalManager.temp_bed.soft_pwm_amount > 0)
|| TERN0(HAS_CONTROLLER_FAN_BOARD_TEMP_TRIGGER, thermalManager.wholeDegBoard() >= CONTROLLER_FAN_TRIGGER_TEMP)
)
lastMotorOn = ms; //... set time to NOW so the fan will turn on

|| TERN0(HAS_CONTROLLER_FAN_MIN_BOARD_TEMP, thermalManager.wholeDegBoard() >= CONTROLLER_FAN_MIN_BOARD_TEMP)
) lastMotorOn = ms; //... set time to NOW so the fan will turn on

// Fan Settings. Set fan > 0:
// - If AutoMode is on and steppers have been enabled for CONTROLLERFAN_IDLE_TIME seconds.
Expand Down
10 changes: 7 additions & 3 deletions Marlin/src/inc/Conditionals_post.h
Original file line number Diff line number Diff line change
Expand Up @@ -2816,9 +2816,6 @@
#endif
#undef _NOT_E_AUTO
#undef _HAS_FAN
#if PIN_EXISTS(CONTROLLER_FAN)
#define HAS_CONTROLLER_FAN 1
#endif

#if BED_OR_CHAMBER || HAS_FAN0
#define BED_OR_CHAMBER_OR_FAN 1
Expand Down Expand Up @@ -2898,6 +2895,13 @@
/**
* Controller Fan Settings
*/
#if PIN_EXISTS(CONTROLLER_FAN)
#define HAS_CONTROLLER_FAN 1
#if CONTROLLER_FAN_MIN_BOARD_TEMP
#define HAS_CONTROLLER_FAN_MIN_BOARD_TEMP 1
#endif
#endif

#if HAS_CONTROLLER_FAN
#if ENABLED(CONTROLLER_FAN_USE_BOARD_TEMP)
#define HAS_CONTROLLER_FAN_BOARD_TEMP_TRIGGER 1
Expand Down
8 changes: 2 additions & 6 deletions Marlin/src/inc/SanityCheck.h
Original file line number Diff line number Diff line change
Expand Up @@ -2230,15 +2230,11 @@ static_assert(Y_MAX_LENGTH >= Y_BED_SIZE, "Movement bounds (Y_MIN_POS, Y_MAX_POS
#error "TEMP_SENSOR_BOARD requires TEMP_BOARD_PIN."
#elif !HAS_TEMP_ADC_BOARD
#error "TEMP_BOARD_PIN must be an ADC pin."
#endif
#endif

#if ENABLED(CONTROLLER_FAN_USE_BOARD_TEMP)
#if !HAS_TEMP_BOARD
#error "CONTROLLER_FAN_USE_BOARD_TEMP requires TEMP_SENSOR_BOARD."
#elif ENABLED(THERMAL_PROTECTION_BOARD) && (!defined(BOARD_MINTEMP) || !defined(BOARD_MAXTEMP))
#error "THERMAL_PROTECTION_BOARD requires BOARD_MINTEMP and BOARD_MAXTEMP."
#endif
#elif CONTROLLER_FAN_MIN_BOARD_TEMP
#error "CONTROLLER_FAN_MIN_BOARD_TEMP requires TEMP_SENSOR_BOARD."
#endif

#if ENABLED(LASER_COOLANT_FLOW_METER) && !(PIN_EXISTS(FLOWMETER) && ENABLED(LASER_FEATURE))
Expand Down

0 comments on commit 1e6876a

Please sign in to comment.