mirror of
https://github.com/MarlinFirmware/Marlin.git
synced 2026-03-05 09:34:47 -07:00
Merge 3f9f622c9a into b553c0e62a
This commit is contained in:
commit
0140939e1d
6 changed files with 11 additions and 0 deletions
|
|
@ -44,6 +44,10 @@
|
|||
#define _CNT_P FAN_COUNT
|
||||
#endif
|
||||
|
||||
#ifndef min
|
||||
#define min std::min
|
||||
#endif
|
||||
|
||||
/**
|
||||
* M106: Set Fan Speed
|
||||
*
|
||||
|
|
@ -86,6 +90,8 @@ void GcodeSuite::M106() {
|
|||
if (!got_preset && parser.seenval('S'))
|
||||
speed = parser.value_ushort();
|
||||
|
||||
speed = min(speed, (uint16_t) thermalManager.max_fan_speed);
|
||||
|
||||
TERN_(FOAMCUTTER_XYUV, speed *= 2.55f); // Get command in % of max heat
|
||||
|
||||
// Set speed, with constraint
|
||||
|
|
|
|||
|
|
@ -387,6 +387,7 @@ namespace LanguageNarrow_en {
|
|||
LSTR MSG_LED_BRIGHTNESS = _UxGT("Brightness");
|
||||
LSTR MSG_HOTEND_TOO_COLD = _UxGT("Hotend too cold");
|
||||
LSTR MSG_CHAMBER = _UxGT("Enclosure");
|
||||
LSTR MSG_MAX_FAN_SPEED = _UxGT("Max Fan Speed");
|
||||
LSTR MSG_STORED_FAN_N = _UxGT("Stored Fan ~");
|
||||
LSTR MSG_EXTRA_FAN_SPEED = _UxGT("Extra Fan Speed");
|
||||
LSTR MSG_EXTRA_FAN_SPEED_N = _UxGT("Extra Fan Speed ~");
|
||||
|
|
|
|||
|
|
@ -241,6 +241,7 @@ void menu_temperature() {
|
|||
singlenozzle_item(7);
|
||||
#endif
|
||||
|
||||
EDIT_ITEM_FAST(percent, MSG_MAX_FAN_SPEED, &Temperature::max_fan_speed, 0, 255);
|
||||
#endif // HAS_FAN
|
||||
|
||||
#if HAS_PREHEAT
|
||||
|
|
|
|||
|
|
@ -192,6 +192,7 @@ void menu_tune() {
|
|||
singlenozzle_item(7);
|
||||
#endif
|
||||
|
||||
EDIT_ITEM_FAST(percent, MSG_MAX_FAN_SPEED, &Temperature::max_fan_speed, 0, 255);
|
||||
#endif // HAS_FAN
|
||||
|
||||
//
|
||||
|
|
|
|||
|
|
@ -436,6 +436,7 @@ PGMSTR(str_t_heating_failed, STR_T_HEATING_FAILED);
|
|||
#if HAS_FAN
|
||||
|
||||
uint8_t Temperature::fan_speed[FAN_COUNT] = ARRAY_N_1(FAN_COUNT, FAN_OFF_PWM);
|
||||
uint8_t Temperature::max_fan_speed = 255;
|
||||
|
||||
#if ENABLED(EXTRA_FAN_SPEED)
|
||||
|
||||
|
|
|
|||
|
|
@ -919,6 +919,7 @@ class Temperature {
|
|||
|
||||
static uint8_t fan_speed[FAN_COUNT];
|
||||
#define FANS_LOOP(I) for (uint8_t I = 0; I < FAN_COUNT; ++I)
|
||||
static uint8_t max_fan_speed;
|
||||
|
||||
static void set_fan_speed(const uint8_t fan, const uint16_t speed);
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue