Merge branch 'bugfix-2.0.x' of https://github.com/MarlinFirmware/Marlin into bugfix-2.0.x
This commit is contained in:
+1
-5
@@ -27,7 +27,7 @@ bdf2u8g
|
||||
# OS
|
||||
#
|
||||
applet/
|
||||
*.DS_Store
|
||||
.DS_Store
|
||||
|
||||
#
|
||||
# Misc
|
||||
@@ -167,7 +167,3 @@ __pycache__
|
||||
|
||||
# IOLogger logs
|
||||
*_log.csv
|
||||
|
||||
# Simulation / Native
|
||||
eeprom.dat
|
||||
imgui.ini
|
||||
|
||||
+6
-18
@@ -35,7 +35,7 @@
|
||||
*
|
||||
* Advanced settings can be found in Configuration_adv.h
|
||||
*/
|
||||
#define CONFIGURATION_H_VERSION 02000902
|
||||
#define CONFIGURATION_H_VERSION 02000903
|
||||
|
||||
//===========================================================================
|
||||
//============================= Getting Started =============================
|
||||
@@ -2770,23 +2770,11 @@
|
||||
//
|
||||
// Ender-3 v2 OEM display. A DWIN display with Rotary Encoder.
|
||||
//
|
||||
//#define DWIN_CREALITY_LCD
|
||||
|
||||
//
|
||||
// Ender-3 v2 OEM display, enhanced.
|
||||
//
|
||||
//#define DWIN_CREALITY_LCD_ENHANCED
|
||||
|
||||
//
|
||||
// Ender-3 v2 OEM display with enhancements by Jacob Myers
|
||||
//
|
||||
//#define DWIN_CREALITY_LCD_JYERSUI
|
||||
|
||||
//
|
||||
// MarlinUI for Creality's DWIN display (and others)
|
||||
//
|
||||
//#define DWIN_MARLINUI_PORTRAIT
|
||||
//#define DWIN_MARLINUI_LANDSCAPE
|
||||
//#define DWIN_CREALITY_LCD // Creality UI
|
||||
//#define DWIN_CREALITY_LCD_ENHANCED // Enhanced UI
|
||||
//#define DWIN_CREALITY_LCD_JYERSUI // Jyers UI by Jacob Myers
|
||||
//#define DWIN_MARLINUI_PORTRAIT // MarlinUI (portrait orientation)
|
||||
//#define DWIN_MARLINUI_LANDSCAPE // MarlinUI (landscape orientation)
|
||||
|
||||
//
|
||||
// Touch Screen Settings
|
||||
|
||||
+60
-51
@@ -30,7 +30,7 @@
|
||||
*
|
||||
* Basic settings can be found in Configuration.h
|
||||
*/
|
||||
#define CONFIGURATION_ADV_H_VERSION 02000902
|
||||
#define CONFIGURATION_ADV_H_VERSION 02000903
|
||||
|
||||
//===========================================================================
|
||||
//============================= Thermal Settings ============================
|
||||
@@ -414,7 +414,7 @@
|
||||
*/
|
||||
#define AUTOTEMP
|
||||
#if ENABLED(AUTOTEMP)
|
||||
#define AUTOTEMP_OLDWEIGHT 0.98
|
||||
#define AUTOTEMP_OLDWEIGHT 0.98 // Factor used to weight previous readings (0.0 < value < 1.0)
|
||||
// Turn on AUTOTEMP on M104/M109 by default using proportions set here
|
||||
//#define AUTOTEMP_PROPORTIONAL
|
||||
#if ENABLED(AUTOTEMP_PROPORTIONAL)
|
||||
@@ -1913,6 +1913,7 @@
|
||||
#define LIN_ADVANCE_K 0.22 // Unit: mm compression per 1mm/s extruder speed
|
||||
//#define LA_DEBUG // If enabled, this will generate debug information output over USB.
|
||||
//#define EXPERIMENTAL_SCURVE // Enable this option to permit S-Curve Acceleration
|
||||
//#define ALLOW_LOW_EJERK // Allow a DEFAULT_EJERK value of <10. Recommended for direct drive hotends.
|
||||
#endif
|
||||
|
||||
// @section leveling
|
||||
@@ -1988,65 +1989,69 @@
|
||||
|
||||
/**
|
||||
* Thermal Probe Compensation
|
||||
* Probe measurements are adjusted to compensate for temperature distortion.
|
||||
* Use G76 to calibrate this feature. Use M871 to set values manually.
|
||||
* For a more detailed explanation of the process see G76_M871.cpp.
|
||||
*
|
||||
* Adjust probe measurements to compensate for distortion associated with the temperature
|
||||
* of the probe, bed, and/or hotend.
|
||||
* Use G76 to automatically calibrate this feature for probe and bed temperatures.
|
||||
* (Extruder temperature/offset values must be calibrated manually.)
|
||||
* Use M871 to set temperature/offset values manually.
|
||||
* For more details see https://marlinfw.org/docs/features/probe_temp_compensation.html
|
||||
*/
|
||||
#if HAS_BED_PROBE && TEMP_SENSOR_PROBE && TEMP_SENSOR_BED
|
||||
// Enable thermal first layer compensation using bed and probe temperatures
|
||||
#define PROBE_TEMP_COMPENSATION
|
||||
//#define PTC_PROBE // Compensate based on probe temperature
|
||||
//#define PTC_BED // Compensate based on bed temperature
|
||||
//#define PTC_HOTEND // Compensate based on hotend temperature
|
||||
|
||||
// Add additional compensation depending on hotend temperature
|
||||
// Note: this values cannot be calibrated and have to be set manually
|
||||
#if ENABLED(PROBE_TEMP_COMPENSATION)
|
||||
#if ANY(PTC_PROBE, PTC_BED, PTC_HOTEND)
|
||||
/**
|
||||
* If the probe is outside the defined range, use linear extrapolation with the closest
|
||||
* point and the point with index PTC_LINEAR_EXTRAPOLATION. e.g., If set to 4 it will use the
|
||||
* linear extrapolation between data[0] and data[4] for values below PTC_PROBE_START.
|
||||
*/
|
||||
//#define PTC_LINEAR_EXTRAPOLATION 4
|
||||
|
||||
#if ENABLED(PTC_PROBE)
|
||||
// Probe temperature calibration generates a table of values starting at PTC_PROBE_START
|
||||
// (e.g., 30), in steps of PTC_PROBE_RES (e.g., 5) with PTC_PROBE_COUNT (e.g., 10) samples.
|
||||
#define PTC_PROBE_START 30 // (°C)
|
||||
#define PTC_PROBE_RES 5 // (°C)
|
||||
#define PTC_PROBE_COUNT 10
|
||||
#define PTC_PROBE_ZOFFS { 0 } // (µm) Z adjustments per sample
|
||||
#endif
|
||||
|
||||
#if ENABLED(PTC_BED)
|
||||
// Bed temperature calibration builds a similar table.
|
||||
#define PTC_BED_START 60 // (°C)
|
||||
#define PTC_BED_RES 5 // (°C)
|
||||
#define PTC_BED_COUNT 10
|
||||
#define PTC_BED_ZOFFS { 0 } // (µm) Z adjustments per sample
|
||||
#endif
|
||||
|
||||
#if ENABLED(PTC_HOTEND)
|
||||
// Note: There is no automatic calibration for the hotend. Use M871.
|
||||
#define PTC_HOTEND_START 180 // (°C)
|
||||
#define PTC_HOTEND_RES 5 // (°C)
|
||||
#define PTC_HOTEND_COUNT 20
|
||||
#define PTC_HOTEND_ZOFFS { 0 } // (µm) Z adjustments per sample
|
||||
#endif
|
||||
|
||||
// G76 options
|
||||
#if BOTH(PTC_PROBE, PTC_BED)
|
||||
// Park position to wait for probe cooldown
|
||||
#define PTC_PARK_POS { 0, 0, 100 }
|
||||
|
||||
// Probe position to probe and wait for probe to reach target temperature
|
||||
//#define PTC_PROBE_POS { 12.0f, 7.3f } // Example: MK52 magnetic heatbed
|
||||
#define PTC_PROBE_POS { 90, 100 }
|
||||
|
||||
// Enable additional compensation using hotend temperature
|
||||
// Note: this values cannot be calibrated automatically but have to be set manually via M871.
|
||||
//#define USE_TEMP_EXT_COMPENSATION
|
||||
|
||||
// Probe temperature calibration generates a table of values starting at PTC_SAMPLE_START
|
||||
// (e.g., 30), in steps of PTC_SAMPLE_RES (e.g., 5) with PTC_SAMPLE_COUNT (e.g., 10) samples.
|
||||
|
||||
//#define PTC_SAMPLE_START 30 // (°C)
|
||||
//#define PTC_SAMPLE_RES 5 // (°C)
|
||||
//#define PTC_SAMPLE_COUNT 10
|
||||
|
||||
// Bed temperature calibration builds a similar table.
|
||||
|
||||
//#define BTC_SAMPLE_START 60 // (°C)
|
||||
//#define BTC_SAMPLE_RES 5 // (°C)
|
||||
//#define BTC_SAMPLE_COUNT 10
|
||||
|
||||
#if ENABLED(USE_TEMP_EXT_COMPENSATION)
|
||||
//#define ETC_SAMPLE_START 180 // (°C)
|
||||
//#define ETC_SAMPLE_RES 5 // (°C)
|
||||
//#define ETC_SAMPLE_COUNT 20
|
||||
#endif
|
||||
|
||||
// The temperature the probe should be at while taking measurements during bed temperature
|
||||
// calibration.
|
||||
//#define BTC_PROBE_TEMP 30 // (°C)
|
||||
// The temperature the probe should be at while taking measurements during
|
||||
// bed temperature calibration.
|
||||
#define PTC_PROBE_TEMP 30 // (°C)
|
||||
|
||||
// Height above Z=0.0 to raise the nozzle. Lowering this can help the probe to heat faster.
|
||||
// Note: the Z=0.0 offset is determined by the probe offset which can be set using M851.
|
||||
//#define PTC_PROBE_HEATING_OFFSET 0.5
|
||||
|
||||
// Height to raise the Z-probe between heating and taking the next measurement. Some probes
|
||||
// may fail to untrigger if they have been triggered for a long time, which can be solved by
|
||||
// increasing the height the probe is raised to.
|
||||
//#define PTC_PROBE_RAISE 15
|
||||
|
||||
// If the probe is outside of the defined range, use linear extrapolation using the closest
|
||||
// point and the PTC_LINEAR_EXTRAPOLATION'th next point. E.g. if set to 4 it will use data[0]
|
||||
// and data[4] to perform linear extrapolation for values below PTC_SAMPLE_START.
|
||||
//#define PTC_LINEAR_EXTRAPOLATION 4
|
||||
// Note: The Z=0.0 offset is determined by the probe Z offset (e.g., as set with M851 Z).
|
||||
#define PTC_PROBE_HEATING_OFFSET 0.5
|
||||
#endif
|
||||
#endif
|
||||
#endif // PTC_PROBE || PTC_BED || PTC_HOTEND
|
||||
|
||||
// @section extras
|
||||
|
||||
@@ -3844,7 +3849,8 @@
|
||||
#if ENABLED(HOST_ACTION_COMMANDS)
|
||||
//#define HOST_PAUSE_M76
|
||||
//#define HOST_PROMPT_SUPPORT
|
||||
//#define HOST_START_MENU_ITEM // Add a menu item that tells the host to start
|
||||
//#define HOST_START_MENU_ITEM // Add a menu item that tells the host to start
|
||||
//#define HOST_SHUTDOWN_MENU_ITEM // Add a menu item that tells the host to shut down
|
||||
#endif
|
||||
|
||||
/**
|
||||
@@ -4218,3 +4224,6 @@
|
||||
*/
|
||||
//#define SOFT_RESET_VIA_SERIAL // 'KILL' and '^X' commands will soft-reset the controller
|
||||
//#define SOFT_RESET_ON_KILL // Use a digital button to soft-reset the controller after KILL
|
||||
|
||||
// Report uncleaned reset reason from register r2 instead of MCUSR. Supported by Optiboot on AVR.
|
||||
//#define OPTIBOOT_RESET_REASON
|
||||
|
||||
+1
-1
@@ -41,7 +41,7 @@
|
||||
* here we define this default string as the date where the latest release
|
||||
* version was tagged.
|
||||
*/
|
||||
//#define STRING_DISTRIBUTION_DATE "2021-10-25"
|
||||
//#define STRING_DISTRIBUTION_DATE "2021-11-04"
|
||||
|
||||
/**
|
||||
* Defines a generic printer name to be output to the LCD after booting Marlin.
|
||||
|
||||
@@ -35,12 +35,31 @@
|
||||
// Public Variables
|
||||
// ------------------------
|
||||
|
||||
//uint8_t MCUSR;
|
||||
// Don't initialize/override variable (which would happen in .init4)
|
||||
uint8_t reset_reason __attribute__((section(".noinit")));
|
||||
|
||||
// ------------------------
|
||||
// Public functions
|
||||
// ------------------------
|
||||
|
||||
__attribute__((naked)) // Don't output function pro- and epilogue
|
||||
__attribute__((used)) // Output the function, even if "not used"
|
||||
__attribute__((section(".init3"))) // Put in an early user definable section
|
||||
void HAL_save_reset_reason() {
|
||||
#if ENABLED(OPTIBOOT_RESET_REASON)
|
||||
__asm__ __volatile__(
|
||||
A("STS %0, r2")
|
||||
: "=m"(reset_reason)
|
||||
);
|
||||
#else
|
||||
reset_reason = MCUSR;
|
||||
#endif
|
||||
|
||||
// Clear within 16ms since WDRF bit enables a 16ms watchdog timer -> Boot loop
|
||||
MCUSR = 0;
|
||||
wdt_disable();
|
||||
}
|
||||
|
||||
void HAL_init() {
|
||||
// Init Servo Pins
|
||||
#define INIT_SERVO(N) OUT_WRITE(SERVO##N##_PIN, LOW)
|
||||
|
||||
@@ -91,7 +91,7 @@ typedef int8_t pin_t;
|
||||
// Public Variables
|
||||
// ------------------------
|
||||
|
||||
//extern uint8_t MCUSR;
|
||||
extern uint8_t reset_reason;
|
||||
|
||||
// Serial ports
|
||||
#ifdef USBCON
|
||||
@@ -152,8 +152,8 @@ void HAL_init();
|
||||
|
||||
//void _delay_ms(const int delay);
|
||||
|
||||
inline void HAL_clear_reset_source() { MCUSR = 0; }
|
||||
inline uint8_t HAL_get_reset_source() { return MCUSR; }
|
||||
inline void HAL_clear_reset_source() { }
|
||||
inline uint8_t HAL_get_reset_source() { return reset_reason; }
|
||||
|
||||
void HAL_reboot();
|
||||
|
||||
@@ -221,7 +221,7 @@ void set_pwm_frequency(const pin_t pin, int f_desired);
|
||||
|
||||
/**
|
||||
* set_pwm_duty
|
||||
* Sets the PWM duty cycle of the provided pin to the provided value
|
||||
* Set the PWM duty cycle of the provided pin to the provided value
|
||||
* Optionally allows inverting the duty cycle [default = false]
|
||||
* Optionally allows changing the maximum size of the provided value to enable finer PWM duty control [default = 255]
|
||||
*/
|
||||
|
||||
@@ -22,11 +22,10 @@
|
||||
#ifdef __AVR__
|
||||
|
||||
#include "../../inc/MarlinConfigPre.h"
|
||||
#include "HAL.h"
|
||||
|
||||
#if NEEDS_HARDWARE_PWM // Specific meta-flag for features that mandate PWM
|
||||
|
||||
#include "HAL.h"
|
||||
|
||||
struct Timer {
|
||||
volatile uint8_t* TCCRnQ[3]; // max 3 TCCR registers per timer
|
||||
volatile uint16_t* OCRnQ[3]; // max 3 OCR registers per timer
|
||||
@@ -153,7 +152,7 @@ Timer get_pwm_timer(const pin_t pin) {
|
||||
|
||||
void set_pwm_frequency(const pin_t pin, int f_desired) {
|
||||
Timer timer = get_pwm_timer(pin);
|
||||
if (timer.n == 0) return; // Don't proceed if protected timer or not recognised
|
||||
if (timer.n == 0) return; // Don't proceed if protected timer or not recognized
|
||||
uint16_t size;
|
||||
if (timer.n == 2) size = 255; else size = 65535;
|
||||
|
||||
@@ -243,40 +242,39 @@ void set_pwm_frequency(const pin_t pin, int f_desired) {
|
||||
_SET_ICRn(timer.ICRn, res); // Set ICRn value (TOP) = res
|
||||
}
|
||||
|
||||
#endif // NEEDS_HARDWARE_PWM
|
||||
|
||||
void set_pwm_duty(const pin_t pin, const uint16_t v, const uint16_t v_size/*=255*/, const bool invert/*=false*/) {
|
||||
// If v is 0 or v_size (max), digitalWrite to LOW or HIGH.
|
||||
// Note that digitalWrite also disables pwm output for us (sets COM bit to 0)
|
||||
if (v == 0)
|
||||
digitalWrite(pin, invert);
|
||||
else if (v == v_size)
|
||||
digitalWrite(pin, !invert);
|
||||
else {
|
||||
Timer timer = get_pwm_timer(pin);
|
||||
if (timer.n == 0) return; // Don't proceed if protected timer or not recognised
|
||||
// Set compare output mode to CLEAR -> SET or SET -> CLEAR (if inverted)
|
||||
_SET_COMnQ(timer.TCCRnQ, (timer.q
|
||||
#ifdef TCCR2
|
||||
+ (timer.q == 2) // COM20 is on bit 4 of TCCR2, thus requires q + 1 in the macro
|
||||
#endif
|
||||
), COM_CLEAR_SET + invert
|
||||
);
|
||||
#if NEEDS_HARDWARE_PWM
|
||||
|
||||
uint16_t top;
|
||||
if (timer.n == 2) { // if TIMER2
|
||||
top = (
|
||||
#if ENABLED(USE_OCR2A_AS_TOP)
|
||||
*timer.OCRnQ[0] // top = OCR2A
|
||||
#else
|
||||
255 // top = 0xFF (max)
|
||||
#endif
|
||||
// If v is 0 or v_size (max), digitalWrite to LOW or HIGH.
|
||||
// Note that digitalWrite also disables pwm output for us (sets COM bit to 0)
|
||||
if (v == 0)
|
||||
digitalWrite(pin, invert);
|
||||
else if (v == v_size)
|
||||
digitalWrite(pin, !invert);
|
||||
else {
|
||||
Timer timer = get_pwm_timer(pin);
|
||||
if (timer.n == 0) return; // Don't proceed if protected timer or not recognized
|
||||
// Set compare output mode to CLEAR -> SET or SET -> CLEAR (if inverted)
|
||||
_SET_COMnQ(timer.TCCRnQ, (timer.q
|
||||
#ifdef TCCR2
|
||||
+ (timer.q == 2) // COM20 is on bit 4 of TCCR2, thus requires q + 1 in the macro
|
||||
#endif
|
||||
), COM_CLEAR_SET + invert
|
||||
);
|
||||
}
|
||||
else
|
||||
top = *timer.ICRn; // top = ICRn
|
||||
|
||||
_SET_OCRnQ(timer.OCRnQ, timer.q, v * float(top) / float(v_size)); // Scale 8/16-bit v to top value
|
||||
}
|
||||
uint16_t top = (timer.n == 2) ? TERN(USE_OCR2A_AS_TOP, *timer.OCRnQ[0], 255) : *timer.ICRn;
|
||||
_SET_OCRnQ(timer.OCRnQ, timer.q, (v * top + v_size / 2) / v_size); // Scale 8/16-bit v to top value
|
||||
}
|
||||
|
||||
#else
|
||||
|
||||
analogWrite(pin, v);
|
||||
UNUSED(v_size);
|
||||
UNUSED(invert);
|
||||
|
||||
#endif
|
||||
}
|
||||
|
||||
#endif // NEEDS_HARDWARE_PWM
|
||||
#endif // __AVR__
|
||||
|
||||
@@ -144,6 +144,11 @@ inline void HAL_adc_init() {}//todo
|
||||
void HAL_adc_start_conversion(const uint8_t ch);
|
||||
uint16_t HAL_adc_get_result();
|
||||
|
||||
//
|
||||
// PWM
|
||||
//
|
||||
inline void set_pwm_duty(const pin_t pin, const uint16_t v, const uint16_t=255, const bool=false) { analogWrite(pin, v); }
|
||||
|
||||
//
|
||||
// Pin Map
|
||||
//
|
||||
|
||||
@@ -4,15 +4,16 @@
|
||||
# Windows: bossac.exe
|
||||
# Other: leave unchanged
|
||||
#
|
||||
import pioutil
|
||||
if pioutil.is_pio_build():
|
||||
import platform
|
||||
current_OS = platform.system()
|
||||
|
||||
import platform
|
||||
current_OS = platform.system()
|
||||
if current_OS == 'Windows':
|
||||
|
||||
if current_OS == 'Windows':
|
||||
Import("env")
|
||||
|
||||
Import("env")
|
||||
|
||||
# Use bossac.exe on Windows
|
||||
env.Replace(
|
||||
UPLOADCMD="bossac --info --unlock --write --verify --reset --erase -U false --boot $SOURCE"
|
||||
)
|
||||
# Use bossac.exe on Windows
|
||||
env.Replace(
|
||||
UPLOADCMD="bossac --info --unlock --write --verify --reset --erase -U false --boot $SOURCE"
|
||||
)
|
||||
|
||||
@@ -129,6 +129,10 @@ void HAL_adc_init();
|
||||
|
||||
void HAL_adc_start_conversion(const uint8_t adc_pin);
|
||||
|
||||
// PWM
|
||||
inline void set_pwm_duty(const pin_t pin, const uint16_t v, const uint16_t=255, const bool=false) { analogWrite(pin, v); }
|
||||
|
||||
// Pin Map
|
||||
#define GET_PIN_MAP_PIN(index) index
|
||||
#define GET_PIN_MAP_INDEX(pin) pin
|
||||
#define PARSED_PIN_INDEX(code, dval) parser.intval(code, dval)
|
||||
|
||||
@@ -64,12 +64,9 @@ uint32_t i2s_port_data = 0;
|
||||
#define I2S_EXIT_CRITICAL() portEXIT_CRITICAL(&i2s_spinlock[i2s_num])
|
||||
|
||||
static inline void gpio_matrix_out_check(uint32_t gpio, uint32_t signal_idx, bool out_inv, bool oen_inv) {
|
||||
//if pin = -1, do not need to configure
|
||||
if (gpio != -1) {
|
||||
PIN_FUNC_SELECT(GPIO_PIN_MUX_REG[gpio], PIN_FUNC_GPIO);
|
||||
gpio_set_direction((gpio_num_t)gpio, (gpio_mode_t)GPIO_MODE_DEF_OUTPUT);
|
||||
gpio_matrix_out(gpio, signal_idx, out_inv, oen_inv);
|
||||
}
|
||||
PIN_FUNC_SELECT(GPIO_PIN_MUX_REG[gpio], PIN_FUNC_GPIO);
|
||||
gpio_set_direction((gpio_num_t)gpio, (gpio_mode_t)GPIO_MODE_DEF_OUTPUT);
|
||||
gpio_matrix_out(gpio, signal_idx, out_inv, oen_inv);
|
||||
}
|
||||
|
||||
static esp_err_t i2s_reset_fifo(i2s_port_t i2s_num) {
|
||||
@@ -256,13 +253,7 @@ int i2s_init() {
|
||||
|
||||
I2S0.fifo_conf.dscr_en = 0;
|
||||
|
||||
I2S0.conf_chan.tx_chan_mod = (
|
||||
#if ENABLED(I2S_STEPPER_SPLIT_STREAM)
|
||||
4
|
||||
#else
|
||||
0
|
||||
#endif
|
||||
);
|
||||
I2S0.conf_chan.tx_chan_mod = TERN(I2S_STEPPER_SPLIT_STREAM, 4, 0);
|
||||
I2S0.fifo_conf.tx_fifo_mod = 0;
|
||||
I2S0.conf.tx_mono = 0;
|
||||
|
||||
@@ -313,9 +304,16 @@ int i2s_init() {
|
||||
xTaskCreatePinnedToCore(stepperTask, "StepperTask", 10000, nullptr, 1, nullptr, CONFIG_ARDUINO_RUNNING_CORE); // run I2S stepper task on same core as rest of Marlin
|
||||
|
||||
// Route the i2s pins to the appropriate GPIO
|
||||
gpio_matrix_out_check(I2S_DATA, I2S0O_DATA_OUT23_IDX, 0, 0);
|
||||
gpio_matrix_out_check(I2S_BCK, I2S0O_BCK_OUT_IDX, 0, 0);
|
||||
gpio_matrix_out_check(I2S_WS, I2S0O_WS_OUT_IDX, 0, 0);
|
||||
// If a pin is not defined, no need to configure
|
||||
#if defined(I2S_DATA) && I2S_DATA >= 0
|
||||
gpio_matrix_out_check(I2S_DATA, I2S0O_DATA_OUT23_IDX, 0, 0);
|
||||
#endif
|
||||
#if defined(I2S_BCK) && I2S_BCK >= 0
|
||||
gpio_matrix_out_check(I2S_BCK, I2S0O_BCK_OUT_IDX, 0, 0);
|
||||
#endif
|
||||
#if defined(I2S_WS) && I2S_WS >= 0
|
||||
gpio_matrix_out_check(I2S_WS, I2S0O_WS_OUT_IDX, 0, 0);
|
||||
#endif
|
||||
|
||||
// Start the I2S peripheral
|
||||
return i2s_start(I2S_NUM_0);
|
||||
|
||||
@@ -101,6 +101,9 @@ void HAL_adc_enable_channel(const uint8_t ch);
|
||||
void HAL_adc_start_conversion(const uint8_t ch);
|
||||
uint16_t HAL_adc_get_result();
|
||||
|
||||
// PWM
|
||||
inline void set_pwm_duty(const pin_t pin, const uint16_t v, const uint16_t=255, const bool=false) { analogWrite(pin, v); }
|
||||
|
||||
// Reset source
|
||||
inline void HAL_clear_reset_source(void) {}
|
||||
inline uint8_t HAL_get_reset_source(void) { return RST_POWER_ON; }
|
||||
|
||||
@@ -22,18 +22,18 @@
|
||||
#ifdef TARGET_LPC1768
|
||||
|
||||
#include "../../inc/MarlinConfigPre.h"
|
||||
|
||||
#if NEEDS_HARDWARE_PWM // Specific meta-flag for features that mandate PWM
|
||||
|
||||
#include <pwm.h>
|
||||
|
||||
void set_pwm_frequency(const pin_t pin, int f_desired) {
|
||||
LPC176x::pwm_set_frequency(pin, f_desired);
|
||||
}
|
||||
|
||||
void set_pwm_duty(const pin_t pin, const uint16_t v, const uint16_t v_size/*=255*/, const bool invert/*=false*/) {
|
||||
LPC176x::pwm_write_ratio(pin, invert ? 1.0f - (float)v / v_size : (float)v / v_size);
|
||||
}
|
||||
|
||||
#endif // NEEDS_HARDWARE_PWM
|
||||
#if NEEDS_HARDWARE_PWM // Specific meta-flag for features that mandate PWM
|
||||
|
||||
void set_pwm_frequency(const pin_t pin, int f_desired) {
|
||||
LPC176x::pwm_set_frequency(pin, f_desired);
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
#endif // TARGET_LPC1768
|
||||
|
||||
@@ -1,123 +1,127 @@
|
||||
#
|
||||
# sets output_port
|
||||
# upload_extra_script.py
|
||||
# set the output_port
|
||||
# if target_filename is found then that drive is used
|
||||
# else if target_drive is found then that drive is used
|
||||
#
|
||||
from __future__ import print_function
|
||||
|
||||
target_filename = "FIRMWARE.CUR"
|
||||
target_drive = "REARM"
|
||||
import pioutil
|
||||
if pioutil.is_pio_build():
|
||||
|
||||
import os,getpass,platform
|
||||
target_filename = "FIRMWARE.CUR"
|
||||
target_drive = "REARM"
|
||||
|
||||
current_OS = platform.system()
|
||||
Import("env")
|
||||
import os,getpass,platform
|
||||
|
||||
def print_error(e):
|
||||
print('\nUnable to find destination disk (%s)\n' \
|
||||
'Please select it in platformio.ini using the upload_port keyword ' \
|
||||
'(https://docs.platformio.org/en/latest/projectconf/section_env_upload.html) ' \
|
||||
'or copy the firmware (.pio/build/%s/firmware.bin) manually to the appropriate disk\n' \
|
||||
%(e, env.get('PIOENV')))
|
||||
current_OS = platform.system()
|
||||
Import("env")
|
||||
|
||||
def before_upload(source, target, env):
|
||||
try:
|
||||
#
|
||||
# Find a disk for upload
|
||||
#
|
||||
upload_disk = 'Disk not found'
|
||||
target_file_found = False
|
||||
target_drive_found = False
|
||||
if current_OS == 'Windows':
|
||||
def print_error(e):
|
||||
print('\nUnable to find destination disk (%s)\n' \
|
||||
'Please select it in platformio.ini using the upload_port keyword ' \
|
||||
'(https://docs.platformio.org/en/latest/projectconf/section_env_upload.html) ' \
|
||||
'or copy the firmware (.pio/build/%s/firmware.bin) manually to the appropriate disk\n' \
|
||||
%(e, env.get('PIOENV')))
|
||||
|
||||
def before_upload(source, target, env):
|
||||
try:
|
||||
#
|
||||
# platformio.ini will accept this for a Windows upload port designation: 'upload_port = L:'
|
||||
# Windows - doesn't care about the disk's name, only cares about the drive letter
|
||||
import subprocess,string
|
||||
from ctypes import windll
|
||||
# Find a disk for upload
|
||||
#
|
||||
upload_disk = 'Disk not found'
|
||||
target_file_found = False
|
||||
target_drive_found = False
|
||||
if current_OS == 'Windows':
|
||||
#
|
||||
# platformio.ini will accept this for a Windows upload port designation: 'upload_port = L:'
|
||||
# Windows - doesn't care about the disk's name, only cares about the drive letter
|
||||
import subprocess,string
|
||||
from ctypes import windll
|
||||
|
||||
# getting list of drives
|
||||
# https://stackoverflow.com/questions/827371/is-there-a-way-to-list-all-the-available-drive-letters-in-python
|
||||
drives = []
|
||||
bitmask = windll.kernel32.GetLogicalDrives()
|
||||
for letter in string.ascii_uppercase:
|
||||
if bitmask & 1:
|
||||
drives.append(letter)
|
||||
bitmask >>= 1
|
||||
# getting list of drives
|
||||
# https://stackoverflow.com/questions/827371/is-there-a-way-to-list-all-the-available-drive-letters-in-python
|
||||
drives = []
|
||||
bitmask = windll.kernel32.GetLogicalDrives()
|
||||
for letter in string.ascii_uppercase:
|
||||
if bitmask & 1:
|
||||
drives.append(letter)
|
||||
bitmask >>= 1
|
||||
|
||||
for drive in drives:
|
||||
final_drive_name = drive + ':\\'
|
||||
# print ('disc check: {}'.format(final_drive_name))
|
||||
try:
|
||||
volume_info = str(subprocess.check_output('cmd /C dir ' + final_drive_name, stderr=subprocess.STDOUT))
|
||||
except Exception as e:
|
||||
print ('error:{}'.format(e))
|
||||
continue
|
||||
else:
|
||||
if target_drive in volume_info and not target_file_found: # set upload if not found target file yet
|
||||
target_drive_found = True
|
||||
upload_disk = final_drive_name
|
||||
if target_filename in volume_info:
|
||||
if not target_file_found:
|
||||
for drive in drives:
|
||||
final_drive_name = drive + ':\\'
|
||||
# print ('disc check: {}'.format(final_drive_name))
|
||||
try:
|
||||
volume_info = str(subprocess.check_output('cmd /C dir ' + final_drive_name, stderr=subprocess.STDOUT))
|
||||
except Exception as e:
|
||||
print ('error:{}'.format(e))
|
||||
continue
|
||||
else:
|
||||
if target_drive in volume_info and not target_file_found: # set upload if not found target file yet
|
||||
target_drive_found = True
|
||||
upload_disk = final_drive_name
|
||||
target_file_found = True
|
||||
if target_filename in volume_info:
|
||||
if not target_file_found:
|
||||
upload_disk = final_drive_name
|
||||
target_file_found = True
|
||||
|
||||
elif current_OS == 'Linux':
|
||||
#
|
||||
# platformio.ini will accept this for a Linux upload port designation: 'upload_port = /media/media_name/drive'
|
||||
#
|
||||
drives = os.listdir(os.path.join(os.sep, 'media', getpass.getuser()))
|
||||
if target_drive in drives: # If target drive is found, use it.
|
||||
target_drive_found = True
|
||||
upload_disk = os.path.join(os.sep, 'media', getpass.getuser(), target_drive) + os.sep
|
||||
else:
|
||||
elif current_OS == 'Linux':
|
||||
#
|
||||
# platformio.ini will accept this for a Linux upload port designation: 'upload_port = /media/media_name/drive'
|
||||
#
|
||||
drives = os.listdir(os.path.join(os.sep, 'media', getpass.getuser()))
|
||||
if target_drive in drives: # If target drive is found, use it.
|
||||
target_drive_found = True
|
||||
upload_disk = os.path.join(os.sep, 'media', getpass.getuser(), target_drive) + os.sep
|
||||
else:
|
||||
for drive in drives:
|
||||
try:
|
||||
files = os.listdir(os.path.join(os.sep, 'media', getpass.getuser(), drive))
|
||||
except:
|
||||
continue
|
||||
else:
|
||||
if target_filename in files:
|
||||
upload_disk = os.path.join(os.sep, 'media', getpass.getuser(), drive) + os.sep
|
||||
target_file_found = True
|
||||
break
|
||||
#
|
||||
# set upload_port to drive if found
|
||||
#
|
||||
|
||||
if target_file_found or target_drive_found:
|
||||
env.Replace(
|
||||
UPLOAD_FLAGS="-P$UPLOAD_PORT"
|
||||
)
|
||||
|
||||
elif current_OS == 'Darwin': # MAC
|
||||
#
|
||||
# platformio.ini will accept this for a OSX upload port designation: 'upload_port = /media/media_name/drive'
|
||||
#
|
||||
drives = os.listdir('/Volumes') # human readable names
|
||||
if target_drive in drives and not target_file_found: # set upload if not found target file yet
|
||||
target_drive_found = True
|
||||
upload_disk = '/Volumes/' + target_drive + '/'
|
||||
for drive in drives:
|
||||
try:
|
||||
files = os.listdir(os.path.join(os.sep, 'media', getpass.getuser(), drive))
|
||||
filenames = os.listdir('/Volumes/' + drive + '/') # will get an error if the drive is protected
|
||||
except:
|
||||
continue
|
||||
else:
|
||||
if target_filename in files:
|
||||
upload_disk = os.path.join(os.sep, 'media', getpass.getuser(), drive) + os.sep
|
||||
if target_filename in filenames:
|
||||
if not target_file_found:
|
||||
upload_disk = '/Volumes/' + drive + '/'
|
||||
target_file_found = True
|
||||
break
|
||||
#
|
||||
# set upload_port to drive if found
|
||||
#
|
||||
|
||||
#
|
||||
# Set upload_port to drive if found
|
||||
#
|
||||
if target_file_found or target_drive_found:
|
||||
env.Replace(
|
||||
UPLOAD_FLAGS="-P$UPLOAD_PORT"
|
||||
)
|
||||
env.Replace(UPLOAD_PORT=upload_disk)
|
||||
print('\nUpload disk: ', upload_disk, '\n')
|
||||
else:
|
||||
print_error('Autodetect Error')
|
||||
|
||||
elif current_OS == 'Darwin': # MAC
|
||||
#
|
||||
# platformio.ini will accept this for a OSX upload port designation: 'upload_port = /media/media_name/drive'
|
||||
#
|
||||
drives = os.listdir('/Volumes') # human readable names
|
||||
if target_drive in drives and not target_file_found: # set upload if not found target file yet
|
||||
target_drive_found = True
|
||||
upload_disk = '/Volumes/' + target_drive + '/'
|
||||
for drive in drives:
|
||||
try:
|
||||
filenames = os.listdir('/Volumes/' + drive + '/') # will get an error if the drive is protected
|
||||
except:
|
||||
continue
|
||||
else:
|
||||
if target_filename in filenames:
|
||||
if not target_file_found:
|
||||
upload_disk = '/Volumes/' + drive + '/'
|
||||
target_file_found = True
|
||||
except Exception as e:
|
||||
print_error(str(e))
|
||||
|
||||
#
|
||||
# Set upload_port to drive if found
|
||||
#
|
||||
if target_file_found or target_drive_found:
|
||||
env.Replace(UPLOAD_PORT=upload_disk)
|
||||
print('\nUpload disk: ', upload_disk, '\n')
|
||||
else:
|
||||
print_error('Autodetect Error')
|
||||
|
||||
except Exception as e:
|
||||
print_error(str(e))
|
||||
|
||||
env.AddPreAction("upload", before_upload)
|
||||
env.AddPreAction("upload", before_upload)
|
||||
|
||||
@@ -133,6 +133,9 @@ void HAL_adc_enable_channel(const uint8_t ch);
|
||||
void HAL_adc_start_conversion(const uint8_t ch);
|
||||
uint16_t HAL_adc_get_result();
|
||||
|
||||
// PWM
|
||||
inline void set_pwm_duty(const pin_t pin, const uint16_t v, const uint16_t=255, const bool=false) { analogWrite(pin, v); }
|
||||
|
||||
// Reset source
|
||||
inline void HAL_clear_reset_source(void) {}
|
||||
inline uint8_t HAL_get_reset_source(void) { return RST_POWER_ON; }
|
||||
|
||||
@@ -127,6 +127,11 @@ void HAL_adc_init();
|
||||
|
||||
void HAL_adc_start_conversion(const uint8_t adc_pin);
|
||||
|
||||
//
|
||||
// PWM
|
||||
//
|
||||
inline void set_pwm_duty(const pin_t pin, const uint16_t v, const uint16_t=255, const bool=false) { analogWrite(pin, v); }
|
||||
|
||||
//
|
||||
// Pin Map
|
||||
//
|
||||
|
||||
@@ -154,7 +154,7 @@ void HAL_adc_start_conversion(const uint8_t adc_pin) { HAL_adc_result = analogRe
|
||||
uint16_t HAL_adc_get_result() { return HAL_adc_result; }
|
||||
|
||||
// Reset the system to initiate a firmware flash
|
||||
void flashFirmware(const int16_t) { HAL_reboot(); }
|
||||
WEAK void flashFirmware(const int16_t) { HAL_reboot(); }
|
||||
|
||||
// Maple Compatibility
|
||||
volatile uint32_t systick_uptime_millis = 0;
|
||||
|
||||
@@ -24,32 +24,17 @@
|
||||
|
||||
#ifdef HAL_STM32
|
||||
|
||||
#include "../../inc/MarlinConfigPre.h"
|
||||
|
||||
#if NEEDS_HARDWARE_PWM
|
||||
|
||||
#include "HAL.h"
|
||||
#include "../../inc/MarlinConfig.h"
|
||||
#include "timers.h"
|
||||
|
||||
void set_pwm_frequency(const pin_t pin, int f_desired) {
|
||||
void set_pwm_duty(const pin_t pin, const uint16_t v, const uint16_t v_size/*=255*/, const bool invert/*=false*/) {
|
||||
if (!PWM_PIN(pin)) return; // Don't proceed if no hardware timer
|
||||
|
||||
PinName pin_name = digitalPinToPinName(pin);
|
||||
TIM_TypeDef *Instance = (TIM_TypeDef *)pinmap_peripheral(pin_name, PinMap_PWM); // Get HAL timer instance
|
||||
|
||||
LOOP_S_L_N(i, 0, NUM_HARDWARE_TIMERS) // Protect used timers
|
||||
if (timer_instance[i] && timer_instance[i]->getHandle()->Instance == Instance)
|
||||
return;
|
||||
|
||||
pwm_start(pin_name, f_desired, 0, RESOLUTION_8B_COMPARE_FORMAT);
|
||||
}
|
||||
|
||||
void set_pwm_duty(const pin_t pin, const uint16_t v, const uint16_t v_size/*=255*/, const bool invert/*=false*/) {
|
||||
PinName pin_name = digitalPinToPinName(pin);
|
||||
TIM_TypeDef *Instance = (TIM_TypeDef *)pinmap_peripheral(pin_name, PinMap_PWM);
|
||||
|
||||
uint16_t adj_val = Instance->ARR * v / v_size;
|
||||
if (invert) adj_val = Instance->ARR - adj_val;
|
||||
|
||||
switch (get_pwm_channel(pin_name)) {
|
||||
case TIM_CHANNEL_1: LL_TIM_OC_SetCompareCH1(Instance, adj_val); break;
|
||||
case TIM_CHANNEL_2: LL_TIM_OC_SetCompareCH2(Instance, adj_val); break;
|
||||
@@ -58,5 +43,21 @@ void set_pwm_duty(const pin_t pin, const uint16_t v, const uint16_t v_size/*=255
|
||||
}
|
||||
}
|
||||
|
||||
#endif // NEEDS_HARDWARE_PWM
|
||||
#if NEEDS_HARDWARE_PWM
|
||||
|
||||
void set_pwm_frequency(const pin_t pin, int f_desired) {
|
||||
if (!PWM_PIN(pin)) return; // Don't proceed if no hardware timer
|
||||
|
||||
PinName pin_name = digitalPinToPinName(pin);
|
||||
TIM_TypeDef *Instance = (TIM_TypeDef *)pinmap_peripheral(pin_name, PinMap_PWM); // Get HAL timer instance
|
||||
|
||||
LOOP_S_L_N(i, 0, NUM_HARDWARE_TIMERS) // Protect used timers
|
||||
if (timer_instance[i] && timer_instance[i]->getHandle()->Instance == Instance)
|
||||
return;
|
||||
|
||||
pwm_start(pin_name, f_desired, 0, RESOLUTION_8B_COMPARE_FORMAT);
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
#endif // HAL_STM32
|
||||
|
||||
@@ -449,8 +449,7 @@ uint16_t analogRead(pin_t pin) {
|
||||
|
||||
// Wrapper to maple unprotected analogWrite
|
||||
void analogWrite(pin_t pin, int pwm_val8) {
|
||||
if (PWM_PIN(pin))
|
||||
analogWrite(uint8_t(pin), pwm_val8);
|
||||
if (PWM_PIN(pin)) analogWrite(uint8_t(pin), pwm_val8);
|
||||
}
|
||||
|
||||
void HAL_reboot() { nvic_sys_reset(); }
|
||||
|
||||
@@ -30,25 +30,27 @@ if __name__ == "__main__":
|
||||
|
||||
# extra script for linker options
|
||||
else:
|
||||
from SCons.Script import DefaultEnvironment
|
||||
env = DefaultEnvironment()
|
||||
env.Append(
|
||||
import pioutil
|
||||
if pioutil.is_pio_build():
|
||||
from SCons.Script import DefaultEnvironment
|
||||
env = DefaultEnvironment()
|
||||
env.Append(
|
||||
ARFLAGS=["rcs"],
|
||||
|
||||
ASFLAGS=["-x", "assembler-with-cpp"],
|
||||
|
||||
CXXFLAGS=[
|
||||
"-fabi-version=0",
|
||||
"-fno-use-cxa-atexit",
|
||||
"-fno-threadsafe-statics"
|
||||
"-fabi-version=0",
|
||||
"-fno-use-cxa-atexit",
|
||||
"-fno-threadsafe-statics"
|
||||
],
|
||||
LINKFLAGS=[
|
||||
"-Os",
|
||||
"-mcpu=cortex-m3",
|
||||
"-ffreestanding",
|
||||
"-mthumb",
|
||||
"--specs=nano.specs",
|
||||
"--specs=nosys.specs",
|
||||
"-u_printf_float",
|
||||
"-Os",
|
||||
"-mcpu=cortex-m3",
|
||||
"-ffreestanding",
|
||||
"-mthumb",
|
||||
"--specs=nano.specs",
|
||||
"--specs=nosys.specs",
|
||||
"-u_printf_float",
|
||||
],
|
||||
)
|
||||
)
|
||||
|
||||
@@ -23,46 +23,47 @@
|
||||
|
||||
#include "../../inc/MarlinConfigPre.h"
|
||||
|
||||
#if NEEDS_HARDWARE_PWM
|
||||
|
||||
#include <pwm.h>
|
||||
#include "HAL.h"
|
||||
#include "timers.h"
|
||||
|
||||
void set_pwm_frequency(const pin_t pin, int f_desired) {
|
||||
if (!PWM_PIN(pin)) return; // Don't proceed if no hardware timer
|
||||
|
||||
timer_dev *timer = PIN_MAP[pin].timer_device;
|
||||
uint8_t channel = PIN_MAP[pin].timer_channel;
|
||||
|
||||
// Protect used timers
|
||||
if (timer == get_timer_dev(TEMP_TIMER_NUM)) return;
|
||||
if (timer == get_timer_dev(STEP_TIMER_NUM)) return;
|
||||
#if PULSE_TIMER_NUM != STEP_TIMER_NUM
|
||||
if (timer == get_timer_dev(PULSE_TIMER_NUM)) return;
|
||||
#endif
|
||||
|
||||
if (!(timer->regs.bas->SR & TIMER_CR1_CEN)) // Ensure the timer is enabled
|
||||
timer_init(timer);
|
||||
|
||||
timer_set_mode(timer, channel, TIMER_PWM);
|
||||
uint16_t preload = 255; // Lock 255 PWM resolution for high frequencies
|
||||
int32_t prescaler = (HAL_TIMER_RATE) / (preload + 1) / f_desired - 1;
|
||||
if (prescaler > 65535) { // For low frequencies increase prescaler
|
||||
prescaler = 65535;
|
||||
preload = (HAL_TIMER_RATE) / (prescaler + 1) / f_desired - 1;
|
||||
}
|
||||
if (prescaler < 0) return; // Too high frequency
|
||||
timer_set_reload(timer, preload);
|
||||
timer_set_prescaler(timer, prescaler);
|
||||
}
|
||||
|
||||
void set_pwm_duty(const pin_t pin, const uint16_t v, const uint16_t v_size/*=255*/, const bool invert/*=false*/) {
|
||||
if (!PWM_PIN(pin)) return;
|
||||
timer_dev *timer = PIN_MAP[pin].timer_device;
|
||||
uint16_t max_val = timer->regs.bas->ARR * v / v_size;
|
||||
if (invert) max_val = v_size - max_val;
|
||||
pwmWrite(pin, max_val);
|
||||
}
|
||||
|
||||
#if NEEDS_HARDWARE_PWM
|
||||
|
||||
void set_pwm_frequency(const pin_t pin, int f_desired) {
|
||||
if (!PWM_PIN(pin)) return; // Don't proceed if no hardware timer
|
||||
|
||||
timer_dev *timer = PIN_MAP[pin].timer_device;
|
||||
uint8_t channel = PIN_MAP[pin].timer_channel;
|
||||
|
||||
// Protect used timers
|
||||
if (timer == get_timer_dev(TEMP_TIMER_NUM)) return;
|
||||
if (timer == get_timer_dev(STEP_TIMER_NUM)) return;
|
||||
#if PULSE_TIMER_NUM != STEP_TIMER_NUM
|
||||
if (timer == get_timer_dev(PULSE_TIMER_NUM)) return;
|
||||
#endif
|
||||
|
||||
if (!(timer->regs.bas->SR & TIMER_CR1_CEN)) // Ensure the timer is enabled
|
||||
timer_init(timer);
|
||||
|
||||
timer_set_mode(timer, channel, TIMER_PWM);
|
||||
uint16_t preload = 255; // Lock 255 PWM resolution for high frequencies
|
||||
int32_t prescaler = (HAL_TIMER_RATE) / (preload + 1) / f_desired - 1;
|
||||
if (prescaler > 65535) { // For low frequencies increase prescaler
|
||||
prescaler = 65535;
|
||||
preload = (HAL_TIMER_RATE) / (prescaler + 1) / f_desired - 1;
|
||||
}
|
||||
if (prescaler < 0) return; // Too high frequency
|
||||
timer_set_reload(timer, preload);
|
||||
timer_set_prescaler(timer, prescaler);
|
||||
}
|
||||
|
||||
#endif // NEEDS_HARDWARE_PWM
|
||||
#endif // __STM32F1__
|
||||
|
||||
@@ -122,6 +122,12 @@ void HAL_adc_init();
|
||||
void HAL_adc_start_conversion(const uint8_t adc_pin);
|
||||
uint16_t HAL_adc_get_result();
|
||||
|
||||
// PWM
|
||||
|
||||
inline void set_pwm_duty(const pin_t pin, const uint16_t v, const uint16_t=255, const bool=false) { analogWrite(pin, v); }
|
||||
|
||||
// Pin Map
|
||||
|
||||
#define GET_PIN_MAP_PIN(index) index
|
||||
#define GET_PIN_MAP_INDEX(pin) pin
|
||||
#define PARSED_PIN_INDEX(code, dval) parser.intval(code, dval)
|
||||
|
||||
@@ -129,6 +129,12 @@ void HAL_adc_init();
|
||||
void HAL_adc_start_conversion(const uint8_t adc_pin);
|
||||
uint16_t HAL_adc_get_result();
|
||||
|
||||
// PWM
|
||||
|
||||
inline void set_pwm_duty(const pin_t pin, const uint16_t v, const uint16_t=255, const bool=false) { analogWrite(pin, v); }
|
||||
|
||||
// Pin Map
|
||||
|
||||
#define GET_PIN_MAP_PIN(index) index
|
||||
#define GET_PIN_MAP_INDEX(pin) pin
|
||||
#define PARSED_PIN_INDEX(code, dval) parser.intval(code, dval)
|
||||
|
||||
@@ -106,17 +106,17 @@ void HAL_adc_init() {
|
||||
void HAL_clear_reset_source() {
|
||||
uint32_t reset_source = SRC_SRSR;
|
||||
SRC_SRSR = reset_source;
|
||||
}
|
||||
}
|
||||
|
||||
uint8_t HAL_get_reset_source() {
|
||||
switch (SRC_SRSR & 0xFF) {
|
||||
case 1: return RST_POWER_ON; break;
|
||||
case 2: return RST_SOFTWARE; break;
|
||||
case 4: return RST_EXTERNAL; break;
|
||||
// case 8: return RST_BROWN_OUT; break;
|
||||
//case 8: return RST_BROWN_OUT; break;
|
||||
case 16: return RST_WATCHDOG; break;
|
||||
case 64: return RST_JTAG; break;
|
||||
// case 128: return RST_OVERTEMP; break;
|
||||
case 64: return RST_JTAG; break;
|
||||
//case 128: return RST_OVERTEMP; break;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
@@ -168,7 +168,7 @@ uint16_t HAL_adc_get_result() {
|
||||
return 0;
|
||||
}
|
||||
|
||||
bool is_output(uint8_t pin) {
|
||||
bool is_output(pin_t pin) {
|
||||
const struct digital_pin_bitband_and_config_table_struct *p;
|
||||
p = digital_pin_to_info_PGM + pin;
|
||||
return (*(p->reg + 1) & p->mask);
|
||||
|
||||
@@ -150,8 +150,14 @@ void HAL_adc_init();
|
||||
void HAL_adc_start_conversion(const uint8_t adc_pin);
|
||||
uint16_t HAL_adc_get_result();
|
||||
|
||||
// PWM
|
||||
|
||||
inline void set_pwm_duty(const pin_t pin, const uint16_t v, const uint16_t=255, const bool=false) { analogWrite(pin, v); }
|
||||
|
||||
// Pin Map
|
||||
|
||||
#define GET_PIN_MAP_PIN(index) index
|
||||
#define GET_PIN_MAP_INDEX(pin) pin
|
||||
#define PARSED_PIN_INDEX(code, dval) parser.intval(code, dval)
|
||||
|
||||
bool is_output(uint8_t pin);
|
||||
bool is_output(pin_t pin);
|
||||
|
||||
@@ -1104,6 +1104,10 @@ void setup() {
|
||||
|
||||
tmc_standby_setup(); // TMC Low Power Standby pins must be set early or they're not usable
|
||||
|
||||
// Check startup - does nothing if bootloader sets MCUSR to 0
|
||||
const byte mcu = HAL_get_reset_source();
|
||||
HAL_clear_reset_source();
|
||||
|
||||
#if ENABLED(MARLIN_DEV_MODE)
|
||||
auto log_current_ms = [&](PGM_P const msg) {
|
||||
SERIAL_ECHO_START();
|
||||
@@ -1232,15 +1236,14 @@ void setup() {
|
||||
|
||||
SETUP_RUN(esp_wifi_init());
|
||||
|
||||
// Check startup - does nothing if bootloader sets MCUSR to 0
|
||||
const byte mcu = HAL_get_reset_source();
|
||||
// Report Reset Reason
|
||||
if (mcu & RST_POWER_ON) SERIAL_ECHOLNPGM(STR_POWERUP);
|
||||
if (mcu & RST_EXTERNAL) SERIAL_ECHOLNPGM(STR_EXTERNAL_RESET);
|
||||
if (mcu & RST_BROWN_OUT) SERIAL_ECHOLNPGM(STR_BROWNOUT_RESET);
|
||||
if (mcu & RST_WATCHDOG) SERIAL_ECHOLNPGM(STR_WATCHDOG_RESET);
|
||||
if (mcu & RST_SOFTWARE) SERIAL_ECHOLNPGM(STR_SOFTWARE_RESET);
|
||||
HAL_clear_reset_source();
|
||||
|
||||
// Identify myself as Marlin x.x.x
|
||||
SERIAL_ECHOLNPGM("Marlin " SHORT_BUILD_VERSION);
|
||||
#if defined(STRING_DISTRIBUTION_DATE) && defined(STRING_CONFIG_H_AUTHOR)
|
||||
SERIAL_ECHO_MSG(
|
||||
|
||||
@@ -402,10 +402,11 @@
|
||||
#define BOARD_ANET_ET4 4230 // ANET ET4 V1.x (STM32F407VGT6)
|
||||
#define BOARD_ANET_ET4P 4231 // ANET ET4P V1.x (STM32F407VGT6)
|
||||
#define BOARD_FYSETC_CHEETAH_V20 4232 // FYSETC Cheetah V2.0
|
||||
#define BOARD_TH3D_EZBOARD_LITE_V2 4233 // TH3D EZBoard Lite v2.0
|
||||
#define BOARD_TH3D_EZBOARD_V2 4233 // TH3D EZBoard v2.0
|
||||
#define BOARD_INDEX_REV03 4234 // Index PnP Controller REV03 (STM32F407VET6/VGT6)
|
||||
#define BOARD_MKS_ROBIN_NANO_V1_3_F4 4235 // MKS Robin Nano V1.3 and MKS Robin Nano-S V1.3 (STM32F407VET6)
|
||||
#define BOARD_MKS_EAGLE 4236 // MKS Eagle (STM32F407VET6)
|
||||
#define BOARD_ARTILLERY_RUBY 4237 // Artillery Ruby (STM32F401RCT6)
|
||||
|
||||
//
|
||||
// ARM Cortex M7
|
||||
@@ -425,9 +426,10 @@
|
||||
#define BOARD_MRR_ESPA 6001 // MRR ESPA based on ESP32 (native pins only)
|
||||
#define BOARD_MRR_ESPE 6002 // MRR ESPE based on ESP32 (with I2S stepper stream)
|
||||
#define BOARD_E4D_BOX 6003 // E4d@BOX
|
||||
#define BOARD_FYSETC_E4 6004 // FYSETC E4
|
||||
#define BOARD_PANDA_ZHU 6005 // Panda_ZHU
|
||||
#define BOARD_PANDA_M4 6006 // Panda_M4
|
||||
#define BOARD_RESP32_CUSTOM 6004 // Rutilea ESP32 custom board
|
||||
#define BOARD_FYSETC_E4 6005 // FYSETC E4
|
||||
#define BOARD_PANDA_ZHU 6006 // Panda_ZHU
|
||||
#define BOARD_PANDA_M4 6007 // Panda_M4
|
||||
|
||||
//
|
||||
// SAMD51 ARM Cortex M4
|
||||
|
||||
@@ -33,6 +33,12 @@
|
||||
|
||||
#define _AXIS(A) (A##_AXIS)
|
||||
|
||||
#define _XSTOP_ 0x01
|
||||
#define _YSTOP_ 0x02
|
||||
#define _ZSTOP_ 0x03
|
||||
#define _ISTOP_ 0x04
|
||||
#define _JSTOP_ 0x05
|
||||
#define _KSTOP_ 0x06
|
||||
#define _XMIN_ 0x11
|
||||
#define _YMIN_ 0x12
|
||||
#define _ZMIN_ 0x13
|
||||
|
||||
@@ -87,7 +87,7 @@ extern uint8_t marlin_debug_flags;
|
||||
// interface with the ability to output to multiple serial ports.
|
||||
#if HAS_MULTI_SERIAL
|
||||
#define _PORT_REDIRECT(n,p) REMEMBER(n,multiSerial.portMask,p)
|
||||
#define _PORT_RESTORE(n,p) RESTORE(n)
|
||||
#define _PORT_RESTORE(n) RESTORE(n)
|
||||
#define SERIAL_ASSERT(P) if (multiSerial.portMask!=(P)) { debugger(); }
|
||||
// If we have a catchall, use that directly
|
||||
#ifdef SERIAL_CATCHALL
|
||||
|
||||
@@ -346,13 +346,14 @@ void unified_bed_leveling::G29() {
|
||||
|
||||
if (parser.seen('Q')) {
|
||||
const int16_t test_pattern = parser.has_value() ? parser.value_int() : -99;
|
||||
if (!WITHIN(test_pattern, -1, 2)) {
|
||||
SERIAL_ECHOLNPGM("Invalid test_pattern value. (-1 to 2)\n");
|
||||
if (!WITHIN(test_pattern, TERN0(UBL_DEVEL_DEBUGGING, -1), 2)) {
|
||||
SERIAL_ECHOLNPGM("?Invalid (Q) test pattern. (" TERN(UBL_DEVEL_DEBUGGING, "-1", "0") " to 2)\n");
|
||||
return;
|
||||
}
|
||||
SERIAL_ECHOLNPGM("Loading test_pattern values.\n");
|
||||
SERIAL_ECHOLNPGM("Applying test pattern.\n");
|
||||
switch (test_pattern) {
|
||||
|
||||
default:
|
||||
case -1: TERN_(UBL_DEVEL_DEBUGGING, g29_eeprom_dump()); break;
|
||||
|
||||
case 0:
|
||||
|
||||
@@ -70,7 +70,7 @@ void CaseLight::update(const bool sflag) {
|
||||
|
||||
#if CASELIGHT_USES_BRIGHTNESS
|
||||
if (pin_is_pwm())
|
||||
analogWrite(pin_t(CASE_LIGHT_PIN), (
|
||||
set_pwm_duty(pin_t(CASE_LIGHT_PIN), (
|
||||
#if CASE_LIGHT_MAX_PWM == 255
|
||||
n10ct
|
||||
#else
|
||||
|
||||
@@ -72,9 +72,10 @@ void ControllerFan::update() {
|
||||
? settings.active_speed : settings.idle_speed
|
||||
);
|
||||
|
||||
// Allow digital or PWM fan output (see M42 handling)
|
||||
WRITE(CONTROLLER_FAN_PIN, speed);
|
||||
analogWrite(pin_t(CONTROLLER_FAN_PIN), speed);
|
||||
if (PWM_PIN(CONTROLLER_FAN_PIN))
|
||||
set_pwm_duty(pin_t(CONTROLLER_FAN_PIN), speed);
|
||||
else
|
||||
WRITE(CONTROLLER_FAN_PIN, speed);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -80,6 +80,10 @@ void HostUI::action(FSTR_P const fstr, const bool eol) {
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifdef SHUTDOWN_ACTION
|
||||
void HostUI::shutdown() { action(F(SHUTDOWN_ACTION)); }
|
||||
#endif
|
||||
|
||||
#if ENABLED(HOST_PROMPT_SUPPORT)
|
||||
|
||||
PromptReason HostUI::host_prompt_reason = PROMPT_NOT_DEFINED;
|
||||
|
||||
@@ -71,6 +71,9 @@ class HostUI {
|
||||
#ifdef ACTION_ON_START
|
||||
static void start();
|
||||
#endif
|
||||
#ifdef SHUTDOWN_ACTION
|
||||
static void shutdown();
|
||||
#endif
|
||||
|
||||
#if ENABLED(G29_RETRY_AND_RECOVER)
|
||||
#ifdef ACTION_ON_G29_RECOVER
|
||||
|
||||
@@ -121,11 +121,11 @@ void LEDLights::set_color(const LEDColor &incol
|
||||
|
||||
// This variant uses 3-4 separate pins for the RGB(W) components.
|
||||
// If the pins can do PWM then their intensity will be set.
|
||||
#define _UPDATE_RGBW(C,c) do { \
|
||||
if (PWM_PIN(RGB_LED_##C##_PIN)) \
|
||||
analogWrite(pin_t(RGB_LED_##C##_PIN), c); \
|
||||
else \
|
||||
WRITE(RGB_LED_##C##_PIN, c ? HIGH : LOW); \
|
||||
#define _UPDATE_RGBW(C,c) do { \
|
||||
if (PWM_PIN(RGB_LED_##C##_PIN)) \
|
||||
set_pwm_duty(pin_t(RGB_LED_##C##_PIN), c); \
|
||||
else \
|
||||
WRITE(RGB_LED_##C##_PIN, c ? HIGH : LOW); \
|
||||
}while(0)
|
||||
#define UPDATE_RGBW(C,c) _UPDATE_RGBW(C, TERN1(CASE_LIGHT_USE_RGB_LED, caselight.on) ? incol.c : 0)
|
||||
UPDATE_RGBW(R,r); UPDATE_RGBW(G,g); UPDATE_RGBW(B,b);
|
||||
@@ -170,9 +170,9 @@ void LEDLights::set_color(const LEDColor &incol
|
||||
|
||||
#if ENABLED(NEO2_COLOR_PRESETS)
|
||||
const LEDColor LEDLights2::defaultLEDColor = LEDColor(
|
||||
LED_USER_PRESET_RED, LED_USER_PRESET_GREEN, LED_USER_PRESET_BLUE
|
||||
OPTARG(HAS_WHITE_LED2, LED_USER_PRESET_WHITE)
|
||||
OPTARG(NEOPIXEL_LED, LED_USER_PRESET_BRIGHTNESS)
|
||||
NEO2_USER_PRESET_RED, NEO2_USER_PRESET_GREEN, NEO2_USER_PRESET_BLUE
|
||||
OPTARG(HAS_WHITE_LED2, NEO2_USER_PRESET_WHITE)
|
||||
OPTARG(NEOPIXEL_LED, NEO2_USER_PRESET_BRIGHTNESS)
|
||||
);
|
||||
#endif
|
||||
|
||||
|
||||
@@ -22,39 +22,53 @@
|
||||
|
||||
#include "../inc/MarlinConfigPre.h"
|
||||
|
||||
#if ENABLED(PROBE_TEMP_COMPENSATION)
|
||||
#if HAS_PTC
|
||||
|
||||
//#define DEBUG_PTC // Print extra debug output with 'M871'
|
||||
|
||||
#include "probe_temp_comp.h"
|
||||
#include <math.h>
|
||||
|
||||
ProbeTempComp temp_comp;
|
||||
ProbeTempComp ptc;
|
||||
|
||||
int16_t ProbeTempComp::z_offsets_probe[cali_info_init[TSI_PROBE].measurements], // = {0}
|
||||
ProbeTempComp::z_offsets_bed[cali_info_init[TSI_BED].measurements]; // = {0}
|
||||
#if ENABLED(PTC_PROBE)
|
||||
constexpr int16_t z_offsets_probe_default[PTC_PROBE_COUNT] = PTC_PROBE_ZOFFS;
|
||||
int16_t ProbeTempComp::z_offsets_probe[PTC_PROBE_COUNT] = PTC_PROBE_ZOFFS;
|
||||
#endif
|
||||
|
||||
#if ENABLED(USE_TEMP_EXT_COMPENSATION)
|
||||
int16_t ProbeTempComp::z_offsets_ext[cali_info_init[TSI_EXT].measurements]; // = {0}
|
||||
#if ENABLED(PTC_BED)
|
||||
constexpr int16_t z_offsets_bed_default[PTC_BED_COUNT] = PTC_BED_ZOFFS;
|
||||
int16_t ProbeTempComp::z_offsets_bed[PTC_BED_COUNT] = PTC_BED_ZOFFS;
|
||||
#endif
|
||||
|
||||
#if ENABLED(PTC_HOTEND)
|
||||
constexpr int16_t z_offsets_hotend_default[PTC_HOTEND_COUNT] = PTC_HOTEND_ZOFFS;
|
||||
int16_t ProbeTempComp::z_offsets_hotend[PTC_HOTEND_COUNT] = PTC_HOTEND_ZOFFS;
|
||||
#endif
|
||||
|
||||
int16_t *ProbeTempComp::sensor_z_offsets[TSI_COUNT] = {
|
||||
ProbeTempComp::z_offsets_probe, ProbeTempComp::z_offsets_bed
|
||||
OPTARG(USE_TEMP_EXT_COMPENSATION, ProbeTempComp::z_offsets_ext)
|
||||
#if ENABLED(PTC_PROBE)
|
||||
ProbeTempComp::z_offsets_probe,
|
||||
#endif
|
||||
#if ENABLED(PTC_BED)
|
||||
ProbeTempComp::z_offsets_bed,
|
||||
#endif
|
||||
#if ENABLED(PTC_HOTEND)
|
||||
ProbeTempComp::z_offsets_hotend,
|
||||
#endif
|
||||
};
|
||||
|
||||
const temp_calib_t ProbeTempComp::cali_info[TSI_COUNT] = {
|
||||
cali_info_init[TSI_PROBE], cali_info_init[TSI_BED]
|
||||
OPTARG(USE_TEMP_EXT_COMPENSATION, cali_info_init[TSI_EXT])
|
||||
};
|
||||
|
||||
constexpr xyz_pos_t ProbeTempComp::park_point;
|
||||
constexpr xy_pos_t ProbeTempComp::measure_point;
|
||||
constexpr celsius_t ProbeTempComp::probe_calib_bed_temp;
|
||||
constexpr temp_calib_t ProbeTempComp::cali_info[TSI_COUNT];
|
||||
|
||||
uint8_t ProbeTempComp::calib_idx; // = 0
|
||||
float ProbeTempComp::init_measurement; // = 0.0
|
||||
|
||||
void ProbeTempComp::reset() {
|
||||
TERN_(PTC_PROBE, LOOP_L_N(i, PTC_PROBE_COUNT) z_offsets_probe[i] = z_offsets_probe_default[i]);
|
||||
TERN_(PTC_BED, LOOP_L_N(i, PTC_BED_COUNT) z_offsets_bed[i] = z_offsets_bed_default[i]);
|
||||
TERN_(PTC_HOTEND, LOOP_L_N(i, PTC_HOTEND_COUNT) z_offsets_hotend[i] = z_offsets_hotend_default[i]);
|
||||
}
|
||||
|
||||
void ProbeTempComp::clear_offsets(const TempSensorID tsi) {
|
||||
LOOP_L_N(i, cali_info[tsi].measurements)
|
||||
sensor_z_offsets[tsi][i] = 0;
|
||||
@@ -71,10 +85,9 @@ void ProbeTempComp::print_offsets() {
|
||||
LOOP_L_N(s, TSI_COUNT) {
|
||||
celsius_t temp = cali_info[s].start_temp;
|
||||
for (int16_t i = -1; i < cali_info[s].measurements; ++i) {
|
||||
SERIAL_ECHOF(s == TSI_BED ? F("Bed") :
|
||||
#if ENABLED(USE_TEMP_EXT_COMPENSATION)
|
||||
s == TSI_EXT ? F("Extruder") :
|
||||
#endif
|
||||
SERIAL_ECHOF(
|
||||
TERN_(PTC_BED, s == TSI_BED ? F("Bed") :)
|
||||
TERN_(PTC_HOTEND, s == TSI_EXT ? F("Extruder") :)
|
||||
F("Probe")
|
||||
);
|
||||
SERIAL_ECHOLNPGM(
|
||||
@@ -100,21 +113,13 @@ void ProbeTempComp::prepare_new_calibration(const_float_t init_meas_z) {
|
||||
}
|
||||
|
||||
void ProbeTempComp::push_back_new_measurement(const TempSensorID tsi, const_float_t meas_z) {
|
||||
switch (tsi) {
|
||||
case TSI_PROBE:
|
||||
case TSI_BED:
|
||||
//case TSI_EXT:
|
||||
if (calib_idx >= cali_info[tsi].measurements) return;
|
||||
sensor_z_offsets[tsi][calib_idx++] = static_cast<int16_t>(meas_z * 1000.0f - init_measurement * 1000.0f);
|
||||
default: break;
|
||||
}
|
||||
if (calib_idx >= cali_info[tsi].measurements) return;
|
||||
sensor_z_offsets[tsi][calib_idx++] = static_cast<int16_t>((meas_z - init_measurement) * 1000.0f);
|
||||
}
|
||||
|
||||
bool ProbeTempComp::finish_calibration(const TempSensorID tsi) {
|
||||
if (tsi != TSI_PROBE && tsi != TSI_BED) return false;
|
||||
|
||||
if (calib_idx < 3) {
|
||||
SERIAL_ECHOLNPGM("!Insufficient measurements (min. 3).");
|
||||
if (!calib_idx) {
|
||||
SERIAL_ECHOLNPGM("!No measurements.");
|
||||
clear_offsets(tsi);
|
||||
return false;
|
||||
}
|
||||
@@ -130,16 +135,15 @@ bool ProbeTempComp::finish_calibration(const TempSensorID tsi) {
|
||||
SERIAL_ECHOLNPGM("Got ", calib_idx, " measurements. ");
|
||||
if (linear_regression(tsi, k, d)) {
|
||||
SERIAL_ECHOPGM("Applying linear extrapolation");
|
||||
calib_idx--;
|
||||
for (; calib_idx < measurements; ++calib_idx) {
|
||||
const celsius_float_t temp = start_temp + float(calib_idx) * res_temp;
|
||||
const celsius_float_t temp = start_temp + float(calib_idx + 1) * res_temp;
|
||||
data[calib_idx] = static_cast<int16_t>(k * temp + d);
|
||||
}
|
||||
}
|
||||
else {
|
||||
// Simply use the last measured value for higher temperatures
|
||||
SERIAL_ECHOPGM("Failed to extrapolate");
|
||||
const int16_t last_val = data[calib_idx];
|
||||
const int16_t last_val = data[calib_idx-1];
|
||||
for (; calib_idx < measurements; ++calib_idx)
|
||||
data[calib_idx] = last_val;
|
||||
}
|
||||
@@ -157,7 +161,7 @@ bool ProbeTempComp::finish_calibration(const TempSensorID tsi) {
|
||||
// Restrict the max. offset difference between two probings
|
||||
if (calib_idx > 0 && ABS(data[calib_idx - 1] - data[calib_idx]) > 800) {
|
||||
SERIAL_ECHOLNPGM("!Invalid Z-offset between two probings detected (0-0.8).");
|
||||
clear_offsets(TSI_PROBE);
|
||||
clear_offsets(tsi);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
@@ -168,8 +172,8 @@ bool ProbeTempComp::finish_calibration(const TempSensorID tsi) {
|
||||
void ProbeTempComp::compensate_measurement(const TempSensorID tsi, const celsius_t temp, float &meas_z) {
|
||||
const uint8_t measurements = cali_info[tsi].measurements;
|
||||
const celsius_t start_temp = cali_info[tsi].start_temp,
|
||||
end_temp = cali_info[tsi].end_temp,
|
||||
res_temp = cali_info[tsi].temp_resolution;
|
||||
res_temp = cali_info[tsi].temp_resolution,
|
||||
end_temp = start_temp + measurements * res_temp;
|
||||
const int16_t * const data = sensor_z_offsets[tsi];
|
||||
|
||||
// Given a data index, return { celsius, zoffset } in the form { x, y }
|
||||
@@ -208,9 +212,7 @@ void ProbeTempComp::compensate_measurement(const TempSensorID tsi, const celsius
|
||||
}
|
||||
|
||||
bool ProbeTempComp::linear_regression(const TempSensorID tsi, float &k, float &d) {
|
||||
if (tsi != TSI_PROBE && tsi != TSI_BED) return false;
|
||||
|
||||
if (!WITHIN(calib_idx, 2, cali_info[tsi].measurements)) return false;
|
||||
if (!WITHIN(calib_idx, 1, cali_info[tsi].measurements)) return false;
|
||||
|
||||
const celsius_t start_temp = cali_info[tsi].start_temp,
|
||||
res_temp = cali_info[tsi].temp_resolution;
|
||||
@@ -243,4 +245,4 @@ bool ProbeTempComp::linear_regression(const TempSensorID tsi, float &k, float &d
|
||||
return true;
|
||||
}
|
||||
|
||||
#endif // PROBE_TEMP_COMPENSATION
|
||||
#endif // HAS_PTC
|
||||
|
||||
@@ -24,9 +24,13 @@
|
||||
#include "../inc/MarlinConfig.h"
|
||||
|
||||
enum TempSensorID : uint8_t {
|
||||
TSI_PROBE,
|
||||
TSI_BED,
|
||||
#if ENABLED(USE_TEMP_EXT_COMPENSATION)
|
||||
#if ENABLED(PTC_PROBE)
|
||||
TSI_PROBE,
|
||||
#endif
|
||||
#if ENABLED(PTC_BED)
|
||||
TSI_BED,
|
||||
#endif
|
||||
#if ENABLED(PTC_HOTEND)
|
||||
TSI_EXT,
|
||||
#endif
|
||||
TSI_COUNT
|
||||
@@ -35,8 +39,7 @@ enum TempSensorID : uint8_t {
|
||||
typedef struct {
|
||||
uint8_t measurements; // Max. number of measurements to be stored (35 - 80°C)
|
||||
celsius_t temp_resolution, // Resolution in °C between measurements
|
||||
start_temp, // Base measurement; z-offset == 0
|
||||
end_temp;
|
||||
start_temp; // Base measurement; z-offset == 0
|
||||
} temp_calib_t;
|
||||
|
||||
/**
|
||||
@@ -45,93 +48,40 @@ typedef struct {
|
||||
* measurement errors/shifts due to changed temperature.
|
||||
*/
|
||||
|
||||
// Probe temperature calibration constants
|
||||
#ifndef PTC_SAMPLE_COUNT
|
||||
#define PTC_SAMPLE_COUNT 10
|
||||
#endif
|
||||
#ifndef PTC_SAMPLE_RES
|
||||
#define PTC_SAMPLE_RES 5
|
||||
#endif
|
||||
#ifndef PTC_SAMPLE_START
|
||||
#define PTC_SAMPLE_START 30
|
||||
#endif
|
||||
#define PTC_SAMPLE_END (PTC_SAMPLE_START + (PTC_SAMPLE_COUNT) * PTC_SAMPLE_RES)
|
||||
|
||||
// Bed temperature calibration constants
|
||||
#ifndef BTC_PROBE_TEMP
|
||||
#define BTC_PROBE_TEMP 30
|
||||
#endif
|
||||
#ifndef BTC_SAMPLE_COUNT
|
||||
#define BTC_SAMPLE_COUNT 10
|
||||
#endif
|
||||
#ifndef BTC_SAMPLE_RES
|
||||
#define BTC_SAMPLE_RES 5
|
||||
#endif
|
||||
#ifndef BTC_SAMPLE_START
|
||||
#define BTC_SAMPLE_START 60
|
||||
#endif
|
||||
#define BTC_SAMPLE_END (BTC_SAMPLE_START + (BTC_SAMPLE_COUNT) * BTC_SAMPLE_RES)
|
||||
|
||||
// Extruder temperature calibration constants
|
||||
#if ENABLED(USE_TEMP_EXT_COMPENSATION)
|
||||
#ifndef ETC_SAMPLE_COUNT
|
||||
#define ETC_SAMPLE_COUNT 20
|
||||
#endif
|
||||
#ifndef ETC_SAMPLE_RES
|
||||
#define ETC_SAMPLE_RES 5
|
||||
#endif
|
||||
#ifndef ETC_SAMPLE_START
|
||||
#define ETC_SAMPLE_START 180
|
||||
#endif
|
||||
#define ETC_SAMPLE_END (ETC_SAMPLE_START + (ETC_SAMPLE_COUNT) * ETC_SAMPLE_RES)
|
||||
#endif
|
||||
|
||||
#ifndef PTC_PROBE_HEATING_OFFSET
|
||||
#define PTC_PROBE_HEATING_OFFSET 0.5f
|
||||
#endif
|
||||
|
||||
#ifndef PTC_PROBE_RAISE
|
||||
#define PTC_PROBE_RAISE 10
|
||||
#endif
|
||||
|
||||
static constexpr temp_calib_t cali_info_init[TSI_COUNT] = {
|
||||
{ PTC_SAMPLE_COUNT, PTC_SAMPLE_RES, PTC_SAMPLE_START, PTC_SAMPLE_END }, // Probe
|
||||
{ BTC_SAMPLE_COUNT, BTC_SAMPLE_RES, BTC_SAMPLE_START, BTC_SAMPLE_END }, // Bed
|
||||
#if ENABLED(USE_TEMP_EXT_COMPENSATION)
|
||||
{ ETC_SAMPLE_COUNT, ETC_SAMPLE_RES, ETC_SAMPLE_START, ETC_SAMPLE_END }, // Extruder
|
||||
#endif
|
||||
};
|
||||
|
||||
class ProbeTempComp {
|
||||
public:
|
||||
|
||||
static const temp_calib_t cali_info[TSI_COUNT];
|
||||
static constexpr temp_calib_t cali_info[TSI_COUNT] = {
|
||||
#if ENABLED(PTC_PROBE)
|
||||
{ PTC_PROBE_COUNT, PTC_PROBE_RES, PTC_PROBE_START }, // Probe
|
||||
#endif
|
||||
#if ENABLED(PTC_BED)
|
||||
{ PTC_BED_COUNT, PTC_BED_RES, PTC_BED_START }, // Bed
|
||||
#endif
|
||||
#if ENABLED(PTC_HOTEND)
|
||||
{ PTC_HOTEND_COUNT, PTC_HOTEND_RES, PTC_HOTEND_START }, // Extruder
|
||||
#endif
|
||||
};
|
||||
|
||||
// Where to park nozzle to wait for probe cooldown
|
||||
static constexpr xyz_pos_t park_point = PTC_PARK_POS;
|
||||
|
||||
// XY coordinates of nozzle for probing the bed
|
||||
static constexpr xy_pos_t measure_point = PTC_PROBE_POS; // Coordinates to probe
|
||||
//measure_point = { 12.0f, 7.3f }; // Coordinates for the MK52 magnetic heatbed
|
||||
|
||||
static constexpr celsius_t probe_calib_bed_temp = BED_MAX_TARGET, // Bed temperature while calibrating probe
|
||||
bed_calib_probe_temp = BTC_PROBE_TEMP; // Probe temperature while calibrating bed
|
||||
|
||||
static int16_t *sensor_z_offsets[TSI_COUNT],
|
||||
z_offsets_probe[cali_info_init[TSI_PROBE].measurements], // (µm)
|
||||
z_offsets_bed[cali_info_init[TSI_BED].measurements]; // (µm)
|
||||
|
||||
#if ENABLED(USE_TEMP_EXT_COMPENSATION)
|
||||
static int16_t z_offsets_ext[cali_info_init[TSI_EXT].measurements]; // (µm)
|
||||
static int16_t *sensor_z_offsets[TSI_COUNT];
|
||||
#if ENABLED(PTC_PROBE)
|
||||
static int16_t z_offsets_probe[PTC_PROBE_COUNT]; // (µm)
|
||||
#endif
|
||||
#if ENABLED(PTC_BED)
|
||||
static int16_t z_offsets_bed[PTC_BED_COUNT]; // (µm)
|
||||
#endif
|
||||
#if ENABLED(PTC_HOTEND)
|
||||
static int16_t z_offsets_hotend[PTC_HOTEND_COUNT]; // (µm)
|
||||
#endif
|
||||
|
||||
static inline void reset_index() { calib_idx = 0; };
|
||||
static inline uint8_t get_index() { return calib_idx; }
|
||||
static void reset();
|
||||
static void clear_offsets(const TempSensorID tsi);
|
||||
static inline void clear_all_offsets() {
|
||||
clear_offsets(TSI_BED);
|
||||
clear_offsets(TSI_PROBE);
|
||||
TERN_(USE_TEMP_EXT_COMPENSATION, clear_offsets(TSI_EXT));
|
||||
TERN_(PTC_PROBE, clear_offsets(TSI_PROBE));
|
||||
TERN_(PTC_BED, clear_offsets(TSI_BED));
|
||||
TERN_(PTC_HOTEND, clear_offsets(TSI_EXT));
|
||||
}
|
||||
static bool set_offset(const TempSensorID tsi, const uint8_t idx, const int16_t offset);
|
||||
static void print_offsets();
|
||||
@@ -156,4 +106,4 @@ class ProbeTempComp {
|
||||
static bool linear_regression(const TempSensorID tsi, float &k, float &d);
|
||||
};
|
||||
|
||||
extern ProbeTempComp temp_comp;
|
||||
extern ProbeTempComp ptc;
|
||||
|
||||
@@ -66,7 +66,7 @@ void SpindleLaser::init() {
|
||||
#endif
|
||||
#if ENABLED(SPINDLE_LASER_USE_PWM)
|
||||
SET_PWM(SPINDLE_LASER_PWM_PIN);
|
||||
analogWrite(pin_t(SPINDLE_LASER_PWM_PIN), SPINDLE_LASER_PWM_OFF); // Set to lowest speed
|
||||
set_pwm_duty(pin_t(SPINDLE_LASER_PWM_PIN), SPINDLE_LASER_PWM_OFF); // Set to lowest speed
|
||||
#endif
|
||||
#if ENABLED(HAL_CAN_SET_PWM_FREQ) && defined(SPINDLE_LASER_FREQUENCY)
|
||||
set_pwm_frequency(pin_t(SPINDLE_LASER_PWM_PIN), SPINDLE_LASER_FREQUENCY);
|
||||
@@ -92,10 +92,8 @@ void SpindleLaser::init() {
|
||||
void SpindleLaser::_set_ocr(const uint8_t ocr) {
|
||||
#if NEEDS_HARDWARE_PWM && SPINDLE_LASER_FREQUENCY
|
||||
set_pwm_frequency(pin_t(SPINDLE_LASER_PWM_PIN), TERN(MARLIN_DEV_MODE, frequency, SPINDLE_LASER_FREQUENCY));
|
||||
set_pwm_duty(pin_t(SPINDLE_LASER_PWM_PIN), ocr ^ SPINDLE_LASER_PWM_OFF);
|
||||
#else
|
||||
analogWrite(pin_t(SPINDLE_LASER_PWM_PIN), ocr ^ SPINDLE_LASER_PWM_OFF);
|
||||
#endif
|
||||
set_pwm_duty(pin_t(SPINDLE_LASER_PWM_PIN), ocr ^ SPINDLE_LASER_PWM_OFF);
|
||||
}
|
||||
|
||||
void SpindleLaser::set_ocr(const uint8_t ocr) {
|
||||
|
||||
@@ -520,7 +520,7 @@ void GcodeSuite::G26() {
|
||||
g26.keep_heaters_on = parser.boolval('K');
|
||||
|
||||
// Accept 'I' if temperature presets are defined
|
||||
#if PREHEAT_COUNT
|
||||
#if HAS_PREHEAT
|
||||
const uint8_t preset_index = parser.seenval('I') ? _MIN(parser.value_byte(), PREHEAT_COUNT - 1) + 1 : 0;
|
||||
#endif
|
||||
|
||||
@@ -530,7 +530,7 @@ void GcodeSuite::G26() {
|
||||
celsius_t bedtemp = 0;
|
||||
|
||||
// Use the 'I' index if temperature presets are defined
|
||||
#if PREHEAT_COUNT
|
||||
#if HAS_PREHEAT
|
||||
if (preset_index) bedtemp = ui.material_preset[preset_index - 1].bed_temp;
|
||||
#endif
|
||||
|
||||
@@ -613,7 +613,7 @@ void GcodeSuite::G26() {
|
||||
celsius_t noztemp = 0;
|
||||
|
||||
// Accept 'I' if temperature presets are defined
|
||||
#if PREHEAT_COUNT
|
||||
#if HAS_PREHEAT
|
||||
if (preset_index) noztemp = ui.material_preset[preset_index - 1].hotend_temp;
|
||||
#endif
|
||||
|
||||
|
||||
@@ -36,7 +36,7 @@
|
||||
#include "../../../module/probe.h"
|
||||
#include "../../queue.h"
|
||||
|
||||
#if ENABLED(PROBE_TEMP_COMPENSATION)
|
||||
#if HAS_PTC
|
||||
#include "../../../feature/probe_temp_comp.h"
|
||||
#include "../../../module/temperature.h"
|
||||
#endif
|
||||
@@ -645,11 +645,9 @@ G29_TYPE GcodeSuite::G29() {
|
||||
break; // Breaks out of both loops
|
||||
}
|
||||
|
||||
#if ENABLED(PROBE_TEMP_COMPENSATION)
|
||||
temp_comp.compensate_measurement(TSI_BED, thermalManager.degBed(), abl.measured_z);
|
||||
temp_comp.compensate_measurement(TSI_PROBE, thermalManager.degProbe(), abl.measured_z);
|
||||
TERN_(USE_TEMP_EXT_COMPENSATION, temp_comp.compensate_measurement(TSI_EXT, thermalManager.degHotend(0), abl.measured_z));
|
||||
#endif
|
||||
TERN_(PTC_BED, ptc.compensate_measurement(TSI_BED, thermalManager.degBed(), abl.measured_z));
|
||||
TERN_(PTC_PROBE, ptc.compensate_measurement(TSI_PROBE, thermalManager.degProbe(), abl.measured_z));
|
||||
TERN_(PTC_HOTEND, ptc.compensate_measurement(TSI_EXT, thermalManager.degHotend(0), abl.measured_z));
|
||||
|
||||
#if ENABLED(AUTO_BED_LEVELING_LINEAR)
|
||||
|
||||
|
||||
@@ -1,358 +0,0 @@
|
||||
/**
|
||||
* Marlin 3D Printer Firmware
|
||||
* Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
|
||||
*
|
||||
* Based on Sprinter and grbl.
|
||||
* Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*
|
||||
*/
|
||||
|
||||
/**
|
||||
* G76_M871.cpp - Temperature calibration/compensation for z-probing
|
||||
*/
|
||||
|
||||
#include "../../inc/MarlinConfig.h"
|
||||
|
||||
#if ENABLED(PROBE_TEMP_COMPENSATION)
|
||||
|
||||
#include "../gcode.h"
|
||||
#include "../../module/motion.h"
|
||||
#include "../../module/planner.h"
|
||||
#include "../../module/probe.h"
|
||||
#include "../../feature/bedlevel/bedlevel.h"
|
||||
#include "../../module/temperature.h"
|
||||
#include "../../module/probe.h"
|
||||
#include "../../feature/probe_temp_comp.h"
|
||||
#include "../../lcd/marlinui.h"
|
||||
|
||||
/**
|
||||
* G76: calibrate probe and/or bed temperature offsets
|
||||
* Notes:
|
||||
* - When calibrating probe, bed temperature is held constant.
|
||||
* Compensation values are deltas to first probe measurement at probe temp. = 30°C.
|
||||
* - When calibrating bed, probe temperature is held constant.
|
||||
* Compensation values are deltas to first probe measurement at bed temp. = 60°C.
|
||||
* - The hotend will not be heated at any time.
|
||||
* - On my Průša MK3S clone I put a piece of paper between the probe and the hotend
|
||||
* so the hotend fan would not cool my probe constantly. Alternatively you could just
|
||||
* make sure the fan is not running while running the calibration process.
|
||||
*
|
||||
* Probe calibration:
|
||||
* - Moves probe to cooldown point.
|
||||
* - Heats up bed to 100°C.
|
||||
* - Moves probe to probing point (1mm above heatbed).
|
||||
* - Waits until probe reaches target temperature (30°C).
|
||||
* - Does a z-probing (=base value) and increases target temperature by 5°C.
|
||||
* - Waits until probe reaches increased target temperature.
|
||||
* - Does a z-probing (delta to base value will be a compensation value) and increases target temperature by 5°C.
|
||||
* - Repeats last two steps until max. temperature reached or timeout (i.e. probe does not heat up any further).
|
||||
* - Compensation values of higher temperatures will be extrapolated (using linear regression first).
|
||||
* While this is not exact by any means it is still better than simply using the last compensation value.
|
||||
*
|
||||
* Bed calibration:
|
||||
* - Moves probe to cooldown point.
|
||||
* - Heats up bed to 60°C.
|
||||
* - Moves probe to probing point (1mm above heatbed).
|
||||
* - Waits until probe reaches target temperature (30°C).
|
||||
* - Does a z-probing (=base value) and increases bed temperature by 5°C.
|
||||
* - Moves probe to cooldown point.
|
||||
* - Waits until probe is below 30°C and bed has reached target temperature.
|
||||
* - Moves probe to probing point and waits until it reaches target temperature (30°C).
|
||||
* - Does a z-probing (delta to base value will be a compensation value) and increases bed temperature by 5°C.
|
||||
* - Repeats last four points until max. bed temperature reached (110°C) or timeout.
|
||||
* - Compensation values of higher temperatures will be extrapolated (using linear regression first).
|
||||
* While this is not exact by any means it is still better than simply using the last compensation value.
|
||||
*
|
||||
* G76 [B | P]
|
||||
* - no flag - Both calibration procedures will be run.
|
||||
* - `B` - Run bed temperature calibration.
|
||||
* - `P` - Run probe temperature calibration.
|
||||
*/
|
||||
|
||||
static void say_waiting_for() { SERIAL_ECHOPGM("Waiting for "); }
|
||||
static void say_waiting_for_probe_heating() { say_waiting_for(); SERIAL_ECHOLNPGM("probe heating."); }
|
||||
static void say_successfully_calibrated() { SERIAL_ECHOPGM("Successfully calibrated"); }
|
||||
static void say_failed_to_calibrate() { SERIAL_ECHOPGM("!Failed to calibrate"); }
|
||||
|
||||
void GcodeSuite::G76() {
|
||||
// Check if heated bed is available and z-homing is done with probe
|
||||
#if TEMP_SENSOR_BED == 0 || !(HOMING_Z_WITH_PROBE)
|
||||
return;
|
||||
#endif
|
||||
|
||||
auto report_temps = [](millis_t &ntr, millis_t timeout=0) {
|
||||
idle_no_sleep();
|
||||
const millis_t ms = millis();
|
||||
if (ELAPSED(ms, ntr)) {
|
||||
ntr = ms + 1000;
|
||||
thermalManager.print_heater_states(active_extruder);
|
||||
}
|
||||
return (timeout && ELAPSED(ms, timeout));
|
||||
};
|
||||
|
||||
auto wait_for_temps = [&](const celsius_t tb, const celsius_t tp, millis_t &ntr, const millis_t timeout=0) {
|
||||
say_waiting_for(); SERIAL_ECHOLNPGM("bed and probe temperature.");
|
||||
while (thermalManager.wholeDegBed() != tb || thermalManager.wholeDegProbe() > tp)
|
||||
if (report_temps(ntr, timeout)) return true;
|
||||
return false;
|
||||
};
|
||||
|
||||
auto g76_probe = [](const TempSensorID sid, celsius_t &targ, const xy_pos_t &nozpos) {
|
||||
do_z_clearance(5.0); // Raise nozzle before probing
|
||||
const float measured_z = probe.probe_at_point(nozpos, PROBE_PT_STOW, 0, false); // verbose=0, probe_relative=false
|
||||
if (isnan(measured_z))
|
||||
SERIAL_ECHOLNPGM("!Received NAN. Aborting.");
|
||||
else {
|
||||
SERIAL_ECHOLNPAIR_F("Measured: ", measured_z);
|
||||
if (targ == cali_info_init[sid].start_temp)
|
||||
temp_comp.prepare_new_calibration(measured_z);
|
||||
else
|
||||
temp_comp.push_back_new_measurement(sid, measured_z);
|
||||
targ += cali_info_init[sid].temp_resolution;
|
||||
}
|
||||
return measured_z;
|
||||
};
|
||||
|
||||
#if ENABLED(BLTOUCH)
|
||||
// Make sure any BLTouch error condition is cleared
|
||||
bltouch_command(BLTOUCH_RESET, BLTOUCH_RESET_DELAY);
|
||||
set_bltouch_deployed(false);
|
||||
#endif
|
||||
|
||||
bool do_bed_cal = parser.boolval('B'), do_probe_cal = parser.boolval('P');
|
||||
if (!do_bed_cal && !do_probe_cal) do_bed_cal = do_probe_cal = true;
|
||||
|
||||
// Synchronize with planner
|
||||
planner.synchronize();
|
||||
|
||||
const xyz_pos_t parkpos = temp_comp.park_point,
|
||||
probe_pos_xyz = xyz_pos_t(temp_comp.measure_point) + xyz_pos_t({ 0.0f, 0.0f, PTC_PROBE_HEATING_OFFSET }),
|
||||
noz_pos_xyz = probe_pos_xyz - probe.offset_xy; // Nozzle position based on probe position
|
||||
|
||||
if (do_bed_cal || do_probe_cal) {
|
||||
// Ensure park position is reachable
|
||||
bool reachable = position_is_reachable(parkpos) || WITHIN(parkpos.z, Z_MIN_POS - fslop, Z_MAX_POS + fslop);
|
||||
if (!reachable)
|
||||
SERIAL_ECHOLNPGM("!Park");
|
||||
else {
|
||||
// Ensure probe position is reachable
|
||||
reachable = probe.can_reach(probe_pos_xyz);
|
||||
if (!reachable) SERIAL_ECHOLNPGM("!Probe");
|
||||
}
|
||||
|
||||
if (!reachable) {
|
||||
SERIAL_ECHOLNPGM(" position unreachable - aborting.");
|
||||
return;
|
||||
}
|
||||
|
||||
process_subcommands_now(FPSTR(G28_STR));
|
||||
}
|
||||
|
||||
remember_feedrate_scaling_off();
|
||||
|
||||
/******************************************
|
||||
* Calibrate bed temperature offsets
|
||||
******************************************/
|
||||
|
||||
// Report temperatures every second and handle heating timeouts
|
||||
millis_t next_temp_report = millis() + 1000;
|
||||
|
||||
auto report_targets = [&](const celsius_t tb, const celsius_t tp) {
|
||||
SERIAL_ECHOLNPGM("Target Bed:", tb, " Probe:", tp);
|
||||
};
|
||||
|
||||
if (do_bed_cal) {
|
||||
|
||||
celsius_t target_bed = cali_info_init[TSI_BED].start_temp,
|
||||
target_probe = temp_comp.bed_calib_probe_temp;
|
||||
|
||||
say_waiting_for(); SERIAL_ECHOLNPGM(" cooling.");
|
||||
while (thermalManager.wholeDegBed() > target_bed || thermalManager.wholeDegProbe() > target_probe)
|
||||
report_temps(next_temp_report);
|
||||
|
||||
// Disable leveling so it won't mess with us
|
||||
TERN_(HAS_LEVELING, set_bed_leveling_enabled(false));
|
||||
|
||||
for (;;) {
|
||||
thermalManager.setTargetBed(target_bed);
|
||||
|
||||
report_targets(target_bed, target_probe);
|
||||
|
||||
// Park nozzle
|
||||
do_blocking_move_to(parkpos);
|
||||
|
||||
// Wait for heatbed to reach target temp and probe to cool below target temp
|
||||
if (wait_for_temps(target_bed, target_probe, next_temp_report, millis() + MIN_TO_MS(15))) {
|
||||
SERIAL_ECHOLNPGM("!Bed heating timeout.");
|
||||
break;
|
||||
}
|
||||
|
||||
// Move the nozzle to the probing point and wait for the probe to reach target temp
|
||||
do_blocking_move_to(noz_pos_xyz);
|
||||
say_waiting_for_probe_heating();
|
||||
SERIAL_EOL();
|
||||
while (thermalManager.wholeDegProbe() < target_probe)
|
||||
report_temps(next_temp_report);
|
||||
|
||||
const float measured_z = g76_probe(TSI_BED, target_bed, noz_pos_xyz);
|
||||
if (isnan(measured_z) || target_bed > (BED_MAX_TARGET)) break;
|
||||
}
|
||||
|
||||
SERIAL_ECHOLNPGM("Retrieved measurements: ", temp_comp.get_index());
|
||||
if (temp_comp.finish_calibration(TSI_BED)) {
|
||||
say_successfully_calibrated();
|
||||
SERIAL_ECHOLNPGM(" bed.");
|
||||
}
|
||||
else {
|
||||
say_failed_to_calibrate();
|
||||
SERIAL_ECHOLNPGM(" bed. Values reset.");
|
||||
}
|
||||
|
||||
// Cleanup
|
||||
thermalManager.setTargetBed(0);
|
||||
TERN_(HAS_LEVELING, set_bed_leveling_enabled(true));
|
||||
} // do_bed_cal
|
||||
|
||||
/********************************************
|
||||
* Calibrate probe temperature offsets
|
||||
********************************************/
|
||||
|
||||
if (do_probe_cal) {
|
||||
|
||||
// Park nozzle
|
||||
do_blocking_move_to(parkpos);
|
||||
|
||||
// Initialize temperatures
|
||||
const celsius_t target_bed = temp_comp.probe_calib_bed_temp;
|
||||
thermalManager.setTargetBed(target_bed);
|
||||
|
||||
celsius_t target_probe = cali_info_init[TSI_PROBE].start_temp;
|
||||
|
||||
report_targets(target_bed, target_probe);
|
||||
|
||||
// Wait for heatbed to reach target temp and probe to cool below target temp
|
||||
wait_for_temps(target_bed, target_probe, next_temp_report);
|
||||
|
||||
// Disable leveling so it won't mess with us
|
||||
TERN_(HAS_LEVELING, set_bed_leveling_enabled(false));
|
||||
|
||||
bool timeout = false;
|
||||
for (;;) {
|
||||
// Move probe to probing point and wait for it to reach target temperature
|
||||
do_blocking_move_to(noz_pos_xyz);
|
||||
|
||||
say_waiting_for_probe_heating();
|
||||
SERIAL_ECHOLNPGM(" Bed:", target_bed, " Probe:", target_probe);
|
||||
const millis_t probe_timeout_ms = millis() + SEC_TO_MS(900UL);
|
||||
while (thermalManager.degProbe() < target_probe) {
|
||||
if (report_temps(next_temp_report, probe_timeout_ms)) {
|
||||
SERIAL_ECHOLNPGM("!Probe heating timed out.");
|
||||
timeout = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (timeout) break;
|
||||
|
||||
const float measured_z = g76_probe(TSI_PROBE, target_probe, noz_pos_xyz);
|
||||
if (isnan(measured_z) || target_probe > cali_info_init[TSI_PROBE].end_temp) break;
|
||||
}
|
||||
|
||||
SERIAL_ECHOLNPGM("Retrieved measurements: ", temp_comp.get_index());
|
||||
if (temp_comp.finish_calibration(TSI_PROBE))
|
||||
say_successfully_calibrated();
|
||||
else
|
||||
say_failed_to_calibrate();
|
||||
SERIAL_ECHOLNPGM(" probe.");
|
||||
|
||||
// Cleanup
|
||||
thermalManager.setTargetBed(0);
|
||||
TERN_(HAS_LEVELING, set_bed_leveling_enabled(true));
|
||||
|
||||
SERIAL_ECHOLNPGM("Final compensation values:");
|
||||
temp_comp.print_offsets();
|
||||
} // do_probe_cal
|
||||
|
||||
restore_feedrate_and_scaling();
|
||||
}
|
||||
|
||||
/**
|
||||
* M871: Report / reset temperature compensation offsets.
|
||||
* Note: This does not affect values in EEPROM until M500.
|
||||
*
|
||||
* M871 [ R | B | P | E ]
|
||||
*
|
||||
* No Parameters - Print current offset values.
|
||||
*
|
||||
* Select only one of these flags:
|
||||
* R - Reset all offsets to zero (i.e., disable compensation).
|
||||
* B - Manually set offset for bed
|
||||
* P - Manually set offset for probe
|
||||
* E - Manually set offset for extruder
|
||||
*
|
||||
* With B, P, or E:
|
||||
* I[index] - Index in the array
|
||||
* V[value] - Adjustment in µm
|
||||
*/
|
||||
void GcodeSuite::M871() {
|
||||
|
||||
if (parser.seen('R')) {
|
||||
// Reset z-probe offsets to factory defaults
|
||||
temp_comp.clear_all_offsets();
|
||||
SERIAL_ECHOLNPGM("Offsets reset to default.");
|
||||
}
|
||||
else if (parser.seen("BPE")) {
|
||||
if (!parser.seenval('V')) return;
|
||||
const int16_t offset_val = parser.value_int();
|
||||
if (!parser.seenval('I')) return;
|
||||
const int16_t idx = parser.value_int();
|
||||
const TempSensorID mod = (parser.seen('B') ? TSI_BED :
|
||||
#if ENABLED(USE_TEMP_EXT_COMPENSATION)
|
||||
parser.seen('E') ? TSI_EXT :
|
||||
#endif
|
||||
TSI_PROBE
|
||||
);
|
||||
if (idx > 0 && temp_comp.set_offset(mod, idx - 1, offset_val))
|
||||
SERIAL_ECHOLNPGM("Set value: ", offset_val);
|
||||
else
|
||||
SERIAL_ECHOLNPGM("!Invalid index. Failed to set value (note: value at index 0 is constant).");
|
||||
|
||||
}
|
||||
else // Print current Z-probe adjustments. Note: Values in EEPROM might differ.
|
||||
temp_comp.print_offsets();
|
||||
}
|
||||
|
||||
/**
|
||||
* M192: Wait for probe temperature sensor to reach a target
|
||||
*
|
||||
* Select only one of these flags:
|
||||
* R - Wait for heating or cooling
|
||||
* S - Wait only for heating
|
||||
*/
|
||||
void GcodeSuite::M192() {
|
||||
if (DEBUGGING(DRYRUN)) return;
|
||||
|
||||
const bool no_wait_for_cooling = parser.seenval('S');
|
||||
if (!no_wait_for_cooling && ! parser.seenval('R')) {
|
||||
SERIAL_ERROR_MSG("No target temperature set.");
|
||||
return;
|
||||
}
|
||||
|
||||
const celsius_t target_temp = parser.value_celsius();
|
||||
ui.set_status(thermalManager.isProbeBelowTemp(target_temp) ? GET_TEXT_F(MSG_PROBE_HEATING) : GET_TEXT_F(MSG_PROBE_COOLING));
|
||||
thermalManager.wait_for_probe(target_temp, no_wait_for_cooling);
|
||||
}
|
||||
|
||||
#endif // PROBE_TEMP_COMPENSATION
|
||||
@@ -0,0 +1,337 @@
|
||||
/**
|
||||
* Marlin 3D Printer Firmware
|
||||
* Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
|
||||
*
|
||||
* Based on Sprinter and grbl.
|
||||
* Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*
|
||||
*/
|
||||
|
||||
/**
|
||||
* G76_M871.cpp - Temperature calibration/compensation for z-probing
|
||||
*/
|
||||
|
||||
#include "../../inc/MarlinConfig.h"
|
||||
|
||||
#if HAS_PTC
|
||||
|
||||
#include "../gcode.h"
|
||||
#include "../../module/motion.h"
|
||||
#include "../../module/planner.h"
|
||||
#include "../../module/probe.h"
|
||||
#include "../../feature/bedlevel/bedlevel.h"
|
||||
#include "../../module/temperature.h"
|
||||
#include "../../module/probe.h"
|
||||
#include "../../feature/probe_temp_comp.h"
|
||||
#include "../../lcd/marlinui.h"
|
||||
|
||||
/**
|
||||
* G76: calibrate probe and/or bed temperature offsets
|
||||
* Notes:
|
||||
* - When calibrating probe, bed temperature is held constant.
|
||||
* Compensation values are deltas to first probe measurement at probe temp. = 30°C.
|
||||
* - When calibrating bed, probe temperature is held constant.
|
||||
* Compensation values are deltas to first probe measurement at bed temp. = 60°C.
|
||||
* - The hotend will not be heated at any time.
|
||||
* - On my Průša MK3S clone I put a piece of paper between the probe and the hotend
|
||||
* so the hotend fan would not cool my probe constantly. Alternatively you could just
|
||||
* make sure the fan is not running while running the calibration process.
|
||||
*
|
||||
* Probe calibration:
|
||||
* - Moves probe to cooldown point.
|
||||
* - Heats up bed to 100°C.
|
||||
* - Moves probe to probing point (1mm above heatbed).
|
||||
* - Waits until probe reaches target temperature (30°C).
|
||||
* - Does a z-probing (=base value) and increases target temperature by 5°C.
|
||||
* - Waits until probe reaches increased target temperature.
|
||||
* - Does a z-probing (delta to base value will be a compensation value) and increases target temperature by 5°C.
|
||||
* - Repeats last two steps until max. temperature reached or timeout (i.e. probe does not heat up any further).
|
||||
* - Compensation values of higher temperatures will be extrapolated (using linear regression first).
|
||||
* While this is not exact by any means it is still better than simply using the last compensation value.
|
||||
*
|
||||
* Bed calibration:
|
||||
* - Moves probe to cooldown point.
|
||||
* - Heats up bed to 60°C.
|
||||
* - Moves probe to probing point (1mm above heatbed).
|
||||
* - Waits until probe reaches target temperature (30°C).
|
||||
* - Does a z-probing (=base value) and increases bed temperature by 5°C.
|
||||
* - Moves probe to cooldown point.
|
||||
* - Waits until probe is below 30°C and bed has reached target temperature.
|
||||
* - Moves probe to probing point and waits until it reaches target temperature (30°C).
|
||||
* - Does a z-probing (delta to base value will be a compensation value) and increases bed temperature by 5°C.
|
||||
* - Repeats last four points until max. bed temperature reached (110°C) or timeout.
|
||||
* - Compensation values of higher temperatures will be extrapolated (using linear regression first).
|
||||
* While this is not exact by any means it is still better than simply using the last compensation value.
|
||||
*
|
||||
* G76 [B | P]
|
||||
* - no flag - Both calibration procedures will be run.
|
||||
* - `B` - Run bed temperature calibration.
|
||||
* - `P` - Run probe temperature calibration.
|
||||
*/
|
||||
|
||||
static void say_waiting_for() { SERIAL_ECHOPGM("Waiting for "); }
|
||||
static void say_waiting_for_probe_heating() { say_waiting_for(); SERIAL_ECHOLNPGM("probe heating."); }
|
||||
static void say_successfully_calibrated() { SERIAL_ECHOPGM("Successfully calibrated"); }
|
||||
static void say_failed_to_calibrate() { SERIAL_ECHOPGM("!Failed to calibrate"); }
|
||||
|
||||
#if BOTH(PTC_PROBE, PTC_BED)
|
||||
|
||||
void GcodeSuite::G76() {
|
||||
auto report_temps = [](millis_t &ntr, millis_t timeout=0) {
|
||||
idle_no_sleep();
|
||||
const millis_t ms = millis();
|
||||
if (ELAPSED(ms, ntr)) {
|
||||
ntr = ms + 1000;
|
||||
thermalManager.print_heater_states(active_extruder);
|
||||
}
|
||||
return (timeout && ELAPSED(ms, timeout));
|
||||
};
|
||||
|
||||
auto wait_for_temps = [&](const celsius_t tb, const celsius_t tp, millis_t &ntr, const millis_t timeout=0) {
|
||||
say_waiting_for(); SERIAL_ECHOLNPGM("bed and probe temperature.");
|
||||
while (thermalManager.wholeDegBed() != tb || thermalManager.wholeDegProbe() > tp)
|
||||
if (report_temps(ntr, timeout)) return true;
|
||||
return false;
|
||||
};
|
||||
|
||||
auto g76_probe = [](const TempSensorID sid, celsius_t &targ, const xy_pos_t &nozpos) {
|
||||
do_z_clearance(5.0); // Raise nozzle before probing
|
||||
const float measured_z = probe.probe_at_point(nozpos, PROBE_PT_STOW, 0, false); // verbose=0, probe_relative=false
|
||||
if (isnan(measured_z))
|
||||
SERIAL_ECHOLNPGM("!Received NAN. Aborting.");
|
||||
else {
|
||||
SERIAL_ECHOLNPAIR_F("Measured: ", measured_z);
|
||||
if (targ == ProbeTempComp::cali_info[sid].start_temp)
|
||||
ptc.prepare_new_calibration(measured_z);
|
||||
else
|
||||
ptc.push_back_new_measurement(sid, measured_z);
|
||||
targ += ProbeTempComp::cali_info[sid].temp_resolution;
|
||||
}
|
||||
return measured_z;
|
||||
};
|
||||
|
||||
#if ENABLED(BLTOUCH)
|
||||
// Make sure any BLTouch error condition is cleared
|
||||
bltouch_command(BLTOUCH_RESET, BLTOUCH_RESET_DELAY);
|
||||
set_bltouch_deployed(false);
|
||||
#endif
|
||||
|
||||
bool do_bed_cal = parser.boolval('B'), do_probe_cal = parser.boolval('P');
|
||||
if (!do_bed_cal && !do_probe_cal) do_bed_cal = do_probe_cal = true;
|
||||
|
||||
// Synchronize with planner
|
||||
planner.synchronize();
|
||||
|
||||
#ifndef PTC_PROBE_HEATING_OFFSET
|
||||
#define PTC_PROBE_HEATING_OFFSET 0
|
||||
#endif
|
||||
const xyz_pos_t parkpos = PTC_PARK_POS,
|
||||
probe_pos_xyz = xyz_pos_t(PTC_PROBE_POS) + xyz_pos_t({ 0.0f, 0.0f, PTC_PROBE_HEATING_OFFSET }),
|
||||
noz_pos_xyz = probe_pos_xyz - probe.offset_xy; // Nozzle position based on probe position
|
||||
|
||||
if (do_bed_cal || do_probe_cal) {
|
||||
// Ensure park position is reachable
|
||||
bool reachable = position_is_reachable(parkpos) || WITHIN(parkpos.z, Z_MIN_POS - fslop, Z_MAX_POS + fslop);
|
||||
if (!reachable)
|
||||
SERIAL_ECHOLNPGM("!Park");
|
||||
else {
|
||||
// Ensure probe position is reachable
|
||||
reachable = probe.can_reach(probe_pos_xyz);
|
||||
if (!reachable) SERIAL_ECHOLNPGM("!Probe");
|
||||
}
|
||||
|
||||
if (!reachable) {
|
||||
SERIAL_ECHOLNPGM(" position unreachable - aborting.");
|
||||
return;
|
||||
}
|
||||
|
||||
process_subcommands_now(FPSTR(G28_STR));
|
||||
}
|
||||
|
||||
remember_feedrate_scaling_off();
|
||||
|
||||
/******************************************
|
||||
* Calibrate bed temperature offsets
|
||||
******************************************/
|
||||
|
||||
// Report temperatures every second and handle heating timeouts
|
||||
millis_t next_temp_report = millis() + 1000;
|
||||
|
||||
auto report_targets = [&](const celsius_t tb, const celsius_t tp) {
|
||||
SERIAL_ECHOLNPGM("Target Bed:", tb, " Probe:", tp);
|
||||
};
|
||||
|
||||
if (do_bed_cal) {
|
||||
|
||||
celsius_t target_bed = PTC_BED_START,
|
||||
target_probe = PTC_PROBE_TEMP;
|
||||
|
||||
say_waiting_for(); SERIAL_ECHOLNPGM(" cooling.");
|
||||
while (thermalManager.wholeDegBed() > target_bed || thermalManager.wholeDegProbe() > target_probe)
|
||||
report_temps(next_temp_report);
|
||||
|
||||
// Disable leveling so it won't mess with us
|
||||
TERN_(HAS_LEVELING, set_bed_leveling_enabled(false));
|
||||
|
||||
for (uint8_t idx = 0; idx <= PTC_BED_COUNT; idx++) {
|
||||
thermalManager.setTargetBed(target_bed);
|
||||
|
||||
report_targets(target_bed, target_probe);
|
||||
|
||||
// Park nozzle
|
||||
do_blocking_move_to(parkpos);
|
||||
|
||||
// Wait for heatbed to reach target temp and probe to cool below target temp
|
||||
if (wait_for_temps(target_bed, target_probe, next_temp_report, millis() + MIN_TO_MS(15))) {
|
||||
SERIAL_ECHOLNPGM("!Bed heating timeout.");
|
||||
break;
|
||||
}
|
||||
|
||||
// Move the nozzle to the probing point and wait for the probe to reach target temp
|
||||
do_blocking_move_to(noz_pos_xyz);
|
||||
say_waiting_for_probe_heating();
|
||||
SERIAL_EOL();
|
||||
while (thermalManager.wholeDegProbe() < target_probe)
|
||||
report_temps(next_temp_report);
|
||||
|
||||
const float measured_z = g76_probe(TSI_BED, target_bed, noz_pos_xyz);
|
||||
if (isnan(measured_z) || target_bed > (BED_MAX_TARGET)) break;
|
||||
}
|
||||
|
||||
SERIAL_ECHOLNPGM("Retrieved measurements: ", ptc.get_index());
|
||||
if (ptc.finish_calibration(TSI_BED)) {
|
||||
say_successfully_calibrated();
|
||||
SERIAL_ECHOLNPGM(" bed.");
|
||||
}
|
||||
else {
|
||||
say_failed_to_calibrate();
|
||||
SERIAL_ECHOLNPGM(" bed. Values reset.");
|
||||
}
|
||||
|
||||
// Cleanup
|
||||
thermalManager.setTargetBed(0);
|
||||
TERN_(HAS_LEVELING, set_bed_leveling_enabled(true));
|
||||
} // do_bed_cal
|
||||
|
||||
/********************************************
|
||||
* Calibrate probe temperature offsets
|
||||
********************************************/
|
||||
|
||||
if (do_probe_cal) {
|
||||
|
||||
// Park nozzle
|
||||
do_blocking_move_to(parkpos);
|
||||
|
||||
// Initialize temperatures
|
||||
const celsius_t target_bed = BED_MAX_TARGET;
|
||||
thermalManager.setTargetBed(target_bed);
|
||||
|
||||
celsius_t target_probe = PTC_PROBE_START;
|
||||
|
||||
report_targets(target_bed, target_probe);
|
||||
|
||||
// Wait for heatbed to reach target temp and probe to cool below target temp
|
||||
wait_for_temps(target_bed, target_probe, next_temp_report);
|
||||
|
||||
// Disable leveling so it won't mess with us
|
||||
TERN_(HAS_LEVELING, set_bed_leveling_enabled(false));
|
||||
|
||||
bool timeout = false;
|
||||
for (uint8_t idx = 0; idx <= PTC_PROBE_COUNT; idx++) {
|
||||
// Move probe to probing point and wait for it to reach target temperature
|
||||
do_blocking_move_to(noz_pos_xyz);
|
||||
|
||||
say_waiting_for_probe_heating();
|
||||
SERIAL_ECHOLNPGM(" Bed:", target_bed, " Probe:", target_probe);
|
||||
const millis_t probe_timeout_ms = millis() + SEC_TO_MS(900UL);
|
||||
while (thermalManager.degProbe() < target_probe) {
|
||||
if (report_temps(next_temp_report, probe_timeout_ms)) {
|
||||
SERIAL_ECHOLNPGM("!Probe heating timed out.");
|
||||
timeout = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (timeout) break;
|
||||
|
||||
const float measured_z = g76_probe(TSI_PROBE, target_probe, noz_pos_xyz);
|
||||
if (isnan(measured_z)) break;
|
||||
}
|
||||
|
||||
SERIAL_ECHOLNPGM("Retrieved measurements: ", ptc.get_index());
|
||||
if (ptc.finish_calibration(TSI_PROBE))
|
||||
say_successfully_calibrated();
|
||||
else
|
||||
say_failed_to_calibrate();
|
||||
SERIAL_ECHOLNPGM(" probe.");
|
||||
|
||||
// Cleanup
|
||||
thermalManager.setTargetBed(0);
|
||||
TERN_(HAS_LEVELING, set_bed_leveling_enabled(true));
|
||||
|
||||
SERIAL_ECHOLNPGM("Final compensation values:");
|
||||
ptc.print_offsets();
|
||||
} // do_probe_cal
|
||||
|
||||
restore_feedrate_and_scaling();
|
||||
}
|
||||
|
||||
#endif // PTC_PROBE && PTC_BED
|
||||
|
||||
/**
|
||||
* M871: Report / reset temperature compensation offsets.
|
||||
* Note: This does not affect values in EEPROM until M500.
|
||||
*
|
||||
* M871 [ R | B | P | E ]
|
||||
*
|
||||
* No Parameters - Print current offset values.
|
||||
*
|
||||
* Select only one of these flags:
|
||||
* R - Reset all offsets to zero (i.e., disable compensation).
|
||||
* B - Manually set offset for bed
|
||||
* P - Manually set offset for probe
|
||||
* E - Manually set offset for extruder
|
||||
*
|
||||
* With B, P, or E:
|
||||
* I[index] - Index in the array
|
||||
* V[value] - Adjustment in µm
|
||||
*/
|
||||
void GcodeSuite::M871() {
|
||||
|
||||
if (parser.seen('R')) {
|
||||
// Reset z-probe offsets to factory defaults
|
||||
ptc.clear_all_offsets();
|
||||
SERIAL_ECHOLNPGM("Offsets reset to default.");
|
||||
}
|
||||
else if (parser.seen("BPE")) {
|
||||
if (!parser.seenval('V')) return;
|
||||
const int16_t offset_val = parser.value_int();
|
||||
if (!parser.seenval('I')) return;
|
||||
const int16_t idx = parser.value_int();
|
||||
const TempSensorID mod = TERN_(PTC_BED, parser.seen_test('B') ? TSI_BED :)
|
||||
TERN_(PTC_HOTEND, parser.seen_test('E') ? TSI_EXT :)
|
||||
TERN_(PTC_PROBE, parser.seen_test('P') ? TSI_PROBE :) TSI_COUNT;
|
||||
if (mod == TSI_COUNT)
|
||||
SERIAL_ECHOLNPGM("!Invalid sensor.");
|
||||
else if (idx > 0 && ptc.set_offset(mod, idx - 1, offset_val))
|
||||
SERIAL_ECHOLNPGM("Set value: ", offset_val);
|
||||
else
|
||||
SERIAL_ECHOLNPGM("!Invalid index. Failed to set value (note: value at index 0 is constant).");
|
||||
}
|
||||
else // Print current Z-probe adjustments. Note: Values in EEPROM might differ.
|
||||
ptc.print_offsets();
|
||||
}
|
||||
|
||||
#endif // HAS_PTC
|
||||
@@ -126,10 +126,10 @@ void GcodeSuite::M42() {
|
||||
extDigitalWrite(pin, pin_status);
|
||||
|
||||
#ifdef ARDUINO_ARCH_STM32
|
||||
// A simple I/O will be set to 0 by analogWrite()
|
||||
// A simple I/O will be set to 0 by set_pwm_duty()
|
||||
if (pin_status <= 1 && !PWM_PIN(pin)) return;
|
||||
#endif
|
||||
analogWrite(pin, pin_status);
|
||||
set_pwm_duty(pin, pin_status);
|
||||
}
|
||||
|
||||
#endif // DIRECT_PIN_CONTROL
|
||||
|
||||
@@ -74,13 +74,12 @@
|
||||
* This code should ALWAYS be available for FULL SHUTDOWN!
|
||||
*/
|
||||
void GcodeSuite::M81() {
|
||||
thermalManager.disable_all_heaters();
|
||||
planner.finish_and_disable();
|
||||
thermalManager.cooldown();
|
||||
|
||||
print_job_timer.stop();
|
||||
|
||||
#if HAS_FAN
|
||||
thermalManager.zero_fan_speeds();
|
||||
#if ENABLED(PROBING_FANS_OFF)
|
||||
thermalManager.fans_paused = false;
|
||||
ZERO(thermalManager.saved_fan_speed);
|
||||
|
||||
@@ -280,7 +280,7 @@ void GcodeSuite::M906() {
|
||||
|
||||
#if E_STEPPERS
|
||||
case E_AXIS: {
|
||||
const int8_t target_e_stepper = get_target_e_stepper_from_command();
|
||||
const int8_t target_e_stepper = get_target_e_stepper_from_command(0);
|
||||
if (target_e_stepper < 0) return;
|
||||
switch (target_e_stepper) {
|
||||
#if AXIS_IS_L64XX(E0)
|
||||
|
||||
@@ -133,7 +133,7 @@ static void say_stealth_status() {
|
||||
*/
|
||||
void GcodeSuite::M569() {
|
||||
if (parser.seen('S'))
|
||||
set_stealth_status(parser.value_bool(), get_target_e_stepper_from_command());
|
||||
set_stealth_status(parser.value_bool(), get_target_e_stepper_from_command(0));
|
||||
else
|
||||
say_stealth_status();
|
||||
}
|
||||
|
||||
@@ -104,7 +104,7 @@ void GcodeSuite::M906() {
|
||||
|
||||
#if E_STEPPERS
|
||||
case E_AXIS: {
|
||||
const int8_t target_e_stepper = get_target_e_stepper_from_command();
|
||||
const int8_t target_e_stepper = get_target_e_stepper_from_command(0);
|
||||
if (target_e_stepper < 0) return;
|
||||
switch (target_e_stepper) {
|
||||
#if AXIS_IS_TMC(E0)
|
||||
|
||||
@@ -268,7 +268,7 @@
|
||||
break;
|
||||
#if E_STEPPERS
|
||||
case E_AXIS: {
|
||||
const int8_t target_e_stepper = get_target_e_stepper_from_command();
|
||||
const int8_t target_e_stepper = get_target_e_stepper_from_command(0);
|
||||
if (target_e_stepper < 0) return;
|
||||
switch (target_e_stepper) {
|
||||
TERN_(E0_HAS_STEALTHCHOP, case 0: TMC_SET_PWMTHRS_E(0); break;)
|
||||
|
||||
@@ -137,11 +137,12 @@ int8_t GcodeSuite::get_target_extruder_from_command() {
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the target e stepper from the T parameter
|
||||
* Return -1 if the T parameter is out of range or unspecified
|
||||
* Get the target E stepper from the 'T' parameter.
|
||||
* If there is no 'T' parameter then dval will be substituted.
|
||||
* Returns -1 if the resulting E stepper index is out of range.
|
||||
*/
|
||||
int8_t GcodeSuite::get_target_e_stepper_from_command() {
|
||||
const int8_t e = parser.intval('T', -1);
|
||||
int8_t GcodeSuite::get_target_e_stepper_from_command(const int8_t dval/*=-1*/) {
|
||||
const int8_t e = parser.intval('T', dval);
|
||||
if (WITHIN(e, 0, E_STEPPERS - 1)) return e;
|
||||
|
||||
SERIAL_ECHO_START();
|
||||
@@ -423,7 +424,7 @@ void GcodeSuite::process_parsed_command(const bool no_ok/*=false*/) {
|
||||
case 61: G61(); break; // G61: Apply/restore saved coordinates.
|
||||
#endif
|
||||
|
||||
#if ENABLED(PROBE_TEMP_COMPENSATION)
|
||||
#if BOTH(PTC_PROBE, PTC_BED)
|
||||
case 76: G76(); break; // G76: Calibrate first layer compensation values
|
||||
#endif
|
||||
|
||||
@@ -586,6 +587,10 @@ void GcodeSuite::process_parsed_command(const bool no_ok/*=false*/) {
|
||||
case 191: M191(); break; // M191: Wait for chamber temperature to reach target
|
||||
#endif
|
||||
|
||||
#if HAS_TEMP_PROBE
|
||||
case 192: M192(); break; // M192: Wait for probe temp
|
||||
#endif
|
||||
|
||||
#if HAS_COOLER
|
||||
case 143: M143(); break; // M143: Set cooler temperature
|
||||
case 193: M193(); break; // M193: Wait for cooler temperature to reach target
|
||||
@@ -639,7 +644,7 @@ void GcodeSuite::process_parsed_command(const bool no_ok/*=false*/) {
|
||||
case 120: M120(); break; // M120: Enable endstops
|
||||
case 121: M121(); break; // M121: Disable endstops
|
||||
|
||||
#if PREHEAT_COUNT
|
||||
#if HAS_PREHEAT
|
||||
case 145: M145(); break; // M145: Set material heatup parameters
|
||||
#endif
|
||||
|
||||
@@ -920,8 +925,7 @@ void GcodeSuite::process_parsed_command(const bool no_ok/*=false*/) {
|
||||
case 852: M852(); break; // M852: Set Skew factors
|
||||
#endif
|
||||
|
||||
#if ENABLED(PROBE_TEMP_COMPENSATION)
|
||||
case 192: M192(); break; // M192: Wait for probe temp
|
||||
#if HAS_PTC
|
||||
case 871: M871(); break; // M871: Print/reset/clear first layer temperature offset values
|
||||
#endif
|
||||
|
||||
|
||||
+42
-21
@@ -66,7 +66,7 @@
|
||||
* G42 - Coordinated move to a mesh point (Requires MESH_BED_LEVELING, AUTO_BED_LEVELING_BLINEAR, or AUTO_BED_LEVELING_UBL)
|
||||
* G60 - Save current position. (Requires SAVED_POSITIONS)
|
||||
* G61 - Apply/restore saved coordinates. (Requires SAVED_POSITIONS)
|
||||
* G76 - Calibrate first layer temperature offsets. (Requires PROBE_TEMP_COMPENSATION)
|
||||
* G76 - Calibrate first layer temperature offsets. (Requires PTC_PROBE and PTC_BED)
|
||||
* G80 - Cancel current motion mode (Requires GCODE_MOTION_MODES)
|
||||
* G90 - Use Absolute Coordinates
|
||||
* G91 - Use Relative Coordinates
|
||||
@@ -88,6 +88,8 @@
|
||||
* M16 - Expected printer check. (Requires EXPECTED_PRINTER_CHECK)
|
||||
* M17 - Enable/Power all stepper motors
|
||||
* M18 - Disable all stepper motors; same as M84
|
||||
*
|
||||
*** Print from Media (SDSUPPORT) ***
|
||||
* M20 - List SD card. (Requires SDSUPPORT)
|
||||
* M21 - Init SD card. (Requires SDSUPPORT)
|
||||
* M22 - Release SD card. (Requires SDSUPPORT)
|
||||
@@ -100,30 +102,36 @@
|
||||
* OR, with 'C' get the current filename.
|
||||
* M28 - Start SD write: "M28 /path/file.gco". (Requires SDSUPPORT)
|
||||
* M29 - Stop SD write. (Requires SDSUPPORT)
|
||||
* M30 - Delete file from SD: "M30 /path/file.gco"
|
||||
* M30 - Delete file from SD: "M30 /path/file.gco" (Requires SDSUPPORT)
|
||||
* M31 - Report time since last M109 or SD card start to serial.
|
||||
* M32 - Select file and start SD print: "M32 [S<bytepos>] !/path/file.gco#". (Requires SDSUPPORT)
|
||||
* Use P to run other files as sub-programs: "M32 P !filename#"
|
||||
* The '#' is necessary when calling from within sd files, as it stops buffer prereading
|
||||
* M33 - Get the longname version of a path. (Requires LONG_FILENAME_HOST_SUPPORT)
|
||||
* M34 - Set SD Card sorting options. (Requires SDCARD_SORT_ALPHA)
|
||||
*
|
||||
* M42 - Change pin status via gcode: M42 P<pin> S<value>. LED pin assumed if P is omitted. (Requires DIRECT_PIN_CONTROL)
|
||||
* M43 - Display pin status, watch pins for changes, watch endstops & toggle LED, Z servo probe test, toggle pins
|
||||
* M43 - Display pin status, watch pins for changes, watch endstops & toggle LED, Z servo probe test, toggle pins (Requires PINS_DEBUGGING)
|
||||
* M48 - Measure Z Probe repeatability: M48 P<points> X<pos> Y<pos> V<level> E<engage> L<legs> S<chizoid>. (Requires Z_MIN_PROBE_REPEATABILITY_TEST)
|
||||
*
|
||||
* M73 - Set the progress percentage. (Requires LCD_SET_PROGRESS_MANUALLY)
|
||||
* M75 - Start the print job timer.
|
||||
* M76 - Pause the print job timer.
|
||||
* M77 - Stop the print job timer.
|
||||
* M78 - Show statistical information about the print jobs. (Requires PRINTCOUNTER)
|
||||
*
|
||||
* M80 - Turn on Power Supply. (Requires PSU_CONTROL)
|
||||
* M81 - Turn off Power Supply. (Requires PSU_CONTROL)
|
||||
*
|
||||
* M82 - Set E codes absolute (default).
|
||||
* M83 - Set E codes relative while in Absolute (G90) mode.
|
||||
* M84 - Disable steppers until next move, or use S<seconds> to specify an idle
|
||||
* duration after which steppers should turn off. S0 disables the timeout.
|
||||
* M85 - Set inactivity shutdown timer with parameter S<seconds>. To disable set zero (default)
|
||||
* M92 - Set planner.settings.axis_steps_per_mm for one or more axes.
|
||||
*
|
||||
* M100 - Watch Free Memory (for debugging) (Requires M100_FREE_MEMORY_WATCHER)
|
||||
*
|
||||
* M104 - Set extruder target temp.
|
||||
* M105 - Report current temperatures.
|
||||
* M106 - Set print fan speed.
|
||||
@@ -132,23 +140,29 @@
|
||||
* M109 - S<temp> Wait for extruder current temp to reach target temp. ** Wait only when heating! **
|
||||
* R<temp> Wait for extruder current temp to reach target temp. ** Wait for heating or cooling. **
|
||||
* If AUTOTEMP is enabled, S<mintemp> B<maxtemp> F<factor>. Exit autotemp by any M109 without F
|
||||
*
|
||||
* M110 - Set the current line number. (Used by host printing)
|
||||
* M111 - Set debug flags: "M111 S<flagbits>". See flag bits defined in enum.h.
|
||||
* M112 - Full Shutdown.
|
||||
*
|
||||
* M113 - Get or set the timeout interval for Host Keepalive "busy" messages. (Requires HOST_KEEPALIVE_FEATURE)
|
||||
* M114 - Report current position.
|
||||
* M115 - Report capabilities. (Extended capabilities requires EXTENDED_CAPABILITIES_REPORT)
|
||||
* M117 - Display a message on the controller screen. (Requires an LCD)
|
||||
* M118 - Display a message in the host console.
|
||||
*
|
||||
* M119 - Report endstops status.
|
||||
* M120 - Enable endstops detection.
|
||||
* M121 - Disable endstops detection.
|
||||
*
|
||||
* M122 - Debug stepper (Requires at least one _DRIVER_TYPE defined as TMC2130/2160/5130/5160/2208/2209/2660 or L6470)
|
||||
* M125 - Save current position and move to filament change position. (Requires PARK_HEAD_ON_PAUSE)
|
||||
*
|
||||
* M126 - Solenoid Air Valve Open. (Requires BARICUDA)
|
||||
* M127 - Solenoid Air Valve Closed. (Requires BARICUDA)
|
||||
* M128 - EtoP Open. (Requires BARICUDA)
|
||||
* M129 - EtoP Closed. (Requires BARICUDA)
|
||||
*
|
||||
* M140 - Set bed target temp. S<temp>
|
||||
* M141 - Set heated chamber target temp. S<temp> (Requires a chamber heater)
|
||||
* M143 - Set cooler target temp. S<temp> (Requires a laser cooling device)
|
||||
@@ -161,9 +175,9 @@
|
||||
* M164 - Commit the mix and save to a virtual tool (current, or as specified by 'S'). (Requires MIXING_EXTRUDER)
|
||||
* M165 - Set the mix for the mixing extruder (and current virtual tool) with parameters ABCDHI. (Requires MIXING_EXTRUDER and DIRECT_MIXING_IN_G1)
|
||||
* M166 - Set the Gradient Mix for the mixing extruder. (Requires GRADIENT_MIX)
|
||||
* M190 - S<temp> Wait for bed current temp to reach target temp. ** Wait only when heating! **
|
||||
* R<temp> Wait for bed current temp to reach target temp. ** Wait for heating or cooling. **
|
||||
* M193 - R<temp> Wait for cooler temp to reach target temp. ** Wait for cooling. **
|
||||
* M190 - Set bed target temperature and wait. R<temp> Set target temperature and wait. S<temp> Set, but only wait when heating. (Requires TEMP_SENSOR_BED)
|
||||
* M192 - Wait for probe to reach target temperature. (Requires TEMP_SENSOR_PROBE)
|
||||
* M193 - R<temp> Wait for cooler to reach target temp. ** Wait for cooling. **
|
||||
* M200 - Set filament diameter, D<diameter>, setting E axis units to cubic. (Use S0 to revert to linear units.)
|
||||
* M201 - Set max acceleration in units/s^2 for print moves: "M201 X<accel> Y<accel> Z<accel> E<accel>"
|
||||
* M202 - Set max acceleration in units/s^2 for travel moves: "M202 X<accel> Y<accel> Z<accel> E<accel>" ** UNUSED IN MARLIN! **
|
||||
@@ -183,7 +197,7 @@
|
||||
* M218 - Set/get a tool offset: "M218 T<index> X<offset> Y<offset>". (Requires 2 or more extruders)
|
||||
* M220 - Set Feedrate Percentage: "M220 S<percent>" (i.e., "FR" on the LCD)
|
||||
* Use "M220 B" to back up the Feedrate Percentage and "M220 R" to restore it. (Requires an MMU_MODEL version 2 or 2S)
|
||||
* M221 - Set Flow Percentage: "M221 S<percent>"
|
||||
* M221 - Set Flow Percentage: "M221 S<percent>" (Requires an extruder)
|
||||
* M226 - Wait until a pin is in a given state: "M226 P<pin> S<state>" (Requires DIRECT_PIN_CONTROL)
|
||||
* M240 - Trigger a camera to take a photograph. (Requires PHOTO_GCODE)
|
||||
* M250 - Set LCD contrast: "M250 C<contrast>" (0-63). (Requires LCD support)
|
||||
@@ -230,9 +244,9 @@
|
||||
* M502 - Revert to the default "factory settings". ** Does not write them to EEPROM! **
|
||||
* M503 - Print the current settings (in memory): "M503 S<verbose>". S0 specifies compact output.
|
||||
* M504 - Validate EEPROM contents. (Requires EEPROM_SETTINGS)
|
||||
* M510 - Lock Printer
|
||||
* M511 - Unlock Printer
|
||||
* M512 - Set/Change/Remove Password
|
||||
* M510 - Lock Printer (Requires PASSWORD_FEATURE)
|
||||
* M511 - Unlock Printer (Requires PASSWORD_UNLOCK_GCODE)
|
||||
* M512 - Set/Change/Remove Password (Requires PASSWORD_CHANGE_GCODE)
|
||||
* M524 - Abort the current SD print job started with M24. (Requires SDSUPPORT)
|
||||
* M540 - Enable/disable SD card abort on endstop hit: "M540 S<state>". (Requires SD_ABORT_ON_ENDSTOP_HIT)
|
||||
* M552 - Get or set IP address. Enable/disable network interface. (Requires enabled Ethernet port)
|
||||
@@ -252,7 +266,9 @@
|
||||
* M808 - Set or Goto a Repeat Marker (Requires GCODE_REPEAT_MARKERS)
|
||||
* M810-M819 - Define/execute a G-code macro (Requires GCODE_MACROS)
|
||||
* M851 - Set Z probe's XYZ offsets in current units. (Negative values: X=left, Y=front, Z=below)
|
||||
* M852 - Set skew factors: "M852 [I<xy>] [J<xz>] [K<yz>]". (Requires SKEW_CORRECTION_GCODE, and SKEW_CORRECTION_FOR_Z for IJ)
|
||||
* M852 - Set skew factors: "M852 [I<xy>] [J<xz>] [K<yz>]". (Requires SKEW_CORRECTION_GCODE, plus SKEW_CORRECTION_FOR_Z for IJ)
|
||||
*
|
||||
*** I2C_POSITION_ENCODERS ***
|
||||
* M860 - Report the position of position encoder modules.
|
||||
* M861 - Report the status of position encoder modules.
|
||||
* M862 - Perform an axis continuity test for position encoder modules.
|
||||
@@ -263,8 +279,8 @@
|
||||
* M867 - Enable/disable or toggle error correction for position encoder modules.
|
||||
* M868 - Report or set position encoder module error correction threshold.
|
||||
* M869 - Report position encoder module error.
|
||||
* M871 - Print/reset/clear first layer temperature offset values. (Requires PROBE_TEMP_COMPENSATION)
|
||||
* M192 - Wait for probe temp (Requires PROBE_TEMP_COMPENSATION)
|
||||
*
|
||||
* M871 - Print/reset/clear first layer temperature offset values. (Requires PTC_PROBE, PTC_BED, or PTC_HOTEND)
|
||||
* M876 - Handle Prompt Response. (Requires HOST_PROMPT_SUPPORT and not EMERGENCY_PARSER)
|
||||
* M900 - Get or Set Linear Advance K-factor. (Requires LIN_ADVANCE)
|
||||
* M906 - Set or get motor current in milliamps using axis codes X, Y, Z, E. Report values if no axis codes given. (Requires at least one _DRIVER_TYPE defined as TMC2130/2160/5130/5160/2208/2209/2660 or L6470)
|
||||
@@ -282,13 +298,14 @@
|
||||
* M951 - Set Magnetic Parking Extruder parameters. (Requires MAGNETIC_PARKING_EXTRUDER)
|
||||
* M7219 - Control Max7219 Matrix LEDs. (Requires MAX7219_GCODE)
|
||||
*
|
||||
*** SCARA ***
|
||||
* M360 - SCARA calibration: Move to cal-position ThetaA (0 deg calibration)
|
||||
* M361 - SCARA calibration: Move to cal-position ThetaB (90 deg calibration - steps per degree)
|
||||
* M362 - SCARA calibration: Move to cal-position PsiA (0 deg calibration)
|
||||
* M363 - SCARA calibration: Move to cal-position PsiB (90 deg calibration - steps per degree)
|
||||
* M364 - SCARA calibration: Move to cal-position PSIC (90 deg to Theta calibration position)
|
||||
*
|
||||
* ************ Custom codes - This can change to suit future G-code regulations
|
||||
*** Custom codes (can be changed to suit future G-code standards) ***
|
||||
* G425 - Calibrate using a conductive object. (Requires CALIBRATION_GCODE)
|
||||
* M928 - Start SD logging: "M928 filename.gco". Stop with M29. (Requires SDSUPPORT)
|
||||
* M993 - Backup SPI Flash to SD
|
||||
@@ -296,10 +313,11 @@
|
||||
* M995 - Touch screen calibration for TFT display
|
||||
* M997 - Perform in-application firmware update
|
||||
* M999 - Restart after being stopped by error
|
||||
*
|
||||
* D... - Custom Development G-code. Add hooks to 'gcode_D.cpp' for developers to test features. (Requires MARLIN_DEV_MODE)
|
||||
* D576 - Set buffer monitoring options. (Requires BUFFER_MONITORING)
|
||||
*
|
||||
* "T" Codes
|
||||
*** "T" Codes ***
|
||||
*
|
||||
* T0-T3 - Select an extruder (tool) by index: "T<n> F<units/min>"
|
||||
*/
|
||||
@@ -390,7 +408,7 @@ public:
|
||||
static void say_units();
|
||||
|
||||
static int8_t get_target_extruder_from_command();
|
||||
static int8_t get_target_e_stepper_from_command();
|
||||
static int8_t get_target_e_stepper_from_command(const int8_t dval=-1);
|
||||
static void get_destination_from_command();
|
||||
|
||||
static void process_parsed_command(const bool no_ok=false);
|
||||
@@ -551,7 +569,7 @@ private:
|
||||
static void G59();
|
||||
#endif
|
||||
|
||||
#if ENABLED(PROBE_TEMP_COMPENSATION)
|
||||
#if BOTH(PTC_PROBE, PTC_BED)
|
||||
static void G76();
|
||||
#endif
|
||||
|
||||
@@ -744,12 +762,16 @@ private:
|
||||
static void M191();
|
||||
#endif
|
||||
|
||||
#if HAS_TEMP_PROBE
|
||||
static void M192();
|
||||
#endif
|
||||
|
||||
#if HAS_COOLER
|
||||
static void M143();
|
||||
static void M193();
|
||||
#endif
|
||||
|
||||
#if PREHEAT_COUNT
|
||||
#if HAS_PREHEAT
|
||||
static void M145();
|
||||
static void M145_report(const bool forReplay=true);
|
||||
#endif
|
||||
@@ -1087,8 +1109,7 @@ private:
|
||||
FORCE_INLINE static void M869() { I2CPEM.M869(); }
|
||||
#endif
|
||||
|
||||
#if ENABLED(PROBE_TEMP_COMPENSATION)
|
||||
static void M192();
|
||||
#if HAS_PTC
|
||||
static void M871();
|
||||
#endif
|
||||
|
||||
@@ -1109,7 +1130,7 @@ private:
|
||||
static void M913();
|
||||
static void M913_report(const bool forReplay=true);
|
||||
#endif
|
||||
#if ENABLED(USE_SENSORLESS)
|
||||
#if USE_SENSORLESS
|
||||
static void M914();
|
||||
static void M914_report(const bool forReplay=true);
|
||||
#endif
|
||||
|
||||
@@ -22,7 +22,7 @@
|
||||
|
||||
#include "../../inc/MarlinConfig.h"
|
||||
|
||||
#if PREHEAT_COUNT
|
||||
#if HAS_PREHEAT
|
||||
|
||||
#include "../gcode.h"
|
||||
#include "../../lcd/marlinui.h"
|
||||
@@ -79,4 +79,4 @@ void GcodeSuite::M145_report(const bool forReplay/*=true*/) {
|
||||
}
|
||||
}
|
||||
|
||||
#endif // PREHEAT_COUNT
|
||||
#endif // HAS_PREHEAT
|
||||
|
||||
@@ -719,7 +719,7 @@ void GCodeQueue::advance() {
|
||||
|
||||
if (auto_buffer_report_interval && ELAPSED(ms, next_buffer_report_ms)) {
|
||||
next_buffer_report_ms = ms + 1000UL * auto_buffer_report_interval;
|
||||
PORT_REDIRECT(SERIAL_BOTH);
|
||||
PORT_REDIRECT(SerialMask::All);
|
||||
report_buffer_statistics();
|
||||
PORT_RESTORE();
|
||||
}
|
||||
|
||||
@@ -88,7 +88,7 @@ void GcodeSuite::M104_M109(const bool isM109) {
|
||||
celsius_t temp = 0;
|
||||
|
||||
// Accept 'I' if temperature presets are defined
|
||||
#if PREHEAT_COUNT
|
||||
#if HAS_PREHEAT
|
||||
got_temp = parser.seenval('I');
|
||||
if (got_temp) {
|
||||
const uint8_t index = parser.value_byte();
|
||||
|
||||
@@ -32,7 +32,7 @@
|
||||
#include "../../module/planner.h"
|
||||
#endif
|
||||
|
||||
#if PREHEAT_COUNT
|
||||
#if HAS_PREHEAT
|
||||
#include "../../lcd/marlinui.h"
|
||||
#endif
|
||||
|
||||
@@ -75,7 +75,7 @@ void GcodeSuite::M106() {
|
||||
uint16_t speed = dspeed;
|
||||
|
||||
// Accept 'I' if temperature presets are defined
|
||||
#if PREHEAT_COUNT
|
||||
#if HAS_PREHEAT
|
||||
const bool got_preset = parser.seenval('I');
|
||||
if (got_preset) speed = ui.material_preset[_MIN(parser.value_byte(), PREHEAT_COUNT - 1)].fan_speed;
|
||||
#else
|
||||
|
||||
@@ -63,7 +63,7 @@ void GcodeSuite::M140_M190(const bool isM190) {
|
||||
celsius_t temp = 0;
|
||||
|
||||
// Accept 'I' if temperature presets are defined
|
||||
#if PREHEAT_COUNT
|
||||
#if HAS_PREHEAT
|
||||
got_temp = parser.seenval('I');
|
||||
if (got_temp) {
|
||||
const uint8_t index = parser.value_byte();
|
||||
|
||||
@@ -0,0 +1,56 @@
|
||||
/**
|
||||
* Marlin 3D Printer Firmware
|
||||
* Copyright (c) 2021 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
|
||||
*
|
||||
* Based on Sprinter and grbl.
|
||||
* Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*
|
||||
*/
|
||||
|
||||
/**
|
||||
* M192.cpp - Wait for probe to reach temperature
|
||||
*/
|
||||
|
||||
#include "../../inc/MarlinConfig.h"
|
||||
|
||||
#if HAS_TEMP_PROBE
|
||||
|
||||
#include "../gcode.h"
|
||||
#include "../../module/temperature.h"
|
||||
#include "../../lcd/marlinui.h"
|
||||
|
||||
/**
|
||||
* M192: Wait for probe temperature sensor to reach a target
|
||||
*
|
||||
* Select only one of these flags:
|
||||
* R - Wait for heating or cooling
|
||||
* S - Wait only for heating
|
||||
*/
|
||||
void GcodeSuite::M192() {
|
||||
if (DEBUGGING(DRYRUN)) return;
|
||||
|
||||
const bool no_wait_for_cooling = parser.seenval('S');
|
||||
if (!no_wait_for_cooling && !parser.seenval('R')) {
|
||||
SERIAL_ERROR_MSG("No target temperature set.");
|
||||
return;
|
||||
}
|
||||
|
||||
const celsius_t target_temp = parser.value_celsius();
|
||||
ui.set_status(thermalManager.isProbeBelowTemp(target_temp) ? GET_TEXT_F(MSG_PROBE_HEATING) : GET_TEXT_F(MSG_PROBE_COOLING));
|
||||
thermalManager.wait_for_probe(target_temp, no_wait_for_cooling);
|
||||
}
|
||||
|
||||
#endif // HAS_TEMP_PROBE
|
||||
@@ -550,6 +550,20 @@
|
||||
#endif
|
||||
#endif
|
||||
|
||||
// Probe Temperature Compensation
|
||||
#if !TEMP_SENSOR_PROBE
|
||||
#undef PTC_PROBE
|
||||
#endif
|
||||
#if !TEMP_SENSOR_BED
|
||||
#undef PTC_BED
|
||||
#endif
|
||||
#if !HAS_EXTRUDERS
|
||||
#undef PTC_HOTEND
|
||||
#endif
|
||||
#if ANY(PTC_PROBE, PTC_BED, PTC_HOTEND)
|
||||
#define HAS_PTC 1
|
||||
#endif
|
||||
|
||||
// Let SD_FINISHED_RELEASECOMMAND stand in for SD_FINISHED_STEPPERRELEASE
|
||||
#if ENABLED(SD_FINISHED_STEPPERRELEASE)
|
||||
#ifndef SD_FINISHED_RELEASECOMMAND
|
||||
@@ -701,6 +715,9 @@
|
||||
#ifndef ACTION_ON_KILL
|
||||
#define ACTION_ON_KILL "poweroff"
|
||||
#endif
|
||||
#ifndef SHUTDOWN_ACTION
|
||||
#define SHUTDOWN_ACTION "shutdown"
|
||||
#endif
|
||||
#if HAS_FILAMENT_SENSOR
|
||||
#ifndef ACTION_ON_FILAMENT_RUNOUT
|
||||
#define ACTION_ON_FILAMENT_RUNOUT "filament_runout"
|
||||
|
||||
@@ -769,19 +769,25 @@
|
||||
#define X2_MAX_ENDSTOP_INVERTING false
|
||||
#endif
|
||||
#endif
|
||||
#ifndef X2_MAX_PIN
|
||||
#if !defined(X2_MAX_PIN) && !defined(X2_STOP_PIN)
|
||||
#if X2_USE_ENDSTOP == _XMIN_
|
||||
#define X2_MAX_PIN X_MIN_PIN
|
||||
#elif X2_USE_ENDSTOP == _XMAX_
|
||||
#define X2_MAX_PIN X_MAX_PIN
|
||||
#elif X2_USE_ENDSTOP == _XSTOP_
|
||||
#define X2_MAX_PIN X_STOP_PIN
|
||||
#elif X2_USE_ENDSTOP == _YMIN_
|
||||
#define X2_MAX_PIN Y_MIN_PIN
|
||||
#elif X2_USE_ENDSTOP == _YMAX_
|
||||
#define X2_MAX_PIN Y_MAX_PIN
|
||||
#elif X2_USE_ENDSTOP == _YSTOP_
|
||||
#define X2_MAX_PIN Y_STOP_PIN
|
||||
#elif X2_USE_ENDSTOP == _ZMIN_
|
||||
#define X2_MAX_PIN Z_MIN_PIN
|
||||
#elif X2_USE_ENDSTOP == _ZMAX_
|
||||
#define X2_MAX_PIN Z_MAX_PIN
|
||||
#elif X2_USE_ENDSTOP == _ZSTOP_
|
||||
#define X2_MAX_PIN Z_STOP_PIN
|
||||
#elif X2_USE_ENDSTOP == _XDIAG_
|
||||
#define X2_MAX_PIN X_DIAG_PIN
|
||||
#elif X2_USE_ENDSTOP == _YDIAG_
|
||||
@@ -827,19 +833,25 @@
|
||||
#define X2_MIN_ENDSTOP_INVERTING false
|
||||
#endif
|
||||
#endif
|
||||
#ifndef X2_MIN_PIN
|
||||
#if !defined(X2_MIN_PIN) && !defined(X2_STOP_PIN)
|
||||
#if X2_USE_ENDSTOP == _XMIN_
|
||||
#define X2_MIN_PIN X_MIN_PIN
|
||||
#elif X2_USE_ENDSTOP == _XMAX_
|
||||
#define X2_MIN_PIN X_MAX_PIN
|
||||
#elif X2_USE_ENDSTOP == _XSTOP_
|
||||
#define X2_MIN_PIN X_STOP_PIN
|
||||
#elif X2_USE_ENDSTOP == _YMIN_
|
||||
#define X2_MIN_PIN Y_MIN_PIN
|
||||
#elif X2_USE_ENDSTOP == _YMAX_
|
||||
#define X2_MIN_PIN Y_MAX_PIN
|
||||
#elif X2_USE_ENDSTOP == _YSTOP_
|
||||
#define X2_MIN_PIN Y_STOP_PIN
|
||||
#elif X2_USE_ENDSTOP == _ZMIN_
|
||||
#define X2_MIN_PIN Z_MIN_PIN
|
||||
#elif X2_USE_ENDSTOP == _ZMAX_
|
||||
#define X2_MIN_PIN Z_MAX_PIN
|
||||
#elif X2_USE_ENDSTOP == _ZSTOP_
|
||||
#define X2_MIN_PIN Z_STOP_PIN
|
||||
#elif X2_USE_ENDSTOP == _XDIAG_
|
||||
#define X2_MIN_PIN X_DIAG_PIN
|
||||
#elif X2_USE_ENDSTOP == _YDIAG_
|
||||
@@ -892,19 +904,25 @@
|
||||
#define Y2_MAX_ENDSTOP_INVERTING false
|
||||
#endif
|
||||
#endif
|
||||
#ifndef Y2_MAX_PIN
|
||||
#if !defined(Y2_MAX_PIN) && !defined(Y2_STOP_PIN)
|
||||
#if Y2_USE_ENDSTOP == _XMIN_
|
||||
#define Y2_MAX_PIN X_MIN_PIN
|
||||
#elif Y2_USE_ENDSTOP == _XMAX_
|
||||
#define Y2_MAX_PIN X_MAX_PIN
|
||||
#elif Y2_USE_ENDSTOP == _XSTOP_
|
||||
#define Y2_MAX_PIN X_STOP_PIN
|
||||
#elif Y2_USE_ENDSTOP == _YMIN_
|
||||
#define Y2_MAX_PIN Y_MIN_PIN
|
||||
#elif Y2_USE_ENDSTOP == _YMAX_
|
||||
#define Y2_MAX_PIN Y_MAX_PIN
|
||||
#elif Y2_USE_ENDSTOP == _YSTOP_
|
||||
#define Y2_MAX_PIN Y_STOP_PIN
|
||||
#elif Y2_USE_ENDSTOP == _ZMIN_
|
||||
#define Y2_MAX_PIN Z_MIN_PIN
|
||||
#elif Y2_USE_ENDSTOP == _ZMAX_
|
||||
#define Y2_MAX_PIN Z_MAX_PIN
|
||||
#elif Y2_USE_ENDSTOP == _ZSTOP_
|
||||
#define Y2_MAX_PIN Z_STOP_PIN
|
||||
#elif Y2_USE_ENDSTOP == _XDIAG_
|
||||
#define Y2_MAX_PIN X_DIAG_PIN
|
||||
#elif Y2_USE_ENDSTOP == _YDIAG_
|
||||
@@ -950,19 +968,25 @@
|
||||
#define Y2_MIN_ENDSTOP_INVERTING false
|
||||
#endif
|
||||
#endif
|
||||
#ifndef Y2_MIN_PIN
|
||||
#if !defined(Y2_MIN_PIN) && !defined(Y2_STOP_PIN)
|
||||
#if Y2_USE_ENDSTOP == _XMIN_
|
||||
#define Y2_MIN_PIN X_MIN_PIN
|
||||
#elif Y2_USE_ENDSTOP == _XMAX_
|
||||
#define Y2_MIN_PIN X_MAX_PIN
|
||||
#elif Y2_USE_ENDSTOP == _XSTOP_
|
||||
#define Y2_MIN_PIN X_STOP_PIN
|
||||
#elif Y2_USE_ENDSTOP == _YMIN_
|
||||
#define Y2_MIN_PIN Y_MIN_PIN
|
||||
#elif Y2_USE_ENDSTOP == _YMAX_
|
||||
#define Y2_MIN_PIN Y_MAX_PIN
|
||||
#elif Y2_USE_ENDSTOP == _YSTOP_
|
||||
#define Y2_MIN_PIN Y_STOP_PIN
|
||||
#elif Y2_USE_ENDSTOP == _ZMIN_
|
||||
#define Y2_MIN_PIN Z_MIN_PIN
|
||||
#elif Y2_USE_ENDSTOP == _ZMAX_
|
||||
#define Y2_MIN_PIN Z_MAX_PIN
|
||||
#elif Y2_USE_ENDSTOP == _ZSTOP_
|
||||
#define Y2_MIN_PIN Z_STOP_PIN
|
||||
#elif Y2_USE_ENDSTOP == _XDIAG_
|
||||
#define Y2_MIN_PIN X_DIAG_PIN
|
||||
#elif Y2_USE_ENDSTOP == _YDIAG_
|
||||
@@ -1016,19 +1040,25 @@
|
||||
#define Z2_MAX_ENDSTOP_INVERTING false
|
||||
#endif
|
||||
#endif
|
||||
#ifndef Z2_MAX_PIN
|
||||
#if !defined(Z2_MAX_PIN) && !defined(Z2_STOP_PIN)
|
||||
#if Z2_USE_ENDSTOP == _XMIN_
|
||||
#define Z2_MAX_PIN X_MIN_PIN
|
||||
#elif Z2_USE_ENDSTOP == _XMAX_
|
||||
#define Z2_MAX_PIN X_MAX_PIN
|
||||
#elif Z2_USE_ENDSTOP == _XSTOP_
|
||||
#define Z2_MAX_PIN X_STOP_PIN
|
||||
#elif Z2_USE_ENDSTOP == _YMIN_
|
||||
#define Z2_MAX_PIN Y_MIN_PIN
|
||||
#elif Z2_USE_ENDSTOP == _YMAX_
|
||||
#define Z2_MAX_PIN Y_MAX_PIN
|
||||
#elif Z2_USE_ENDSTOP == _YSTOP_
|
||||
#define Z2_MAX_PIN Y_STOP_PIN
|
||||
#elif Z2_USE_ENDSTOP == _ZMIN_
|
||||
#define Z2_MAX_PIN Z_MIN_PIN
|
||||
#elif Z2_USE_ENDSTOP == _ZMAX_
|
||||
#define Z2_MAX_PIN Z_MAX_PIN
|
||||
#elif Z2_USE_ENDSTOP == _ZSTOP_
|
||||
#define Z2_MAX_PIN Z_STOP_PIN
|
||||
#elif Z2_USE_ENDSTOP == _XDIAG_
|
||||
#define Z2_MAX_PIN X_DIAG_PIN
|
||||
#elif Z2_USE_ENDSTOP == _YDIAG_
|
||||
@@ -1079,14 +1109,20 @@
|
||||
#define Z2_MIN_PIN X_MIN_PIN
|
||||
#elif Z2_USE_ENDSTOP == _XMAX_
|
||||
#define Z2_MIN_PIN X_MAX_PIN
|
||||
#elif Z2_USE_ENDSTOP == _XSTOP_
|
||||
#define Z2_MIN_PIN X_STOP_PIN
|
||||
#elif Z2_USE_ENDSTOP == _YMIN_
|
||||
#define Z2_MIN_PIN Y_MIN_PIN
|
||||
#elif Z2_USE_ENDSTOP == _YMAX_
|
||||
#define Z2_MIN_PIN Y_MAX_PIN
|
||||
#elif Z2_USE_ENDSTOP == _YSTOP_
|
||||
#define Z2_MIN_PIN Y_STOP_PIN
|
||||
#elif Z2_USE_ENDSTOP == _ZMIN_
|
||||
#define Z2_MIN_PIN Z_MIN_PIN
|
||||
#elif Z2_USE_ENDSTOP == _ZMAX_
|
||||
#define Z2_MIN_PIN Z_MAX_PIN
|
||||
#elif Z2_USE_ENDSTOP == _ZSTOP_
|
||||
#define Z2_MIN_PIN Z_STOP_PIN
|
||||
#elif Z2_USE_ENDSTOP == _XDIAG_
|
||||
#define Z2_MIN_PIN X_DIAG_PIN
|
||||
#elif Z2_USE_ENDSTOP == _YDIAG_
|
||||
@@ -1140,14 +1176,20 @@
|
||||
#define Z3_MAX_PIN X_MIN_PIN
|
||||
#elif Z3_USE_ENDSTOP == _XMAX_
|
||||
#define Z3_MAX_PIN X_MAX_PIN
|
||||
#elif Z3_USE_ENDSTOP == _XSTOP_
|
||||
#define Z3_MAX_PIN X_STOP_PIN
|
||||
#elif Z3_USE_ENDSTOP == _YMIN_
|
||||
#define Z3_MAX_PIN Y_MIN_PIN
|
||||
#elif Z3_USE_ENDSTOP == _YMAX_
|
||||
#define Z3_MAX_PIN Y_MAX_PIN
|
||||
#elif Z3_USE_ENDSTOP == _YSTOP_
|
||||
#define Z3_MAX_PIN Y_STOP_PIN
|
||||
#elif Z3_USE_ENDSTOP == _ZMIN_
|
||||
#define Z3_MAX_PIN Z_MIN_PIN
|
||||
#elif Z3_USE_ENDSTOP == _ZMAX_
|
||||
#define Z3_MAX_PIN Z_MAX_PIN
|
||||
#elif Z3_USE_ENDSTOP == _ZSTOP_
|
||||
#define Z3_MAX_PIN Z_STOP_PIN
|
||||
#elif Z3_USE_ENDSTOP == _XDIAG_
|
||||
#define Z3_MAX_PIN X_DIAG_PIN
|
||||
#elif Z3_USE_ENDSTOP == _YDIAG_
|
||||
@@ -1198,14 +1240,20 @@
|
||||
#define Z3_MIN_PIN X_MIN_PIN
|
||||
#elif Z3_USE_ENDSTOP == _XMAX_
|
||||
#define Z3_MIN_PIN X_MAX_PIN
|
||||
#elif Z3_USE_ENDSTOP == _XSTOP_
|
||||
#define Z3_MIN_PIN X_STOP_PIN
|
||||
#elif Z3_USE_ENDSTOP == _YMIN_
|
||||
#define Z3_MIN_PIN Y_MIN_PIN
|
||||
#elif Z3_USE_ENDSTOP == _YMAX_
|
||||
#define Z3_MIN_PIN Y_MAX_PIN
|
||||
#elif Z3_USE_ENDSTOP == _YSTOP_
|
||||
#define Z3_MIN_PIN Y_STOP_PIN
|
||||
#elif Z3_USE_ENDSTOP == _ZMIN_
|
||||
#define Z3_MIN_PIN Z_MIN_PIN
|
||||
#elif Z3_USE_ENDSTOP == _ZMAX_
|
||||
#define Z3_MIN_PIN Z_MAX_PIN
|
||||
#elif Z3_USE_ENDSTOP == _ZSTOP_
|
||||
#define Z3_MIN_PIN Z_STOP_PIN
|
||||
#elif Z3_USE_ENDSTOP == _XDIAG_
|
||||
#define Z3_MIN_PIN X_DIAG_PIN
|
||||
#elif Z3_USE_ENDSTOP == _YDIAG_
|
||||
@@ -1260,14 +1308,20 @@
|
||||
#define Z4_MAX_PIN X_MIN_PIN
|
||||
#elif Z4_USE_ENDSTOP == _XMAX_
|
||||
#define Z4_MAX_PIN X_MAX_PIN
|
||||
#elif Z4_USE_ENDSTOP == _XSTOP_
|
||||
#define Z4_MAX_PIN X_STOP_PIN
|
||||
#elif Z4_USE_ENDSTOP == _YMIN_
|
||||
#define Z4_MAX_PIN Y_MIN_PIN
|
||||
#elif Z4_USE_ENDSTOP == _YMAX_
|
||||
#define Z4_MAX_PIN Y_MAX_PIN
|
||||
#elif Z4_USE_ENDSTOP == _YSTOP_
|
||||
#define Z4_MAX_PIN Y_STOP_PIN
|
||||
#elif Z4_USE_ENDSTOP == _ZMIN_
|
||||
#define Z4_MAX_PIN Z_MIN_PIN
|
||||
#elif Z4_USE_ENDSTOP == _ZMAX_
|
||||
#define Z4_MAX_PIN Z_MAX_PIN
|
||||
#elif Z4_USE_ENDSTOP == _ZSTOP_
|
||||
#define Z4_MAX_PIN Z_STOP_PIN
|
||||
#elif Z4_USE_ENDSTOP == _XDIAG_
|
||||
#define Z4_MAX_PIN X_DIAG_PIN
|
||||
#elif Z4_USE_ENDSTOP == _YDIAG_
|
||||
@@ -1318,14 +1372,20 @@
|
||||
#define Z4_MIN_PIN X_MIN_PIN
|
||||
#elif Z4_USE_ENDSTOP == _XMAX_
|
||||
#define Z4_MIN_PIN X_MAX_PIN
|
||||
#elif Z4_USE_ENDSTOP == _XSTOP_
|
||||
#define Z4_MIN_PIN X_STOP_PIN
|
||||
#elif Z4_USE_ENDSTOP == _YMIN_
|
||||
#define Z4_MIN_PIN Y_MIN_PIN
|
||||
#elif Z4_USE_ENDSTOP == _YMAX_
|
||||
#define Z4_MIN_PIN Y_MAX_PIN
|
||||
#elif Z4_USE_ENDSTOP == _YSTOP_
|
||||
#define Z4_MIN_PIN Y_STOP_PIN
|
||||
#elif Z4_USE_ENDSTOP == _ZMIN_
|
||||
#define Z4_MIN_PIN Z_MIN_PIN
|
||||
#elif Z4_USE_ENDSTOP == _ZMAX_
|
||||
#define Z4_MIN_PIN Z_MAX_PIN
|
||||
#elif Z4_USE_ENDSTOP == _ZSTOP_
|
||||
#define Z4_MIN_PIN Z_STOP_PIN
|
||||
#elif Z4_USE_ENDSTOP == _XDIAG_
|
||||
#define Z4_MIN_PIN X_DIAG_PIN
|
||||
#elif Z4_USE_ENDSTOP == _YDIAG_
|
||||
@@ -2876,10 +2936,14 @@
|
||||
#elif defined(PREHEAT_1_LABEL)
|
||||
#define PREHEAT_COUNT 1
|
||||
#endif
|
||||
#if PREHEAT_COUNT && ANY(HAS_HOTEND, HAS_HEATED_BED, HAS_FAN)
|
||||
#define HAS_PREHEAT 1
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#if !PREHEAT_COUNT
|
||||
#if !HAS_PREHEAT
|
||||
#undef PREHEAT_SHORTCUT_MENU_ITEM
|
||||
#undef DGUS_PREHEAT_UI
|
||||
#endif
|
||||
|
||||
/**
|
||||
|
||||
@@ -597,6 +597,10 @@
|
||||
#error "SPINDLE_LASER_PWM (true) is now set with SPINDLE_LASER_USE_PWM (enabled)."
|
||||
#elif ANY(IS_RAMPS_EEB, IS_RAMPS_EEF, IS_RAMPS_EFB, IS_RAMPS_EFF, IS_RAMPS_SF)
|
||||
#error "The IS_RAMPS_* conditionals (for heater/fan/bed pins) are now called FET_ORDER_*."
|
||||
#elif defined(PROBE_TEMP_COMPENSATION)
|
||||
#error "PROBE_TEMP_COMPENSATION is now set using the PTC_PROBE, PTC_BED, PTC_HOTEND options."
|
||||
#elif defined(BTC_PROBE_TEMP)
|
||||
#error "BTC_PROBE_TEMP is now PTC_PROBE_TEMP."
|
||||
#endif
|
||||
|
||||
#if MB(DUE3DOM_MINI) && PIN_EXISTS(TEMP_2) && DISABLED(TEMP_SENSOR_BOARD)
|
||||
@@ -611,60 +615,60 @@ static_assert(COUNT(arm) == LOGICAL_AXES, "AXIS_RELATIVE_MODES must contain " _L
|
||||
/**
|
||||
* Probe temp compensation requirements
|
||||
*/
|
||||
|
||||
#if ENABLED(PROBE_TEMP_COMPENSATION)
|
||||
#if defined(PTC_PARK_POS_X) || defined(PTC_PARK_POS_Y) || defined(PTC_PARK_POS_Z)
|
||||
#error "PTC_PARK_POS_[XYZ] is now PTC_PARK_POS (array)."
|
||||
#elif !defined(PTC_PARK_POS)
|
||||
#error "PROBE_TEMP_COMPENSATION requires PTC_PARK_POS."
|
||||
#elif defined(PTC_PROBE_POS_X) || defined(PTC_PROBE_POS_Y)
|
||||
#error "PTC_PROBE_POS_[XY] is now PTC_PROBE_POS (array)."
|
||||
#elif !defined(PTC_PROBE_POS)
|
||||
#error "PROBE_TEMP_COMPENSATION requires PTC_PROBE_POS."
|
||||
#if HAS_PTC
|
||||
#if TEMP_SENSOR_PROBE && TEMP_SENSOR_BED
|
||||
#if defined(PTC_PARK_POS_X) || defined(PTC_PARK_POS_Y) || defined(PTC_PARK_POS_Z)
|
||||
#error "PTC_PARK_POS_[XYZ] is now PTC_PARK_POS (array)."
|
||||
#elif !defined(PTC_PARK_POS)
|
||||
#error "PTC_PARK_POS is required for Probe Temperature Compensation."
|
||||
#elif defined(PTC_PROBE_POS_X) || defined(PTC_PROBE_POS_Y)
|
||||
#error "PTC_PROBE_POS_[XY] is now PTC_PROBE_POS (array)."
|
||||
#elif !defined(PTC_PROBE_POS)
|
||||
#error "PTC_PROBE_POS is required for Probe Temperature Compensation."
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifdef PTC_SAMPLE_START
|
||||
constexpr auto _ptc_sample_start = PTC_SAMPLE_START;
|
||||
#ifdef PTC_PROBE_START
|
||||
constexpr auto _ptc_sample_start = PTC_PROBE_START;
|
||||
constexpr decltype(_ptc_sample_start) _test_ptc_sample_start = 12.3f;
|
||||
static_assert(_test_ptc_sample_start != 12.3f, "PTC_SAMPLE_START must be a whole number.");
|
||||
static_assert(_test_ptc_sample_start != 12.3f, "PTC_PROBE_START must be a whole number.");
|
||||
#endif
|
||||
#ifdef PTC_SAMPLE_RES
|
||||
constexpr auto _ptc_sample_res = PTC_SAMPLE_RES;
|
||||
#ifdef PTC_PROBE_RES
|
||||
constexpr auto _ptc_sample_res = PTC_PROBE_RES;
|
||||
constexpr decltype(_ptc_sample_res) _test_ptc_sample_res = 12.3f;
|
||||
static_assert(_test_ptc_sample_res != 12.3f, "PTC_SAMPLE_RES must be a whole number.");
|
||||
static_assert(_test_ptc_sample_res != 12.3f, "PTC_PROBE_RES must be a whole number.");
|
||||
#endif
|
||||
#ifdef BTC_SAMPLE_START
|
||||
constexpr auto _btc_sample_start = BTC_SAMPLE_START;
|
||||
#ifdef PTC_BED_START
|
||||
constexpr auto _btc_sample_start = PTC_BED_START;
|
||||
constexpr decltype(_btc_sample_start) _test_btc_sample_start = 12.3f;
|
||||
static_assert(_test_btc_sample_start != 12.3f, "BTC_SAMPLE_START must be a whole number.");
|
||||
static_assert(_test_btc_sample_start != 12.3f, "PTC_BED_START must be a whole number.");
|
||||
#endif
|
||||
#ifdef BTC_SAMPLE_RES
|
||||
constexpr auto _btc_sample_res = BTC_SAMPLE_RES;
|
||||
#ifdef PTC_BED_RES
|
||||
constexpr auto _btc_sample_res = PTC_BED_RES;
|
||||
constexpr decltype(_btc_sample_res) _test_btc_sample_res = 12.3f;
|
||||
static_assert(_test_btc_sample_res != 12.3f, "BTC_SAMPLE_RES must be a whole number.");
|
||||
static_assert(_test_btc_sample_res != 12.3f, "PTC_BED_RES must be a whole number.");
|
||||
#endif
|
||||
#ifdef BTC_PROBE_TEMP
|
||||
constexpr auto _btc_probe_temp = BTC_PROBE_TEMP;
|
||||
#ifdef PTC_PROBE_TEMP
|
||||
constexpr auto _btc_probe_temp = PTC_PROBE_TEMP;
|
||||
constexpr decltype(_btc_probe_temp) _test_btc_probe_temp = 12.3f;
|
||||
static_assert(_test_btc_probe_temp != 12.3f, "BTC_PROBE_TEMP must be a whole number.");
|
||||
static_assert(_test_btc_probe_temp != 12.3f, "PTC_PROBE_TEMP must be a whole number.");
|
||||
#endif
|
||||
#if ENABLED(USE_TEMP_EXT_COMPENSATION)
|
||||
#ifdef ETC_SAMPLE_START
|
||||
constexpr auto _etc_sample_start = ETC_SAMPLE_START;
|
||||
#if ENABLED(PTC_HOTEND)
|
||||
#if EXTRUDERS != 1
|
||||
#error "PTC_HOTEND only works with a single extruder."
|
||||
#endif
|
||||
#ifdef PTC_HOTEND_START
|
||||
constexpr auto _etc_sample_start = PTC_HOTEND_START;
|
||||
constexpr decltype(_etc_sample_start) _test_etc_sample_start = 12.3f;
|
||||
static_assert(_test_etc_sample_start != 12.3f, "ETC_SAMPLE_START must be a whole number.");
|
||||
static_assert(_test_etc_sample_start != 12.3f, "PTC_HOTEND_START must be a whole number.");
|
||||
#endif
|
||||
#ifdef ETC_SAMPLE_RES
|
||||
constexpr auto _etc_sample_res = ETC_SAMPLE_RES;
|
||||
#ifdef PTC_HOTEND_RES
|
||||
constexpr auto _etc_sample_res = PTC_HOTEND_RES;
|
||||
constexpr decltype(_etc_sample_res) _test_etc_sample_res = 12.3f;
|
||||
static_assert(_test_etc_sample_res != 12.3f, "ETC_SAMPLE_RES must be a whole number.");
|
||||
static_assert(_test_etc_sample_res != 12.3f, "PTC_HOTEND_RES must be a whole number.");
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#if ENABLED(USE_TEMP_EXT_COMPENSATION) && EXTRUDERS != 1
|
||||
#error "USE_TEMP_EXT_COMPENSATION only works with a single extruder."
|
||||
#endif
|
||||
#endif
|
||||
#endif // HAS_PTC
|
||||
|
||||
/**
|
||||
* Marlin release, version and default string
|
||||
@@ -1242,8 +1246,8 @@ static_assert(Y_MAX_LENGTH >= Y_BED_SIZE, "Movement bounds (Y_MIN_POS, Y_MAX_POS
|
||||
#error "LIN_ADVANCE and S_CURVE_ACCELERATION may not play well together! Enable EXPERIMENTAL_SCURVE to continue."
|
||||
#elif ENABLED(DIRECT_STEPPING)
|
||||
#error "DIRECT_STEPPING is incompatible with LIN_ADVANCE. Enable in external planner if possible."
|
||||
#elif !HAS_JUNCTION_DEVIATION && defined(DEFAULT_EJERK)
|
||||
static_assert(DEFAULT_EJERK >= 10, "It is strongly recommended to set DEFAULT_EJERK >= 10 when using LIN_ADVANCE.");
|
||||
#elif NONE(HAS_JUNCTION_DEVIATION, ALLOW_LOW_EJERK) && defined(DEFAULT_EJERK)
|
||||
static_assert(DEFAULT_EJERK >= 10, "It is strongly recommended to set DEFAULT_EJERK >= 10 when using LIN_ADVANCE. Enable ALLOW_LOW_EJERK to bypass this alert (e.g., for direct drive).");
|
||||
#endif
|
||||
#endif
|
||||
|
||||
@@ -2485,6 +2489,11 @@ static_assert(Y_MAX_LENGTH >= Y_BED_SIZE, "Movement bounds (Y_MIN_POS, Y_MAX_POS
|
||||
#error "An encoder button is required or SOFT_RESET_ON_KILL will reset the printer without notice!"
|
||||
#endif
|
||||
|
||||
// Reset reason for AVR
|
||||
#if ENABLED(OPTIBOOT_RESET_REASON) && !defined(__AVR__)
|
||||
#error "OPTIBOOT_RESET_REASON only applies to AVR."
|
||||
#endif
|
||||
|
||||
/**
|
||||
* I2C bus
|
||||
*/
|
||||
|
||||
@@ -42,7 +42,7 @@
|
||||
* version was tagged.
|
||||
*/
|
||||
#ifndef STRING_DISTRIBUTION_DATE
|
||||
#define STRING_DISTRIBUTION_DATE "2021-10-25"
|
||||
#define STRING_DISTRIBUTION_DATE "2021-11-04"
|
||||
#endif
|
||||
|
||||
/**
|
||||
@@ -52,7 +52,7 @@
|
||||
* to alert users to major changes.
|
||||
*/
|
||||
|
||||
#define MARLIN_HEX_VERSION 02000902
|
||||
#define MARLIN_HEX_VERSION 02000903
|
||||
#ifndef REQUIRED_CONFIGURATION_H_VERSION
|
||||
#define REQUIRED_CONFIGURATION_H_VERSION MARLIN_HEX_VERSION
|
||||
#endif
|
||||
|
||||
@@ -79,14 +79,20 @@
|
||||
#warning "Auto-assigned X2_DIAG_PIN to X_MIN_PIN."
|
||||
#elif X2_USE_ENDSTOP == _XMAX_
|
||||
#warning "Auto-assigned X2_DIAG_PIN to X_MAX_PIN."
|
||||
#elif X2_USE_ENDSTOP == _XSTOP_
|
||||
#warning "Auto-assigned X2_DIAG_PIN to X_STOP_PIN."
|
||||
#elif X2_USE_ENDSTOP == _YMIN_
|
||||
#warning "Auto-assigned X2_DIAG_PIN to Y_MIN_PIN."
|
||||
#elif X2_USE_ENDSTOP == _YMAX_
|
||||
#warning "Auto-assigned X2_DIAG_PIN to Y_MAX_PIN."
|
||||
#elif X2_USE_ENDSTOP == _YSTOP_
|
||||
#warning "Auto-assigned X2_DIAG_PIN to Y_STOP_PIN."
|
||||
#elif X2_USE_ENDSTOP == _ZMIN_
|
||||
#warning "Auto-assigned X2_DIAG_PIN to Z_MIN_PIN."
|
||||
#elif X2_USE_ENDSTOP == _ZMAX_
|
||||
#warning "Auto-assigned X2_DIAG_PIN to Z_MAX_PIN."
|
||||
#elif X2_USE_ENDSTOP == _ZSTOP_
|
||||
#warning "Auto-assigned X2_DIAG_PIN to Z_STOP_PIN."
|
||||
#elif X2_USE_ENDSTOP == _XDIAG_
|
||||
#warning "Auto-assigned X2_DIAG_PIN to X_DIAG_PIN."
|
||||
#elif X2_USE_ENDSTOP == _YDIAG_
|
||||
@@ -131,14 +137,20 @@
|
||||
#warning "Auto-assigned Y2_DIAG_PIN to X_MIN_PIN."
|
||||
#elif Y2_USE_ENDSTOP == _XMAX_
|
||||
#warning "Auto-assigned Y2_DIAG_PIN to X_MAX_PIN."
|
||||
#elif Y2_USE_ENDSTOP == _XSTOP_
|
||||
#warning "Auto-assigned Y2_DIAG_PIN to X_STOP_PIN."
|
||||
#elif Y2_USE_ENDSTOP == _YMIN_
|
||||
#warning "Auto-assigned Y2_DIAG_PIN to Y_MIN_PIN."
|
||||
#elif Y2_USE_ENDSTOP == _YMAX_
|
||||
#warning "Auto-assigned Y2_DIAG_PIN to Y_MAX_PIN."
|
||||
#elif Y2_USE_ENDSTOP == _YSTOP_
|
||||
#warning "Auto-assigned Y2_DIAG_PIN to Y_STOP_PIN."
|
||||
#elif Y2_USE_ENDSTOP == _ZMIN_
|
||||
#warning "Auto-assigned Y2_DIAG_PIN to Z_MIN_PIN."
|
||||
#elif Y2_USE_ENDSTOP == _ZMAX_
|
||||
#warning "Auto-assigned Y2_DIAG_PIN to Z_MAX_PIN."
|
||||
#elif Y2_USE_ENDSTOP == _ZSTOP_
|
||||
#warning "Auto-assigned Y2_DIAG_PIN to Z_STOP_PIN."
|
||||
#elif Y2_USE_ENDSTOP == _XDIAG_
|
||||
#warning "Auto-assigned Y2_DIAG_PIN to X_DIAG_PIN."
|
||||
#elif Y2_USE_ENDSTOP == _YDIAG_
|
||||
@@ -183,14 +195,20 @@
|
||||
#warning "Auto-assigned Z2_DIAG_PIN to X_MIN_PIN."
|
||||
#elif Z2_USE_ENDSTOP == _XMAX_
|
||||
#warning "Auto-assigned Z2_DIAG_PIN to X_MAX_PIN."
|
||||
#elif Z2_USE_ENDSTOP == _XSTOP_
|
||||
#warning "Auto-assigned Z2_DIAG_PIN to X_STOP_PIN."
|
||||
#elif Z2_USE_ENDSTOP == _YMIN_
|
||||
#warning "Auto-assigned Z2_DIAG_PIN to Y_MIN_PIN."
|
||||
#elif Z2_USE_ENDSTOP == _YMAX_
|
||||
#warning "Auto-assigned Z2_DIAG_PIN to Y_MAX_PIN."
|
||||
#elif Z2_USE_ENDSTOP == _YSTOP_
|
||||
#warning "Auto-assigned Z2_DIAG_PIN to Y_STOP_PIN."
|
||||
#elif Z2_USE_ENDSTOP == _ZMIN_
|
||||
#warning "Auto-assigned Z2_DIAG_PIN to Z_MIN_PIN."
|
||||
#elif Z2_USE_ENDSTOP == _ZMAX_
|
||||
#warning "Auto-assigned Z2_DIAG_PIN to Z_MAX_PIN."
|
||||
#elif Z2_USE_ENDSTOP == _ZSTOP_
|
||||
#warning "Auto-assigned Z2_DIAG_PIN to Z_STOP_PIN."
|
||||
#elif Z2_USE_ENDSTOP == _XDIAG_
|
||||
#warning "Auto-assigned Z2_DIAG_PIN to X_DIAG_PIN."
|
||||
#elif Z2_USE_ENDSTOP == _YDIAG_
|
||||
@@ -235,14 +253,20 @@
|
||||
#warning "Auto-assigned Z3_DIAG_PIN to X_MIN_PIN."
|
||||
#elif Z3_USE_ENDSTOP == _XMAX_
|
||||
#warning "Auto-assigned Z3_DIAG_PIN to X_MAX_PIN."
|
||||
#elif Z3_USE_ENDSTOP == _XSTOP_
|
||||
#warning "Auto-assigned Z3_DIAG_PIN to X_STOP_PIN."
|
||||
#elif Z3_USE_ENDSTOP == _YMIN_
|
||||
#warning "Auto-assigned Z3_DIAG_PIN to Y_MIN_PIN."
|
||||
#elif Z3_USE_ENDSTOP == _YMAX_
|
||||
#warning "Auto-assigned Z3_DIAG_PIN to Y_MAX_PIN."
|
||||
#elif Z3_USE_ENDSTOP == _YSTOP_
|
||||
#warning "Auto-assigned Z3_DIAG_PIN to Y_STOP_PIN."
|
||||
#elif Z3_USE_ENDSTOP == _ZMIN_
|
||||
#warning "Auto-assigned Z3_DIAG_PIN to Z_MIN_PIN."
|
||||
#elif Z3_USE_ENDSTOP == _ZMAX_
|
||||
#warning "Auto-assigned Z3_DIAG_PIN to Z_MAX_PIN."
|
||||
#elif Z3_USE_ENDSTOP == _ZSTOP_
|
||||
#warning "Auto-assigned Z3_DIAG_PIN to Z_STOP_PIN."
|
||||
#elif Z3_USE_ENDSTOP == _XDIAG_
|
||||
#warning "Auto-assigned Z3_DIAG_PIN to X_DIAG_PIN."
|
||||
#elif Z3_USE_ENDSTOP == _YDIAG_
|
||||
@@ -287,14 +311,20 @@
|
||||
#warning "Auto-assigned Z4_DIAG_PIN to X_MIN_PIN."
|
||||
#elif Z4_USE_ENDSTOP == _XMAX_
|
||||
#warning "Auto-assigned Z4_DIAG_PIN to X_MAX_PIN."
|
||||
#elif Z4_USE_ENDSTOP == _XSTOP_
|
||||
#warning "Auto-assigned Z4_DIAG_PIN to X_STOP_PIN."
|
||||
#elif Z4_USE_ENDSTOP == _YMIN_
|
||||
#warning "Auto-assigned Z4_DIAG_PIN to Y_MIN_PIN."
|
||||
#elif Z4_USE_ENDSTOP == _YMAX_
|
||||
#warning "Auto-assigned Z4_DIAG_PIN to Y_MAX_PIN."
|
||||
#elif Z4_USE_ENDSTOP == _YSTOP_
|
||||
#warning "Auto-assigned Z4_DIAG_PIN to Y_STOP_PIN."
|
||||
#elif Z4_USE_ENDSTOP == _ZMIN_
|
||||
#warning "Auto-assigned Z4_DIAG_PIN to Z_MIN_PIN."
|
||||
#elif Z4_USE_ENDSTOP == _ZMAX_
|
||||
#warning "Auto-assigned Z4_DIAG_PIN to Z_MAX_PIN."
|
||||
#elif Z4_USE_ENDSTOP == _ZSTOP_
|
||||
#warning "Auto-assigned Z4_DIAG_PIN to Z_STOP_PIN."
|
||||
#elif Z4_USE_ENDSTOP == _XDIAG_
|
||||
#warning "Auto-assigned Z4_DIAG_PIN to X_DIAG_PIN."
|
||||
#elif Z4_USE_ENDSTOP == _YDIAG_
|
||||
@@ -339,14 +369,20 @@
|
||||
#warning "Auto-assigned I_DIAG_PIN to X_MIN_PIN."
|
||||
#elif I_USE_ENDSTOP == _XMAX_
|
||||
#warning "Auto-assigned I_DIAG_PIN to X_MAX_PIN."
|
||||
#elif I_USE_ENDSTOP == _XSTOP_
|
||||
#warning "Auto-assigned I_DIAG_PIN to X_STOP_PIN."
|
||||
#elif I_USE_ENDSTOP == _YMIN_
|
||||
#warning "Auto-assigned I_DIAG_PIN to Y_MIN_PIN."
|
||||
#elif I_USE_ENDSTOP == _YMAX_
|
||||
#warning "Auto-assigned I_DIAG_PIN to Y_MAX_PIN."
|
||||
#elif I_USE_ENDSTOP == _YSTOP_
|
||||
#warning "Auto-assigned I_DIAG_PIN to Y_STOP_PIN."
|
||||
#elif I_USE_ENDSTOP == _ZMIN_
|
||||
#warning "Auto-assigned I_DIAG_PIN to Z_MIN_PIN."
|
||||
#elif I_USE_ENDSTOP == _ZMAX_
|
||||
#warning "Auto-assigned I_DIAG_PIN to Z_MAX_PIN."
|
||||
#elif I_USE_ENDSTOP == _ZSTOP_
|
||||
#warning "Auto-assigned I_DIAG_PIN to Z_STOP_PIN."
|
||||
#elif I_USE_ENDSTOP == _XDIAG_
|
||||
#warning "Auto-assigned I_DIAG_PIN to X_DIAG_PIN."
|
||||
#elif I_USE_ENDSTOP == _YDIAG_
|
||||
@@ -391,14 +427,20 @@
|
||||
#warning "Auto-assigned J_DIAG_PIN to X_MIN_PIN."
|
||||
#elif J_USE_ENDSTOP == _XMAX_
|
||||
#warning "Auto-assigned J_DIAG_PIN to X_MAX_PIN."
|
||||
#elif J_USE_ENDSTOP == _XSTOP_
|
||||
#warning "Auto-assigned J_DIAG_PIN to X_STOP_PIN."
|
||||
#elif J_USE_ENDSTOP == _YMIN_
|
||||
#warning "Auto-assigned J_DIAG_PIN to Y_MIN_PIN."
|
||||
#elif J_USE_ENDSTOP == _YMAX_
|
||||
#warning "Auto-assigned J_DIAG_PIN to Y_MAX_PIN."
|
||||
#elif J_USE_ENDSTOP == _YSTOP_
|
||||
#warning "Auto-assigned J_DIAG_PIN to Y_STOP_PIN."
|
||||
#elif J_USE_ENDSTOP == _ZMIN_
|
||||
#warning "Auto-assigned J_DIAG_PIN to Z_MIN_PIN."
|
||||
#elif J_USE_ENDSTOP == _ZMAX_
|
||||
#warning "Auto-assigned J_DIAG_PIN to Z_MAX_PIN."
|
||||
#elif J_USE_ENDSTOP == _ZSTOP_
|
||||
#warning "Auto-assigned J_DIAG_PIN to Z_STOP_PIN."
|
||||
#elif J_USE_ENDSTOP == _XDIAG_
|
||||
#warning "Auto-assigned J_DIAG_PIN to X_DIAG_PIN."
|
||||
#elif J_USE_ENDSTOP == _YDIAG_
|
||||
@@ -443,14 +485,20 @@
|
||||
#warning "Auto-assigned K_DIAG_PIN to X_MIN_PIN."
|
||||
#elif K_USE_ENDSTOP == _XMAX_
|
||||
#warning "Auto-assigned K_DIAG_PIN to X_MAX_PIN."
|
||||
#elif K_USE_ENDSTOP == _XSTOP_
|
||||
#warning "Auto-assigned K_DIAG_PIN to X_STOP_PIN."
|
||||
#elif K_USE_ENDSTOP == _YMIN_
|
||||
#warning "Auto-assigned K_DIAG_PIN to Y_MIN_PIN."
|
||||
#elif K_USE_ENDSTOP == _YMAX_
|
||||
#warning "Auto-assigned K_DIAG_PIN to Y_MAX_PIN."
|
||||
#elif K_USE_ENDSTOP == _YSTOP_
|
||||
#warning "Auto-assigned K_DIAG_PIN to Y_STOP_PIN."
|
||||
#elif K_USE_ENDSTOP == _ZMIN_
|
||||
#warning "Auto-assigned K_DIAG_PIN to Z_MIN_PIN."
|
||||
#elif K_USE_ENDSTOP == _ZMAX_
|
||||
#warning "Auto-assigned K_DIAG_PIN to Z_MAX_PIN."
|
||||
#elif K_USE_ENDSTOP == _ZSTOP_
|
||||
#warning "Auto-assigned K_DIAG_PIN to Z_STOP_PIN."
|
||||
#elif K_USE_ENDSTOP == _XDIAG_
|
||||
#warning "Auto-assigned K_DIAG_PIN to X_DIAG_PIN."
|
||||
#elif K_USE_ENDSTOP == _YDIAG_
|
||||
@@ -488,3 +536,12 @@
|
||||
#if HOMING_Z_WITH_PROBE && IS_CARTESIAN && DISABLED(Z_SAFE_HOMING)
|
||||
#error "Z_SAFE_HOMING is recommended when homing with a probe. Enable Z_SAFE_HOMING or comment out this line to continue."
|
||||
#endif
|
||||
|
||||
//
|
||||
// Warn users of potential endstop/DIAG pin conflicts to prevent homing issues when not using sensorless homing
|
||||
//
|
||||
#if !USE_SENSORLESS && ENABLED(USES_DIAG_JUMPERS)
|
||||
#warning "Motherboard DIAG jumpers must be removed when SENSORLESS_HOMING is disabled."
|
||||
#elif !USE_SENSORLESS && ENABLED(USES_DIAG_PINS)
|
||||
#warning "Driver DIAG pins must be physically removed unless SENSORLESS_HOMING is enabled. (See https://bit.ly/2ZPRlt0)"
|
||||
#endif
|
||||
|
||||
@@ -339,12 +339,14 @@ void MarlinUI::draw_kill_screen() {
|
||||
void MarlinUI::clear_lcd() { } // Automatically cleared by Picture Loop
|
||||
|
||||
#if HAS_LCD_BRIGHTNESS
|
||||
|
||||
void MarlinUI::_set_brightness() {
|
||||
#if PIN_EXISTS(TFT_BACKLIGHT)
|
||||
if (PWM_PIN(TFT_BACKLIGHT_PIN))
|
||||
analogWrite(pin_t(TFT_BACKLIGHT_PIN), brightness);
|
||||
analogWrite(pin_t(TFT_BACKLIGHT_PIN), backlight ? brightness : 0);
|
||||
#endif
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
#if HAS_LCD_MENU
|
||||
|
||||
@@ -165,14 +165,15 @@ typedef struct {
|
||||
} select_t;
|
||||
|
||||
select_t select_page{0}, select_file{0}, select_print{0}, select_prepare{0}
|
||||
, select_control{0}, select_axis{0}, select_temp{0}, select_motion{0}, select_tune{0}
|
||||
, select_advset{0}, select_PLA{0}, select_ABS{0}
|
||||
, select_speed{0}
|
||||
, select_acc{0}
|
||||
, select_jerk{0}
|
||||
, select_step{0}
|
||||
, select_item{0}
|
||||
;
|
||||
, select_control{0}, select_axis{0}, select_temp{0}, select_motion{0}, select_tune{0}
|
||||
, select_advset{0}, select_speed{0}, select_acc{0}, select_jerk{0}, select_step{0}, select_item{0};
|
||||
|
||||
#if HAS_PREHEAT
|
||||
select_t select_PLA{0};
|
||||
#if PREHEAT_COUNT > 1
|
||||
select_t select_ABS{0};
|
||||
#endif
|
||||
#endif
|
||||
|
||||
uint8_t index_file = MROWS,
|
||||
index_prepare = MROWS,
|
||||
@@ -497,8 +498,8 @@ inline bool Apply_Encoder(const EncoderState &encoder_diffState, T &valref) {
|
||||
#define PREPARE_CASE_DISA 2
|
||||
#define PREPARE_CASE_HOME 3
|
||||
#define PREPARE_CASE_ZOFF (PREPARE_CASE_HOME + ENABLED(HAS_ZOFFSET_ITEM))
|
||||
#define PREPARE_CASE_PLA (PREPARE_CASE_ZOFF + ENABLED(HAS_HOTEND))
|
||||
#define PREPARE_CASE_ABS (PREPARE_CASE_PLA + ENABLED(HAS_HOTEND))
|
||||
#define PREPARE_CASE_PLA (PREPARE_CASE_ZOFF + ENABLED(HAS_PREHEAT))
|
||||
#define PREPARE_CASE_ABS (PREPARE_CASE_PLA + (TERN0(HAS_PREHEAT, PREHEAT_COUNT > 1)))
|
||||
#define PREPARE_CASE_COOL (PREPARE_CASE_ABS + EITHER(HAS_HOTEND, HAS_HEATED_BED))
|
||||
#define PREPARE_CASE_LANG (PREPARE_CASE_COOL + 1)
|
||||
#define PREPARE_CASE_TOTAL PREPARE_CASE_LANG
|
||||
@@ -522,8 +523,8 @@ inline bool Apply_Encoder(const EncoderState &encoder_diffState, T &valref) {
|
||||
#define TEMP_CASE_TEMP (0 + ENABLED(HAS_HOTEND))
|
||||
#define TEMP_CASE_BED (TEMP_CASE_TEMP + ENABLED(HAS_HEATED_BED))
|
||||
#define TEMP_CASE_FAN (TEMP_CASE_BED + ENABLED(HAS_FAN))
|
||||
#define TEMP_CASE_PLA (TEMP_CASE_FAN + ENABLED(HAS_HOTEND))
|
||||
#define TEMP_CASE_ABS (TEMP_CASE_PLA + ENABLED(HAS_HOTEND))
|
||||
#define TEMP_CASE_PLA (TEMP_CASE_FAN + ENABLED(HAS_PREHEAT))
|
||||
#define TEMP_CASE_ABS (TEMP_CASE_PLA + (TERN0(HAS_PREHEAT, PREHEAT_COUNT > 1)))
|
||||
#define TEMP_CASE_TOTAL TEMP_CASE_ABS
|
||||
|
||||
#define PREHEAT_CASE_TEMP (0 + ENABLED(HAS_HOTEND))
|
||||
@@ -615,7 +616,7 @@ void Draw_Edit_Float3(const uint8_t row, const uint16_t value, const bool active
|
||||
}
|
||||
|
||||
void Draw_Edit_Signed_Float2(const uint8_t row, const float value, const bool active=false) {
|
||||
DWIN_Draw_Signed_Float(font8x16, active ? Select_Color : Color_Bg_Black, 2, UNITFDIGITS, 220 + 8 - UNITFDIGITS * 8, EBASE(row), value);
|
||||
DWIN_Draw_Signed_Float(font8x16, active ? Select_Color : Color_Bg_Black, 2, UNITFDIGITS + 1, 220 + 8 - UNITFDIGITS * 8, EBASE(row), value);
|
||||
}
|
||||
|
||||
void Draw_Edit_Signed_Float3(const uint8_t row, const float value, const bool active=false) {
|
||||
@@ -700,7 +701,7 @@ void Item_Prepare_Home(const uint8_t row) {
|
||||
|
||||
#endif
|
||||
|
||||
#if HAS_HOTEND
|
||||
#if HAS_PREHEAT
|
||||
void Item_Prepare_PLA(const uint8_t row) {
|
||||
if (HMI_IsChinese())
|
||||
Item_AreaCopy(100, 89, 151, 101, row);
|
||||
@@ -715,22 +716,22 @@ void Item_Prepare_Home(const uint8_t row) {
|
||||
Draw_Menu_Line(row, ICON_PLAPreheat);
|
||||
}
|
||||
|
||||
void Item_Prepare_ABS(const uint8_t row) {
|
||||
if (HMI_IsChinese())
|
||||
Item_AreaCopy(180, 89, 233, 100, row);
|
||||
else {
|
||||
#ifdef USE_STRING_TITLES
|
||||
DWIN_Draw_Label(row, F("Preheat " PREHEAT_2_LABEL));
|
||||
#else
|
||||
Item_AreaCopy(108, 76, 155, 87, row); // "Preheat"
|
||||
say_abs_en(52, row); // "ABS"
|
||||
#endif
|
||||
#if PREHEAT_COUNT > 1
|
||||
void Item_Prepare_ABS(const uint8_t row) {
|
||||
if (HMI_IsChinese())
|
||||
Item_AreaCopy(180, 89, 233, 100, row);
|
||||
else {
|
||||
#ifdef USE_STRING_TITLES
|
||||
DWIN_Draw_Label(row, F("Preheat " PREHEAT_2_LABEL));
|
||||
#else
|
||||
Item_AreaCopy(108, 76, 155, 87, row); // "Preheat"
|
||||
say_abs_en(52, row); // "ABS"
|
||||
#endif
|
||||
}
|
||||
Draw_Menu_Line(row, ICON_ABSPreheat);
|
||||
}
|
||||
Draw_Menu_Line(row, ICON_ABSPreheat);
|
||||
}
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#if HAS_PREHEAT
|
||||
void Item_Prepare_Cool(const uint8_t row) {
|
||||
if (HMI_IsChinese())
|
||||
Item_AreaCopy(1, 104, 56, 117, row);
|
||||
@@ -785,11 +786,13 @@ void Draw_Prepare_Menu() {
|
||||
#if HAS_ZOFFSET_ITEM
|
||||
if (PVISI(PREPARE_CASE_ZOFF)) Item_Prepare_Offset(PSCROL(PREPARE_CASE_ZOFF)); // Edit Z-Offset / Babystep / Set Home Offset
|
||||
#endif
|
||||
#if HAS_HOTEND
|
||||
if (PVISI(PREPARE_CASE_PLA)) Item_Prepare_PLA(PSCROL(PREPARE_CASE_PLA)); // Preheat PLA
|
||||
if (PVISI(PREPARE_CASE_ABS)) Item_Prepare_ABS(PSCROL(PREPARE_CASE_ABS)); // Preheat ABS
|
||||
#endif
|
||||
#if HAS_PREHEAT
|
||||
if (PVISI(PREPARE_CASE_PLA)) Item_Prepare_PLA(PSCROL(PREPARE_CASE_PLA)); // Preheat PLA
|
||||
#if PREHEAT_COUNT > 1
|
||||
if (PVISI(PREPARE_CASE_ABS)) Item_Prepare_ABS(PSCROL(PREPARE_CASE_ABS)); // Preheat ABS
|
||||
#endif
|
||||
#endif
|
||||
#if HAS_HOTEND || HAS_HEATED_BED
|
||||
if (PVISI(PREPARE_CASE_COOL)) Item_Prepare_Cool(PSCROL(PREPARE_CASE_COOL)); // Cooldown
|
||||
#endif
|
||||
if (PVISI(PREPARE_CASE_LANG)) Item_Prepare_Lang(PSCROL(PREPARE_CASE_LANG)); // Language CN/EN
|
||||
@@ -1425,25 +1428,34 @@ void HMI_Move_Z() {
|
||||
uint8_t temp_line;
|
||||
switch (HMI_ValueStruct.show_mode) {
|
||||
case -1: temp_line = TEMP_CASE_TEMP; break;
|
||||
case -2: temp_line = PREHEAT_CASE_TEMP; break;
|
||||
case -3: temp_line = PREHEAT_CASE_TEMP; break;
|
||||
#if HAS_PREHEAT
|
||||
case -2: temp_line = PREHEAT_CASE_TEMP; break;
|
||||
#if PREHEAT_COUNT > 1
|
||||
case -3: temp_line = PREHEAT_CASE_TEMP; break;
|
||||
#endif
|
||||
#endif
|
||||
default: temp_line = TUNE_CASE_TEMP + MROWS - index_tune;
|
||||
}
|
||||
if (Apply_Encoder(encoder_diffState, HMI_ValueStruct.E_Temp)) {
|
||||
EncoderRate.enabled = false;
|
||||
if (HMI_ValueStruct.show_mode == -2) {
|
||||
checkkey = PLAPreheat;
|
||||
ui.material_preset[0].hotend_temp = HMI_ValueStruct.E_Temp;
|
||||
Draw_Edit_Integer3(temp_line, ui.material_preset[0].hotend_temp);
|
||||
return;
|
||||
}
|
||||
else if (HMI_ValueStruct.show_mode == -3) {
|
||||
checkkey = ABSPreheat;
|
||||
ui.material_preset[1].hotend_temp = HMI_ValueStruct.E_Temp;
|
||||
Draw_Edit_Integer3(temp_line, ui.material_preset[1].hotend_temp);
|
||||
return;
|
||||
}
|
||||
else if (HMI_ValueStruct.show_mode == -1) // Temperature
|
||||
#if HAS_PREHEAT
|
||||
if (HMI_ValueStruct.show_mode == -2) {
|
||||
checkkey = PLAPreheat;
|
||||
ui.material_preset[0].hotend_temp = HMI_ValueStruct.E_Temp;
|
||||
Draw_Edit_Integer3(temp_line, ui.material_preset[0].hotend_temp);
|
||||
return;
|
||||
}
|
||||
#if PREHEAT_COUNT > 1
|
||||
if (HMI_ValueStruct.show_mode == -3) {
|
||||
checkkey = ABSPreheat;
|
||||
ui.material_preset[1].hotend_temp = HMI_ValueStruct.E_Temp;
|
||||
Draw_Edit_Integer3(temp_line, ui.material_preset[1].hotend_temp);
|
||||
return;
|
||||
}
|
||||
#endif
|
||||
#endif
|
||||
|
||||
if (HMI_ValueStruct.show_mode == -1) // Temperature
|
||||
checkkey = TemperatureID;
|
||||
else
|
||||
checkkey = Tune;
|
||||
@@ -1467,28 +1479,33 @@ void HMI_Move_Z() {
|
||||
uint8_t bed_line;
|
||||
switch (HMI_ValueStruct.show_mode) {
|
||||
case -1: bed_line = TEMP_CASE_BED; break;
|
||||
case -2: bed_line = PREHEAT_CASE_BED; break;
|
||||
case -3: bed_line = PREHEAT_CASE_BED; break;
|
||||
#if HAS_PREHEAT
|
||||
case -2: bed_line = PREHEAT_CASE_BED; break;
|
||||
#if PREHEAT_COUNT > 1
|
||||
case -3: bed_line = PREHEAT_CASE_BED; break;
|
||||
#endif
|
||||
#endif
|
||||
default: bed_line = TUNE_CASE_BED + MROWS - index_tune;
|
||||
}
|
||||
if (Apply_Encoder(encoder_diffState, HMI_ValueStruct.Bed_Temp)) {
|
||||
EncoderRate.enabled = false;
|
||||
if (HMI_ValueStruct.show_mode == -2) {
|
||||
checkkey = PLAPreheat;
|
||||
ui.material_preset[0].bed_temp = HMI_ValueStruct.Bed_Temp;
|
||||
Draw_Edit_Integer3(bed_line, ui.material_preset[0].bed_temp);
|
||||
return;
|
||||
}
|
||||
else if (HMI_ValueStruct.show_mode == -3) {
|
||||
checkkey = ABSPreheat;
|
||||
ui.material_preset[1].bed_temp = HMI_ValueStruct.Bed_Temp;
|
||||
Draw_Edit_Integer3(bed_line, ui.material_preset[1].bed_temp);
|
||||
return;
|
||||
}
|
||||
else if (HMI_ValueStruct.show_mode == -1)
|
||||
checkkey = TemperatureID;
|
||||
else
|
||||
checkkey = Tune;
|
||||
#if HAS_PREHEAT
|
||||
if (HMI_ValueStruct.show_mode == -2) {
|
||||
checkkey = PLAPreheat;
|
||||
ui.material_preset[0].bed_temp = HMI_ValueStruct.Bed_Temp;
|
||||
Draw_Edit_Integer3(bed_line, ui.material_preset[0].bed_temp);
|
||||
return;
|
||||
}
|
||||
#if PREHEAT_COUNT > 1
|
||||
if (HMI_ValueStruct.show_mode == -3) {
|
||||
checkkey = ABSPreheat;
|
||||
ui.material_preset[1].bed_temp = HMI_ValueStruct.Bed_Temp;
|
||||
Draw_Edit_Integer3(bed_line, ui.material_preset[1].bed_temp);
|
||||
return;
|
||||
}
|
||||
#endif
|
||||
#endif
|
||||
checkkey = HMI_ValueStruct.show_mode == -1 ? TemperatureID : Tune;
|
||||
Draw_Edit_Integer3(bed_line, HMI_ValueStruct.Bed_Temp);
|
||||
thermalManager.setTargetBed(HMI_ValueStruct.Bed_Temp);
|
||||
return;
|
||||
@@ -1522,16 +1539,15 @@ void HMI_Move_Z() {
|
||||
Draw_Edit_Integer3(fan_line, ui.material_preset[0].fan_speed);
|
||||
return;
|
||||
}
|
||||
else if (HMI_ValueStruct.show_mode == -3) {
|
||||
checkkey = ABSPreheat;
|
||||
ui.material_preset[1].fan_speed = HMI_ValueStruct.Fan_speed;
|
||||
Draw_Edit_Integer3(fan_line, ui.material_preset[1].fan_speed);
|
||||
return;
|
||||
}
|
||||
else if (HMI_ValueStruct.show_mode == -1)
|
||||
checkkey = TemperatureID;
|
||||
else
|
||||
checkkey = Tune;
|
||||
#if PREHEAT_COUNT > 1
|
||||
if (HMI_ValueStruct.show_mode == -3) {
|
||||
checkkey = ABSPreheat;
|
||||
ui.material_preset[1].fan_speed = HMI_ValueStruct.Fan_speed;
|
||||
Draw_Edit_Integer3(fan_line, ui.material_preset[1].fan_speed);
|
||||
return;
|
||||
}
|
||||
#endif
|
||||
checkkey = HMI_ValueStruct.show_mode == -1 ? TemperatureID : Tune;
|
||||
Draw_Edit_Integer3(fan_line, HMI_ValueStruct.Fan_speed);
|
||||
thermalManager.set_fan_speed(0, HMI_ValueStruct.Fan_speed);
|
||||
return;
|
||||
@@ -1659,7 +1675,7 @@ void _update_axis_value(const AxisEnum axis, const uint16_t x, const uint16_t y,
|
||||
else if (blink && draw_empty)
|
||||
DWIN_Draw_String(true, font8x16, Color_White, Color_Bg_Black, x, y, F(" "));
|
||||
else
|
||||
DWIN_Draw_FloatValue(true, true, 0, font8x16, Color_White, Color_Bg_Black, 3, 1, x, y, p * 10);
|
||||
DWIN_Draw_FloatValue(true, true, 0, font8x16, Color_White, Color_Bg_Black, 3, 1, x, y, p);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1769,11 +1785,11 @@ void update_variable() {
|
||||
if (BABY_Z_VAR != _offset) {
|
||||
_offset = BABY_Z_VAR;
|
||||
if (BABY_Z_VAR < 0) {
|
||||
Draw_Stat_Float(207, 417, -_offset * 100);
|
||||
Draw_Stat_Float(207, 417, -_offset);
|
||||
DWIN_Draw_String(true, font8x16, Color_White, Color_Bg_Black, 205, 419, F("-"));
|
||||
}
|
||||
else {
|
||||
Draw_Stat_Float(207, 417, _offset * 100);
|
||||
Draw_Stat_Float(207, 417, _offset);
|
||||
DWIN_Draw_String(true, font8x16, Color_White, Color_Bg_Black, 205, 419, F(" "));
|
||||
}
|
||||
}
|
||||
@@ -2656,10 +2672,10 @@ void HMI_Prepare() {
|
||||
// Draw "More" icon for sub-menus
|
||||
if (index_prepare < 7) Draw_More_Icon(MROWS - index_prepare + 1);
|
||||
|
||||
#if HAS_HOTEND
|
||||
#if PREHEAT_COUNT > 1
|
||||
if (index_prepare == PREPARE_CASE_ABS) Item_Prepare_ABS(MROWS);
|
||||
#endif
|
||||
#if HAS_PREHEAT
|
||||
#if HAS_HOTEND || HAS_HEATED_BED
|
||||
if (index_prepare == PREPARE_CASE_COOL) Item_Prepare_Cool(MROWS);
|
||||
#endif
|
||||
if (index_prepare == PREPARE_CASE_LANG) Item_Prepare_Lang(MROWS);
|
||||
@@ -2719,6 +2735,7 @@ void HMI_Prepare() {
|
||||
queue.inject_P(G28_STR); // G28 will set home_flag
|
||||
Popup_Window_Home();
|
||||
break;
|
||||
|
||||
#if HAS_ZOFFSET_ITEM
|
||||
case PREPARE_CASE_ZOFF:
|
||||
#if EITHER(HAS_BED_PROBE, BABYSTEPPING)
|
||||
@@ -2734,28 +2751,23 @@ void HMI_Prepare() {
|
||||
#endif
|
||||
break;
|
||||
#endif
|
||||
|
||||
#if HAS_PREHEAT
|
||||
case PREPARE_CASE_PLA:
|
||||
TERN_(HAS_HOTEND, thermalManager.setTargetHotend(ui.material_preset[0].hotend_temp, 0));
|
||||
TERN_(HAS_HEATED_BED, thermalManager.setTargetBed(ui.material_preset[0].bed_temp));
|
||||
TERN_(HAS_FAN, thermalManager.set_fan_speed(0, ui.material_preset[0].fan_speed));
|
||||
break;
|
||||
case PREPARE_CASE_ABS:
|
||||
TERN_(HAS_HOTEND, thermalManager.setTargetHotend(ui.material_preset[1].hotend_temp, 0));
|
||||
TERN_(HAS_HEATED_BED, thermalManager.setTargetBed(ui.material_preset[1].bed_temp));
|
||||
TERN_(HAS_FAN, thermalManager.set_fan_speed(0, ui.material_preset[1].fan_speed));
|
||||
break;
|
||||
case PREPARE_CASE_COOL:
|
||||
TERN_(HAS_FAN, thermalManager.zero_fan_speeds());
|
||||
#if HAS_HOTEND || HAS_HEATED_BED
|
||||
thermalManager.disable_all_heaters();
|
||||
#endif
|
||||
break;
|
||||
case PREPARE_CASE_PLA: ui.preheat_all(0); break;
|
||||
#if PREHEAT_COUNT > 1
|
||||
case PREPARE_CASE_ABS: ui.preheat_all(1); break;
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#if HAS_HOTEND || HAS_HEATED_BED
|
||||
case PREPARE_CASE_COOL: thermalManager.cooldown(); break;
|
||||
#endif
|
||||
|
||||
case PREPARE_CASE_LANG:
|
||||
HMI_ToggleLanguage();
|
||||
Draw_Prepare_Menu();
|
||||
break;
|
||||
|
||||
default: break;
|
||||
}
|
||||
}
|
||||
@@ -2776,9 +2788,11 @@ void Draw_Temperature_Menu() {
|
||||
#if HAS_FAN
|
||||
Item_AreaCopy(115, 134, 170, 146, TEMP_CASE_FAN);
|
||||
#endif
|
||||
#if HAS_HOTEND
|
||||
#if HAS_PREHEAT
|
||||
Item_AreaCopy(100, 89, 178, 101, TEMP_CASE_PLA);
|
||||
Item_AreaCopy(180, 89, 260, 100, TEMP_CASE_ABS);
|
||||
#if PREHEAT_COUNT > 1
|
||||
Item_AreaCopy(180, 89, 260, 100, TEMP_CASE_ABS);
|
||||
#endif
|
||||
#endif
|
||||
}
|
||||
else {
|
||||
@@ -2797,30 +2811,33 @@ void Draw_Temperature_Menu() {
|
||||
#if HAS_FAN
|
||||
DWIN_Draw_Label(TEMP_CASE_FAN, GET_TEXT_F(MSG_FAN_SPEED));
|
||||
#endif
|
||||
#if HAS_HOTEND
|
||||
#if HAS_PREHEAT
|
||||
DWIN_Draw_Label(TEMP_CASE_PLA, F(PREHEAT_1_LABEL " Preheat Settings"));
|
||||
DWIN_Draw_Label(TEMP_CASE_ABS, F(PREHEAT_2_LABEL " Preheat Settings"));
|
||||
#if PREHEAT_COUNT > 1
|
||||
DWIN_Draw_Label(TEMP_CASE_ABS, F(PREHEAT_2_LABEL " Preheat Settings"));
|
||||
#endif
|
||||
#endif
|
||||
#else
|
||||
#if HAS_HOTEND
|
||||
Item_AreaCopy(197, 104, 238, 114, TEMP_CASE_TEMP); // "Nozzle"
|
||||
Item_AreaCopy(1, 89, 83, 101, TEMP_CASE_TEMP, 44); // "Temperature"
|
||||
Item_AreaCopy(197, 104, 238, 114, TEMP_CASE_TEMP); // "Nozzle"
|
||||
Item_AreaCopy(1, 89, 83, 101, TEMP_CASE_TEMP, 44); // "Temperature"
|
||||
#endif
|
||||
#if HAS_HEATED_BED
|
||||
Item_AreaCopy(240, 104, 264, 114, TEMP_CASE_BED); // "Bed"
|
||||
Item_AreaCopy(1, 89, 83, 101, TEMP_CASE_BED, 27); // "Temperature"
|
||||
Item_AreaCopy(240, 104, 264, 114, TEMP_CASE_BED); // "Bed"
|
||||
Item_AreaCopy(1, 89, 83, 101, TEMP_CASE_BED, 27); // "Temperature"
|
||||
#endif
|
||||
#if HAS_FAN
|
||||
Item_AreaCopy( 1, 119, 61, 132, TEMP_CASE_FAN); // "Fan speed"
|
||||
Item_AreaCopy( 1, 119, 61, 132, TEMP_CASE_FAN); // "Fan speed"
|
||||
#endif
|
||||
#if HAS_HOTEND
|
||||
Item_AreaCopy(107, 76, 156, 86, TEMP_CASE_PLA); // "Preheat"
|
||||
say_pla_en(52, TEMP_CASE_PLA); // "PLA"
|
||||
Item_AreaCopy(150, 135, 202, 148, TEMP_CASE_PLA, 79); // "Settings"
|
||||
|
||||
Item_AreaCopy(107, 76, 156, 86, TEMP_CASE_ABS); // "Preheat"
|
||||
say_abs_en(52, TEMP_CASE_ABS); // "ABS"
|
||||
Item_AreaCopy(150, 135, 202, 148, TEMP_CASE_ABS, 81); // "Settings"
|
||||
#if HAS_PREHEAT
|
||||
Item_AreaCopy(107, 76, 156, 86, TEMP_CASE_PLA); // "Preheat"
|
||||
say_pla_en(52, TEMP_CASE_PLA); // "PLA"
|
||||
Item_AreaCopy(150, 135, 202, 148, TEMP_CASE_PLA, 79); // "Settings"
|
||||
#if PREHEAT_COUNT > 1
|
||||
Item_AreaCopy(107, 76, 156, 86, TEMP_CASE_ABS); // "Preheat"
|
||||
say_abs_en(52, TEMP_CASE_ABS); // "ABS"
|
||||
Item_AreaCopy(150, 135, 202, 148, TEMP_CASE_ABS, 81); // "Settings"
|
||||
#endif
|
||||
#endif
|
||||
#endif
|
||||
}
|
||||
@@ -2843,12 +2860,12 @@ void Draw_Temperature_Menu() {
|
||||
_TMENU_ICON(TEMP_CASE_FAN);
|
||||
Draw_Edit_Integer3(i, thermalManager.fan_speed[0]);
|
||||
#endif
|
||||
#if HAS_HOTEND
|
||||
#if HAS_PREHEAT
|
||||
// PLA/ABS items have submenus
|
||||
_TMENU_ICON(TEMP_CASE_PLA);
|
||||
Draw_More_Icon(i);
|
||||
_TMENU_ICON(TEMP_CASE_ABS);
|
||||
Draw_More_Icon(i);
|
||||
_TMENU_ICON(TEMP_CASE_PLA); Draw_More_Icon(i);
|
||||
#if PREHEAT_COUNT > 1
|
||||
_TMENU_ICON(TEMP_CASE_ABS); Draw_More_Icon(i);
|
||||
#endif
|
||||
#endif
|
||||
}
|
||||
|
||||
@@ -3068,7 +3085,8 @@ void HMI_Temperature() {
|
||||
EncoderRate.enabled = true;
|
||||
break;
|
||||
#endif
|
||||
#if HAS_HOTEND
|
||||
|
||||
#if HAS_PREHEAT
|
||||
case TEMP_CASE_PLA: {
|
||||
checkkey = PLAPreheat;
|
||||
select_PLA.reset();
|
||||
@@ -3145,7 +3163,9 @@ void HMI_Temperature() {
|
||||
Draw_Menu_Line(++i, ICON_WriteEEPROM);
|
||||
#endif
|
||||
} break;
|
||||
#endif // HAS_PREHEAT
|
||||
|
||||
#if PREHEAT_COUNT > 1
|
||||
case TEMP_CASE_ABS: { // ABS preheat setting
|
||||
checkkey = ABSPreheat;
|
||||
select_ABS.reset();
|
||||
@@ -3227,7 +3247,7 @@ void HMI_Temperature() {
|
||||
|
||||
} break;
|
||||
|
||||
#endif // HAS_HOTEND
|
||||
#endif // PREHEAT_COUNT > 1
|
||||
}
|
||||
}
|
||||
DWIN_UpdateLCD();
|
||||
@@ -3570,14 +3590,12 @@ void HMI_AdvSet() {
|
||||
|
||||
#if HAS_HOTEND
|
||||
case ADVSET_CASE_HEPID:
|
||||
thermalManager.setTargetHotend(ui.material_preset[0].hotend_temp, 0);
|
||||
thermalManager.PID_autotune(ui.material_preset[0].hotend_temp, H_E0, 10, true);
|
||||
break;
|
||||
#endif
|
||||
|
||||
#if HAS_HEATED_BED
|
||||
case ADVSET_CASE_BEDPID:
|
||||
thermalManager.setTargetBed(ui.material_preset[0].bed_temp);
|
||||
thermalManager.PID_autotune(ui.material_preset[0].bed_temp, H_BED, 10, true);
|
||||
break;
|
||||
#endif
|
||||
@@ -3872,63 +3890,65 @@ void HMI_Tune() {
|
||||
DWIN_UpdateLCD();
|
||||
}
|
||||
|
||||
// ABS Preheat
|
||||
void HMI_ABSPreheatSetting() {
|
||||
EncoderState encoder_diffState = get_encoder_state();
|
||||
if (encoder_diffState == ENCODER_DIFF_NO) return;
|
||||
#if PREHEAT_COUNT > 1
|
||||
// ABS Preheat
|
||||
void HMI_ABSPreheatSetting() {
|
||||
EncoderState encoder_diffState = get_encoder_state();
|
||||
if (encoder_diffState == ENCODER_DIFF_NO) return;
|
||||
|
||||
// Avoid flicker by updating only the previous menu
|
||||
if (encoder_diffState == ENCODER_DIFF_CW) {
|
||||
if (select_ABS.inc(1 + PREHEAT_CASE_TOTAL)) Move_Highlight(1, select_ABS.now);
|
||||
}
|
||||
else if (encoder_diffState == ENCODER_DIFF_CCW) {
|
||||
if (select_ABS.dec()) Move_Highlight(-1, select_ABS.now);
|
||||
}
|
||||
else if (encoder_diffState == ENCODER_DIFF_ENTER) {
|
||||
switch (select_ABS.now) {
|
||||
case CASE_BACK:
|
||||
checkkey = TemperatureID;
|
||||
select_temp.now = TEMP_CASE_ABS;
|
||||
HMI_ValueStruct.show_mode = -1;
|
||||
Draw_Temperature_Menu();
|
||||
break;
|
||||
#if HAS_HOTEND
|
||||
case PREHEAT_CASE_TEMP:
|
||||
checkkey = ETemp;
|
||||
HMI_ValueStruct.E_Temp = ui.material_preset[1].hotend_temp;
|
||||
Draw_Edit_Integer3(PREHEAT_CASE_TEMP, ui.material_preset[1].hotend_temp, true);
|
||||
EncoderRate.enabled = true;
|
||||
break;
|
||||
#endif
|
||||
#if HAS_HEATED_BED
|
||||
case PREHEAT_CASE_BED:
|
||||
checkkey = BedTemp;
|
||||
HMI_ValueStruct.Bed_Temp = ui.material_preset[1].bed_temp;
|
||||
Draw_Edit_Integer3(PREHEAT_CASE_BED, ui.material_preset[1].bed_temp, true);
|
||||
EncoderRate.enabled = true;
|
||||
break;
|
||||
#endif
|
||||
#if HAS_FAN
|
||||
case PREHEAT_CASE_FAN:
|
||||
checkkey = FanSpeed;
|
||||
HMI_ValueStruct.Fan_speed = ui.material_preset[1].fan_speed;
|
||||
Draw_Edit_Integer3(PREHEAT_CASE_FAN, ui.material_preset[1].fan_speed, true);
|
||||
EncoderRate.enabled = true;
|
||||
break;
|
||||
#endif
|
||||
#if ENABLED(EEPROM_SETTINGS)
|
||||
case PREHEAT_CASE_SAVE: {
|
||||
const bool success = settings.save();
|
||||
HMI_AudioFeedback(success);
|
||||
} break;
|
||||
#endif
|
||||
default: break;
|
||||
// Avoid flicker by updating only the previous menu
|
||||
if (encoder_diffState == ENCODER_DIFF_CW) {
|
||||
if (select_ABS.inc(1 + PREHEAT_CASE_TOTAL)) Move_Highlight(1, select_ABS.now);
|
||||
}
|
||||
else if (encoder_diffState == ENCODER_DIFF_CCW) {
|
||||
if (select_ABS.dec()) Move_Highlight(-1, select_ABS.now);
|
||||
}
|
||||
else if (encoder_diffState == ENCODER_DIFF_ENTER) {
|
||||
switch (select_ABS.now) {
|
||||
case CASE_BACK:
|
||||
checkkey = TemperatureID;
|
||||
select_temp.now = TEMP_CASE_ABS;
|
||||
HMI_ValueStruct.show_mode = -1;
|
||||
Draw_Temperature_Menu();
|
||||
break;
|
||||
#if HAS_HOTEND
|
||||
case PREHEAT_CASE_TEMP:
|
||||
checkkey = ETemp;
|
||||
HMI_ValueStruct.E_Temp = ui.material_preset[1].hotend_temp;
|
||||
Draw_Edit_Integer3(PREHEAT_CASE_TEMP, ui.material_preset[1].hotend_temp, true);
|
||||
EncoderRate.enabled = true;
|
||||
break;
|
||||
#endif
|
||||
#if HAS_HEATED_BED
|
||||
case PREHEAT_CASE_BED:
|
||||
checkkey = BedTemp;
|
||||
HMI_ValueStruct.Bed_Temp = ui.material_preset[1].bed_temp;
|
||||
Draw_Edit_Integer3(PREHEAT_CASE_BED, ui.material_preset[1].bed_temp, true);
|
||||
EncoderRate.enabled = true;
|
||||
break;
|
||||
#endif
|
||||
#if HAS_FAN
|
||||
case PREHEAT_CASE_FAN:
|
||||
checkkey = FanSpeed;
|
||||
HMI_ValueStruct.Fan_speed = ui.material_preset[1].fan_speed;
|
||||
Draw_Edit_Integer3(PREHEAT_CASE_FAN, ui.material_preset[1].fan_speed, true);
|
||||
EncoderRate.enabled = true;
|
||||
break;
|
||||
#endif
|
||||
#if ENABLED(EEPROM_SETTINGS)
|
||||
case PREHEAT_CASE_SAVE: {
|
||||
const bool success = settings.save();
|
||||
HMI_AudioFeedback(success);
|
||||
} break;
|
||||
#endif
|
||||
default: break;
|
||||
}
|
||||
}
|
||||
DWIN_UpdateLCD();
|
||||
}
|
||||
DWIN_UpdateLCD();
|
||||
}
|
||||
#endif // PREHEAT_COUNT > 1
|
||||
|
||||
#endif
|
||||
#endif // HAS_PREHEAT
|
||||
|
||||
// Max Speed
|
||||
void HMI_MaxSpeed() {
|
||||
@@ -4232,7 +4252,9 @@ void DWIN_HandleScreen() {
|
||||
case Tune: HMI_Tune(); break;
|
||||
#if HAS_PREHEAT
|
||||
case PLAPreheat: HMI_PLAPreheatSetting(); break;
|
||||
case ABSPreheat: HMI_ABSPreheatSetting(); break;
|
||||
#if PREHEAT_COUNT > 1
|
||||
case ABSPreheat: HMI_ABSPreheatSetting(); break;
|
||||
#endif
|
||||
#endif
|
||||
case MaxSpeed: HMI_MaxSpeed(); break;
|
||||
case MaxAcceleration: HMI_MaxAcceleration(); break;
|
||||
|
||||
@@ -31,13 +31,6 @@
|
||||
|
||||
#include "../../../inc/MarlinConfigPre.h"
|
||||
|
||||
#if ANY(HAS_HOTEND, HAS_HEATED_BED, HAS_FAN) && PREHEAT_COUNT
|
||||
#define HAS_PREHEAT 1
|
||||
#if PREHEAT_COUNT < 2
|
||||
#error "Creality DWIN requires two material preheat presets."
|
||||
#endif
|
||||
#endif
|
||||
|
||||
enum processID : uint8_t {
|
||||
// Process ID
|
||||
MainMenu,
|
||||
@@ -53,7 +46,9 @@ enum processID : uint8_t {
|
||||
Tune,
|
||||
#if HAS_PREHEAT
|
||||
PLAPreheat,
|
||||
ABSPreheat,
|
||||
#if PREHEAT_COUNT > 1
|
||||
ABSPreheat,
|
||||
#endif
|
||||
#endif
|
||||
MaxSpeed,
|
||||
MaxSpeed_value,
|
||||
|
||||
@@ -1787,8 +1787,7 @@ void DWIN_Print_Started(const bool sd) {
|
||||
// Ended print job
|
||||
void DWIN_Print_Finished() {
|
||||
if (checkkey == PrintProcess || printingIsActive()) {
|
||||
thermalManager.disable_all_heaters();
|
||||
thermalManager.zero_fan_speeds();
|
||||
thermalManager.cooldown();
|
||||
HMI_flag.print_finish = true;
|
||||
}
|
||||
}
|
||||
@@ -2116,23 +2115,13 @@ void SetHome() {
|
||||
#endif
|
||||
|
||||
#if HAS_PREHEAT
|
||||
void SetPreheat(const uint8_t i) {
|
||||
TERN_(HAS_HOTEND, thermalManager.setTargetHotend(ui.material_preset[i].hotend_temp, 0));
|
||||
TERN_(HAS_HEATED_BED, thermalManager.setTargetBed(ui.material_preset[i].bed_temp));
|
||||
TERN_(HAS_FAN, thermalManager.set_fan_speed(0, ui.material_preset[i].fan_speed));
|
||||
}
|
||||
void SetPreheat0() { SetPreheat(0); }
|
||||
void SetPreheat1() { SetPreheat(1); }
|
||||
void SetPreheat2() { SetPreheat(2); }
|
||||
|
||||
void SetCoolDown() {
|
||||
TERN_(HAS_FAN, thermalManager.zero_fan_speeds());
|
||||
#if HAS_HOTEND || HAS_HEATED_BED
|
||||
thermalManager.disable_all_heaters();
|
||||
#endif
|
||||
}
|
||||
void DoPreheat0() { ui.preheat_all(0); }
|
||||
void DoPreheat1() { ui.preheat_all(1); }
|
||||
void DoPreheat2() { ui.preheat_all(2); }
|
||||
#endif
|
||||
|
||||
void DoCoolDown() { thermalManager.cooldown(); }
|
||||
|
||||
void SetLanguage() {
|
||||
HMI_ToggleLanguage();
|
||||
CurrentMenu = nullptr; // Invalidate menu to full redraw
|
||||
@@ -3124,14 +3113,16 @@ void Draw_Prepare_Menu() {
|
||||
ADDMENUITEM(ICON_SetHome, GET_TEXT_F(MSG_SET_HOME_OFFSETS), onDrawHomeOffset, SetHome);
|
||||
#endif
|
||||
#endif
|
||||
#if HAS_HOTEND
|
||||
ADDMENUITEM(ICON_PLAPreheat, GET_TEXT_F(MSG_PREHEAT_1), onDrawPreheat1, SetPreheat0);
|
||||
ADDMENUITEM(ICON_ABSPreheat, PSTR("Preheat " PREHEAT_2_LABEL), onDrawPreheat2, SetPreheat1);
|
||||
ADDMENUITEM(ICON_CustomPreheat, GET_TEXT_F(MSG_PREHEAT_CUSTOM), onDrawMenuItem, SetPreheat2);
|
||||
#endif
|
||||
#if HAS_PREHEAT
|
||||
ADDMENUITEM(ICON_Cool, GET_TEXT_F(MSG_COOLDOWN), onDrawCooldown, SetCoolDown);
|
||||
ADDMENUITEM(ICON_PLAPreheat, GET_TEXT_F(MSG_PREHEAT_1), onDrawPreheat1, DoPreheat0);
|
||||
#if PREHEAT_COUNT > 1
|
||||
ADDMENUITEM(ICON_ABSPreheat, PSTR("Preheat " PREHEAT_2_LABEL), onDrawPreheat2, DoPreheat1);
|
||||
#endif
|
||||
#if PREHEAT_COUNT > 2
|
||||
ADDMENUITEM(ICON_CustomPreheat, GET_TEXT_F(MSG_PREHEAT_CUSTOM), onDrawMenuItem, DoPreheat2);
|
||||
#endif
|
||||
#endif
|
||||
ADDMENUITEM(ICON_Cool, GET_TEXT_F(MSG_COOLDOWN), onDrawCooldown, DoCoolDown);
|
||||
ADDMENUITEM(ICON_Language, PSTR("UI Language"), onDrawLanguage, SetLanguage);
|
||||
}
|
||||
CurrentMenu->draw();
|
||||
|
||||
@@ -33,13 +33,6 @@
|
||||
#include "../common/encoder.h"
|
||||
#include "../../../libs/BL24CXX.h"
|
||||
|
||||
#if ANY(HAS_HOTEND, HAS_HEATED_BED, HAS_FAN) && PREHEAT_COUNT
|
||||
#define HAS_PREHEAT 1
|
||||
#if PREHEAT_COUNT < 2
|
||||
#error "Creality DWIN requires two material preheat presets."
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#if ANY(AUTO_BED_LEVELING_BILINEAR, AUTO_BED_LEVELING_LINEAR, AUTO_BED_LEVELING_3POINT) && DISABLED(PROBE_MANUALLY)
|
||||
#define HAS_ONESTEP_LEVELING 1
|
||||
#endif
|
||||
@@ -123,12 +116,14 @@ typedef struct {
|
||||
uint16_t Barfill_Color = Def_Barfill_Color;
|
||||
uint16_t Indicator_Color = Def_Indicator_Color;
|
||||
uint16_t Coordinate_Color = Def_Coordinate_Color;
|
||||
#if HAS_HOTEND
|
||||
int16_t HotendPidT = PREHEAT_1_TEMP_HOTEND;
|
||||
int16_t PidCycles = 10;
|
||||
#endif
|
||||
#ifdef PREHEAT_1_TEMP_BED
|
||||
int16_t BedPidT = PREHEAT_1_TEMP_BED;
|
||||
#if HAS_PREHEAT
|
||||
#ifdef PREHEAT_1_TEMP_HOTEND
|
||||
int16_t HotendPidT = PREHEAT_1_TEMP_HOTEND;
|
||||
int16_t PidCycles = 10;
|
||||
#endif
|
||||
#ifdef PREHEAT_1_TEMP_BED
|
||||
int16_t BedPidT = PREHEAT_1_TEMP_BED;
|
||||
#endif
|
||||
#endif
|
||||
#if ENABLED(PREVENT_COLD_EXTRUSION)
|
||||
int16_t ExtMinT = EXTRUDE_MINTEMP;
|
||||
|
||||
@@ -76,10 +76,6 @@
|
||||
#include "../../../module/probe.h"
|
||||
#endif
|
||||
|
||||
#if ANY(HAS_HOTEND, HAS_HEATED_BED, HAS_FAN) && PREHEAT_COUNT
|
||||
#define HAS_PREHEAT 1
|
||||
#endif
|
||||
|
||||
#if ENABLED(POWER_LOSS_RECOVERY)
|
||||
#include "../../../feature/powerloss.h"
|
||||
#endif
|
||||
@@ -1034,7 +1030,7 @@ void CrealityDWINClass::Menu_Item_Handler(uint8_t menu, uint8_t item, bool draw/
|
||||
#define PREPARE_MANUALLEVEL (PREPARE_HOME + 1)
|
||||
#define PREPARE_ZOFFSET (PREPARE_MANUALLEVEL + ENABLED(HAS_ZOFFSET_ITEM))
|
||||
#define PREPARE_PREHEAT (PREPARE_ZOFFSET + ENABLED(HAS_PREHEAT))
|
||||
#define PREPARE_COOLDOWN (PREPARE_PREHEAT + ENABLED(HAS_PREHEAT))
|
||||
#define PREPARE_COOLDOWN (PREPARE_PREHEAT + EITHER(HAS_HOTEND, HAS_HEATED_BED))
|
||||
#define PREPARE_CHANGEFIL (PREPARE_COOLDOWN + ENABLED(ADVANCED_PAUSE_FEATURE))
|
||||
#define PREPARE_TOTAL PREPARE_CHANGEFIL
|
||||
|
||||
@@ -1100,13 +1096,14 @@ void CrealityDWINClass::Menu_Item_Handler(uint8_t menu, uint8_t item, bool draw/
|
||||
else
|
||||
Draw_Menu(Preheat);
|
||||
break;
|
||||
#endif
|
||||
|
||||
#if HAS_HOTEND || HAS_HEATED_BED
|
||||
case PREPARE_COOLDOWN:
|
||||
if (draw)
|
||||
Draw_Menu_Item(row, ICON_Cool, F("Cooldown"));
|
||||
else {
|
||||
TERN_(HAS_FAN, thermalManager.zero_fan_speeds());
|
||||
thermalManager.disable_all_heaters();
|
||||
}
|
||||
else
|
||||
thermalManager.cooldown();
|
||||
break;
|
||||
#endif
|
||||
|
||||
@@ -1588,18 +1585,24 @@ void CrealityDWINClass::Menu_Item_Handler(uint8_t menu, uint8_t item, bool draw/
|
||||
}
|
||||
break;
|
||||
#endif
|
||||
#if HAS_PREHEAT
|
||||
case Preheat:
|
||||
|
||||
#if HAS_PREHEAT
|
||||
case Preheat: {
|
||||
#define PREHEAT_BACK 0
|
||||
#define PREHEAT_MODE (PREHEAT_BACK + 1)
|
||||
#define PREHEAT_1 (PREHEAT_MODE + (PREHEAT_COUNT >= 1))
|
||||
#define PREHEAT_1 (PREHEAT_MODE + 1)
|
||||
#define PREHEAT_2 (PREHEAT_1 + (PREHEAT_COUNT >= 2))
|
||||
#define PREHEAT_3 (PREHEAT_2 + (PREHEAT_COUNT >= 3))
|
||||
#define PREHEAT_4 (PREHEAT_3 + (PREHEAT_COUNT >= 4))
|
||||
#define PREHEAT_5 (PREHEAT_4 + (PREHEAT_COUNT >= 5))
|
||||
#define PREHEAT_TOTAL PREHEAT_5
|
||||
|
||||
auto do_preheat = [](const uint8_t m) {
|
||||
thermalManager.cooldown();
|
||||
if (preheatmode == 0 || preheatmode == 1) { ui.preheat_hotend_and_fan(m); }
|
||||
if (preheatmode == 0 || preheatmode == 2) ui.preheat_bed(m);
|
||||
};
|
||||
|
||||
switch (item) {
|
||||
case PREHEAT_BACK:
|
||||
if (draw)
|
||||
@@ -1620,17 +1623,8 @@ void CrealityDWINClass::Menu_Item_Handler(uint8_t menu, uint8_t item, bool draw/
|
||||
case PREHEAT_1:
|
||||
if (draw)
|
||||
Draw_Menu_Item(row, ICON_Temperature, F(PREHEAT_1_LABEL));
|
||||
else {
|
||||
thermalManager.disable_all_heaters();
|
||||
TERN_(HAS_FAN, thermalManager.zero_fan_speeds());
|
||||
if (preheatmode == 0 || preheatmode == 1) {
|
||||
TERN_(HAS_HOTEND, thermalManager.setTargetHotend(ui.material_preset[0].hotend_temp, 0));
|
||||
TERN_(HAS_FAN, thermalManager.set_fan_speed(0, ui.material_preset[0].fan_speed));
|
||||
}
|
||||
#if HAS_HEATED_BED
|
||||
if (preheatmode == 0 || preheatmode == 2) thermalManager.setTargetBed(ui.material_preset[0].bed_temp);
|
||||
#endif
|
||||
}
|
||||
else
|
||||
do_preheat(0);
|
||||
break;
|
||||
#endif
|
||||
|
||||
@@ -1638,17 +1632,8 @@ void CrealityDWINClass::Menu_Item_Handler(uint8_t menu, uint8_t item, bool draw/
|
||||
case PREHEAT_2:
|
||||
if (draw)
|
||||
Draw_Menu_Item(row, ICON_Temperature, F(PREHEAT_2_LABEL));
|
||||
else {
|
||||
thermalManager.disable_all_heaters();
|
||||
TERN_(HAS_FAN, thermalManager.zero_fan_speeds());
|
||||
if (preheatmode == 0 || preheatmode == 1) {
|
||||
TERN_(HAS_HOTEND, thermalManager.setTargetHotend(ui.material_preset[1].hotend_temp, 0));
|
||||
TERN_(HAS_FAN, thermalManager.set_fan_speed(0, ui.material_preset[1].fan_speed));
|
||||
}
|
||||
#if HAS_HEATED_BED
|
||||
if (preheatmode == 0 || preheatmode == 2) thermalManager.setTargetBed(ui.material_preset[1].bed_temp);
|
||||
#endif
|
||||
}
|
||||
else
|
||||
do_preheat(1);
|
||||
break;
|
||||
#endif
|
||||
|
||||
@@ -1656,17 +1641,8 @@ void CrealityDWINClass::Menu_Item_Handler(uint8_t menu, uint8_t item, bool draw/
|
||||
case PREHEAT_3:
|
||||
if (draw)
|
||||
Draw_Menu_Item(row, ICON_Temperature, F(PREHEAT_3_LABEL));
|
||||
else {
|
||||
thermalManager.disable_all_heaters();
|
||||
TERN_(HAS_FAN, thermalManager.zero_fan_speeds());
|
||||
if (preheatmode == 0 || preheatmode == 1) {
|
||||
TERN_(HAS_HOTEND, thermalManager.setTargetHotend(ui.material_preset[2].hotend_temp, 0));
|
||||
TERN_(HAS_FAN, thermalManager.set_fan_speed(0, ui.material_preset[2].fan_speed));
|
||||
}
|
||||
#if HAS_HEATED_BED
|
||||
if (preheatmode == 0 || preheatmode == 2) thermalManager.setTargetBed(ui.material_preset[2].bed_temp);
|
||||
#endif
|
||||
}
|
||||
else
|
||||
do_preheat(2);
|
||||
break;
|
||||
#endif
|
||||
|
||||
@@ -1674,17 +1650,8 @@ void CrealityDWINClass::Menu_Item_Handler(uint8_t menu, uint8_t item, bool draw/
|
||||
case PREHEAT_4:
|
||||
if (draw)
|
||||
Draw_Menu_Item(row, ICON_Temperature, F(PREHEAT_4_LABEL));
|
||||
else {
|
||||
thermalManager.disable_all_heaters();
|
||||
TERN_(HAS_FAN, thermalManager.zero_fan_speeds());
|
||||
if (preheatmode == 0 || preheatmode == 1) {
|
||||
TERN_(HAS_HOTEND, thermalManager.setTargetHotend(ui.material_preset[3].hotend_temp, 0));
|
||||
TERN_(HAS_FAN, thermalManager.set_fan_speed(0, ui.material_preset[3].fan_speed));
|
||||
}
|
||||
#if HAS_HEATED_BED
|
||||
if (preheatmode == 0 || preheatmode == 2) thermalManager.setTargetBed(ui.material_preset[3].bed_temp);
|
||||
#endif
|
||||
}
|
||||
else
|
||||
do_preheat(3);
|
||||
break;
|
||||
#endif
|
||||
|
||||
@@ -1692,22 +1659,13 @@ void CrealityDWINClass::Menu_Item_Handler(uint8_t menu, uint8_t item, bool draw/
|
||||
case PREHEAT_5:
|
||||
if (draw)
|
||||
Draw_Menu_Item(row, ICON_Temperature, F(PREHEAT_5_LABEL));
|
||||
else {
|
||||
thermalManager.disable_all_heaters();
|
||||
TERN_(HAS_FAN, thermalManager.zero_fan_speeds());
|
||||
if (preheatmode == 0 || preheatmode == 1) {
|
||||
TERN_(HAS_HOTEND, thermalManager.setTargetHotend(ui.material_preset[4].hotend_temp, 0));
|
||||
TERN_(HAS_FAN, thermalManager.set_fan_speed(0, ui.material_preset[4].fan_speed));
|
||||
}
|
||||
#if HAS_HEATED_BED
|
||||
if (preheatmode == 0 || preheatmode == 2) thermalManager.setTargetBed(ui.material_preset[4].bed_temp);
|
||||
#endif
|
||||
}
|
||||
else
|
||||
do_preheat(4);
|
||||
break;
|
||||
#endif
|
||||
}
|
||||
break;
|
||||
#endif
|
||||
} break;
|
||||
#endif // HAS_PREHEAT
|
||||
|
||||
#if ENABLED(FILAMENT_LOAD_UNLOAD_GCODES)
|
||||
case ChangeFilament:
|
||||
@@ -3968,50 +3926,40 @@ void CrealityDWINClass::Menu_Item_Handler(uint8_t menu, uint8_t item, bool draw/
|
||||
case PREHEATHOTEND_1:
|
||||
if (draw)
|
||||
Draw_Menu_Item(row, ICON_Temperature, F(PREHEAT_1_LABEL));
|
||||
else {
|
||||
thermalManager.setTargetHotend(ui.material_preset[0].hotend_temp, 0);
|
||||
thermalManager.set_fan_speed(0, ui.material_preset[0].fan_speed);
|
||||
}
|
||||
else
|
||||
ui.preheat_hotend_and_fan(0);
|
||||
break;
|
||||
#endif
|
||||
#if PREHEAT_COUNT >= 2
|
||||
case PREHEATHOTEND_2:
|
||||
if (draw)
|
||||
Draw_Menu_Item(row, ICON_Temperature, F(PREHEAT_2_LABEL));
|
||||
else {
|
||||
thermalManager.setTargetHotend(ui.material_preset[1].hotend_temp, 0);
|
||||
thermalManager.set_fan_speed(0, ui.material_preset[1].fan_speed);
|
||||
}
|
||||
else
|
||||
ui.preheat_hotend_and_fan(1);
|
||||
break;
|
||||
#endif
|
||||
#if PREHEAT_COUNT >= 3
|
||||
case PREHEATHOTEND_3:
|
||||
if (draw)
|
||||
Draw_Menu_Item(row, ICON_Temperature, F(PREHEAT_3_LABEL));
|
||||
else {
|
||||
thermalManager.setTargetHotend(ui.material_preset[2].hotend_temp, 0);
|
||||
thermalManager.set_fan_speed(0, ui.material_preset[2].fan_speed);
|
||||
}
|
||||
else
|
||||
ui.preheat_hotend_and_fan(2);
|
||||
break;
|
||||
#endif
|
||||
#if PREHEAT_COUNT >= 4
|
||||
case PREHEATHOTEND_4:
|
||||
if (draw)
|
||||
Draw_Menu_Item(row, ICON_Temperature, F(PREHEAT_4_LABEL));
|
||||
else {
|
||||
thermalManager.setTargetHotend(ui.material_preset[3].hotend_temp, 0);
|
||||
thermalManager.set_fan_speed(0, ui.material_preset[3].fan_speed);
|
||||
}
|
||||
else
|
||||
ui.preheat_hotend_and_fan(3);
|
||||
break;
|
||||
#endif
|
||||
#if PREHEAT_COUNT >= 5
|
||||
case PREHEATHOTEND_5:
|
||||
if (draw)
|
||||
Draw_Menu_Item(row, ICON_Temperature, F(PREHEAT_5_LABEL));
|
||||
else {
|
||||
thermalManager.setTargetHotend(ui.material_preset[4].hotend_temp, 0);
|
||||
thermalManager.set_fan_speed(0, ui.material_preset[4].fan_speed);
|
||||
}
|
||||
else
|
||||
ui.preheat_hotend_and_fan(4);
|
||||
break;
|
||||
#endif
|
||||
case PREHEATHOTEND_CUSTOM:
|
||||
@@ -4548,8 +4496,7 @@ void CrealityDWINClass::Popup_Control() {
|
||||
TERN_(HAS_HOTEND, pausetemp = thermalManager.temp_hotend[0].target);
|
||||
TERN_(HAS_HEATED_BED, pausebed = thermalManager.temp_bed.target);
|
||||
TERN_(HAS_FAN, pausefan = thermalManager.fan_speed[0]);
|
||||
thermalManager.disable_all_heaters();
|
||||
TERN_(HAS_FAN, thermalManager.zero_fan_speeds());
|
||||
thermalManager.cooldown();
|
||||
#endif
|
||||
}
|
||||
else {
|
||||
@@ -4562,8 +4509,7 @@ void CrealityDWINClass::Popup_Control() {
|
||||
if (selection == 0) {
|
||||
if (sdprint) {
|
||||
ui.abort_print();
|
||||
TERN_(HAS_FAN, thermalManager.zero_fan_speeds());
|
||||
thermalManager.disable_all_heaters();
|
||||
thermalManager.cooldown();
|
||||
}
|
||||
else {
|
||||
TERN_(HOST_ACTION_COMMANDS, hostui.cancel());
|
||||
@@ -4793,8 +4739,7 @@ void CrealityDWINClass::Start_Print(bool sd) {
|
||||
void CrealityDWINClass::Stop_Print() {
|
||||
printing = false;
|
||||
sdprint = false;
|
||||
TERN_(HAS_FAN, thermalManager.zero_fan_speeds());
|
||||
thermalManager.disable_all_heaters();
|
||||
thermalManager.cooldown();
|
||||
TERN_(LCD_SET_PROGRESS_MANUALLY, ui.set_progress(100 * (PROGRESS_SCALE)));
|
||||
TERN_(USE_M73_REMAINING_TIME, ui.set_remaining_time(0));
|
||||
Draw_Print_confirm();
|
||||
|
||||
@@ -132,20 +132,19 @@ FORCE_INLINE void _draw_fan_status(const uint16_t x, const uint16_t y) {
|
||||
}
|
||||
}
|
||||
|
||||
#if HOTENDS > 2
|
||||
#define HOTEND_STATS 3
|
||||
#elif HOTENDS > 1
|
||||
#define HOTEND_STATS 2
|
||||
#elif HAS_HOTEND
|
||||
#define HOTEND_STATS 1
|
||||
#endif
|
||||
|
||||
/**
|
||||
* Draw a single heater icon with current and target temperature, at the given XY
|
||||
*/
|
||||
FORCE_INLINE void _draw_heater_status(const heater_id_t heater, const uint16_t x, const uint16_t y) {
|
||||
|
||||
#if HAS_HOTEND
|
||||
#if HOTENDS > 2
|
||||
#define HOTEND_STATS 3
|
||||
#elif HOTENDS > 1
|
||||
#define HOTEND_STATS 2
|
||||
#elif HAS_HOTEND
|
||||
#define HOTEND_STATS 1
|
||||
#endif
|
||||
static celsius_t old_temp[HOTEND_STATS] = ARRAY_N_1(HOTEND_STATS, 500),
|
||||
old_target[HOTEND_STATS] = ARRAY_N_1(HOTEND_STATS, 500);
|
||||
static bool old_on[HOTEND_STATS] = ARRAY_N_1(HOTEND_STATS, false);
|
||||
|
||||
@@ -185,7 +185,7 @@ void DGUSScreenHandler::DGUSLCD_SendStringToDisplayPGM(DGUS_VP_Variable &var) {
|
||||
case VP_E0_PID_I: valuesend = unscalePID_i(value); break;
|
||||
case VP_E0_PID_D: valuesend = unscalePID_d(value); break;
|
||||
#endif
|
||||
#if HOTENDS >= 2
|
||||
#if HAS_MULTI_HOTEND
|
||||
case VP_E1_PID_P: valuesend = value; break;
|
||||
case VP_E1_PID_I: valuesend = unscalePID_i(value); break;
|
||||
case VP_E1_PID_D: valuesend = unscalePID_d(value); break;
|
||||
@@ -400,7 +400,7 @@ void DGUSScreenHandler::HandleTemperatureChanged(DGUS_VP_Variable &var, void *va
|
||||
acceptedvalue = thermalManager.degTargetHotend(0);
|
||||
break;
|
||||
#endif
|
||||
#if HOTENDS >= 2
|
||||
#if HAS_MULTI_HOTEND
|
||||
case VP_T_E1_Set:
|
||||
NOMORE(newvalue, HEATER_1_MAXTEMP);
|
||||
thermalManager.setTargetHotend(newvalue, 1);
|
||||
@@ -551,7 +551,7 @@ void DGUSScreenHandler::HandleStepPerMMExtruderChanged(DGUS_VP_Variable &var, vo
|
||||
sprintf_P(buf, PSTR("M303 E%d C5 S210 U1"), ExtUI::extruder_t::E0);
|
||||
break;
|
||||
#endif
|
||||
#if HOTENDS >= 2
|
||||
#if HAS_MULTI_HOTEND
|
||||
case VP_PID_AUTOTUNE_E1:
|
||||
sprintf_P(buf, PSTR("M303 E%d C5 S210 U1"), ExtUI::extruder_t::E1);
|
||||
break;
|
||||
@@ -598,7 +598,7 @@ void DGUSScreenHandler::HandleHeaterControl(DGUS_VP_Variable &var, void *val_ptr
|
||||
switch (var.VP) {
|
||||
#if HAS_HOTEND
|
||||
case VP_E0_CONTROL:
|
||||
#if HOTENDS >= 2
|
||||
#if HAS_MULTI_HOTEND
|
||||
case VP_E1_CONTROL:
|
||||
#if HOTENDS >= 3
|
||||
case VP_E2_CONTROL:
|
||||
@@ -621,55 +621,16 @@ void DGUSScreenHandler::HandleHeaterControl(DGUS_VP_Variable &var, void *val_ptr
|
||||
void DGUSScreenHandler::HandlePreheat(DGUS_VP_Variable &var, void *val_ptr) {
|
||||
DEBUG_ECHOLNPGM("HandlePreheat");
|
||||
|
||||
uint8_t e_temp = 0;
|
||||
#if HAS_HEATED_BED
|
||||
uint8_t bed_temp = 0;
|
||||
#endif
|
||||
const uint16_t preheat_option = swap16(*(uint16_t*)val_ptr);
|
||||
switch (preheat_option) {
|
||||
default:
|
||||
case 0: // Preheat PLA
|
||||
#if defined(PREHEAT_1_TEMP_HOTEND) && defined(PREHEAT_1_TEMP_BED)
|
||||
e_temp = PREHEAT_1_TEMP_HOTEND;
|
||||
TERN_(HAS_HEATED_BED, bed_temp = PREHEAT_1_TEMP_BED);
|
||||
#endif
|
||||
break;
|
||||
case 1: // Preheat ABS
|
||||
#if defined(PREHEAT_2_TEMP_HOTEND) && defined(PREHEAT_2_TEMP_BED)
|
||||
e_temp = PREHEAT_2_TEMP_HOTEND;
|
||||
TERN_(HAS_HEATED_BED, bed_temp = PREHEAT_2_TEMP_BED);
|
||||
#endif
|
||||
break;
|
||||
case 2: // Preheat PET
|
||||
#if defined(PREHEAT_3_TEMP_HOTEND) && defined(PREHEAT_3_TEMP_BED)
|
||||
e_temp = PREHEAT_3_TEMP_HOTEND;
|
||||
TERN_(HAS_HEATED_BED, bed_temp = PREHEAT_3_TEMP_BED);
|
||||
#endif
|
||||
break;
|
||||
case 3: // Preheat FLEX
|
||||
#if defined(PREHEAT_4_TEMP_HOTEND) && defined(PREHEAT_4_TEMP_BED)
|
||||
e_temp = PREHEAT_4_TEMP_HOTEND;
|
||||
TERN_(HAS_HEATED_BED, bed_temp = PREHEAT_4_TEMP_BED);
|
||||
#endif
|
||||
break;
|
||||
switch (var.VP) {
|
||||
default: return;
|
||||
case VP_E0_BED_PREHEAT: TERN_(HAS_HOTEND, ui.preheat_all(0)); break;
|
||||
case VP_E1_BED_PREHEAT: TERN_(HAS_MULTI_HOTEND, ui.preheat_all(1)); break;
|
||||
}
|
||||
case 7: break; // Custom preheat
|
||||
case 9: break; // Cool down
|
||||
}
|
||||
|
||||
switch (var.VP) {
|
||||
default: return;
|
||||
#if HAS_HOTEND
|
||||
case VP_E0_BED_PREHEAT:
|
||||
thermalManager.setTargetHotend(e_temp, 0);
|
||||
TERN_(HAS_HEATED_BED, thermalManager.setTargetBed(bed_temp));
|
||||
break;
|
||||
#endif
|
||||
#if HOTENDS >= 2
|
||||
case VP_E1_BED_PREHEAT:
|
||||
thermalManager.setTargetHotend(e_temp, 1);
|
||||
TERN_(HAS_HEATED_BED, thermalManager.setTargetBed(bed_temp));
|
||||
break;
|
||||
#endif
|
||||
case 9: thermalManager.cooldown(); break; // Cool down
|
||||
}
|
||||
|
||||
// Go to the preheat screen to show the heating progress
|
||||
|
||||
@@ -51,7 +51,7 @@ const uint16_t VPList_Main[] PROGMEM = {
|
||||
#if HAS_HOTEND
|
||||
VP_T_E0_Is, VP_T_E0_Set, VP_E0_STATUS,
|
||||
#endif
|
||||
#if HOTENDS >= 2
|
||||
#if HAS_MULTI_HOTEND
|
||||
VP_T_E1_Is, VP_T_E1_Set,
|
||||
#endif
|
||||
#if HAS_HEATED_BED
|
||||
@@ -73,7 +73,7 @@ const uint16_t VPList_Temp[] PROGMEM = {
|
||||
#if HAS_HOTEND
|
||||
VP_T_E0_Is, VP_T_E0_Set,
|
||||
#endif
|
||||
#if HOTENDS >= 2
|
||||
#if HAS_MULTI_HOTEND
|
||||
VP_T_E1_Is, VP_T_E1_Set,
|
||||
#endif
|
||||
#if HAS_HEATED_BED
|
||||
@@ -87,7 +87,7 @@ const uint16_t VPList_Status[] PROGMEM = {
|
||||
#if HAS_HOTEND
|
||||
VP_T_E0_Is, VP_T_E0_Set,
|
||||
#endif
|
||||
#if HOTENDS >= 2
|
||||
#if HAS_MULTI_HOTEND
|
||||
VP_T_E1_Is, VP_T_E1_Set,
|
||||
#endif
|
||||
#if HAS_HEATED_BED
|
||||
@@ -120,7 +120,7 @@ const uint16_t VPList_Preheat[] PROGMEM = {
|
||||
#if HAS_HOTEND
|
||||
VP_T_E0_Is, VP_T_E0_Set,
|
||||
#endif
|
||||
#if HOTENDS >= 2
|
||||
#if HAS_MULTI_HOTEND
|
||||
VP_T_E1_Is, VP_T_E1_Set,
|
||||
#endif
|
||||
#if HAS_HEATED_BED
|
||||
@@ -187,7 +187,7 @@ const uint16_t VPList_SD_PrintManipulation[] PROGMEM = {
|
||||
#if HAS_HOTEND
|
||||
VP_T_E0_Is, VP_T_E0_Set,
|
||||
#endif
|
||||
#if HOTENDS >= 2
|
||||
#if HAS_MULTI_HOTEND
|
||||
VP_T_E1_Is, VP_T_E1_Set,
|
||||
#endif
|
||||
#if HAS_HEATED_BED
|
||||
@@ -379,7 +379,7 @@ const struct DGUS_VP_Variable ListOfVP[] PROGMEM = {
|
||||
VPHELPER(VP_E0_FILAMENT_LOAD_UNLOAD, nullptr, ScreenHandler.HandleFilamentOption, ScreenHandler.HandleFilamentLoadUnload),
|
||||
#endif
|
||||
#endif
|
||||
#if HOTENDS >= 2
|
||||
#if HAS_MULTI_HOTEND
|
||||
VPHELPER(VP_T_E1_Is, &thermalManager.temp_hotend[1].celsius, nullptr, ScreenHandler.DGUSLCD_SendFloatAsLongValueToDisplay<0>),
|
||||
VPHELPER(VP_T_E1_Set, &thermalManager.temp_hotend[1].target, ScreenHandler.HandleTemperatureChanged, ScreenHandler.DGUSLCD_SendWordValueToDisplay),
|
||||
VPHELPER(VP_Flowrate_E1, &planner.flow_percentage[ExtUI::extruder_t::E1], ScreenHandler.HandleFlowRateChanged, ScreenHandler.DGUSLCD_SendWordValueToDisplay), // ERROR: Flow is per-extruder, not per-hotend
|
||||
|
||||
@@ -256,7 +256,7 @@ void DGUSScreenHandler::HandleManualMove(DGUS_VP_Variable &var, void *val_ptr) {
|
||||
case VP_E0_PID_I: newvalue = scalePID_i(value); break;
|
||||
case VP_E0_PID_D: newvalue = scalePID_d(value); break;
|
||||
#endif
|
||||
#if HOTENDS >= 2
|
||||
#if HAS_MULTI_HOTEND
|
||||
case VP_E1_PID_P: newvalue = value; break;
|
||||
case VP_E1_PID_I: newvalue = scalePID_i(value); break;
|
||||
case VP_E1_PID_D: newvalue = scalePID_d(value); break;
|
||||
@@ -334,7 +334,7 @@ void DGUSScreenHandler::HandleManualMove(DGUS_VP_Variable &var, void *val_ptr) {
|
||||
#if HAS_HOTEND
|
||||
thermalManager.setTargetHotend(e_temp, ExtUI::extruder_t::E0);
|
||||
#endif
|
||||
#if HOTENDS >= 2
|
||||
#if HAS_MULTI_HOTEND
|
||||
thermalManager.setTargetHotend(e_temp, ExtUI::extruder_t::E1);
|
||||
#endif
|
||||
GotoScreen(DGUSLCD_SCREEN_UTILITY);
|
||||
|
||||
@@ -50,7 +50,7 @@ const uint16_t VPList_Main[] PROGMEM = {
|
||||
// VP_M117, for completeness, but it cannot be auto-uploaded.
|
||||
#if HAS_HOTEND
|
||||
VP_T_E0_Is, VP_T_E0_Set, VP_E0_STATUS,
|
||||
#if HOTENDS >= 2
|
||||
#if HAS_MULTI_HOTEND
|
||||
VP_T_E1_Is, VP_T_E1_Set,
|
||||
#endif
|
||||
#endif
|
||||
@@ -72,7 +72,7 @@ const uint16_t VPList_Main[] PROGMEM = {
|
||||
const uint16_t VPList_Temp[] PROGMEM = {
|
||||
#if HAS_HOTEND
|
||||
VP_T_E0_Is, VP_T_E0_Set,
|
||||
#if HOTENDS >= 2
|
||||
#if HAS_MULTI_HOTEND
|
||||
VP_T_E1_Is, VP_T_E1_Set,
|
||||
#endif
|
||||
#endif
|
||||
@@ -86,7 +86,7 @@ const uint16_t VPList_Status[] PROGMEM = {
|
||||
// VP_M117, for completeness, but it cannot be auto-uploaded
|
||||
#if HAS_HOTEND
|
||||
VP_T_E0_Is, VP_T_E0_Set,
|
||||
#if HOTENDS >= 2
|
||||
#if HAS_MULTI_HOTEND
|
||||
VP_T_E1_Is, VP_T_E1_Set,
|
||||
#endif
|
||||
#endif
|
||||
@@ -107,7 +107,7 @@ const uint16_t VPList_Status2[] PROGMEM = {
|
||||
// VP_M117, for completeness, but it cannot be auto-uploaded
|
||||
#if HAS_HOTEND
|
||||
VP_Flowrate_E0,
|
||||
#if HOTENDS >= 2
|
||||
#if HAS_MULTI_HOTEND
|
||||
VP_Flowrate_E1,
|
||||
#endif
|
||||
#endif
|
||||
@@ -119,7 +119,7 @@ const uint16_t VPList_Status2[] PROGMEM = {
|
||||
const uint16_t VPList_Preheat[] PROGMEM = {
|
||||
#if HAS_HOTEND
|
||||
VP_T_E0_Is, VP_T_E0_Set,
|
||||
#if HOTENDS >= 2
|
||||
#if HAS_MULTI_HOTEND
|
||||
VP_T_E1_Is, VP_T_E1_Set,
|
||||
#endif
|
||||
#endif
|
||||
@@ -137,7 +137,7 @@ const uint16_t VPList_ManualMove[] PROGMEM = {
|
||||
const uint16_t VPList_ManualExtrude[] PROGMEM = {
|
||||
#if HAS_HOTEND
|
||||
VP_T_E0_Is, VP_T_E0_Set,
|
||||
#if HOTENDS >= 2
|
||||
#if HAS_MULTI_HOTEND
|
||||
VP_T_E1_Is, VP_T_E1_Set,
|
||||
#endif
|
||||
#endif
|
||||
@@ -159,7 +159,7 @@ const uint16_t VPList_Filament_heating[] PROGMEM = {
|
||||
#if HAS_HOTEND
|
||||
VP_T_E0_Is, VP_T_E0_Set,
|
||||
VP_E0_FILAMENT_LOAD_UNLOAD,
|
||||
#if HOTENDS >= 2
|
||||
#if HAS_MULTI_HOTEND
|
||||
VP_T_E1_Is, VP_T_E1_Set,
|
||||
#endif
|
||||
#endif
|
||||
@@ -169,7 +169,7 @@ const uint16_t VPList_Filament_heating[] PROGMEM = {
|
||||
const uint16_t VPList_Filament_load_unload[] PROGMEM = {
|
||||
#if HAS_HOTEND
|
||||
VP_E0_FILAMENT_LOAD_UNLOAD,
|
||||
#if HOTENDS >= 2
|
||||
#if HAS_MULTI_HOTEND
|
||||
VP_E1_FILAMENT_LOAD_UNLOAD,
|
||||
#endif
|
||||
#endif
|
||||
@@ -185,7 +185,7 @@ const uint16_t VPList_SD_PrintManipulation[] PROGMEM = {
|
||||
VP_PrintProgress_Percentage, VP_PrintTime,
|
||||
#if HAS_HOTEND
|
||||
VP_T_E0_Is, VP_T_E0_Set,
|
||||
#if HOTENDS >= 2
|
||||
#if HAS_MULTI_HOTEND
|
||||
VP_T_E1_Is, VP_T_E1_Set,
|
||||
#endif
|
||||
#endif
|
||||
@@ -205,7 +205,7 @@ const uint16_t VPList_SD_PrintManipulation[] PROGMEM = {
|
||||
const uint16_t VPList_SDPrintTune[] PROGMEM = {
|
||||
#if HAS_HOTEND
|
||||
VP_T_E0_Is, VP_T_E0_Set,
|
||||
#if HOTENDS >= 2
|
||||
#if HAS_MULTI_HOTEND
|
||||
VP_T_E1_Is, VP_T_E1_Set,
|
||||
#endif
|
||||
#endif
|
||||
@@ -222,23 +222,17 @@ const uint16_t VPList_SDPrintTune[] PROGMEM = {
|
||||
};
|
||||
|
||||
const uint16_t VPList_StepPerMM[] PROGMEM = {
|
||||
VP_X_STEP_PER_MM,
|
||||
VP_Y_STEP_PER_MM,
|
||||
VP_Z_STEP_PER_MM,
|
||||
#if HAS_HOTEND
|
||||
VP_E0_STEP_PER_MM,
|
||||
#if HOTENDS >= 2
|
||||
VP_E1_STEP_PER_MM,
|
||||
#endif
|
||||
#endif
|
||||
0x0000
|
||||
VP_X_STEP_PER_MM
|
||||
, VP_Y_STEP_PER_MM
|
||||
, VP_Z_STEP_PER_MM
|
||||
OPTARG(HAS_HOTEND, VP_E0_STEP_PER_MM)
|
||||
OPTARG(HAS_MULTI_HOTEND, VP_E1_STEP_PER_MM)
|
||||
, 0x0000
|
||||
};
|
||||
|
||||
const uint16_t VPList_PIDE0[] PROGMEM = {
|
||||
#if ENABLED(PIDTEMP)
|
||||
VP_E0_PID_P,
|
||||
VP_E0_PID_I,
|
||||
VP_E0_PID_D,
|
||||
VP_E0_PID_P, VP_E0_PID_I, VP_E0_PID_D,
|
||||
#endif
|
||||
0x0000
|
||||
};
|
||||
@@ -382,7 +376,7 @@ const struct DGUS_VP_Variable ListOfVP[] PROGMEM = {
|
||||
VPHELPER(VP_PID_AUTOTUNE_E0, nullptr, ScreenHandler.HandlePIDAutotune, nullptr),
|
||||
#endif
|
||||
#endif
|
||||
#if HOTENDS >= 2
|
||||
#if HAS_MULTI_HOTEND
|
||||
VPHELPER(VP_T_E1_Is, &thermalManager.temp_hotend[1].celsius, nullptr, ScreenHandler.DGUSLCD_SendFloatAsLongValueToDisplay<0>),
|
||||
VPHELPER(VP_T_E1_Set, &thermalManager.temp_hotend[1].target, ScreenHandler.HandleTemperatureChanged, ScreenHandler.DGUSLCD_SendWordValueToDisplay),
|
||||
VPHELPER(VP_Flowrate_E1, nullptr, ScreenHandler.HandleFlowRateChanged, ScreenHandler.DGUSLCD_SendWordValueToDisplay),
|
||||
@@ -435,7 +429,7 @@ const struct DGUS_VP_Variable ListOfVP[] PROGMEM = {
|
||||
VPHELPER(VP_Z_STEP_PER_MM, &planner.settings.axis_steps_per_mm[Z_AXIS], ScreenHandler.HandleStepPerMMChanged, ScreenHandler.DGUSLCD_SendFloatAsIntValueToDisplay<1>),
|
||||
#if HAS_HOTEND
|
||||
VPHELPER(VP_E0_STEP_PER_MM, &planner.settings.axis_steps_per_mm[E_AXIS_N(0)], ScreenHandler.HandleStepPerMMExtruderChanged, ScreenHandler.DGUSLCD_SendFloatAsIntValueToDisplay<1>),
|
||||
#if HOTENDS >= 2
|
||||
#if HAS_MULTI_HOTEND
|
||||
VPHELPER(VP_E1_STEP_PER_MM, &planner.settings.axis_steps_per_mm[E_AXIS_N(1)], ScreenHandler.HandleStepPerMMExtruderChanged, ScreenHandler.DGUSLCD_SendFloatAsIntValueToDisplay<1>),
|
||||
#endif
|
||||
#endif
|
||||
|
||||
@@ -256,7 +256,7 @@ void DGUSScreenHandler::HandleManualMove(DGUS_VP_Variable &var, void *val_ptr) {
|
||||
case VP_E0_PID_I: newvalue = scalePID_i(value); break;
|
||||
case VP_E0_PID_D: newvalue = scalePID_d(value); break;
|
||||
#endif
|
||||
#if HOTENDS >= 2
|
||||
#if HAS_MULTI_HOTEND
|
||||
case VP_E1_PID_P: newvalue = value; break;
|
||||
case VP_E1_PID_I: newvalue = scalePID_i(value); break;
|
||||
case VP_E1_PID_D: newvalue = scalePID_d(value); break;
|
||||
@@ -333,7 +333,7 @@ void DGUSScreenHandler::HandleManualMove(DGUS_VP_Variable &var, void *val_ptr) {
|
||||
if (filament_data.action == 0) { // Go back to utility screen
|
||||
#if HAS_HOTEND
|
||||
thermalManager.setTargetHotend(e_temp, ExtUI::extruder_t::E0);
|
||||
#if HOTENDS >= 2
|
||||
#if HAS_MULTI_HOTEND
|
||||
thermalManager.setTargetHotend(e_temp, ExtUI::extruder_t::E1);
|
||||
#endif
|
||||
#endif
|
||||
@@ -348,7 +348,7 @@ void DGUSScreenHandler::HandleManualMove(DGUS_VP_Variable &var, void *val_ptr) {
|
||||
thermalManager.setTargetHotend(e_temp, filament_data.extruder);
|
||||
break;
|
||||
#endif
|
||||
#if HOTENDS >= 2
|
||||
#if HAS_MULTI_HOTEND
|
||||
case VP_E1_FILAMENT_LOAD_UNLOAD:
|
||||
filament_data.extruder = ExtUI::extruder_t::E1;
|
||||
thermalManager.setTargetHotend(e_temp, filament_data.extruder);
|
||||
|
||||
@@ -122,7 +122,7 @@ const uint16_t VPList_Main[] PROGMEM = {
|
||||
// VP_M117, for completeness, but it cannot be auto-uploaded.
|
||||
#if HAS_HOTEND
|
||||
MKSLIST_E_ITEM(0) VP_E0_STATUS,
|
||||
#if HOTENDS >= 2
|
||||
#if HAS_MULTI_HOTEND
|
||||
MKSLIST_E_ITEM(1) VP_E1_STATUS,
|
||||
#endif
|
||||
#endif
|
||||
@@ -567,7 +567,7 @@ const struct DGUS_VP_Variable ListOfVP[] PROGMEM = {
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#if HOTENDS >= 2
|
||||
#if HAS_MULTI_HOTEND
|
||||
VPHELPER(VP_T_E1_Is, &thermalManager.temp_hotend[1].celsius, nullptr, ScreenHandler.DGUSLCD_SendFloatAsLongValueToDisplay<0>),
|
||||
VPHELPER(VP_T_E1_Set, &thermalManager.temp_hotend[1].target, ScreenHandler.HandleTemperatureChanged, ScreenHandler.DGUSLCD_SendWordValueToDisplay),
|
||||
VPHELPER(VP_Flowrate_E1, &planner.flow_percentage[ExtUI::extruder_t::E1], ScreenHandler.HandleFlowRateChanged, ScreenHandler.DGUSLCD_SendWordValueToDisplay),
|
||||
@@ -656,7 +656,7 @@ const struct DGUS_VP_Variable ListOfVP[] PROGMEM = {
|
||||
|
||||
#if HAS_HOTEND
|
||||
VPHELPER(VP_E0_MAX_SPEED, &planner.settings.max_feedrate_mm_s[E_AXIS_N(0)], ScreenHandler.HandleExtruderMaxSpeedChange_MKS, ScreenHandler.DGUSLCD_SendFloatAsIntValueToDisplay<0>),
|
||||
#if HOTENDS >= 2
|
||||
#if HAS_MULTI_HOTEND
|
||||
VPHELPER(VP_E1_MAX_SPEED, &planner.settings.max_feedrate_mm_s[E_AXIS_N(1)], ScreenHandler.HandleExtruderMaxSpeedChange_MKS, ScreenHandler.DGUSLCD_SendFloatAsIntValueToDisplay<0>),
|
||||
#endif
|
||||
#endif
|
||||
@@ -667,7 +667,7 @@ const struct DGUS_VP_Variable ListOfVP[] PROGMEM = {
|
||||
|
||||
#if HAS_HOTEND
|
||||
VPHELPER(VP_E0_ACC_MAX_SPEED, (uint16_t *)&planner.settings.max_acceleration_mm_per_s2[E_AXIS_N(0)], ScreenHandler.HandleExtruderAccChange_MKS, ScreenHandler.DGUSLCD_SendWordValueToDisplay),
|
||||
#if HOTENDS >= 2
|
||||
#if HAS_MULTI_HOTEND
|
||||
VPHELPER(VP_E1_ACC_MAX_SPEED, (uint16_t *)&planner.settings.max_acceleration_mm_per_s2[E_AXIS_N(1)], ScreenHandler.HandleExtruderAccChange_MKS, ScreenHandler.DGUSLCD_SendWordValueToDisplay),
|
||||
#endif
|
||||
#endif
|
||||
@@ -744,7 +744,7 @@ const struct DGUS_VP_Variable ListOfVP[] PROGMEM = {
|
||||
|
||||
#if HAS_HOTEND
|
||||
VPHELPER(VP_E0_STEP_PER_MM, &planner.settings.axis_steps_per_mm[E_AXIS_N(0)], ScreenHandler.HandleStepPerMMExtruderChanged_MKS, ScreenHandler.DGUSLCD_SendFloatAsIntValueToDisplay<0>),
|
||||
#if HOTENDS >= 2
|
||||
#if HAS_MULTI_HOTEND
|
||||
VPHELPER(VP_E1_STEP_PER_MM, &planner.settings.axis_steps_per_mm[E_AXIS_N(1)], ScreenHandler.HandleStepPerMMExtruderChanged_MKS, ScreenHandler.DGUSLCD_SendFloatAsIntValueToDisplay<0>),
|
||||
#endif
|
||||
#endif
|
||||
|
||||
@@ -57,7 +57,7 @@ const uint16_t VPList_Main[] PROGMEM = {
|
||||
const uint16_t VPList_Temp[] PROGMEM = {
|
||||
#if HAS_HOTEND
|
||||
VP_T_E0_Is, VP_T_E0_Set,
|
||||
#if HOTENDS >= 2
|
||||
#if HAS_MULTI_HOTEND
|
||||
VP_T_E1_Is, VP_T_E1_Set,
|
||||
#endif
|
||||
#endif
|
||||
@@ -71,7 +71,7 @@ const uint16_t VPList_Status[] PROGMEM = {
|
||||
// VP_M117, for completeness, but it cannot be auto-uploaded
|
||||
#if HAS_HOTEND
|
||||
VP_T_E0_Is, VP_T_E0_Set,
|
||||
#if HOTENDS >= 2
|
||||
#if HAS_MULTI_HOTEND
|
||||
VP_T_E1_Is, VP_T_E1_Set,
|
||||
#endif
|
||||
#endif
|
||||
@@ -92,7 +92,7 @@ const uint16_t VPList_Status2[] PROGMEM = {
|
||||
// VP_M117, for completeness, but it cannot be auto-uploaded
|
||||
#if HAS_HOTEND
|
||||
VP_Flowrate_E0,
|
||||
#if HOTENDS >= 2
|
||||
#if HAS_MULTI_HOTEND
|
||||
VP_Flowrate_E1,
|
||||
#endif
|
||||
#endif
|
||||
@@ -182,7 +182,7 @@ const struct DGUS_VP_Variable ListOfVP[] PROGMEM = {
|
||||
VPHELPER(VP_E0_FILAMENT_LOAD_UNLOAD, nullptr, ScreenHandler.HandleFilamentOption, ScreenHandler.HandleFilamentLoadUnload),
|
||||
#endif
|
||||
#endif
|
||||
#if HOTENDS >= 2
|
||||
#if HAS_MULTI_HOTEND
|
||||
VPHELPER(VP_T_E1_Is, &thermalManager.temp_hotend[1].celsius, nullptr, ScreenHandler.DGUSLCD_SendFloatAsLongValueToDisplay<0>),
|
||||
VPHELPER(VP_T_E1_Set, &thermalManager.temp_hotend[1].target, ScreenHandler.HandleTemperatureChanged, ScreenHandler.DGUSLCD_SendWordValueToDisplay),
|
||||
VPHELPER(VP_Flowrate_E1, nullptr, ScreenHandler.HandleFlowRateChanged, ScreenHandler.DGUSLCD_SendWordValueToDisplay),
|
||||
@@ -237,7 +237,7 @@ const struct DGUS_VP_Variable ListOfVP[] PROGMEM = {
|
||||
VPHELPER(VP_Z_STEP_PER_MM, &planner.settings.axis_steps_per_mm[Z_AXIS], ScreenHandler.HandleStepPerMMChanged, ScreenHandler.DGUSLCD_SendFloatAsIntValueToDisplay<1>),
|
||||
#if HAS_HOTEND
|
||||
VPHELPER(VP_E0_STEP_PER_MM, &planner.settings.axis_steps_per_mm[E_AXIS_N(0)], ScreenHandler.HandleStepPerMMExtruderChanged, ScreenHandler.DGUSLCD_SendFloatAsIntValueToDisplay<1>),
|
||||
#if HOTENDS >= 2
|
||||
#if HAS_MULTI_HOTEND
|
||||
VPHELPER(VP_E1_STEP_PER_MM, &planner.settings.axis_steps_per_mm[E_AXIS_N(1)], ScreenHandler.HandleStepPerMMExtruderChanged, ScreenHandler.DGUSLCD_SendFloatAsIntValueToDisplay<1>),
|
||||
#endif
|
||||
#endif
|
||||
|
||||
@@ -256,7 +256,7 @@ void DGUSScreenHandler::HandleManualMove(DGUS_VP_Variable &var, void *val_ptr) {
|
||||
case VP_E0_PID_I: newvalue = scalePID_i(value); break;
|
||||
case VP_E0_PID_D: newvalue = scalePID_d(value); break;
|
||||
#endif
|
||||
#if HOTENDS >= 2
|
||||
#if HAS_MULTI_HOTEND
|
||||
case VP_E1_PID_P: newvalue = value; break;
|
||||
case VP_E1_PID_I: newvalue = scalePID_i(value); break;
|
||||
case VP_E1_PID_D: newvalue = scalePID_d(value); break;
|
||||
@@ -333,7 +333,7 @@ void DGUSScreenHandler::HandleManualMove(DGUS_VP_Variable &var, void *val_ptr) {
|
||||
if (filament_data.action == 0) { // Go back to utility screen
|
||||
#if HAS_HOTEND
|
||||
thermalManager.setTargetHotend(e_temp, ExtUI::extruder_t::E0);
|
||||
#if HOTENDS >= 2
|
||||
#if HAS_MULTI_HOTEND
|
||||
thermalManager.setTargetHotend(e_temp, ExtUI::extruder_t::E1);
|
||||
#endif
|
||||
#endif
|
||||
@@ -348,7 +348,7 @@ void DGUSScreenHandler::HandleManualMove(DGUS_VP_Variable &var, void *val_ptr) {
|
||||
thermalManager.setTargetHotend(e_temp, filament_data.extruder);
|
||||
break;
|
||||
#endif
|
||||
#if HOTENDS >= 2
|
||||
#if HAS_MULTI_HOTEND
|
||||
case VP_E1_FILAMENT_LOAD_UNLOAD:
|
||||
filament_data.extruder = ExtUI::extruder_t::E1;
|
||||
thermalManager.setTargetHotend(e_temp, filament_data.extruder);
|
||||
|
||||
@@ -327,7 +327,7 @@ void DGUSRxHandler::TempTarget(DGUS_VP &vp, void *data_ptr) {
|
||||
case DGUS_Addr::TEMP_SetTarget_H0:
|
||||
ExtUI::setTargetTemp_celsius(temp, ExtUI::H0);
|
||||
break;
|
||||
#if HOTENDS > 1
|
||||
#if HAS_MULTI_HOTEND
|
||||
case DGUS_Addr::TEMP_SetTarget_H1:
|
||||
ExtUI::setTargetTemp_celsius(temp, ExtUI::H1);
|
||||
break;
|
||||
@@ -347,7 +347,7 @@ void DGUSRxHandler::TempCool(DGUS_VP &vp, void *data_ptr) {
|
||||
case DGUS_Data::Heater::ALL:
|
||||
ExtUI::setTargetTemp_celsius(0, ExtUI::BED);
|
||||
ExtUI::setTargetTemp_celsius(0, ExtUI::H0);
|
||||
#if HOTENDS > 1
|
||||
#if HAS_MULTI_HOTEND
|
||||
ExtUI::setTargetTemp_celsius(0, ExtUI::H1);
|
||||
#endif
|
||||
break;
|
||||
@@ -357,7 +357,7 @@ void DGUSRxHandler::TempCool(DGUS_VP &vp, void *data_ptr) {
|
||||
case DGUS_Data::Heater::H0:
|
||||
ExtUI::setTargetTemp_celsius(0, ExtUI::H0);
|
||||
break;
|
||||
#if HOTENDS > 1
|
||||
#if HAS_MULTI_HOTEND
|
||||
case DGUS_Data::Heater::H1:
|
||||
ExtUI::setTargetTemp_celsius(0, ExtUI::H1);
|
||||
break;
|
||||
@@ -827,7 +827,7 @@ void DGUSRxHandler::PIDSelect(DGUS_VP &vp, void *data_ptr) {
|
||||
dgus_screen_handler.pid_heater = heater;
|
||||
break;
|
||||
case DGUS_Data::Heater::H0:
|
||||
#if HOTENDS > 1
|
||||
#if HAS_MULTI_HOTEND
|
||||
case DGUS_Data::Heater::H1:
|
||||
#endif
|
||||
dgus_screen_handler.pid_temp = DGUS_PLA_TEMP_HOTEND;
|
||||
@@ -858,7 +858,7 @@ void DGUSRxHandler::PIDSetTemp(DGUS_VP &vp, void *data_ptr) {
|
||||
case DGUS_Data::Heater::H0:
|
||||
temp = constrain(temp, HEATER_0_MINTEMP, (HEATER_0_MAXTEMP - HOTEND_OVERSHOOT));
|
||||
break;
|
||||
#if HOTENDS > 1
|
||||
#if HAS_MULTI_HOTEND
|
||||
case DGUS_Data::Heater::H1:
|
||||
temp = constrain(temp, HEATER_1_MINTEMP, (HEATER_1_MAXTEMP - HOTEND_OVERSHOOT));
|
||||
break;
|
||||
@@ -900,7 +900,7 @@ void DGUSRxHandler::PIDRun(DGUS_VP &vp, void *data_ptr) {
|
||||
dgus_screen_handler.SetStatusMessage(F("PID disabled"));
|
||||
return;
|
||||
#endif
|
||||
#if HOTENDS > 1
|
||||
#if HAS_MULTI_HOTEND
|
||||
case DGUS_Data::Heater::H1:
|
||||
#if ENABLED(PIDTEMP)
|
||||
heater = H_E1;
|
||||
|
||||
@@ -275,7 +275,7 @@ void DGUSTxHandler::TempMax(DGUS_VP &vp) {
|
||||
case DGUS_Addr::TEMP_Max_H0:
|
||||
temp = HEATER_0_MAXTEMP - HOTEND_OVERSHOOT;
|
||||
break;
|
||||
#if HOTENDS > 1
|
||||
#if HAS_MULTI_HOTEND
|
||||
case DGUS_Addr::TEMP_Max_H1:
|
||||
temp = HEATER_1_MAXTEMP - HOTEND_OVERSHOOT;
|
||||
break;
|
||||
@@ -428,7 +428,7 @@ void DGUSTxHandler::PIDKp(DGUS_VP &vp) {
|
||||
case DGUS_Data::Heater::H0:
|
||||
value = ExtUI::getPIDValues_Kp(ExtUI::E0);
|
||||
break;
|
||||
#if HOTENDS > 1
|
||||
#if HAS_MULTI_HOTEND
|
||||
case DGUS_Data::Heater::H1:
|
||||
value = ExtUI::getPIDValues_Kp(ExtUI::E1);
|
||||
break;
|
||||
@@ -454,7 +454,7 @@ void DGUSTxHandler::PIDKi(DGUS_VP &vp) {
|
||||
case DGUS_Data::Heater::H0:
|
||||
value = ExtUI::getPIDValues_Ki(ExtUI::E0);
|
||||
break;
|
||||
#if HOTENDS > 1
|
||||
#if HAS_MULTI_HOTEND
|
||||
case DGUS_Data::Heater::H1:
|
||||
value = ExtUI::getPIDValues_Ki(ExtUI::E1);
|
||||
break;
|
||||
@@ -480,7 +480,7 @@ void DGUSTxHandler::PIDKd(DGUS_VP &vp) {
|
||||
case DGUS_Data::Heater::H0:
|
||||
value = ExtUI::getPIDValues_Kd(ExtUI::E0);
|
||||
break;
|
||||
#if HOTENDS > 1
|
||||
#if HAS_MULTI_HOTEND
|
||||
case DGUS_Data::Heater::H1:
|
||||
value = ExtUI::getPIDValues_Kd(ExtUI::E1);
|
||||
break;
|
||||
|
||||
@@ -64,7 +64,7 @@ enum class DGUS_Addr : uint16_t {
|
||||
TEMP_Preset = 0x2010, // Popup / Data: DGUS_Data::TempPreset
|
||||
TEMP_SetTarget_Bed = 0x2011, // Type: Integer (16 bits signed)
|
||||
TEMP_SetTarget_H0 = 0x2012, // Type: Integer (16 bits signed)
|
||||
#if HOTENDS > 1
|
||||
#if HAS_MULTI_HOTEND
|
||||
TEMP_SetTarget_H1 = 0x2013, // Type: Integer (16 bits signed)
|
||||
#endif
|
||||
TEMP_Cool = 0x2014, // Data: DGUS_Data::Heater
|
||||
@@ -123,7 +123,7 @@ enum class DGUS_Addr : uint16_t {
|
||||
TEMP_Current_H0 = 0x30FF, // Type: Integer (16 bits signed)
|
||||
TEMP_Target_H0 = 0x3100, // Type: Integer (16 bits signed)
|
||||
TEMP_Max_H0 = 0x3101, // Type: Integer (16 bits unsigned)
|
||||
#if HOTENDS > 1
|
||||
#if HAS_MULTI_HOTEND
|
||||
TEMP_Current_H1 = 0x3102, // Type: Integer (16 bits signed)
|
||||
TEMP_Target_H1 = 0x3103, // Type: Integer (16 bits signed)
|
||||
TEMP_Max_H1 = 0x3104, // Type: Integer (16 bits unsigned)
|
||||
|
||||
@@ -102,7 +102,7 @@ const struct DGUS_VP vp_list[] PROGMEM = {
|
||||
VP_HELPER_RX(DGUS_Addr::TEMP_Preset, &DGUSRxHandler::TempPreset),
|
||||
VP_HELPER_RX(DGUS_Addr::TEMP_SetTarget_Bed, &DGUSRxHandler::TempTarget),
|
||||
VP_HELPER_RX(DGUS_Addr::TEMP_SetTarget_H0, &DGUSRxHandler::TempTarget),
|
||||
#if HOTENDS > 1
|
||||
#if HAS_MULTI_HOTEND
|
||||
VP_HELPER_RX(DGUS_Addr::TEMP_SetTarget_H1, &DGUSRxHandler::TempTarget),
|
||||
#endif
|
||||
VP_HELPER_RX(DGUS_Addr::TEMP_Cool, &DGUSRxHandler::TempCool),
|
||||
@@ -217,7 +217,7 @@ const struct DGUS_VP vp_list[] PROGMEM = {
|
||||
&thermalManager.temp_hotend[ExtUI::heater_t::H0].target,
|
||||
&DGUSTxHandler::ExtraToInteger<int16_t>),
|
||||
VP_HELPER_TX(DGUS_Addr::TEMP_Max_H0, &DGUSTxHandler::TempMax),
|
||||
#if HOTENDS > 1
|
||||
#if HAS_MULTI_HOTEND
|
||||
VP_HELPER_TX_AUTO(DGUS_Addr::TEMP_Current_H1,
|
||||
&thermalManager.temp_hotend[ExtUI::heater_t::H1].celsius,
|
||||
&DGUSTxHandler::ExtraToInteger<float>),
|
||||
|
||||
@@ -335,7 +335,7 @@ void NextionTFT::PanelInfo(uint8_t req) {
|
||||
break;
|
||||
|
||||
case 29: // Preheat
|
||||
#if PREHEAT_COUNT
|
||||
#if HAS_PREHEAT
|
||||
if (!isPrinting()) {
|
||||
// Preheat PLA
|
||||
if (nextion_command[4] == 'P') {
|
||||
@@ -560,7 +560,7 @@ void NextionTFT::PanelAction(uint8_t req) {
|
||||
break;
|
||||
|
||||
case 63: // Preheat // Temps defined in configuration.h
|
||||
#if PREHEAT_COUNT
|
||||
#if HAS_PREHEAT
|
||||
if (!isPrinting()) switch (nextion_command[4]) {
|
||||
// Preheat PLA
|
||||
case 'P':
|
||||
|
||||
@@ -705,7 +705,7 @@ namespace ExtUI {
|
||||
uint8_t getIDEX_Mode() { return dual_x_carriage_mode; }
|
||||
#endif
|
||||
|
||||
#if PREHEAT_COUNT
|
||||
#if HAS_PREHEAT
|
||||
uint16_t getMaterial_preset_E(const uint16_t index) { return ui.material_preset[index].hotend_temp; }
|
||||
#if HAS_HEATED_BED
|
||||
uint16_t getMaterial_preset_B(const uint16_t index) { return ui.material_preset[index].bed_temp; }
|
||||
@@ -1034,13 +1034,7 @@ namespace ExtUI {
|
||||
|
||||
void setFeedrate_percent(const_float_t value) { feedrate_percentage = constrain(value, 10, 500); }
|
||||
|
||||
void coolDown() {
|
||||
#if HAS_HOTEND
|
||||
HOTEND_LOOP() thermalManager.setTargetHotend(0, e);
|
||||
#endif
|
||||
TERN_(HAS_HEATED_BED, thermalManager.setTargetBed(0));
|
||||
TERN_(HAS_FAN, thermalManager.zero_fan_speeds());
|
||||
}
|
||||
void coolDown() { thermalManager.cooldown(); }
|
||||
|
||||
bool awaitingUserConfirm() {
|
||||
return TERN0(HAS_RESUME_CONTINUE, wait_for_user) || getHostKeepaliveIsPaused();
|
||||
|
||||
@@ -148,7 +148,7 @@ namespace ExtUI {
|
||||
|
||||
uint32_t getProgress_seconds_elapsed();
|
||||
|
||||
#if PREHEAT_COUNT
|
||||
#if HAS_PREHEAT
|
||||
uint16_t getMaterial_preset_E(const uint16_t);
|
||||
#if HAS_HEATED_BED
|
||||
uint16_t getMaterial_preset_B(const uint16_t);
|
||||
|
||||
@@ -56,7 +56,7 @@ namespace Language_an {
|
||||
LSTR MSG_SET_HOME_OFFSETS = _UxGT("Achustar desfases");
|
||||
LSTR MSG_HOME_OFFSETS_APPLIED = _UxGT("Desfase aplicau");
|
||||
LSTR MSG_SET_ORIGIN = _UxGT("Establir orichen");
|
||||
#if PREHEAT_COUNT
|
||||
#if HAS_PREHEAT
|
||||
LSTR MSG_PREHEAT_1 = _UxGT("Precalentar ") PREHEAT_1_LABEL;
|
||||
LSTR MSG_PREHEAT_1_H = _UxGT("Precalentar ") PREHEAT_1_LABEL " ~";
|
||||
LSTR MSG_PREHEAT_1_END = _UxGT("Precal. ") PREHEAT_1_LABEL _UxGT(" Boquilla");
|
||||
|
||||
@@ -45,7 +45,7 @@ namespace Language_bg {
|
||||
LSTR MSG_AUTO_HOME = _UxGT("Паркиране");
|
||||
LSTR MSG_SET_HOME_OFFSETS = _UxGT("Задай Начало");
|
||||
LSTR MSG_SET_ORIGIN = _UxGT("Изходна точка");
|
||||
#if PREHEAT_COUNT
|
||||
#if HAS_PREHEAT
|
||||
LSTR MSG_PREHEAT_1 = _UxGT("Подгряване ") PREHEAT_1_LABEL;
|
||||
LSTR MSG_PREHEAT_1_H = _UxGT("Подгряване ") PREHEAT_1_LABEL " ~";
|
||||
LSTR MSG_PREHEAT_1_END = _UxGT("Подгряване ") PREHEAT_1_LABEL _UxGT(" Дюза");
|
||||
|
||||
@@ -54,7 +54,7 @@ namespace Language_ca {
|
||||
LSTR MSG_SET_HOME_OFFSETS = _UxGT("Ajusta decalatge");
|
||||
LSTR MSG_HOME_OFFSETS_APPLIED = _UxGT("Decalatge aplicat");
|
||||
LSTR MSG_SET_ORIGIN = _UxGT("Estableix origen");
|
||||
#if PREHEAT_COUNT
|
||||
#if HAS_PREHEAT
|
||||
LSTR MSG_PREHEAT_1 = _UxGT("Preescalfa ") PREHEAT_1_LABEL;
|
||||
LSTR MSG_PREHEAT_1_H = _UxGT("Preescalfa ") PREHEAT_1_LABEL " ~";
|
||||
LSTR MSG_PREHEAT_1_END = _UxGT("Preescalfa ") PREHEAT_1_LABEL _UxGT(" End");
|
||||
|
||||
@@ -78,7 +78,7 @@ namespace Language_cz {
|
||||
LSTR MSG_SET_HOME_OFFSETS = _UxGT("Nastavit ofsety");
|
||||
LSTR MSG_HOME_OFFSETS_APPLIED = _UxGT("Ofsety nastaveny");
|
||||
LSTR MSG_SET_ORIGIN = _UxGT("Nastavit počátek");
|
||||
#if PREHEAT_COUNT
|
||||
#if HAS_PREHEAT
|
||||
LSTR MSG_PREHEAT_1 = _UxGT("Zahřát ") PREHEAT_1_LABEL;
|
||||
LSTR MSG_PREHEAT_1_H = _UxGT("Zahřát ") PREHEAT_1_LABEL " ~";
|
||||
LSTR MSG_PREHEAT_1_END = _UxGT("Zahřát ") PREHEAT_1_LABEL _UxGT(" end");
|
||||
@@ -153,7 +153,7 @@ namespace Language_cz {
|
||||
LSTR MSG_UBL_DONE_EDITING_MESH = _UxGT("Konec úprav sítě");
|
||||
LSTR MSG_UBL_BUILD_CUSTOM_MESH = _UxGT("Vlastní síť");
|
||||
LSTR MSG_UBL_BUILD_MESH_MENU = _UxGT("Vytvořit síť");
|
||||
#if PREHEAT_COUNT
|
||||
#if HAS_PREHEAT
|
||||
LSTR MSG_UBL_BUILD_MESH_M = _UxGT("Síť bodů $");
|
||||
LSTR MSG_UBL_VALIDATE_MESH_M = _UxGT("Kontrola sítě $");
|
||||
#endif
|
||||
|
||||
@@ -48,7 +48,7 @@ namespace Language_da {
|
||||
LSTR MSG_SET_HOME_OFFSETS = _UxGT("Sæt forsk. af home");
|
||||
LSTR MSG_HOME_OFFSETS_APPLIED = _UxGT("Forsk. er nu aktiv");
|
||||
LSTR MSG_SET_ORIGIN = _UxGT("Sæt origin");
|
||||
#if PREHEAT_COUNT
|
||||
#if HAS_PREHEAT
|
||||
LSTR MSG_PREHEAT_1 = _UxGT("Forvarm ") PREHEAT_1_LABEL;
|
||||
LSTR MSG_PREHEAT_1_H = _UxGT("Forvarm ") PREHEAT_1_LABEL " ~";
|
||||
LSTR MSG_PREHEAT_1_END = _UxGT("Forvarm ") PREHEAT_1_LABEL _UxGT(" end");
|
||||
|
||||
@@ -69,7 +69,7 @@ namespace Language_de {
|
||||
LSTR MSG_SET_HOME_OFFSETS = _UxGT("Setze Homeversatz");
|
||||
LSTR MSG_HOME_OFFSETS_APPLIED = _UxGT("Homeversatz aktiv");
|
||||
LSTR MSG_SET_ORIGIN = _UxGT("Setze Nullpunkte"); //"G92 X0 Y0 Z0" commented out in marlinui.cpp
|
||||
#if PREHEAT_COUNT
|
||||
#if HAS_PREHEAT
|
||||
LSTR MSG_PREHEAT_1 = PREHEAT_1_LABEL _UxGT(" Vorwärmen");
|
||||
LSTR MSG_PREHEAT_1_H = PREHEAT_1_LABEL _UxGT(" Vorwärmen ~");
|
||||
LSTR MSG_PREHEAT_1_END = PREHEAT_1_LABEL _UxGT(" Extr. Vorwärmen");
|
||||
@@ -144,7 +144,7 @@ namespace Language_de {
|
||||
LSTR MSG_UBL_DONE_EDITING_MESH = _UxGT("Bearbeitung beendet");
|
||||
LSTR MSG_UBL_BUILD_CUSTOM_MESH = _UxGT("Eigenes Netz erst.");
|
||||
LSTR MSG_UBL_BUILD_MESH_MENU = _UxGT("Netz erstellen");
|
||||
#if PREHEAT_COUNT
|
||||
#if HAS_PREHEAT
|
||||
LSTR MSG_UBL_BUILD_MESH_M = _UxGT("$ Netz erstellen");
|
||||
LSTR MSG_UBL_VALIDATE_MESH_M = _UxGT("$ Netz validieren");
|
||||
#endif
|
||||
|
||||
@@ -65,7 +65,7 @@ namespace Language_el {
|
||||
LSTR MSG_SET_HOME_OFFSETS = _UxGT("Ορισμός μετατοπίσεων");
|
||||
LSTR MSG_HOME_OFFSETS_APPLIED = _UxGT("Εφαρμογή μετατοπίσεων");
|
||||
LSTR MSG_SET_ORIGIN = _UxGT("Ορισμός προέλευσης");
|
||||
#if PREHEAT_COUNT
|
||||
#if HAS_PREHEAT
|
||||
LSTR MSG_PREHEAT_1 = _UxGT("Προθέρμανση ") PREHEAT_1_LABEL;
|
||||
LSTR MSG_PREHEAT_1_H = _UxGT("Προθέρμανση ") PREHEAT_1_LABEL " ~";
|
||||
LSTR MSG_PREHEAT_1_END = _UxGT("Προθέρμανση ") PREHEAT_1_LABEL _UxGT(" End");
|
||||
|
||||
@@ -54,7 +54,7 @@ namespace Language_el_gr {
|
||||
LSTR MSG_SET_HOME_OFFSETS = _UxGT("Ορισμός βασικών μετατοπίσεων");
|
||||
LSTR MSG_HOME_OFFSETS_APPLIED = _UxGT("Εφαρμόστηκαν οι μετατοπίσεις");
|
||||
LSTR MSG_SET_ORIGIN = _UxGT("Ορισμός προέλευσης");
|
||||
#if PREHEAT_COUNT
|
||||
#if HAS_PREHEAT
|
||||
LSTR MSG_PREHEAT_1 = _UxGT("Προθέρμανση ") PREHEAT_1_LABEL;
|
||||
LSTR MSG_PREHEAT_1_H = _UxGT("Προθέρμανση ") PREHEAT_1_LABEL " ~";
|
||||
LSTR MSG_PREHEAT_1_END = _UxGT("Προθέρμανση ") PREHEAT_1_LABEL _UxGT(" End");
|
||||
|
||||
@@ -104,7 +104,7 @@ namespace Language_en {
|
||||
LSTR MSG_TRAMMING_WIZARD = _UxGT("Tramming Wizard");
|
||||
LSTR MSG_SELECT_ORIGIN = _UxGT("Select Origin");
|
||||
LSTR MSG_LAST_VALUE_SP = _UxGT("Last value ");
|
||||
#if PREHEAT_COUNT
|
||||
#if HAS_PREHEAT
|
||||
LSTR MSG_PREHEAT_1 = _UxGT("Preheat ") PREHEAT_1_LABEL;
|
||||
LSTR MSG_PREHEAT_1_H = _UxGT("Preheat ") PREHEAT_1_LABEL " ~";
|
||||
LSTR MSG_PREHEAT_1_END = _UxGT("Preheat ") PREHEAT_1_LABEL _UxGT(" End");
|
||||
@@ -745,6 +745,8 @@ namespace Language_en {
|
||||
LSTR MSG_SD_CARD = _UxGT("SD Card");
|
||||
LSTR MSG_USB_DISK = _UxGT("USB Disk");
|
||||
|
||||
LSTR MSG_HOST_SHUTDOWN = _UxGT("Host Shutdown");
|
||||
|
||||
// These strings can be the same in all languages
|
||||
LSTR MSG_MARLIN = _UxGT("Marlin");
|
||||
LSTR MSG_SHORT_DAY = _UxGT("d"); // One character only
|
||||
|
||||
@@ -73,7 +73,7 @@ namespace Language_es {
|
||||
LSTR MSG_SET_HOME_OFFSETS = _UxGT("Ajustar desfases");
|
||||
LSTR MSG_HOME_OFFSETS_APPLIED = _UxGT("Desfase aplicada");
|
||||
LSTR MSG_SET_ORIGIN = _UxGT("Establecer origen");
|
||||
#if PREHEAT_COUNT
|
||||
#if HAS_PREHEAT
|
||||
LSTR MSG_PREHEAT_1 = _UxGT("Precal. ") PREHEAT_1_LABEL;
|
||||
LSTR MSG_PREHEAT_1_H = _UxGT("Precal. ") PREHEAT_1_LABEL " ~";
|
||||
LSTR MSG_PREHEAT_1_END = _UxGT("Precal. ") PREHEAT_1_LABEL _UxGT(" Fusor");
|
||||
@@ -147,7 +147,7 @@ namespace Language_es {
|
||||
LSTR MSG_UBL_DONE_EDITING_MESH = _UxGT("Term. edici. Mallado");
|
||||
LSTR MSG_UBL_BUILD_CUSTOM_MESH = _UxGT("Crear Mallado Pers.");
|
||||
LSTR MSG_UBL_BUILD_MESH_MENU = _UxGT("Crear Mallado");
|
||||
#if PREHEAT_COUNT
|
||||
#if HAS_PREHEAT
|
||||
LSTR MSG_UBL_BUILD_MESH_M = _UxGT("Crear Mallado ($)");
|
||||
LSTR MSG_UBL_VALIDATE_MESH_M = _UxGT("Valid. Mall. ($)");
|
||||
#endif
|
||||
|
||||
@@ -57,7 +57,7 @@ namespace Language_eu {
|
||||
LSTR MSG_SET_HOME_OFFSETS = _UxGT("Etxe. offset eza.");
|
||||
LSTR MSG_HOME_OFFSETS_APPLIED = _UxGT("Offsetak ezarrita");
|
||||
LSTR MSG_SET_ORIGIN = _UxGT("Hasiera ipini");
|
||||
#if PREHEAT_COUNT
|
||||
#if HAS_PREHEAT
|
||||
LSTR MSG_PREHEAT_1 = _UxGT("Berotu ") PREHEAT_1_LABEL;
|
||||
LSTR MSG_PREHEAT_1_H = _UxGT("Berotu ") PREHEAT_1_LABEL " ~";
|
||||
LSTR MSG_PREHEAT_1_END = _UxGT("Berotu ") PREHEAT_1_LABEL _UxGT(" Amaia");
|
||||
@@ -100,7 +100,7 @@ namespace Language_eu {
|
||||
LSTR MSG_UBL_MESH_EDIT = _UxGT("Sarea editatu");
|
||||
LSTR MSG_UBL_DONE_EDITING_MESH = _UxGT("Sarea editatzea eginda");
|
||||
LSTR MSG_UBL_BUILD_MESH_MENU = _UxGT("Sarea sortu");
|
||||
#if PREHEAT_COUNT
|
||||
#if HAS_PREHEAT
|
||||
LSTR MSG_UBL_BUILD_MESH_M = _UxGT("$ sarea sortu");
|
||||
LSTR MSG_UBL_VALIDATE_MESH_M = _UxGT("$ sarea balioetsi");
|
||||
#endif
|
||||
|
||||
@@ -44,7 +44,7 @@ namespace Language_fi {
|
||||
LSTR MSG_DISABLE_STEPPERS = _UxGT("Vapauta moottorit");
|
||||
LSTR MSG_AUTO_HOME = _UxGT("Aja referenssiin");
|
||||
LSTR MSG_SET_ORIGIN = _UxGT("Aseta origo");
|
||||
#if PREHEAT_COUNT
|
||||
#if HAS_PREHEAT
|
||||
LSTR MSG_PREHEAT_1 = _UxGT("Esilämmitä ") PREHEAT_1_LABEL;
|
||||
LSTR MSG_PREHEAT_1_H = _UxGT("Esilämmitä ") PREHEAT_1_LABEL " ~";
|
||||
LSTR MSG_PREHEAT_1_END = _UxGT("Esilä. ") PREHEAT_1_LABEL _UxGT("Suutin");
|
||||
|
||||
@@ -82,7 +82,7 @@ namespace Language_fr {
|
||||
LSTR MSG_TRAMMING_WIZARD = _UxGT("Assistant Molettes");
|
||||
LSTR MSG_SELECT_ORIGIN = _UxGT("Molette du lit"); // Not a selection of the origin
|
||||
LSTR MSG_LAST_VALUE_SP = _UxGT("Ecart origine ");
|
||||
#if PREHEAT_COUNT
|
||||
#if HAS_PREHEAT
|
||||
LSTR MSG_PREHEAT_1 = _UxGT("Préchauffage ") PREHEAT_1_LABEL;
|
||||
LSTR MSG_PREHEAT_1_H = _UxGT("Préchauffage ") PREHEAT_1_LABEL " ~";
|
||||
LSTR MSG_PREHEAT_1_END = _UxGT("Préch. ") PREHEAT_1_LABEL _UxGT(" buse");
|
||||
@@ -162,7 +162,7 @@ namespace Language_fr {
|
||||
LSTR MSG_UBL_FINE_TUNE_MESH = _UxGT("Réglage fin");
|
||||
LSTR MSG_UBL_DONE_EDITING_MESH = _UxGT("Terminer");
|
||||
LSTR MSG_UBL_BUILD_MESH_MENU = _UxGT("Créer la grille");
|
||||
#if PREHEAT_COUNT
|
||||
#if HAS_PREHEAT
|
||||
LSTR MSG_UBL_BUILD_MESH_M = _UxGT("Créer grille $");
|
||||
LSTR MSG_UBL_VALIDATE_MESH_M = _UxGT("Impr. grille $");
|
||||
#endif
|
||||
|
||||
@@ -70,7 +70,7 @@ namespace Language_gl {
|
||||
LSTR MSG_SET_HOME_OFFSETS = _UxGT("Axustar Desfases");
|
||||
LSTR MSG_HOME_OFFSETS_APPLIED = _UxGT("Desfases aplicados");
|
||||
LSTR MSG_SET_ORIGIN = _UxGT("Fixar orixe");
|
||||
#if PREHEAT_COUNT
|
||||
#if HAS_PREHEAT
|
||||
LSTR MSG_PREHEAT_1 = _UxGT("Prequentar ") PREHEAT_1_LABEL;
|
||||
LSTR MSG_PREHEAT_1_H = _UxGT("Prequentar ") PREHEAT_1_LABEL " ~";
|
||||
LSTR MSG_PREHEAT_1_END = _UxGT("Preque. ") PREHEAT_1_LABEL _UxGT(" Bico");
|
||||
@@ -144,7 +144,7 @@ namespace Language_gl {
|
||||
LSTR MSG_UBL_DONE_EDITING_MESH = _UxGT("Fin Edición da Malla");
|
||||
LSTR MSG_UBL_BUILD_CUSTOM_MESH = _UxGT("Crear Malla Person.");
|
||||
LSTR MSG_UBL_BUILD_MESH_MENU = _UxGT("Crear Malla");
|
||||
#if PREHEAT_COUNT
|
||||
#if HAS_PREHEAT
|
||||
LSTR MSG_UBL_BUILD_MESH_M = _UxGT("Crear Malla ($)");
|
||||
LSTR MSG_UBL_VALIDATE_MESH_M = _UxGT("Validar Malla ($)");
|
||||
#endif
|
||||
|
||||
@@ -54,7 +54,7 @@ namespace Language_hr {
|
||||
LSTR MSG_SET_HOME_OFFSETS = _UxGT("Postavi home offsete");
|
||||
LSTR MSG_HOME_OFFSETS_APPLIED = _UxGT("Offsets postavljeni");
|
||||
LSTR MSG_SET_ORIGIN = _UxGT("Postavi ishodište");
|
||||
#if PREHEAT_COUNT
|
||||
#if HAS_PREHEAT
|
||||
LSTR MSG_PREHEAT_1 = _UxGT("Predgrij ") PREHEAT_1_LABEL;
|
||||
LSTR MSG_PREHEAT_1_H = _UxGT("Predgrij ") PREHEAT_1_LABEL " ~";
|
||||
LSTR MSG_PREHEAT_1_END = _UxGT("Predgrij ") PREHEAT_1_LABEL _UxGT(" Dizna");
|
||||
|
||||
@@ -89,7 +89,7 @@ namespace Language_hu {
|
||||
LSTR MSG_TRAMMING_WIZARD = _UxGT("Elektromos varázsló");
|
||||
LSTR MSG_SELECT_ORIGIN = _UxGT("Eredeti választása");
|
||||
LSTR MSG_LAST_VALUE_SP = _UxGT("Utolsó érték ");
|
||||
#if PREHEAT_COUNT
|
||||
#if HAS_PREHEAT
|
||||
LSTR MSG_PREHEAT_1 = _UxGT("Fütés ") PREHEAT_1_LABEL;
|
||||
LSTR MSG_PREHEAT_1_H = _UxGT("Fütés ") PREHEAT_1_LABEL " ~";
|
||||
LSTR MSG_PREHEAT_1_END = _UxGT("Fütés ") PREHEAT_1_LABEL _UxGT(" Fej");
|
||||
|
||||
@@ -95,7 +95,7 @@ namespace Language_it {
|
||||
LSTR MSG_TRAMMING_WIZARD = _UxGT("Wizard Tramming");
|
||||
LSTR MSG_SELECT_ORIGIN = _UxGT("Selez. origine");
|
||||
LSTR MSG_LAST_VALUE_SP = _UxGT("Ultimo valore ");
|
||||
#if PREHEAT_COUNT
|
||||
#if HAS_PREHEAT
|
||||
LSTR MSG_PREHEAT_1 = _UxGT("Preriscalda ") PREHEAT_1_LABEL;
|
||||
LSTR MSG_PREHEAT_1_H = _UxGT("Preriscalda ") PREHEAT_1_LABEL " ~";
|
||||
LSTR MSG_PREHEAT_1_END = _UxGT("Preris.") PREHEAT_1_LABEL _UxGT(" Ugello");
|
||||
@@ -186,7 +186,7 @@ namespace Language_it {
|
||||
LSTR MSG_UBL_DONE_EDITING_MESH = _UxGT("Modif.Mesh fatta");
|
||||
LSTR MSG_UBL_BUILD_CUSTOM_MESH = _UxGT("Crea Mesh personal.");
|
||||
LSTR MSG_UBL_BUILD_MESH_MENU = _UxGT("Crea Mesh");
|
||||
#if PREHEAT_COUNT
|
||||
#if HAS_PREHEAT
|
||||
LSTR MSG_UBL_BUILD_MESH_M = _UxGT("Crea Mesh ($)");
|
||||
LSTR MSG_UBL_VALIDATE_MESH_M = _UxGT("Valida Mesh ($)");
|
||||
#endif
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user