1
0
mirror of https://github.com/MarlinFirmware/Marlin.git synced 2024-11-22 18:25:18 +00:00

First draft: configure extruder fan speed

This commit is contained in:
vovodroid 2024-03-03 21:11:39 +02:00
parent 248648708f
commit f43310fadb
3 changed files with 9 additions and 1 deletions

View File

@ -354,6 +354,9 @@ void menu_advanced_settings();
#include "../../feature/controllerfan.h"
namespace LanguageNarrow_en {
static LSTR MSG_E_FAN = _UxGT("Extruder fan speed");
}
void menu_controller_fan() {
START_MENU();
BACK_ITEM(MSG_CONFIGURATION);
@ -363,6 +366,7 @@ void menu_advanced_settings();
EDIT_ITEM_FAST(percent, MSG_CONTROLLER_FAN_SPEED, &controllerFan.settings.active_speed, CONTROLLERFAN_SPEED_MIN, 255);
EDIT_ITEM(uint16_4, MSG_CONTROLLER_FAN_DURATION, &controllerFan.settings.duration, 0, 4800);
}
EDIT_ITEM_FAST(percent, MSG_E_FAN, &Temperature::extruder_fan_speed, 0, 255);
END_MENU();
}

View File

@ -408,6 +408,8 @@ PGMSTR(str_t_heating_failed, STR_T_HEATING_FAILED);
uint8_t Temperature::soft_pwm_controller_speed = FAN_OFF_PWM;
#endif
uint8_t Temperature::extruder_fan_speed = EXTRUDER_AUTO_FAN_SPEED;
// Init fans according to whether they're native PWM or Software PWM
#ifdef BOARD_OPENDRAIN_MOSFETS
#define _INIT_SOFT_FAN(P) OUT_WRITE_OD(P, ENABLED(FAN_INVERTING) ? LOW : HIGH)
@ -1460,7 +1462,7 @@ int16_t Temperature::getHeaterPower(const heater_id_t heater_id) {
#if ALL(HAS_FANCHECK, HAS_PWMFANCHECK)
#define _AUTOFAN_SPEED() fan_check.is_measuring() ? 255 : EXTRUDER_AUTO_FAN_SPEED
#else
#define _AUTOFAN_SPEED() EXTRUDER_AUTO_FAN_SPEED
#define _AUTOFAN_SPEED() extruder_fan_speed
#endif
#define _AUTOFAN_CASE(N) case N: _UPDATE_AUTO_FAN(E##N, fan_on, _AUTOFAN_SPEED()); break;
#define _AUTOFAN_NOT(N)

View File

@ -647,6 +647,8 @@ class Temperature {
static uint8_t soft_pwm_controller_speed;
#endif
static uint8_t extruder_fan_speed;
#if ALL(HAS_MARLINUI_MENU, PREVENT_COLD_EXTRUSION) && E_MANUAL > 0
static bool allow_cold_extrude_override;
static void set_menu_cold_override(const bool allow) { allow_cold_extrude_override = allow; }