Add REPORT_FAN_CHANGE as an option

This commit is contained in:
Scott Lahteine 2020-07-14 19:30:48 -05:00 committed by Scott Lahteine
parent b40440cf38
commit 2d33a9fd7c
4 changed files with 24 additions and 26 deletions

View file

@ -3104,6 +3104,8 @@
//#define M114_REALTIME // Real current position based on forward kinematics
//#define M114_LEGACY // M114 used to synchronize on every call. Enable if needed.
//#define REPORT_FAN_CHANGE // Report the new fan speed when changed by M106 (and others)
/**
* Set the number of proportional font spaces required to fill up a typical character space.
* This can help to better align the output of commands like `G29 O` Mesh Output.

View file

@ -161,15 +161,15 @@ void menu_temperature() {
// Nozzle [1-5]:
//
#if HOTENDS == 1
EDIT_ITEM_FAST(int3, MSG_NOZZLE, &thermalManager.temp_hotend[0].target, 0, HEATER_0_MAXTEMP - HOTEND_OVERSHOOT, []{ thermalManager.start_watching_hotend(0); });
EDIT_ITEM_FAST(int3, MSG_NOZZLE, &thermalManager.temp_hotend[0].target, 0, HEATER_0_MAXTEMP - (HOTEND_OVERSHOOT), []{ thermalManager.start_watching_hotend(0); });
#elif HAS_MULTI_HOTEND
HOTEND_LOOP()
EDIT_ITEM_FAST_N(int3, e, MSG_NOZZLE_N, &thermalManager.temp_hotend[e].target, 0, thermalManager.heater_maxtemp[e] - HOTEND_OVERSHOOT, []{ thermalManager.start_watching_hotend(MenuItemBase::itemIndex); });
EDIT_ITEM_FAST_N(int3, e, MSG_NOZZLE_N, &thermalManager.temp_hotend[e].target, 0, thermalManager.heater_maxtemp[e] - (HOTEND_OVERSHOOT), []{ thermalManager.start_watching_hotend(MenuItemBase::itemIndex); });
#endif
#if ENABLED(SINGLENOZZLE_STANDBY_TEMP)
LOOP_S_L_N(e, 1, EXTRUDERS)
EDIT_ITEM_FAST_N(uint16_3, e, MSG_NOZZLE_STANDBY, &singlenozzle_temp[e], 0, thermalManager.heater_maxtemp[0] - HOTEND_OVERSHOOT);
EDIT_ITEM_FAST_N(uint16_3, e, MSG_NOZZLE_STANDBY, &singlenozzle_temp[e], 0, thermalManager.heater_maxtemp[0] - (HOTEND_OVERSHOOT));
#endif
//

View file

@ -216,9 +216,11 @@ const char str_t_thermal_runaway[] PROGMEM = STR_T_THERMAL_RUNAWAY,
if (target >= FAN_COUNT) return;
fan_speed[target] = speed;
report_fan_speed(target);
TERN_(REPORT_FAN_CHANGE, report_fan_speed(target));
}
#if ENABLED(REPORT_FAN_CHANGE)
/**
* Report print fan speed for a target extruder
*/
@ -227,6 +229,7 @@ const char str_t_thermal_runaway[] PROGMEM = STR_T_THERMAL_RUNAWAY,
PORT_REDIRECT(SERIAL_BOTH);
SERIAL_ECHOLNPAIR("M106 P", target, " S", fan_speed[target]);
}
#endif
#if EITHER(PROBING_FANS_OFF, ADVANCED_PAUSE_FANS_PAUSE)

View file

@ -474,7 +474,10 @@ class Temperature {
#define FANS_LOOP(I) LOOP_L_N(I, FAN_COUNT)
static void set_fan_speed(const uint8_t target, const uint16_t speed);
#if ENABLED(REPORT_FAN_CHANGE)
static void report_fan_speed(const uint8_t target);
#endif
#if EITHER(PROBING_FANS_OFF, ADVANCED_PAUSE_FANS_PAUSE)
static bool fans_paused;
@ -487,13 +490,7 @@ class Temperature {
static inline uint8_t scaledFanSpeed(const uint8_t target, const uint8_t fs) {
UNUSED(target); // Potentially unused!
return (fs * uint16_t(
#if ENABLED(ADAPTIVE_FAN_SLOWING)
fan_speed_scaler[target]
#else
128
#endif
)) >> 7;
return (fs * uint16_t(TERN(ADAPTIVE_FAN_SLOWING, fan_speed_scaler[target], 128))) >> 7;
}
static inline uint8_t scaledFanSpeed(const uint8_t target) {
@ -629,7 +626,7 @@ class Temperature {
static void setTargetBed(const int16_t celsius) {
TERN_(AUTO_POWER_CONTROL, powerManager.power_on());
temp_bed.target =
#ifdef BED_MAXTEMP
#ifdef BED_MAX_TARGET
_MIN(celsius, BED_MAX_TARGET)
#else
celsius
@ -790,11 +787,7 @@ class Temperature {
#define HAS_MAX6675 EITHER(HEATER_0_USES_MAX6675, HEATER_1_USES_MAX6675)
#if HAS_MAX6675
#if BOTH(HEATER_0_USES_MAX6675, HEATER_1_USES_MAX6675)
#define COUNT_6675 2
#else
#define COUNT_6675 1
#endif
#define COUNT_6675 1 + BOTH(HEATER_0_USES_MAX6675, HEATER_1_USES_MAX6675)
#if COUNT_6675 > 1
#define READ_MAX6675(N) read_max6675(N)
#else