Compare commits
18 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 48f874ce32 | |||
| fc50018b06 | |||
| 32e6767b5a | |||
| f22307a0af | |||
| 877e10205b | |||
| 8b8defeacc | |||
| f5daefb09d | |||
| 1fdad42c5f | |||
| 591fa8b753 | |||
| f7fff4d455 | |||
| 283aca50ba | |||
| 1bc9a530bd | |||
| 01797f74dc | |||
| ff07c2b375 | |||
| 90289b0ca0 | |||
| 19838d97be | |||
| c4873a64ec | |||
| 7ce4a7f641 |
+35
-34
@@ -619,8 +619,6 @@
|
||||
#define PID_K1 0.95 // Smoothing factor within any PID loop
|
||||
|
||||
#if ENABLED(PIDTEMP)
|
||||
//#define PID_EDIT_MENU // Add PID editing to the "Advanced Settings" menu. (~700 bytes of PROGMEM)
|
||||
//#define PID_AUTOTUNE_MENU // Add PID auto-tuning to the "Advanced Settings" menu. (~250 bytes of PROGMEM)
|
||||
//#define PID_PARAMS_PER_HOTEND // Uses separate PID parameters for each extruder (useful for mismatched extruders)
|
||||
// Set/get with gcode: M301 E[extruder number, 0-2]
|
||||
|
||||
@@ -767,6 +765,9 @@
|
||||
//#define SLOW_PWM_HEATERS // PWM with very low frequency (roughly 0.125Hz=8s) and minimum state time of approximately 1s useful for heaters driven by a relay
|
||||
#define PID_FUNCTIONAL_RANGE 10 // If the temperature difference between the target temperature and the actual temperature
|
||||
// is more than PID_FUNCTIONAL_RANGE then the PID will be shut off and the heater will be set to min/max.
|
||||
|
||||
//#define PID_EDIT_MENU // Add PID editing to the "Advanced Settings" menu. (~700 bytes of PROGMEM)
|
||||
//#define PID_AUTOTUNE_MENU // Add PID auto-tuning to the "Advanced Settings" menu. (~250 bytes of PROGMEM)
|
||||
#endif
|
||||
|
||||
// @section extruder
|
||||
@@ -2700,38 +2701,38 @@
|
||||
//========================== Extensible UI Displays ===========================
|
||||
//=============================================================================
|
||||
|
||||
//
|
||||
// DGUS Touch Display with DWIN OS. (Choose one.)
|
||||
// ORIGIN : https://www.aliexpress.com/item/32993409517.html
|
||||
// FYSETC : https://www.aliexpress.com/item/32961471929.html
|
||||
// MKS : https://www.aliexpress.com/item/1005002008179262.html
|
||||
//
|
||||
// Flash display with DGUS Displays for Marlin:
|
||||
// - Format the SD card to FAT32 with an allocation size of 4kb.
|
||||
// - Download files as specified for your type of display.
|
||||
// - Plug the microSD card into the back of the display.
|
||||
// - Boot the display and wait for the update to complete.
|
||||
//
|
||||
// ORIGIN (Marlin DWIN_SET)
|
||||
// - Download https://github.com/coldtobi/Marlin_DGUS_Resources
|
||||
// - Copy the downloaded DWIN_SET folder to the SD card.
|
||||
//
|
||||
// FYSETC (Supplier default)
|
||||
// - Download https://github.com/FYSETC/FYSTLCD-2.0
|
||||
// - Copy the downloaded SCREEN folder to the SD card.
|
||||
//
|
||||
// HIPRECY (Supplier default)
|
||||
// - Download https://github.com/HiPrecy/Touch-Lcd-LEO
|
||||
// - Copy the downloaded DWIN_SET folder to the SD card.
|
||||
//
|
||||
// MKS (MKS-H43) (Supplier default)
|
||||
// - Download https://github.com/makerbase-mks/MKS-H43
|
||||
// - Copy the downloaded DWIN_SET folder to the SD card.
|
||||
//
|
||||
// RELOADED (T5UID1)
|
||||
// - Download https://github.com/Desuuuu/DGUS-reloaded/releases
|
||||
// - Copy the downloaded DWIN_SET folder to the SD card.
|
||||
//
|
||||
/**
|
||||
* DGUS Touch Display with DWIN OS. (Choose one.)
|
||||
* ORIGIN : https://www.aliexpress.com/item/32993409517.html
|
||||
* FYSETC : https://www.aliexpress.com/item/32961471929.html
|
||||
* MKS : https://www.aliexpress.com/item/1005002008179262.html
|
||||
*
|
||||
* Flash display with DGUS Displays for Marlin:
|
||||
* - Format the SD card to FAT32 with an allocation size of 4kb.
|
||||
* - Download files as specified for your type of display.
|
||||
* - Plug the microSD card into the back of the display.
|
||||
* - Boot the display and wait for the update to complete.
|
||||
*
|
||||
* ORIGIN (Marlin DWIN_SET)
|
||||
* - Download https://github.com/coldtobi/Marlin_DGUS_Resources
|
||||
* - Copy the downloaded DWIN_SET folder to the SD card.
|
||||
*
|
||||
* FYSETC (Supplier default)
|
||||
* - Download https://github.com/FYSETC/FYSTLCD-2.0
|
||||
* - Copy the downloaded SCREEN folder to the SD card.
|
||||
*
|
||||
* HIPRECY (Supplier default)
|
||||
* - Download https://github.com/HiPrecy/Touch-Lcd-LEO
|
||||
* - Copy the downloaded DWIN_SET folder to the SD card.
|
||||
*
|
||||
* MKS (MKS-H43) (Supplier default)
|
||||
* - Download https://github.com/makerbase-mks/MKS-H43
|
||||
* - Copy the downloaded DWIN_SET folder to the SD card.
|
||||
*
|
||||
* RELOADED (T5UID1)
|
||||
* - Download https://github.com/Desuuuu/DGUS-reloaded/releases
|
||||
* - Copy the downloaded DWIN_SET folder to the SD card.
|
||||
*/
|
||||
//#define DGUS_LCD_UI_ORIGIN
|
||||
//#define DGUS_LCD_UI_FYSETC
|
||||
//#define DGUS_LCD_UI_HIPRECY
|
||||
|
||||
@@ -620,7 +620,6 @@
|
||||
#define E7_AUTO_FAN_PIN -1
|
||||
#define CHAMBER_AUTO_FAN_PIN -1
|
||||
#define COOLER_AUTO_FAN_PIN -1
|
||||
#define COOLER_FAN_PIN -1
|
||||
|
||||
#define EXTRUDER_AUTO_FAN_TEMPERATURE 50
|
||||
#define EXTRUDER_AUTO_FAN_SPEED 255 // 255 == full speed
|
||||
@@ -1697,6 +1696,17 @@
|
||||
// Western only. Not available for Cyrillic, Kana, Turkish, Greek, or Chinese.
|
||||
//#define USE_SMALL_INFOFONT
|
||||
|
||||
/**
|
||||
* Graphical Display Sleep
|
||||
*
|
||||
* The U8G library provides sleep / wake functions for SH1106, SSD1306,
|
||||
* SSD1309, and some other DOGM displays.
|
||||
* Enable this option to save energy and prevent OLED pixel burn-in.
|
||||
* Adds the menu item Configuration > LCD Timeout (m) to set a wait period
|
||||
* from 0 (disabled) to 99 minutes.
|
||||
*/
|
||||
//#define DISPLAY_SLEEP_MINUTES 2 // (minutes) Timeout before turning off the screen
|
||||
|
||||
/**
|
||||
* ST7920-based LCDs can emulate a 16 x 4 character display using
|
||||
* the ST7920 character-generator for very fast screen updates.
|
||||
@@ -2866,6 +2876,7 @@
|
||||
#define U_RSENSE 0.11
|
||||
#define U_CHAIN_POS -1
|
||||
//#define U_INTERPOLATE true
|
||||
//#define U_HOLD_MULTIPLIER 0.5
|
||||
#endif
|
||||
|
||||
#if AXIS_IS_TMC(V)
|
||||
@@ -2875,6 +2886,7 @@
|
||||
#define V_RSENSE 0.11
|
||||
#define V_CHAIN_POS -1
|
||||
//#define V_INTERPOLATE true
|
||||
//#define V_HOLD_MULTIPLIER 0.5
|
||||
#endif
|
||||
|
||||
#if AXIS_IS_TMC(W)
|
||||
@@ -2884,6 +2896,7 @@
|
||||
#define W_RSENSE 0.11
|
||||
#define W_CHAIN_POS -1
|
||||
//#define W_INTERPOLATE true
|
||||
//#define W_HOLD_MULTIPLIER 0.5
|
||||
#endif
|
||||
|
||||
#if AXIS_IS_TMC(E0)
|
||||
|
||||
+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 "2022-04-03"
|
||||
//#define STRING_DISTRIBUTION_DATE "2022-04-05"
|
||||
|
||||
/**
|
||||
* Defines a generic printer name to be output to the LCD after booting Marlin.
|
||||
|
||||
@@ -229,7 +229,7 @@ public:
|
||||
SBI(DIDR0, ch);
|
||||
}
|
||||
|
||||
// Begin ADC sampling on the given channel
|
||||
// Begin ADC sampling on the given channel. Called from Temperature::isr!
|
||||
static void adc_start(const uint8_t ch) {
|
||||
#ifdef MUX5
|
||||
ADCSRB = ch > 7 ? _BV(MUX5) : 0;
|
||||
|
||||
@@ -74,7 +74,7 @@
|
||||
#define MULTI_NAME_PAD 26 // space needed to be pretty if not first name assigned to a pin
|
||||
|
||||
void PRINT_ARRAY_NAME(uint8_t x) {
|
||||
char *name_mem_pointer = (char*)pgm_read_ptr(&pin_array[x].name);
|
||||
char *name_mem_pointer = (PGM_P)pgm_read_ptr(&pin_array[x].name);
|
||||
LOOP_L_N(y, MAX_NAME_LENGTH) {
|
||||
char temp_char = pgm_read_byte(name_mem_pointer + y);
|
||||
if (temp_char != 0)
|
||||
|
||||
@@ -209,7 +209,7 @@ public:
|
||||
// Called by Temperature::init for each sensor at startup
|
||||
static void adc_enable(const uint8_t ch) {}
|
||||
|
||||
// Begin ADC sampling on the given channel
|
||||
// Begin ADC sampling on the given channel. Called from Temperature::isr!
|
||||
static void adc_start(const uint8_t ch) { adc_result = analogRead(ch); }
|
||||
|
||||
// Is the ADC ready for reading?
|
||||
|
||||
@@ -244,7 +244,8 @@ void MarlinHAL::adc_start(const pin_t pin) {
|
||||
const adc1_channel_t chan = get_channel(pin);
|
||||
uint32_t mv;
|
||||
esp_adc_cal_get_voltage((adc_channel_t)chan, &characteristics[attenuations[chan]], &mv);
|
||||
adc_result = mv * 1023.0f / float(ADC_REFERENCE_VOLTAGE) / 1000.0f;
|
||||
|
||||
adc_result = mv * isr_float_t(1023) / isr_float_t(ADC_REFERENCE_VOLTAGE) / isr_float_t(1000);
|
||||
|
||||
// Change the attenuation level based on the new reading
|
||||
adc_atten_t atten;
|
||||
|
||||
@@ -74,6 +74,7 @@
|
||||
// Types
|
||||
// ------------------------
|
||||
|
||||
typedef double isr_float_t; // FPU ops are used for single-precision, so use double for ISRs.
|
||||
typedef int16_t pin_t;
|
||||
|
||||
class Servo;
|
||||
@@ -205,7 +206,7 @@ public:
|
||||
// Called by Temperature::init for each sensor at startup
|
||||
static void adc_enable(const pin_t pin) {}
|
||||
|
||||
// Begin ADC sampling on the given channel
|
||||
// Begin ADC sampling on the given pin. Called from Temperature::isr!
|
||||
static void adc_start(const pin_t pin);
|
||||
|
||||
// Is the ADC ready for reading?
|
||||
|
||||
@@ -234,7 +234,7 @@ public:
|
||||
FilteredADC::enable_channel(pin);
|
||||
}
|
||||
|
||||
// Begin ADC sampling on the given pin
|
||||
// Begin ADC sampling on the given pin. Called from Temperature::isr!
|
||||
static uint32_t adc_result;
|
||||
static void adc_start(const pin_t pin) {
|
||||
adc_result = FilteredADC::read(pin) >> (16 - HAL_ADC_RESOLUTION); // returns 16bit value, reduce to required bits
|
||||
|
||||
@@ -242,7 +242,7 @@ public:
|
||||
// Called by Temperature::init for each sensor at startup
|
||||
static void adc_enable(const uint8_t ch);
|
||||
|
||||
// Begin ADC sampling on the given channel
|
||||
// Begin ADC sampling on the given channel. Called from Temperature::isr!
|
||||
static void adc_start(const uint8_t ch);
|
||||
|
||||
// Is the ADC ready for reading?
|
||||
|
||||
@@ -190,7 +190,7 @@ public:
|
||||
// Called by Temperature::init for each sensor at startup
|
||||
static void adc_enable(const uint8_t ch) {}
|
||||
|
||||
// Begin ADC sampling on the given channel
|
||||
// Begin ADC sampling on the given pin. Called from Temperature::isr!
|
||||
static void adc_start(const pin_t pin);
|
||||
|
||||
// Is the ADC ready for reading?
|
||||
|
||||
@@ -127,6 +127,8 @@
|
||||
// Types
|
||||
// ------------------------
|
||||
|
||||
typedef double isr_float_t; // FPU ops are used for single-precision, so use double for ISRs.
|
||||
|
||||
#ifdef STM32G0B1xx
|
||||
typedef int32_t pin_t;
|
||||
#else
|
||||
@@ -241,7 +243,7 @@ public:
|
||||
// Called by Temperature::init for each sensor at startup
|
||||
static void adc_enable(const pin_t pin) { pinMode(pin, INPUT); }
|
||||
|
||||
// Begin ADC sampling on the given channel
|
||||
// Begin ADC sampling on the given pin. Called from Temperature::isr!
|
||||
static void adc_start(const pin_t pin) { adc_result = analogRead(pin); }
|
||||
|
||||
// Is the ADC ready for reading?
|
||||
|
||||
@@ -280,7 +280,7 @@ public:
|
||||
// Called by Temperature::init for each sensor at startup
|
||||
static void adc_enable(const pin_t pin) { pinMode(pin, INPUT_ANALOG); }
|
||||
|
||||
// Begin ADC sampling on the given channel
|
||||
// Begin ADC sampling on the given pin. Called from Temperature::isr!
|
||||
static void adc_start(const pin_t pin);
|
||||
|
||||
// Is the ADC ready for reading?
|
||||
|
||||
@@ -166,7 +166,7 @@ public:
|
||||
// Called by Temperature::init for each sensor at startup
|
||||
static void adc_enable(const pin_t ch) {}
|
||||
|
||||
// Begin ADC sampling on the given channel
|
||||
// Begin ADC sampling on the given channel. Called from Temperature::isr!
|
||||
static void adc_start(const pin_t ch);
|
||||
|
||||
// Is the ADC ready for reading?
|
||||
|
||||
@@ -173,7 +173,7 @@ public:
|
||||
// Called by Temperature::init for each sensor at startup
|
||||
static void adc_enable(const pin_t) {}
|
||||
|
||||
// Begin ADC sampling on the given channel
|
||||
// Begin ADC sampling on the given pin. Called from Temperature::isr!
|
||||
static void adc_start(const pin_t pin);
|
||||
|
||||
// Is the ADC ready for reading?
|
||||
|
||||
@@ -195,7 +195,7 @@ public:
|
||||
// Called by Temperature::init for each sensor at startup
|
||||
static void adc_enable(const pin_t pin) {}
|
||||
|
||||
// Begin ADC sampling on the given channel
|
||||
// Begin ADC sampling on the given pin. Called from Temperature::isr!
|
||||
static void adc_start(const pin_t pin);
|
||||
|
||||
// Is the ADC ready for reading?
|
||||
|
||||
@@ -303,6 +303,7 @@
|
||||
#define STR_MATERIAL_HEATUP "Material heatup parameters"
|
||||
#define STR_LCD_CONTRAST "LCD Contrast"
|
||||
#define STR_LCD_BRIGHTNESS "LCD Brightness"
|
||||
#define STR_DISPLAY_SLEEP "Display Sleep"
|
||||
#define STR_UI_LANGUAGE "UI Language"
|
||||
#define STR_Z_PROBE_OFFSET "Z-Probe Offset"
|
||||
#define STR_TEMPERATURE_UNITS "Temperature Units"
|
||||
|
||||
@@ -36,6 +36,9 @@ extern const char NUL_STR[], SP_P_STR[], SP_T_STR[],
|
||||
X_STR[], Y_STR[], Z_STR[], I_STR[], J_STR[], K_STR[], U_STR[], V_STR[], W_STR[], E_STR[],
|
||||
X_LBL[], Y_LBL[], Z_LBL[], I_LBL[], J_LBL[], K_LBL[], U_LBL[], V_LBL[], W_LBL[], E_LBL[];
|
||||
|
||||
PGM_P const SP_AXIS_LBL[] PROGMEM = LOGICAL_AXIS_ARRAY(SP_E_LBL, SP_X_LBL, SP_Y_LBL, SP_Z_LBL, SP_I_LBL, SP_J_LBL, SP_K_LBL, SP_U_LBL, SP_V_LBL, SP_W_LBL);
|
||||
PGM_P const SP_AXIS_STR[] PROGMEM = LOGICAL_AXIS_ARRAY(SP_E_STR, SP_X_STR, SP_Y_STR, SP_Z_STR, SP_I_STR, SP_J_STR, SP_K_STR, SP_U_STR, SP_V_STR, SP_W_STR);
|
||||
|
||||
//
|
||||
// Debugging flags for use by M111
|
||||
//
|
||||
|
||||
@@ -76,6 +76,59 @@ struct IF<true, L, R> { typedef L type; };
|
||||
|
||||
#define AXIS_COLLISION(L) (AXIS4_NAME == L || AXIS5_NAME == L || AXIS6_NAME == L || AXIS7_NAME == L || AXIS8_NAME == L || AXIS9_NAME == L)
|
||||
|
||||
// General Flags for some number of states
|
||||
template<size_t N>
|
||||
struct Flags {
|
||||
typedef typename IF<(N>8), uint16_t, uint8_t>::type bits_t;
|
||||
typedef struct { bool b0:1, b1:1, b2:1, b3:1, b4:1, b5:1, b6:1, b7:1; } N8;
|
||||
typedef struct { bool b0:1, b1:1, b2:1, b3:1, b4:1, b5:1, b6:1, b7:1, b8:1, b9:1, b10:1, b11:1, b12:1, b13:1, b14:1, b15:1; } N16;
|
||||
union {
|
||||
bits_t b;
|
||||
typename IF<(N>8), N16, N8>::type flag;
|
||||
};
|
||||
void reset() { b = 0; }
|
||||
void set(const int n, const bool onoff) { onoff ? set(n) : clear(n); }
|
||||
void set(const int n) { b |= (bits_t)_BV(n); }
|
||||
void clear(const int n) { b &= ~(bits_t)_BV(n); }
|
||||
bool test(const int n) const { return TEST(b, n); }
|
||||
bool operator[](const int n) { return test(n); }
|
||||
const bool operator[](const int n) const { return test(n); }
|
||||
const int size() const { return sizeof(b); }
|
||||
};
|
||||
|
||||
// Specialization for a single bool flag
|
||||
template<>
|
||||
struct Flags<1> {
|
||||
bool b;
|
||||
void reset() { b = false; }
|
||||
void set(const int n, const bool onoff) { onoff ? set(n) : clear(n); }
|
||||
void set(const int) { b = true; }
|
||||
void clear(const int) { b = false; }
|
||||
bool test(const int) const { return b; }
|
||||
bool operator[](const int) { return b; }
|
||||
const bool operator[](const int) const { return b; }
|
||||
const int size() const { return sizeof(b); }
|
||||
};
|
||||
|
||||
typedef Flags<8> flags_8_t;
|
||||
typedef Flags<16> flags_16_t;
|
||||
|
||||
// Flags for some axis states, with per-axis aliases xyzijkuvwe
|
||||
typedef struct AxisFlags {
|
||||
union {
|
||||
struct Flags<LOGICAL_AXES> flags;
|
||||
struct { bool LOGICAL_AXIS_LIST(e:1, x:1, y:1, z:1, i:1, j:1, k:1, u:1, v:1, w:1); };
|
||||
};
|
||||
void reset() { flags.reset(); }
|
||||
void set(const int n) { flags.set(n); }
|
||||
void set(const int n, const bool onoff) { flags.set(n, onoff); }
|
||||
void clear(const int n) { flags.clear(n); }
|
||||
bool test(const int n) const { return flags.test(n); }
|
||||
bool operator[](const int n) { return flags[n]; }
|
||||
const bool operator[](const int n) const { return flags[n]; }
|
||||
const int size() const { return sizeof(flags); }
|
||||
} axis_flags_t;
|
||||
|
||||
//
|
||||
// Enumerated axis indices
|
||||
//
|
||||
|
||||
@@ -126,7 +126,7 @@ void safe_delay(millis_t ms) {
|
||||
#if ABL_PLANAR
|
||||
SERIAL_ECHOPGM("ABL Adjustment");
|
||||
LOOP_NUM_AXES(a) {
|
||||
SERIAL_CHAR(' ', AXIS_CHAR(a));
|
||||
SERIAL_ECHOPGM_P((PGM_P)pgm_read_ptr(&SP_AXIS_STR[a]));
|
||||
serial_offset(planner.get_axis_position_mm(AxisEnum(a)) - current_position[a]);
|
||||
}
|
||||
#else
|
||||
|
||||
@@ -79,7 +79,7 @@ constexpr uint8_t ui8_to_percent(const uint8_t i) { return (int(i) * 100 + 127)
|
||||
|
||||
// Axis names for G-code parsing, reports, etc.
|
||||
const xyze_char_t axis_codes LOGICAL_AXIS_ARRAY('E', 'X', 'Y', 'Z', AXIS4_NAME, AXIS5_NAME, AXIS6_NAME, AXIS7_NAME, AXIS8_NAME, AXIS9_NAME);
|
||||
#if NUM_AXES <= XYZ
|
||||
#if NUM_AXES <= XYZ && !HAS_EXTRUDERS
|
||||
#define AXIS_CHAR(A) ((char)('X' + A))
|
||||
#define IAXIS_CHAR AXIS_CHAR
|
||||
#else
|
||||
|
||||
@@ -49,7 +49,7 @@ void I2CPositionEncoder::init(const uint8_t address, const AxisEnum axis) {
|
||||
|
||||
initialized = true;
|
||||
|
||||
SERIAL_ECHOLNPGM("Setting up encoder on ", AS_CHAR(axis_codes[encoderAxis]), " axis, addr = ", address);
|
||||
SERIAL_ECHOLNPGM("Setting up encoder on ", AS_CHAR(AXIS_CHAR(encoderAxis)), " axis, addr = ", address);
|
||||
|
||||
position = get_position();
|
||||
}
|
||||
@@ -67,7 +67,7 @@ void I2CPositionEncoder::update() {
|
||||
/*
|
||||
if (trusted) { //commented out as part of the note below
|
||||
trusted = false;
|
||||
SERIAL_ECHOLNPGM("Fault detected on ", AS_CHAR(axis_codes[encoderAxis]), " axis encoder. Disengaging error correction until module is trusted again.");
|
||||
SERIAL_ECHOLNPGM("Fault detected on ", AS_CHAR(AXIS_CHAR(encoderAxis)), " axis encoder. Disengaging error correction until module is trusted again.");
|
||||
}
|
||||
*/
|
||||
return;
|
||||
@@ -92,7 +92,7 @@ void I2CPositionEncoder::update() {
|
||||
if (millis() - lastErrorTime > I2CPE_TIME_TRUSTED) {
|
||||
trusted = true;
|
||||
|
||||
SERIAL_ECHOLNPGM("Untrusted encoder module on ", AS_CHAR(axis_codes[encoderAxis]), " axis has been fault-free for set duration, reinstating error correction.");
|
||||
SERIAL_ECHOLNPGM("Untrusted encoder module on ", AS_CHAR(AXIS_CHAR(encoderAxis)), " axis has been fault-free for set duration, reinstating error correction.");
|
||||
|
||||
//the encoder likely lost its place when the error occurred, so we'll reset and use the printer's
|
||||
//idea of where it the axis is to re-initialize
|
||||
@@ -172,7 +172,7 @@ void I2CPositionEncoder::update() {
|
||||
float sumP = 0;
|
||||
LOOP_L_N(i, I2CPE_ERR_PRST_ARRAY_SIZE) sumP += errPrst[i];
|
||||
const int32_t errorP = int32_t(sumP * RECIPROCAL(I2CPE_ERR_PRST_ARRAY_SIZE));
|
||||
SERIAL_CHAR(axis_codes[encoderAxis]);
|
||||
SERIAL_CHAR(AXIS_CHAR(encoderAxis));
|
||||
SERIAL_ECHOLNPGM(" : CORRECT ERR ", errorP * planner.mm_per_step[encoderAxis], "mm");
|
||||
babystep.add_steps(encoderAxis, -LROUND(errorP));
|
||||
errPrstIdx = 0;
|
||||
@@ -192,7 +192,7 @@ void I2CPositionEncoder::update() {
|
||||
if (ABS(error) > I2CPE_ERR_CNT_THRESH * planner.settings.axis_steps_per_mm[encoderAxis]) {
|
||||
const millis_t ms = millis();
|
||||
if (ELAPSED(ms, nextErrorCountTime)) {
|
||||
SERIAL_CHAR(axis_codes[encoderAxis]);
|
||||
SERIAL_CHAR(AXIS_CHAR(encoderAxis));
|
||||
SERIAL_ECHOLNPGM(" : LARGE ERR ", error, "; diffSum=", diffSum);
|
||||
errorCount++;
|
||||
nextErrorCountTime = ms + I2CPE_ERR_CNT_DEBOUNCE_MS;
|
||||
@@ -212,7 +212,7 @@ void I2CPositionEncoder::set_homed() {
|
||||
homed = trusted = true;
|
||||
|
||||
#ifdef I2CPE_DEBUG
|
||||
SERIAL_CHAR(axis_codes[encoderAxis]);
|
||||
SERIAL_CHAR(AXIS_CHAR(encoderAxis));
|
||||
SERIAL_ECHOLNPGM(" axis encoder homed, offset of ", zeroOffset, " ticks.");
|
||||
#endif
|
||||
}
|
||||
@@ -223,7 +223,7 @@ void I2CPositionEncoder::set_unhomed() {
|
||||
homed = trusted = false;
|
||||
|
||||
#ifdef I2CPE_DEBUG
|
||||
SERIAL_CHAR(axis_codes[encoderAxis]);
|
||||
SERIAL_CHAR(AXIS_CHAR(encoderAxis));
|
||||
SERIAL_ECHOLNPGM(" axis encoder unhomed.");
|
||||
#endif
|
||||
}
|
||||
@@ -231,7 +231,7 @@ void I2CPositionEncoder::set_unhomed() {
|
||||
bool I2CPositionEncoder::passes_test(const bool report) {
|
||||
if (report) {
|
||||
if (H != I2CPE_MAG_SIG_GOOD) SERIAL_ECHOPGM("Warning. ");
|
||||
SERIAL_CHAR(axis_codes[encoderAxis]);
|
||||
SERIAL_CHAR(AXIS_CHAR(encoderAxis));
|
||||
serial_ternary(H == I2CPE_MAG_SIG_BAD, F(" axis "), F("magnetic strip "), F("encoder "));
|
||||
switch (H) {
|
||||
case I2CPE_MAG_SIG_GOOD:
|
||||
@@ -252,7 +252,7 @@ float I2CPositionEncoder::get_axis_error_mm(const bool report) {
|
||||
error = ABS(diff) > 10000 ? 0 : diff; // Huge error is a bad reading
|
||||
|
||||
if (report) {
|
||||
SERIAL_CHAR(axis_codes[encoderAxis]);
|
||||
SERIAL_CHAR(AXIS_CHAR(encoderAxis));
|
||||
SERIAL_ECHOLNPGM(" axis target=", target, "mm; actual=", actual, "mm; err=", error, "mm");
|
||||
}
|
||||
|
||||
@@ -262,7 +262,7 @@ float I2CPositionEncoder::get_axis_error_mm(const bool report) {
|
||||
int32_t I2CPositionEncoder::get_axis_error_steps(const bool report) {
|
||||
if (!active) {
|
||||
if (report) {
|
||||
SERIAL_CHAR(axis_codes[encoderAxis]);
|
||||
SERIAL_CHAR(AXIS_CHAR(encoderAxis));
|
||||
SERIAL_ECHOLNPGM(" axis encoder not active!");
|
||||
}
|
||||
return 0;
|
||||
@@ -287,7 +287,7 @@ int32_t I2CPositionEncoder::get_axis_error_steps(const bool report) {
|
||||
errorPrev = error;
|
||||
|
||||
if (report) {
|
||||
SERIAL_CHAR(axis_codes[encoderAxis]);
|
||||
SERIAL_CHAR(AXIS_CHAR(encoderAxis));
|
||||
SERIAL_ECHOLNPGM(" axis target=", target, "; actual=", encoderCountInStepperTicksScaled, "; err=", error);
|
||||
}
|
||||
|
||||
@@ -657,7 +657,7 @@ void I2CPositionEncodersMgr::report_position(const int8_t idx, const bool units,
|
||||
else {
|
||||
if (noOffset) {
|
||||
const int32_t raw_count = encoders[idx].get_raw_count();
|
||||
SERIAL_CHAR(axis_codes[encoders[idx].get_axis()], ' ');
|
||||
SERIAL_CHAR(AXIS_CHAR(encoders[idx).get_axis()], ' ');
|
||||
|
||||
for (uint8_t j = 31; j > 0; j--)
|
||||
SERIAL_ECHO((bool)(0x00000001 & (raw_count >> j)));
|
||||
@@ -712,7 +712,7 @@ void I2CPositionEncodersMgr::change_module_address(const uint8_t oldaddr, const
|
||||
// and enable it (it will likely have failed initialization on power-up, before the address change).
|
||||
const int8_t idx = idx_from_addr(newaddr);
|
||||
if (idx >= 0 && !encoders[idx].get_active()) {
|
||||
SERIAL_CHAR(axis_codes[encoders[idx].get_axis()]);
|
||||
SERIAL_CHAR(AXIS_CHAR(encoders[idx).get_axis()]);
|
||||
SERIAL_ECHOLNPGM(" axis encoder was not detected on printer startup. Trying again.");
|
||||
encoders[idx].set_active(encoders[idx].passes_test(true));
|
||||
}
|
||||
@@ -814,7 +814,7 @@ void I2CPositionEncodersMgr::M860() {
|
||||
|
||||
if (I2CPE_idx == 0xFF) {
|
||||
LOOP_LOGICAL_AXES(i) {
|
||||
if (!I2CPE_anyaxis || parser.seen_test(axis_codes[i])) {
|
||||
if (!I2CPE_anyaxis || parser.seen_test(AXIS_CHAR(i))) {
|
||||
const uint8_t idx = idx_from_axis(AxisEnum(i));
|
||||
if ((int8_t)idx >= 0) report_position(idx, hasU, hasO);
|
||||
}
|
||||
@@ -841,7 +841,7 @@ void I2CPositionEncodersMgr::M861() {
|
||||
|
||||
if (I2CPE_idx == 0xFF) {
|
||||
LOOP_LOGICAL_AXES(i) {
|
||||
if (!I2CPE_anyaxis || parser.seen(axis_codes[i])) {
|
||||
if (!I2CPE_anyaxis || parser.seen(AXIS_CHAR(i))) {
|
||||
const uint8_t idx = idx_from_axis(AxisEnum(i));
|
||||
if ((int8_t)idx >= 0) report_status(idx);
|
||||
}
|
||||
@@ -869,7 +869,7 @@ void I2CPositionEncodersMgr::M862() {
|
||||
|
||||
if (I2CPE_idx == 0xFF) {
|
||||
LOOP_LOGICAL_AXES(i) {
|
||||
if (!I2CPE_anyaxis || parser.seen(axis_codes[i])) {
|
||||
if (!I2CPE_anyaxis || parser.seen(AXIS_CHAR(i))) {
|
||||
const uint8_t idx = idx_from_axis(AxisEnum(i));
|
||||
if ((int8_t)idx >= 0) test_axis(idx);
|
||||
}
|
||||
@@ -900,7 +900,7 @@ void I2CPositionEncodersMgr::M863() {
|
||||
|
||||
if (I2CPE_idx == 0xFF) {
|
||||
LOOP_LOGICAL_AXES(i) {
|
||||
if (!I2CPE_anyaxis || parser.seen(axis_codes[i])) {
|
||||
if (!I2CPE_anyaxis || parser.seen(AXIS_CHAR(i))) {
|
||||
const uint8_t idx = idx_from_axis(AxisEnum(i));
|
||||
if ((int8_t)idx >= 0) calibrate_steps_mm(idx, iterations);
|
||||
}
|
||||
@@ -976,7 +976,7 @@ void I2CPositionEncodersMgr::M865() {
|
||||
|
||||
if (!I2CPE_addr) {
|
||||
LOOP_LOGICAL_AXES(i) {
|
||||
if (!I2CPE_anyaxis || parser.seen(axis_codes[i])) {
|
||||
if (!I2CPE_anyaxis || parser.seen(AXIS_CHAR(i))) {
|
||||
const uint8_t idx = idx_from_axis(AxisEnum(i));
|
||||
if ((int8_t)idx >= 0) report_module_firmware(encoders[idx].get_address());
|
||||
}
|
||||
@@ -1007,7 +1007,7 @@ void I2CPositionEncodersMgr::M866() {
|
||||
|
||||
if (I2CPE_idx == 0xFF) {
|
||||
LOOP_LOGICAL_AXES(i) {
|
||||
if (!I2CPE_anyaxis || parser.seen(axis_codes[i])) {
|
||||
if (!I2CPE_anyaxis || parser.seen(AXIS_CHAR(i))) {
|
||||
const uint8_t idx = idx_from_axis(AxisEnum(i));
|
||||
if ((int8_t)idx >= 0) {
|
||||
if (hasR)
|
||||
@@ -1045,7 +1045,7 @@ void I2CPositionEncodersMgr::M867() {
|
||||
|
||||
if (I2CPE_idx == 0xFF) {
|
||||
LOOP_LOGICAL_AXES(i) {
|
||||
if (!I2CPE_anyaxis || parser.seen(axis_codes[i])) {
|
||||
if (!I2CPE_anyaxis || parser.seen(AXIS_CHAR(i))) {
|
||||
const uint8_t idx = idx_from_axis(AxisEnum(i));
|
||||
if ((int8_t)idx >= 0) {
|
||||
const bool ena = onoff == -1 ? !encoders[I2CPE_idx].get_ec_enabled() : !!onoff;
|
||||
@@ -1081,7 +1081,7 @@ void I2CPositionEncodersMgr::M868() {
|
||||
|
||||
if (I2CPE_idx == 0xFF) {
|
||||
LOOP_LOGICAL_AXES(i) {
|
||||
if (!I2CPE_anyaxis || parser.seen(axis_codes[i])) {
|
||||
if (!I2CPE_anyaxis || parser.seen(AXIS_CHAR(i))) {
|
||||
const uint8_t idx = idx_from_axis(AxisEnum(i));
|
||||
if ((int8_t)idx >= 0) {
|
||||
if (newThreshold != -9999)
|
||||
@@ -1115,7 +1115,7 @@ void I2CPositionEncodersMgr::M869() {
|
||||
|
||||
if (I2CPE_idx == 0xFF) {
|
||||
LOOP_LOGICAL_AXES(i) {
|
||||
if (!I2CPE_anyaxis || parser.seen(axis_codes[i])) {
|
||||
if (!I2CPE_anyaxis || parser.seen(AXIS_CHAR(i))) {
|
||||
const uint8_t idx = idx_from_axis(AxisEnum(i));
|
||||
if ((int8_t)idx >= 0) report_error(idx);
|
||||
}
|
||||
|
||||
@@ -261,32 +261,32 @@ class I2CPositionEncodersMgr {
|
||||
|
||||
static void report_error_count(const int8_t idx, const AxisEnum axis) {
|
||||
CHECK_IDX();
|
||||
SERIAL_ECHOLNPGM("Error count on ", AS_CHAR(axis_codes[axis]), " axis is ", encoders[idx].get_error_count());
|
||||
SERIAL_ECHOLNPGM("Error count on ", AS_CHAR(AXIS_CHAR(axis)), " axis is ", encoders[idx].get_error_count());
|
||||
}
|
||||
|
||||
static void reset_error_count(const int8_t idx, const AxisEnum axis) {
|
||||
CHECK_IDX();
|
||||
encoders[idx].set_error_count(0);
|
||||
SERIAL_ECHOLNPGM("Error count on ", AS_CHAR(axis_codes[axis]), " axis has been reset.");
|
||||
SERIAL_ECHOLNPGM("Error count on ", AS_CHAR(AXIS_CHAR(axis)), " axis has been reset.");
|
||||
}
|
||||
|
||||
static void enable_ec(const int8_t idx, const bool enabled, const AxisEnum axis) {
|
||||
CHECK_IDX();
|
||||
encoders[idx].set_ec_enabled(enabled);
|
||||
SERIAL_ECHOPGM("Error correction on ", AS_CHAR(axis_codes[axis]));
|
||||
SERIAL_ECHOPGM("Error correction on ", AS_CHAR(AXIS_CHAR(axis)));
|
||||
SERIAL_ECHO_TERNARY(encoders[idx].get_ec_enabled(), " axis is ", "en", "dis", "abled.\n");
|
||||
}
|
||||
|
||||
static void set_ec_threshold(const int8_t idx, const float newThreshold, const AxisEnum axis) {
|
||||
CHECK_IDX();
|
||||
encoders[idx].set_ec_threshold(newThreshold);
|
||||
SERIAL_ECHOLNPGM("Error correct threshold for ", AS_CHAR(axis_codes[axis]), " axis set to ", newThreshold, "mm.");
|
||||
SERIAL_ECHOLNPGM("Error correct threshold for ", AS_CHAR(AXIS_CHAR(axis)), " axis set to ", newThreshold, "mm.");
|
||||
}
|
||||
|
||||
static void get_ec_threshold(const int8_t idx, const AxisEnum axis) {
|
||||
CHECK_IDX();
|
||||
const float threshold = encoders[idx].get_ec_threshold();
|
||||
SERIAL_ECHOLNPGM("Error correct threshold for ", AS_CHAR(axis_codes[axis]), " axis is ", threshold, "mm.");
|
||||
SERIAL_ECHOLNPGM("Error correct threshold for ", AS_CHAR(AXIS_CHAR(axis)), " axis is ", threshold, "mm.");
|
||||
}
|
||||
|
||||
static int8_t idx_from_axis(const AxisEnum axis) {
|
||||
|
||||
@@ -34,7 +34,7 @@
|
||||
#if HAS_AUTO_FAN && EXTRUDER_AUTO_FAN_SPEED != 255 && DISABLED(FOURWIRES_FANS)
|
||||
bool FanCheck::measuring = false;
|
||||
#endif
|
||||
bool FanCheck::tacho_state[TACHO_COUNT];
|
||||
Flags<TACHO_COUNT> FanCheck::tacho_state;
|
||||
uint16_t FanCheck::edge_counter[TACHO_COUNT];
|
||||
uint8_t FanCheck::rps[TACHO_COUNT];
|
||||
FanCheck::TachoError FanCheck::error = FanCheck::TachoError::NONE;
|
||||
@@ -103,7 +103,7 @@ void FanCheck::update_tachometers() {
|
||||
|
||||
if (status != tacho_state[f]) {
|
||||
if (measuring) ++edge_counter[f];
|
||||
tacho_state[f] = status;
|
||||
tacho_state.set(f, status);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -51,7 +51,7 @@ class FanCheck {
|
||||
#else
|
||||
static constexpr bool measuring = true;
|
||||
#endif
|
||||
static bool tacho_state[TACHO_COUNT];
|
||||
static Flags<TACHO_COUNT> tacho_state;
|
||||
static uint16_t edge_counter[TACHO_COUNT];
|
||||
static uint8_t rps[TACHO_COUNT];
|
||||
static TachoError error;
|
||||
|
||||
@@ -45,7 +45,7 @@ FWRetract fwretract; // Single instance - this calls the constructor
|
||||
// private:
|
||||
|
||||
#if HAS_MULTI_EXTRUDER
|
||||
bool FWRetract::retracted_swap[EXTRUDERS]; // Which extruders are swap-retracted
|
||||
Flags<EXTRUDERS> FWRetract::retracted_swap; // Which extruders are swap-retracted
|
||||
#endif
|
||||
|
||||
// public:
|
||||
@@ -56,7 +56,7 @@ fwretract_settings_t FWRetract::settings; // M207 S F Z W, M208 S F
|
||||
bool FWRetract::autoretract_enabled; // M209 S - Autoretract switch
|
||||
#endif
|
||||
|
||||
bool FWRetract::retracted[EXTRUDERS]; // Which extruders are currently retracted
|
||||
Flags<EXTRUDERS> FWRetract::retracted; // Which extruders are currently retracted
|
||||
|
||||
float FWRetract::current_retract[EXTRUDERS], // Retract value used by planner
|
||||
FWRetract::current_hop;
|
||||
@@ -73,9 +73,9 @@ void FWRetract::reset() {
|
||||
settings.swap_retract_recover_feedrate_mm_s = RETRACT_RECOVER_FEEDRATE_SWAP;
|
||||
current_hop = 0.0;
|
||||
|
||||
retracted.reset();
|
||||
EXTRUDER_LOOP() {
|
||||
retracted[e] = false;
|
||||
E_TERN_(retracted_swap[e] = false);
|
||||
E_TERN_(retracted_swap.clear(e));
|
||||
current_retract[e] = 0.0;
|
||||
}
|
||||
}
|
||||
@@ -173,11 +173,11 @@ void FWRetract::retract(const bool retracting E_OPTARG(bool swapping/*=false*/))
|
||||
|
||||
TERN_(RETRACT_SYNC_MIXING, mixer.T(old_mixing_tool)); // Restore original mixing tool
|
||||
|
||||
retracted[active_extruder] = retracting; // Active extruder now retracted / recovered
|
||||
retracted.set(active_extruder, retracting); // Active extruder now retracted / recovered
|
||||
|
||||
// If swap retract/recover update the retracted_swap flag too
|
||||
#if HAS_MULTI_EXTRUDER
|
||||
if (swapping) retracted_swap[active_extruder] = retracting;
|
||||
if (swapping) retracted_swap.set(active_extruder, retracting);
|
||||
#endif
|
||||
|
||||
/* // debugging
|
||||
|
||||
@@ -43,7 +43,7 @@ typedef struct {
|
||||
class FWRetract {
|
||||
private:
|
||||
#if HAS_MULTI_EXTRUDER
|
||||
static bool retracted_swap[EXTRUDERS]; // Which extruders are swap-retracted
|
||||
static Flags<EXTRUDERS> retracted_swap; // Which extruders are swap-retracted
|
||||
#endif
|
||||
|
||||
public:
|
||||
@@ -55,7 +55,7 @@ public:
|
||||
static constexpr bool autoretract_enabled = false;
|
||||
#endif
|
||||
|
||||
static bool retracted[EXTRUDERS]; // Which extruders are currently retracted
|
||||
static Flags<EXTRUDERS> retracted; // Which extruders are currently retracted
|
||||
static float current_retract[EXTRUDERS], // Retract value used by planner
|
||||
current_hop; // Hop value used by planner
|
||||
|
||||
@@ -63,9 +63,7 @@ public:
|
||||
|
||||
static void reset();
|
||||
|
||||
static void refresh_autoretract() {
|
||||
EXTRUDER_LOOP() retracted[e] = false;
|
||||
}
|
||||
static void refresh_autoretract() { retracted.reset(); }
|
||||
|
||||
static void enable_autoretract(const bool enable) {
|
||||
#if ENABLED(FWRETRACT_AUTORETRACT)
|
||||
|
||||
@@ -514,7 +514,7 @@ void PrintJobRecovery::resume() {
|
||||
EXTRUDER_LOOP() {
|
||||
if (info.retract[e] != 0.0) {
|
||||
fwretract.current_retract[e] = info.retract[e];
|
||||
fwretract.retracted[e] = true;
|
||||
fwretract.retracted.set(e);
|
||||
}
|
||||
}
|
||||
fwretract.current_hop = info.retract_hop;
|
||||
|
||||
@@ -66,7 +66,7 @@ void GcodeSuite::M425() {
|
||||
LOOP_NUM_AXES(a) {
|
||||
if (axis_can_calibrate(a) && parser.seen(AXIS_CHAR(a))) {
|
||||
planner.synchronize();
|
||||
backlash.set_distance_mm(AxisEnum(a), parser.has_value() ? parser.value_axis_units(AxisEnum(a)) : backlash.get_measurement(AxisEnum(a)));
|
||||
backlash.set_distance_mm((AxisEnum)a, parser.has_value() ? parser.value_axis_units((AxisEnum)a) : backlash.get_measurement((AxisEnum)a));
|
||||
noArgs = false;
|
||||
}
|
||||
}
|
||||
@@ -92,9 +92,7 @@ void GcodeSuite::M425() {
|
||||
SERIAL_ECHOLNPGM(" Correction Amount/Fade-out: F", backlash.get_correction(), " (F1.0 = full, F0.0 = none)");
|
||||
SERIAL_ECHOPGM(" Backlash Distance (mm): ");
|
||||
LOOP_NUM_AXES(a) if (axis_can_calibrate(a)) {
|
||||
SERIAL_CHAR(' ', AXIS_CHAR(a));
|
||||
SERIAL_ECHO(backlash.get_distance_mm(AxisEnum(a)));
|
||||
SERIAL_EOL();
|
||||
SERIAL_ECHOLNPGM_P((PGM_P)pgm_read_ptr(&SP_AXIS_STR[a]), backlash.get_distance_mm((AxisEnum)a));
|
||||
}
|
||||
|
||||
#ifdef BACKLASH_SMOOTHING_MM
|
||||
@@ -105,8 +103,7 @@ void GcodeSuite::M425() {
|
||||
SERIAL_ECHOPGM(" Average measured backlash (mm):");
|
||||
if (backlash.has_any_measurement()) {
|
||||
LOOP_NUM_AXES(a) if (axis_can_calibrate(a) && backlash.has_measurement(AxisEnum(a))) {
|
||||
SERIAL_CHAR(' ', AXIS_CHAR(a));
|
||||
SERIAL_ECHO(backlash.get_measurement(AxisEnum(a)));
|
||||
SERIAL_ECHOPGM_P((PGM_P)pgm_read_ptr(&SP_AXIS_STR[a]), backlash.get_measurement((AxisEnum)a));
|
||||
}
|
||||
}
|
||||
else
|
||||
|
||||
@@ -125,7 +125,7 @@ void GcodeSuite::M201() {
|
||||
#endif
|
||||
|
||||
LOOP_LOGICAL_AXES(i) {
|
||||
if (parser.seenval(axis_codes[i])) {
|
||||
if (parser.seenval(AXIS_CHAR(i))) {
|
||||
const uint8_t a = TERN(HAS_EXTRUDERS, (i == E_AXIS ? uint8_t(E_AXIS_N(target_extruder)) : i), i);
|
||||
planner.set_max_acceleration(a, parser.value_axis_units((AxisEnum)a));
|
||||
}
|
||||
@@ -144,7 +144,7 @@ void GcodeSuite::M201_report(const bool forReplay/*=true*/) {
|
||||
SP_K_STR, K_AXIS_UNIT(planner.settings.max_acceleration_mm_per_s2[K_AXIS]),
|
||||
SP_U_STR, U_AXIS_UNIT(planner.settings.max_acceleration_mm_per_s2[U_AXIS]),
|
||||
SP_V_STR, V_AXIS_UNIT(planner.settings.max_acceleration_mm_per_s2[V_AXIS]),
|
||||
SP_W_STR, W_AXIS_UNIT(planner.settings.max_acceleration_mm_per_s2[W_AXIS]),
|
||||
SP_W_STR, W_AXIS_UNIT(planner.settings.max_acceleration_mm_per_s2[W_AXIS])
|
||||
)
|
||||
#if HAS_EXTRUDERS && DISABLED(DISTINCT_E_FACTORS)
|
||||
, SP_E_STR, VOLUMETRIC_UNIT(planner.settings.max_acceleration_mm_per_s2[E_AXIS])
|
||||
@@ -174,7 +174,7 @@ void GcodeSuite::M203() {
|
||||
if (target_extruder < 0) return;
|
||||
|
||||
LOOP_LOGICAL_AXES(i)
|
||||
if (parser.seenval(axis_codes[i])) {
|
||||
if (parser.seenval(AXIS_CHAR(i))) {
|
||||
const uint8_t a = TERN(HAS_EXTRUDERS, (i == E_AXIS ? uint8_t(E_AXIS_N(target_extruder)) : i), i);
|
||||
planner.set_max_feedrate(a, parser.value_axis_units((AxisEnum)a));
|
||||
}
|
||||
|
||||
@@ -47,7 +47,7 @@ void GcodeSuite::M92() {
|
||||
return M92_report(true, target_extruder);
|
||||
|
||||
LOOP_LOGICAL_AXES(i) {
|
||||
if (parser.seenval(axis_codes[i])) {
|
||||
if (parser.seenval(AXIS_CHAR(i))) {
|
||||
if (TERN1(HAS_EXTRUDERS, i != E_AXIS))
|
||||
planner.settings.axis_steps_per_mm[i] = parser.value_per_axis_units((AxisEnum)i);
|
||||
else {
|
||||
|
||||
@@ -49,7 +49,7 @@ void GcodeSuite::M111() {
|
||||
LOOP_L_N(i, COUNT(debug_strings)) {
|
||||
if (TEST(marlin_debug_flags, i)) {
|
||||
if (comma++) SERIAL_CHAR(',');
|
||||
SERIAL_ECHOPGM_P((char*)pgm_read_ptr(&debug_strings[i]));
|
||||
SERIAL_ECHOPGM_P((PGM_P)pgm_read_ptr(&debug_strings[i]));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -33,8 +33,8 @@
|
||||
#include "../../core/debug_out.h"
|
||||
#include "../../libs/hex_print.h"
|
||||
|
||||
inline axis_flags_t selected_axis_bits() {
|
||||
axis_flags_t selected{0};
|
||||
inline stepper_flags_t selected_axis_bits() {
|
||||
stepper_flags_t selected{0};
|
||||
#if HAS_EXTRUDERS
|
||||
if (parser.seen('E')) {
|
||||
if (E_TERN0(parser.has_value())) {
|
||||
@@ -61,7 +61,7 @@ inline axis_flags_t selected_axis_bits() {
|
||||
}
|
||||
|
||||
// Enable specified axes and warn about other affected axes
|
||||
void do_enable(const axis_flags_t to_enable) {
|
||||
void do_enable(const stepper_flags_t to_enable) {
|
||||
const ena_mask_t was_enabled = stepper.axis_enabled.bits,
|
||||
shall_enable = to_enable.bits & ~was_enabled;
|
||||
|
||||
@@ -75,7 +75,7 @@ void do_enable(const axis_flags_t to_enable) {
|
||||
LOOP_NUM_AXES(a) {
|
||||
if (TEST(shall_enable, a)) {
|
||||
stepper.enable_axis(AxisEnum(a)); // Mark and enable the requested axis
|
||||
DEBUG_ECHOLNPGM("Enabled ", axis_codes[a], " (", a, ") with overlap ", hex_word(enable_overlap[a]), " ... Enabled: ", hex_word(stepper.axis_enabled.bits));
|
||||
DEBUG_ECHOLNPGM("Enabled ", AXIS_CHAR(a), " (", a, ") with overlap ", hex_word(enable_overlap[a]), " ... Enabled: ", hex_word(stepper.axis_enabled.bits));
|
||||
also_enabled |= enable_overlap[a];
|
||||
}
|
||||
}
|
||||
@@ -92,7 +92,7 @@ void do_enable(const axis_flags_t to_enable) {
|
||||
|
||||
if ((also_enabled &= ~(shall_enable | was_enabled))) {
|
||||
SERIAL_CHAR('(');
|
||||
LOOP_NUM_AXES(a) if (TEST(also_enabled, a)) SERIAL_CHAR(axis_codes[a], ' ');
|
||||
LOOP_NUM_AXES(a) if (TEST(also_enabled, a)) SERIAL_CHAR(AXIS_CHAR(a), ' ');
|
||||
#if HAS_EXTRUDERS
|
||||
#define _EN_ALSO(N) if (TEST(also_enabled, INDEX_OF_AXIS(E_AXIS, N))) SERIAL_CHAR('E', '0' + N, ' ');
|
||||
REPEAT(EXTRUDERS, _EN_ALSO)
|
||||
@@ -147,7 +147,7 @@ void GcodeSuite::M17() {
|
||||
}
|
||||
}
|
||||
|
||||
void try_to_disable(const axis_flags_t to_disable) {
|
||||
void try_to_disable(const stepper_flags_t to_disable) {
|
||||
ena_mask_t still_enabled = to_disable.bits & stepper.axis_enabled.bits;
|
||||
|
||||
DEBUG_ECHOLNPGM("Enabled: ", hex_word(stepper.axis_enabled.bits), " To Disable: ", hex_word(to_disable.bits), " | ", hex_word(still_enabled));
|
||||
@@ -157,7 +157,7 @@ void try_to_disable(const axis_flags_t to_disable) {
|
||||
// Attempt to disable all flagged axes
|
||||
LOOP_NUM_AXES(a)
|
||||
if (TEST(to_disable.bits, a)) {
|
||||
DEBUG_ECHOPGM("Try to disable ", axis_codes[a], " (", a, ") with overlap ", hex_word(enable_overlap[a]), " ... ");
|
||||
DEBUG_ECHOPGM("Try to disable ", AXIS_CHAR(a), " (", a, ") with overlap ", hex_word(enable_overlap[a]), " ... ");
|
||||
if (stepper.disable_axis(AxisEnum(a))) { // Mark the requested axis and request to disable
|
||||
DEBUG_ECHOPGM("OK");
|
||||
still_enabled &= ~(_BV(a) | enable_overlap[a]); // If actually disabled, clear one or more tracked bits
|
||||
@@ -184,7 +184,7 @@ void try_to_disable(const axis_flags_t to_disable) {
|
||||
|
||||
auto overlap_warning = [](const ena_mask_t axis_bits) {
|
||||
SERIAL_ECHOPGM(" not disabled. Shared with");
|
||||
LOOP_NUM_AXES(a) if (TEST(axis_bits, a)) SERIAL_CHAR(' ', axis_codes[a]);
|
||||
LOOP_NUM_AXES(a) if (TEST(axis_bits, a)) SERIAL_ECHOPGM_P((PGM_P)pgm_read_ptr(&SP_AXIS_STR[a]));
|
||||
#if HAS_EXTRUDERS
|
||||
#define _EN_STILLON(N) if (TEST(axis_bits, INDEX_OF_AXIS(E_AXIS, N))) SERIAL_CHAR(' ', 'E', '0' + N);
|
||||
REPEAT(EXTRUDERS, _EN_STILLON)
|
||||
@@ -195,7 +195,7 @@ void try_to_disable(const axis_flags_t to_disable) {
|
||||
// If any of the requested axes are still enabled, give a warning
|
||||
LOOP_NUM_AXES(a) {
|
||||
if (TEST(still_enabled, a)) {
|
||||
SERIAL_CHAR(axis_codes[a]);
|
||||
SERIAL_CHAR(AXIS_CHAR(a));
|
||||
overlap_warning(stepper.axis_enabled.bits & enable_overlap[a]);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -27,35 +27,45 @@
|
||||
#include "../gcode.h"
|
||||
#include "../../module/stepper.h"
|
||||
|
||||
#if NUM_AXES == XYZ && EXTRUDERS >= 1
|
||||
#define HAS_M350_B_PARAM 1 // "5th axis" (after E0) for an original XYZEB setup.
|
||||
#if AXIS_COLLISION('B')
|
||||
#error "M350 parameter 'B' collision with axis name."
|
||||
#endif
|
||||
#endif
|
||||
|
||||
/**
|
||||
* M350: Set axis microstepping modes. S sets mode for all drivers.
|
||||
*
|
||||
* Warning: Steps-per-unit remains unchanged.
|
||||
*/
|
||||
void GcodeSuite::M350() {
|
||||
if (parser.seen('S')) LOOP_LE_N(i, 4) stepper.microstep_mode(i, parser.value_byte());
|
||||
LOOP_LOGICAL_AXES(i) if (parser.seen(axis_codes[i])) stepper.microstep_mode(i, parser.value_byte());
|
||||
if (parser.seen('B')) stepper.microstep_mode(4, parser.value_byte());
|
||||
if (parser.seen('S')) LOOP_DISTINCT_AXES(i) stepper.microstep_mode(i, parser.value_byte());
|
||||
LOOP_LOGICAL_AXES(i) if (parser.seen(AXIS_CHAR(i))) stepper.microstep_mode(i, parser.value_byte());
|
||||
TERN_(HAS_M350_B_PARAM, if (parser.seenval('B')) stepper.microstep_mode(E_AXIS + 1, parser.value_byte()));
|
||||
stepper.microstep_readings();
|
||||
}
|
||||
|
||||
/**
|
||||
* M351: Toggle MS1 MS2 pins directly with axis codes X Y Z E B
|
||||
* M351: Toggle MS1 MS2 pins directly with axis codes X Y Z . . . E [B]
|
||||
* S# determines MS1, MS2 or MS3, X# sets the pin high/low.
|
||||
*
|
||||
* Parameter 'B' sets "5th axis" (after E0) only for an original XYZEB setup.
|
||||
*/
|
||||
void GcodeSuite::M351() {
|
||||
const int8_t bval = TERN(HAS_M350_B_PARAM, parser.byteval('B', -1), -1); UNUSED(bval);
|
||||
if (parser.seenval('S')) switch (parser.value_byte()) {
|
||||
case 1:
|
||||
LOOP_LOGICAL_AXES(i) if (parser.seenval(axis_codes[i])) stepper.microstep_ms(i, parser.value_byte(), -1, -1);
|
||||
if (parser.seenval('B')) stepper.microstep_ms(4, parser.value_byte(), -1, -1);
|
||||
LOOP_LOGICAL_AXES(i) if (parser.seenval(AXIS_CHAR(i))) stepper.microstep_ms(i, parser.value_byte(), -1, -1);
|
||||
TERN_(HAS_M350_B_PARAM, if (bval >= 0) stepper.microstep_ms(E_AXIS + 1, bval != 0, -1, -1));
|
||||
break;
|
||||
case 2:
|
||||
LOOP_LOGICAL_AXES(i) if (parser.seenval(axis_codes[i])) stepper.microstep_ms(i, -1, parser.value_byte(), -1);
|
||||
if (parser.seenval('B')) stepper.microstep_ms(4, -1, parser.value_byte(), -1);
|
||||
LOOP_LOGICAL_AXES(i) if (parser.seenval(AXIS_CHAR(i))) stepper.microstep_ms(i, -1, parser.value_byte(), -1);
|
||||
TERN_(HAS_M350_B_PARAM, if (bval >= 0) stepper.microstep_ms(E_AXIS + 1, -1, bval != 0, -1));
|
||||
break;
|
||||
case 3:
|
||||
LOOP_LOGICAL_AXES(i) if (parser.seenval(axis_codes[i])) stepper.microstep_ms(i, -1, -1, parser.value_byte());
|
||||
if (parser.seenval('B')) stepper.microstep_ms(4, -1, -1, parser.value_byte());
|
||||
LOOP_LOGICAL_AXES(i) if (parser.seenval(AXIS_CHAR(i))) stepper.microstep_ms(i, -1, -1, parser.value_byte());
|
||||
TERN_(HAS_M350_B_PARAM, if (bval >= 0) stepper.microstep_ms(E_AXIS + 1, -1, -1, bval != 0));
|
||||
break;
|
||||
}
|
||||
stepper.microstep_readings();
|
||||
|
||||
@@ -25,7 +25,7 @@
|
||||
#if HAS_L64XX
|
||||
|
||||
#if AXIS_COLLISION('I')
|
||||
#error "M906 parameter collision with axis name."
|
||||
#error "M906 parameter 'I' collision with axis name."
|
||||
#endif
|
||||
|
||||
#include "../../gcode.h"
|
||||
@@ -211,7 +211,7 @@ void L64XX_report_current(L64XX &motor, const L64XX_axis_t axis) {
|
||||
* 1 - monitor only X2, Y2, Z2
|
||||
* 2 - monitor only Z3
|
||||
* 3 - monitor only Z4
|
||||
* Xxxx, Yxxx, Zxxx, Exxx - axis to change (optional)
|
||||
* Xxxx, Yxxx, Zxxx, Axxx, Bxxx, Cxxx, Uxxx, Vxxx, Wxxx, Exxx - axis to change (optional)
|
||||
* L6474 - current in mA (4A max)
|
||||
* All others - 0-255
|
||||
*
|
||||
@@ -236,7 +236,7 @@ void GcodeSuite::M906() {
|
||||
constexpr int8_t index = -1;
|
||||
#endif
|
||||
|
||||
LOOP_LOGICAL_AXES(i) if (uint16_t value = parser.intval(axis_codes[i])) {
|
||||
LOOP_LOGICAL_AXES(i) if (uint16_t value = parser.intval(AXIS_CHAR(i))) {
|
||||
|
||||
report_current = false;
|
||||
|
||||
@@ -285,6 +285,25 @@ void GcodeSuite::M906() {
|
||||
break;
|
||||
#endif
|
||||
|
||||
#if AXIS_IS_L64XX(I)
|
||||
case I_AXIS: L6470_SET_KVAL_HOLD(I); break;
|
||||
#endif
|
||||
#if AXIS_IS_L64XX(J)
|
||||
case J_AXIS: L6470_SET_KVAL_HOLD(J); break;
|
||||
#endif
|
||||
#if AXIS_IS_L64XX(K)
|
||||
case K_AXIS: L6470_SET_KVAL_HOLD(K); break;
|
||||
#endif
|
||||
#if AXIS_IS_L64XX(U)
|
||||
case U_AXIS: L6470_SET_KVAL_HOLD(U); break;
|
||||
#endif
|
||||
#if AXIS_IS_L64XX(V)
|
||||
case V_AXIS: L6470_SET_KVAL_HOLD(V); break;
|
||||
#endif
|
||||
#if AXIS_IS_L64XX(W)
|
||||
case W_AXIS: L6470_SET_KVAL_HOLD(W); break;
|
||||
#endif
|
||||
|
||||
#if AXIS_IS_L64XX(E0) || AXIS_IS_L64XX(E1) || AXIS_IS_L64XX(E2) || AXIS_IS_L64XX(E3) || AXIS_IS_L64XX(E4) || AXIS_IS_L64XX(E5) || AXIS_IS_L64XX(E6) || AXIS_IS_L64XX(E7)
|
||||
case E_AXIS: {
|
||||
const int8_t eindex = get_target_e_stepper_from_command(-2);
|
||||
@@ -346,6 +365,24 @@ void GcodeSuite::M906() {
|
||||
#if AXIS_IS_L64XX(Z4)
|
||||
L64XX_REPORT_CURRENT(Z4);
|
||||
#endif
|
||||
#if AXIS_IS_L64XX(I)
|
||||
L64XX_REPORT_CURRENT(I);
|
||||
#endif
|
||||
#if AXIS_IS_L64XX(J)
|
||||
L64XX_REPORT_CURRENT(J);
|
||||
#endif
|
||||
#if AXIS_IS_L64XX(K)
|
||||
L64XX_REPORT_CURRENT(K);
|
||||
#endif
|
||||
#if AXIS_IS_L64XX(U)
|
||||
L64XX_REPORT_CURRENT(U);
|
||||
#endif
|
||||
#if AXIS_IS_L64XX(V)
|
||||
L64XX_REPORT_CURRENT(V);
|
||||
#endif
|
||||
#if AXIS_IS_L64XX(W)
|
||||
L64XX_REPORT_CURRENT(W);
|
||||
#endif
|
||||
#if AXIS_IS_L64XX(E0)
|
||||
L64XX_REPORT_CURRENT(E0);
|
||||
#endif
|
||||
|
||||
@@ -35,7 +35,7 @@ void GcodeSuite::M122() {
|
||||
xyze_bool_t print_axis = ARRAY_N_1(LOGICAL_AXES, false);
|
||||
|
||||
bool print_all = true;
|
||||
LOOP_LOGICAL_AXES(i) if (parser.seen_test(axis_codes[i])) { print_axis[i] = true; print_all = false; }
|
||||
LOOP_LOGICAL_AXES(i) if (parser.seen_test(AXIS_CHAR(i))) { print_axis[i] = true; print_all = false; }
|
||||
|
||||
if (print_all) LOOP_LOGICAL_AXES(i) print_axis[i] = true;
|
||||
|
||||
|
||||
@@ -25,7 +25,7 @@
|
||||
#if HAS_STEALTHCHOP
|
||||
|
||||
#if AXIS_COLLISION('I')
|
||||
#error "M569 parameter collision with axis name."
|
||||
#error "M569 parameter 'I' collision with axis name."
|
||||
#endif
|
||||
|
||||
#include "../../gcode.h"
|
||||
@@ -53,7 +53,7 @@ static void set_stealth_status(const bool enable, const int8_t eindex) {
|
||||
constexpr int8_t index = -1;
|
||||
#endif
|
||||
|
||||
LOOP_LOGICAL_AXES(i) if (parser.seen(axis_codes[i])) {
|
||||
LOOP_LOGICAL_AXES(i) if (parser.seen(AXIS_CHAR(i))) {
|
||||
switch (i) {
|
||||
case X_AXIS:
|
||||
TERN_(X_HAS_STEALTHCHOP, if (index < 0 || index == 0) TMC_SET_STEALTH(X));
|
||||
|
||||
@@ -66,7 +66,7 @@ void GcodeSuite::M906() {
|
||||
constexpr int8_t index = -1;
|
||||
#endif
|
||||
|
||||
LOOP_LOGICAL_AXES(i) if (uint16_t value = parser.intval(axis_codes[i])) {
|
||||
LOOP_LOGICAL_AXES(i) if (uint16_t value = parser.intval(AXIS_CHAR(i))) {
|
||||
report = false;
|
||||
switch (i) {
|
||||
#if AXIS_IS_TMC(X) || AXIS_IS_TMC(X2)
|
||||
|
||||
@@ -288,7 +288,7 @@
|
||||
#elif AXIS_IS_TMC(X) || AXIS_IS_TMC(Y) || AXIS_IS_TMC(Z)
|
||||
constexpr int8_t index = -1;
|
||||
#endif
|
||||
LOOP_LOGICAL_AXES(i) if (int32_t value = parser.longval(axis_codes[i])) {
|
||||
LOOP_LOGICAL_AXES(i) if (int32_t value = parser.longval(AXIS_CHAR(i))) {
|
||||
report = false;
|
||||
switch (i) {
|
||||
#if X_HAS_STEALTHCHOP || X2_HAS_STEALTHCHOP
|
||||
|
||||
@@ -25,7 +25,7 @@
|
||||
#if HAS_TRINAMIC_CONFIG
|
||||
|
||||
#if AXIS_COLLISION('I')
|
||||
#error "M919 parameter collision with axis name."
|
||||
#error "M919 parameter 'I' collision with axis name."
|
||||
#endif
|
||||
|
||||
#include "../../gcode.h"
|
||||
@@ -112,13 +112,13 @@ void GcodeSuite::M919() {
|
||||
int8_t eindex = -1;
|
||||
#endif
|
||||
bool report = true;
|
||||
LOOP_LOGICAL_AXES(i) if (parser.seen_test(axis_codes[i])) {
|
||||
LOOP_LOGICAL_AXES(i) if (parser.seen_test(AXIS_CHAR(i))) {
|
||||
report = false;
|
||||
|
||||
// Get the chopper timing for the specified axis and index
|
||||
switch (i) {
|
||||
default: // A specified axis isn't Trinamic
|
||||
SERIAL_ECHOLNPGM("?Axis ", AS_CHAR(axis_codes[i]), " has no TMC drivers.");
|
||||
SERIAL_ECHOLNPGM("?Axis ", AS_CHAR(AXIS_CHAR(i)), " has no TMC drivers.");
|
||||
break;
|
||||
|
||||
#if AXIS_IS_TMC(X) || AXIS_IS_TMC(X2)
|
||||
|
||||
@@ -202,6 +202,7 @@
|
||||
* 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)
|
||||
* M255 - Set LCD sleep time: "M255 S<minutes>" (0-99). (Requires an LCD with brightness or sleep/wake)
|
||||
* M256 - Set LCD brightness: "M256 B<brightness>" (0-255). (Requires an LCD with brightness control)
|
||||
* M260 - i2c Send Data (Requires EXPERIMENTAL_I2CBUS)
|
||||
* M261 - i2c Request Data (Requires EXPERIMENTAL_I2CBUS)
|
||||
@@ -879,6 +880,11 @@ private:
|
||||
static void M250_report(const bool forReplay=true);
|
||||
#endif
|
||||
|
||||
#if HAS_DISPLAY_SLEEP
|
||||
static void M255();
|
||||
static void M255_report(const bool forReplay=true);
|
||||
#endif
|
||||
|
||||
#if HAS_LCD_BRIGHTNESS
|
||||
static void M256();
|
||||
static void M256_report(const bool forReplay=true);
|
||||
|
||||
@@ -74,7 +74,7 @@ void GcodeSuite::G92() {
|
||||
#if ENABLED(POWER_LOSS_RECOVERY)
|
||||
case 9: // G92.9 - Set Current Position directly (like Marlin 1.0)
|
||||
LOOP_LOGICAL_AXES(i) {
|
||||
if (parser.seenval(axis_codes[i])) {
|
||||
if (parser.seenval(AXIS_CHAR(i))) {
|
||||
if (TERN1(HAS_EXTRUDERS, i != E_AXIS))
|
||||
sync_XYZE = true;
|
||||
else {
|
||||
@@ -88,7 +88,7 @@ void GcodeSuite::G92() {
|
||||
|
||||
case 0:
|
||||
LOOP_LOGICAL_AXES(i) {
|
||||
if (parser.seenval(axis_codes[i])) {
|
||||
if (parser.seenval(AXIS_CHAR(i))) {
|
||||
const float l = parser.value_axis_units((AxisEnum)i), // Given axis coordinate value, converted to millimeters
|
||||
v = TERN0(HAS_EXTRUDERS, i == E_AXIS) ? l : LOGICAL_TO_NATIVE(l, i), // Axis position in NATIVE space (applying the existing offset)
|
||||
d = v - current_position[i]; // How much is the current axis position altered by?
|
||||
|
||||
@@ -34,10 +34,10 @@
|
||||
#include "../../core/debug_out.h"
|
||||
#endif
|
||||
|
||||
void report_all_axis_pos(const xyze_pos_t &pos, const uint8_t n=XYZE, const uint8_t precision=3) {
|
||||
void report_all_axis_pos(const xyze_pos_t &pos, const uint8_t n=LOGICAL_AXES, const uint8_t precision=3) {
|
||||
char str[12];
|
||||
LOOP_L_N(a, n) {
|
||||
SERIAL_CHAR(' ', axis_codes[a], ':');
|
||||
SERIAL_ECHOPGM_P((PGM_P)pgm_read_ptr(&SP_AXIS_LBL[a]));
|
||||
if (pos[a] >= 0) SERIAL_CHAR(' ');
|
||||
SERIAL_ECHO(dtostrf(pos[a], 1, precision, str));
|
||||
}
|
||||
@@ -47,10 +47,7 @@
|
||||
|
||||
void report_linear_axis_pos(const xyz_pos_t &pos, const uint8_t precision=3) {
|
||||
char str[12];
|
||||
LOOP_NUM_AXES(a) {
|
||||
SERIAL_CHAR(' ', AXIS_CHAR(a), ':');
|
||||
SERIAL_ECHO(dtostrf(pos[a], 1, precision, str));
|
||||
}
|
||||
LOOP_NUM_AXES(a) SERIAL_ECHOPGM_P((PGM_P)pgm_read_ptr(&SP_AXIS_LBL[a]), dtostrf(pos[a], 1, precision, str));
|
||||
SERIAL_EOL();
|
||||
}
|
||||
|
||||
@@ -172,8 +169,7 @@
|
||||
|
||||
SERIAL_ECHOPGM("Stepper:");
|
||||
LOOP_LOGICAL_AXES(i) {
|
||||
SERIAL_CHAR(' ', axis_codes[i], ':');
|
||||
SERIAL_ECHO(stepper.position((AxisEnum)i));
|
||||
SERIAL_ECHOPGM_P((PGM_P)pgm_read_ptr(&SP_AXIS_LBL[i]), stepper.position((AxisEnum)i));
|
||||
}
|
||||
SERIAL_EOL();
|
||||
|
||||
|
||||
@@ -22,7 +22,7 @@
|
||||
|
||||
#include "../../inc/MarlinConfig.h"
|
||||
|
||||
#if ENABLED(HOST_PROMPT_SUPPORT) && DISABLED(EMERGENCY_PARSER)
|
||||
#if HAS_GCODE_M876
|
||||
|
||||
#include "../../feature/host_actions.h"
|
||||
#include "../gcode.h"
|
||||
@@ -37,4 +37,4 @@ void GcodeSuite::M876() {
|
||||
|
||||
}
|
||||
|
||||
#endif // HOST_PROMPT_SUPPORT && !EMERGENCY_PARSER
|
||||
#endif // HAS_GCODE_M876
|
||||
|
||||
@@ -0,0 +1,58 @@
|
||||
/**
|
||||
* Marlin 3D Printer Firmware
|
||||
* Copyright (c) 2022 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/>.
|
||||
*
|
||||
*/
|
||||
#include "../../inc/MarlinConfig.h"
|
||||
|
||||
#if HAS_GCODE_M255
|
||||
|
||||
#include "../gcode.h"
|
||||
#include "../../lcd/marlinui.h"
|
||||
|
||||
/**
|
||||
* M255: Set the LCD sleep timeout (in minutes)
|
||||
* S<minutes> - Period of inactivity required for display / backlight sleep
|
||||
*/
|
||||
void GcodeSuite::M255() {
|
||||
if (parser.seenval('S')) {
|
||||
#if HAS_DISPLAY_SLEEP
|
||||
const int m = parser.value_int();
|
||||
ui.sleep_timeout_minutes = constrain(m, SLEEP_TIMEOUT_MIN, SLEEP_TIMEOUT_MAX);
|
||||
#else
|
||||
const int s = parser.value_int() * 60;
|
||||
ui.lcd_backlight_timeout = constrain(s, LCD_BKL_TIMEOUT_MIN, LCD_BKL_TIMEOUT_MAX);
|
||||
#endif
|
||||
}
|
||||
else
|
||||
M255_report();
|
||||
}
|
||||
|
||||
void GcodeSuite::M255_report(const bool forReplay/*=true*/) {
|
||||
report_heading_etc(forReplay, F(STR_DISPLAY_SLEEP));
|
||||
SERIAL_ECHOLNPGM(" M255 S",
|
||||
#if HAS_DISPLAY_SLEEP
|
||||
ui.sleep_timeout_minutes, " ; (minutes)"
|
||||
#else
|
||||
ui.lcd_backlight_timeout, " ; (seconds)"
|
||||
#endif
|
||||
);
|
||||
}
|
||||
|
||||
#endif // HAS_GCODE_M255
|
||||
@@ -25,7 +25,7 @@
|
||||
#if ENABLED(BEZIER_CURVE_SUPPORT)
|
||||
|
||||
#if AXIS_COLLISION('I') || AXIS_COLLISION('J')
|
||||
#error "G5 parameter collision with axis name."
|
||||
#error "G5 parameter 'I' or 'J' collision with axis name."
|
||||
#endif
|
||||
|
||||
#include "../../module/motion.h"
|
||||
|
||||
@@ -628,6 +628,12 @@
|
||||
#if ALL(HAS_RESUME_CONTINUE, PRINTER_EVENT_LEDS, SDSUPPORT)
|
||||
#define HAS_LEDS_OFF_FLAG 1
|
||||
#endif
|
||||
#ifdef DISPLAY_SLEEP_MINUTES
|
||||
#define HAS_DISPLAY_SLEEP 1
|
||||
#endif
|
||||
#if HAS_DISPLAY_SLEEP || LCD_BACKLIGHT_TIMEOUT
|
||||
#define HAS_GCODE_M255 1
|
||||
#endif
|
||||
|
||||
#if EITHER(DIGIPOT_MCP4018, DIGIPOT_MCP4451)
|
||||
#define HAS_MOTOR_CURRENT_I2C 1
|
||||
@@ -701,6 +707,10 @@
|
||||
#undef SERIAL_XON_XOFF
|
||||
#endif
|
||||
|
||||
#if ENABLED(HOST_PROMPT_SUPPORT) && DISABLED(EMERGENCY_PARSER)
|
||||
#define HAS_GCODE_M876 1
|
||||
#endif
|
||||
|
||||
#if ENABLED(HOST_ACTION_COMMANDS)
|
||||
#ifndef ACTION_ON_PAUSE
|
||||
#define ACTION_ON_PAUSE "pause"
|
||||
|
||||
@@ -612,7 +612,7 @@
|
||||
#elif defined(NOZZLE_PARK_X_ONLY)
|
||||
#error "NOZZLE_PARK_X_ONLY is now NOZZLE_PARK_MOVE 1."
|
||||
#elif defined(NOZZLE_PARK_Y_ONLY)
|
||||
#error "NOZZLE_PARK_X_ONLY is now NOZZLE_PARK_MOVE 2."
|
||||
#error "NOZZLE_PARK_Y_ONLY is now NOZZLE_PARK_MOVE 2."
|
||||
#elif defined(Z_STEPPER_ALIGN_KNOWN_STEPPER_POSITIONS)
|
||||
#error "Z_STEPPER_ALIGN_KNOWN_STEPPER_POSITIONS is now just Z_STEPPER_ALIGN_STEPPER_XY."
|
||||
#elif defined(DWIN_CREALITY_LCD_ENHANCED)
|
||||
@@ -1315,6 +1315,14 @@ static_assert(Y_MAX_LENGTH >= Y_BED_SIZE, "Movement bounds (Y_MIN_POS, Y_MAX_POS
|
||||
#endif
|
||||
#endif
|
||||
|
||||
/**
|
||||
* Generic Switching Toolhead requirements
|
||||
*/
|
||||
#if ANY(SWITCHING_TOOLHEAD, MAGNETIC_SWITCHING_TOOLHEAD, ELECTROMAGNETIC_SWITCHING_TOOLHEAD)
|
||||
constexpr float thpx[] = SWITCHING_TOOLHEAD_X_POS;
|
||||
static_assert(COUNT(thpx) == EXTRUDERS, "SWITCHING_TOOLHEAD_X_POS must be an array EXTRUDERS long.");
|
||||
#endif
|
||||
|
||||
/**
|
||||
* Switching Toolhead requirements
|
||||
*/
|
||||
@@ -2983,6 +2991,17 @@ static_assert(Y_MAX_LENGTH >= Y_BED_SIZE, "Movement bounds (Y_MIN_POS, Y_MAX_POS
|
||||
#endif
|
||||
#endif
|
||||
|
||||
/**
|
||||
* Display Sleep is not supported by these common displays
|
||||
*/
|
||||
#if HAS_DISPLAY_SLEEP
|
||||
#if ANY(IS_U8GLIB_LM6059_AF, IS_U8GLIB_ST7565_64128, REPRAPWORLD_GRAPHICAL_LCD, FYSETC_MINI, ENDER2_STOCKDISPLAY, MINIPANEL)
|
||||
#error "DISPLAY_SLEEP_MINUTES is not supported by your display."
|
||||
#elif !WITHIN(DISPLAY_SLEEP_MINUTES, 0, 255)
|
||||
#error "DISPLAY_SLEEP_MINUTES must be between 0 and 255."
|
||||
#endif
|
||||
#endif
|
||||
|
||||
/**
|
||||
* Some boards forbid the use of -1 Native USB
|
||||
*/
|
||||
|
||||
@@ -42,7 +42,7 @@
|
||||
* version was tagged.
|
||||
*/
|
||||
#ifndef STRING_DISTRIBUTION_DATE
|
||||
#define STRING_DISTRIBUTION_DATE "2022-04-03"
|
||||
#define STRING_DISTRIBUTION_DATE "2022-04-05"
|
||||
#endif
|
||||
|
||||
/**
|
||||
|
||||
@@ -342,6 +342,11 @@ void MarlinUI::draw_kill_screen() {
|
||||
|
||||
void MarlinUI::clear_lcd() { } // Automatically cleared by Picture Loop
|
||||
|
||||
#if HAS_DISPLAY_SLEEP
|
||||
void MarlinUI::sleep_on() { u8g.sleepOn(); }
|
||||
void MarlinUI::sleep_off() { u8g.sleepOff(); }
|
||||
#endif
|
||||
|
||||
#if HAS_LCD_BRIGHTNESS
|
||||
|
||||
void MarlinUI::_set_brightness() {
|
||||
|
||||
@@ -432,7 +432,7 @@ FORCE_INLINE void _draw_axis_value(const AxisEnum axis, const char *value, const
|
||||
const bool is_inch = parser.using_inch_units();
|
||||
const AxisEnum a = TERN(LCD_SHOW_E_TOTAL, axis == E_AXIS ? X_AXIS : axis, axis);
|
||||
const uint8_t offs = a * (is_inch ? XYZ_SPACING_IN : XYZ_SPACING);
|
||||
lcd_put_wchar((is_inch ? X_LABEL_POS_IN : X_LABEL_POS) + offs, XYZ_BASELINE, axis_codes[axis]);
|
||||
lcd_put_wchar((is_inch ? X_LABEL_POS_IN : X_LABEL_POS) + offs, XYZ_BASELINE, AXIS_CHAR(axis));
|
||||
lcd_moveto((is_inch ? X_VALUE_POS_IN : X_VALUE_POS) + offs, XYZ_BASELINE);
|
||||
|
||||
if (blink)
|
||||
|
||||
@@ -235,7 +235,6 @@ void DWIN_Frame_AreaMove(uint8_t mode, uint8_t dir, uint16_t dis,
|
||||
// rlimit: To limit the drawn string length
|
||||
void DWIN_Draw_String(bool bShow, uint8_t size, uint16_t color, uint16_t bColor, uint16_t x, uint16_t y, const char * const string, uint16_t rlimit/*=0xFFFF*/) {
|
||||
DWIN_Draw_Rectangle(1, bColor, x, y, x + (fontWidth(size) * strlen_P(string)), y + fontHeight(size));
|
||||
DWIN_UpdateLCD();
|
||||
constexpr uint8_t widthAdjust = 0;
|
||||
size_t i = 0;
|
||||
DWIN_Byte(i, 0x11);
|
||||
@@ -250,7 +249,6 @@ void DWIN_Draw_String(bool bShow, uint8_t size, uint16_t color, uint16_t bColor,
|
||||
DWIN_Word(i, y);
|
||||
DWIN_Text(i, string, rlimit);
|
||||
DWIN_Send(i);
|
||||
DWIN_UpdateLCD();
|
||||
}
|
||||
|
||||
// Draw a positive integer
|
||||
@@ -297,7 +295,6 @@ void DWIN_Draw_IntValue(uint8_t bShow, bool zeroFill, uint8_t zeroMode, uint8_t
|
||||
#endif
|
||||
|
||||
DWIN_Send(i);
|
||||
DWIN_UpdateLCD();
|
||||
}
|
||||
|
||||
// Draw a floating point number
|
||||
@@ -332,7 +329,6 @@ void DWIN_Draw_FloatValue(uint8_t bShow, bool zeroFill, uint8_t zeroMode, uint8_
|
||||
DWIN_Byte(i, fvalue[0]);
|
||||
*/
|
||||
DWIN_Send(i);
|
||||
DWIN_UpdateLCD();
|
||||
}
|
||||
|
||||
// Draw a floating point number
|
||||
|
||||
@@ -70,7 +70,7 @@ void DWIN_String::add(uint8_t *string, const int8_t index, uint8_t *itemString/*
|
||||
else if (ch == '$' && itemString)
|
||||
add(itemString);
|
||||
else if (ch == '@')
|
||||
add_character(axis_codes[index]);
|
||||
add_character(AXIS_CHAR(index));
|
||||
else
|
||||
add_character(ch);
|
||||
}
|
||||
|
||||
@@ -181,7 +181,6 @@ void MarlinUI::draw_status_message(const bool blink) {
|
||||
dwin_font.solid = true;
|
||||
dwin_font.fg = Color_White;
|
||||
dwin_font.bg = Color_Bg_Black;
|
||||
DWIN_Draw_Box(1, Color_Bg_Black, 0, (LCD_PIXEL_HEIGHT - (STAT_FONT_HEIGHT) - 1), 272, STAT_FONT_HEIGHT + 1);
|
||||
lcd_moveto_xy(0, LCD_PIXEL_HEIGHT - (STAT_FONT_HEIGHT) - 1);
|
||||
|
||||
constexpr uint8_t max_status_chars = (LCD_PIXEL_WIDTH) / (STAT_FONT_WIDTH);
|
||||
|
||||
@@ -196,13 +196,13 @@ FORCE_INLINE void _draw_heater_status(const heater_id_t heater, const uint16_t x
|
||||
#else
|
||||
#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);
|
||||
static celsius_t old_temp[HOTEND_STATS] = { 0 },
|
||||
old_target[HOTEND_STATS] = { 0 };
|
||||
static bool old_on[HOTEND_STATS] = { false };
|
||||
#endif
|
||||
|
||||
#if HAS_HEATED_BED
|
||||
static celsius_t old_bed_temp = 500, old_bed_target = 500;
|
||||
static celsius_t old_bed_temp = 0, old_bed_target = 0;
|
||||
static bool old_bed_on = false;
|
||||
#if HAS_LEVELING
|
||||
static bool old_leveling_on = false;
|
||||
|
||||
@@ -24,9 +24,9 @@
|
||||
//****************俄语***************************//
|
||||
#define TOOL_TEXT_RU "инструмент"
|
||||
#define PREHEAT_TEXT_RU " нагрев"
|
||||
#define MOVE_TEXT_RU "движение"
|
||||
#define HOME_TEXT_RU "домой"
|
||||
#define PRINT_TEXT_RU " печать"
|
||||
#define MOVE_TEXT_RU "двигать"
|
||||
#define HOME_TEXT_RU "дом"
|
||||
#define PRINT_TEXT_RU "печать"
|
||||
#define EXTRUDE_TEXT_RU "экструзия"
|
||||
#define LEVELING_TEXT_RU "уровень"
|
||||
#define AUTO_LEVELING_TEXT_RU "aвтоуровень"
|
||||
@@ -40,17 +40,17 @@
|
||||
#define EXTRUDER_1_TEXT_RU "экструдер1"
|
||||
#define EXTRUDER_2_TEXT_RU "экструдер2"
|
||||
#define HEATBED_TEXT_RU "стол"
|
||||
#define TEXT_1C_RU "1℃"
|
||||
#define TEXT_5C_RU "5℃"
|
||||
#define TEXT_10C_RU "10℃"
|
||||
#define TEXT_1C_RU "1°Ц"
|
||||
#define TEXT_5C_RU "5°Ц"
|
||||
#define TEXT_10C_RU "10°Ц"
|
||||
#define CLOSE_TEXT_RU "выкл"
|
||||
|
||||
#define BACK_TEXT_RU "назад"
|
||||
|
||||
#define TOOL_PREHEAT_RU "нагрев"
|
||||
#define TOOL_EXTRUDE_RU "экструдер"
|
||||
#define TOOL_MOVE_RU "движение"
|
||||
#define TOOL_HOME_RU "домой"
|
||||
#define TOOL_MOVE_RU "двигать"
|
||||
#define TOOL_HOME_RU "дом"
|
||||
#define TOOL_LEVELING_RU "уровень"
|
||||
#define TOOL_AUTO_LEVELING_RU "aвтоуровень"
|
||||
#define TOOL_FILAMENT_RU "замена"
|
||||
@@ -62,33 +62,33 @@
|
||||
#define AXIS_Y_DEC_TEXT_RU "Y -"
|
||||
#define AXIS_Z_ADD_TEXT_RU "Z +"
|
||||
#define AXIS_Z_DEC_TEXT_RU "Z -"
|
||||
#define TEXT_01MM_RU "0.1 mm"
|
||||
#define TEXT_1MM_RU "1 mm"
|
||||
#define TEXT_10MM_RU "10 mm"
|
||||
#define TEXT_01MM_RU "0.1 мм"
|
||||
#define TEXT_1MM_RU "1 мм"
|
||||
#define TEXT_10MM_RU "10 мм"
|
||||
|
||||
#define HOME_X_TEXT_RU "X"
|
||||
#define HOME_Y_TEXT_RU "Y"
|
||||
#define HOME_Z_TEXT_RU "Z"
|
||||
#define HOME_ALL_TEXT_RU "Home"
|
||||
#define HOME_STOPMOVE_RU "Quickstop"
|
||||
#define HOME_ALL_TEXT_RU "Дом"
|
||||
#define HOME_STOPMOVE_RU "Концевик"
|
||||
|
||||
#define PAGE_UP_TEXT_RU "вверх"
|
||||
#define PAGE_DOWN_TEXT_RU "вниз"
|
||||
|
||||
#define EXTRUDER_IN_TEXT_RU "втянуть"
|
||||
#define EXTRUDER_OUT_TEXT_RU "выдавить"
|
||||
#define EXTRUDE_1MM_TEXT_RU "1 mm"
|
||||
#define EXTRUDE_5MM_TEXT_RU "5 mm"
|
||||
#define EXTRUDE_10MM_TEXT_RU "10 mm"
|
||||
#define EXTRUDE_LOW_SPEED_TEXT_RU "мин"
|
||||
#define EXTRUDE_MEDIUM_SPEED_TEXT_RU "сред"
|
||||
#define EXTRUDE_HIGH_SPEED_TEXT_RU "выс"
|
||||
#define EXTRUDE_1MM_TEXT_RU "1 мм"
|
||||
#define EXTRUDE_5MM_TEXT_RU "5 мм"
|
||||
#define EXTRUDE_10MM_TEXT_RU "10 мм"
|
||||
#define EXTRUDE_LOW_SPEED_TEXT_RU "минимум"
|
||||
#define EXTRUDE_MEDIUM_SPEED_TEXT_RU "средний"
|
||||
#define EXTRUDE_HIGH_SPEED_TEXT_RU "высокий"
|
||||
|
||||
#define LEVELING_POINT1_TEXT_RU "1 точка"
|
||||
#define LEVELING_POINT2_TEXT_RU "2 точка"
|
||||
#define LEVELING_POINT3_TEXT_RU "3 точка"
|
||||
#define LEVELING_POINT4_TEXT_RU "4 точка"
|
||||
#define LEVELING_POINT5_TEXT_RU "5 точка"
|
||||
#define LEVELING_POINT1_TEXT_RU "Первая позиция"
|
||||
#define LEVELING_POINT2_TEXT_RU "Вторая позиция"
|
||||
#define LEVELING_POINT3_TEXT_RU "Третья позиция"
|
||||
#define LEVELING_POINT4_TEXT_RU "Четвёртое позиция"
|
||||
#define LEVELING_POINT5_TEXT_RU "Пятая позиция"
|
||||
|
||||
#define FILESYS_TEXT_RU "система"
|
||||
#define WIFI_TEXT_RU "WiFi"
|
||||
@@ -115,7 +115,7 @@
|
||||
#define WIFI_RECONNECT_TEXT_RU "выбор сети"
|
||||
#define CLOUD_TEXT_RU "облако"
|
||||
#define CLOUD_BIND_RU "соединён"
|
||||
#define CLOUD_UNBIND_RU "отсоед."
|
||||
#define CLOUD_UNBIND_RU "отсоединён"
|
||||
#define CLOUD_UNBINDING_RU "отвязано"
|
||||
#define CLOUD_DISCONNECTED_RU "отключено"
|
||||
#define CLOUD_UNBINDED_RU "несвяз."
|
||||
@@ -126,7 +126,7 @@
|
||||
#define FAN_DEC_TEXT_RU "уменьшить"
|
||||
#define FAN_OPEN_TEXT_RU "100%"
|
||||
#define FAN_HALF_TEXT_RU "50%"
|
||||
#define FAN_CLOSE_TEXT_RU "откл"
|
||||
#define FAN_CLOSE_TEXT_RU "отключить"
|
||||
#define FAN_TIPS1_TEXT_RU "вентилятор"
|
||||
#define FAN_TIPS2_TEXT_RU "вентилятор\nоткл"
|
||||
|
||||
@@ -156,7 +156,7 @@
|
||||
#define PRE_HEAT_EXT_TEXT_RU "E"
|
||||
#define PRE_HEAT_BED_TEXT_RU "стол"
|
||||
|
||||
#define FILE_LOADING_RU "загрузка......"
|
||||
#define FILE_LOADING_RU "загрузка"
|
||||
#define NO_FILE_AND_CHECK_RU "нет файла,попробуйте ещё раз!"
|
||||
|
||||
#define NO_FILE_RU "нет файла!"
|
||||
@@ -170,11 +170,11 @@
|
||||
#define ABOUT_VERSION_TEXT_RU "Firmware: "
|
||||
#define ABOUT_WIFI_TEXT_RU "WiFi: "
|
||||
|
||||
#define PRINTING_OPERATION_RU "опции"
|
||||
#define PRINTING_OPERATION_RU "опций"
|
||||
#define PRINTING_PAUSE_RU "пауза"
|
||||
#define PRINTING_TEMP_RU "темп"
|
||||
#define PRINTING_CHANGESPEED_RU "скорости"
|
||||
#define PRINTING_RESUME_RU "возобн. "
|
||||
#define PRINTING_CHANGESPEED_RU "скорост"
|
||||
#define PRINTING_RESUME_RU "возобновить"
|
||||
#define PRINTING_STOP_RU "стоп"
|
||||
#define PRINTING_MORE_RU "больше"
|
||||
#define PRINTING_EXTRUDER_RU "экстр"
|
||||
@@ -222,8 +222,8 @@
|
||||
#define DIALOG_RETRY_RU "повтор"
|
||||
#define DIALOG_DISABLE_RU "запретить"
|
||||
#define DIALOG_PRINT_MODEL_RU "печать модели?"
|
||||
#define DIALOG_CANCEL_PRINT_RU "стоп?"
|
||||
#define DIALOG_STOP_RU "стоп"
|
||||
#define DIALOG_CANCEL_PRINT_RU "Остановить?"
|
||||
#define DIALOG_STOP_RU "Остановить"
|
||||
#define DIALOG_REPRINT_FROM_BREAKPOINT_RU "продолжить?"
|
||||
#define DIALOG_ERROR_TIPS1_RU "ошибка:нет файла, попробуйте ещё раз."
|
||||
#define DIALOG_ERROR_TIPS2_RU "ошибка:сбой передачи. установите скорость \nпередачи данных как на плате управления!"
|
||||
@@ -236,8 +236,8 @@
|
||||
#define DIALOG_REPRINT_RU "Print again"
|
||||
#define DIALOG_WIFI_ENABLE_TIPS_RU "The wifi module is being configured,\nplease wait a moment....."
|
||||
|
||||
#define MESSAGE_PAUSING_RU "Стоянка..."
|
||||
#define MESSAGE_CHANGING_RU "Подождите, пока начнется смена филамента"
|
||||
#define MESSAGE_PAUSING_RU "Пауза"
|
||||
#define MESSAGE_CHANGING_RU "Подождите"
|
||||
#define MESSAGE_UNLOAD_RU "Дождитесь выгрузки нити"
|
||||
#define MESSAGE_WAITING_RU "Нажмите кнопку,чтобы возобновить печать"
|
||||
#define MESSAGE_INSERT_RU "Вставьте нить и нажмите кнопку,чтобы продолжить"
|
||||
@@ -250,7 +250,7 @@
|
||||
#define MESSAGE_PURGE_MORE_RU "чистка"
|
||||
#define MESSAGE_CONTINUE_PRINT_RU "Распечатать"
|
||||
#define EEPROM_SETTINGS_TITLE_RU "Настройки EEPROM"
|
||||
#define EEPROM_SETTINGS_STORE_RU "Cохранение настроек в EEPROM"
|
||||
#define EEPROM_SETTINGS_STORE_RU "Cохранить настройки в EEPROM"
|
||||
#define EEPROM_SETTINGS_READ_RU "Чтение настроек из EEPROM"
|
||||
#define EEPROM_SETTINGS_REVERT_RU "Bосстановить заводские настройки по умолчанию"
|
||||
|
||||
@@ -272,7 +272,7 @@
|
||||
#define DISABLE_RU "нет"
|
||||
#define KEY_CONFIRM_RU "OK"
|
||||
|
||||
#define MACHINE_PARA_TITLE_RU "настройки"
|
||||
#define MACHINE_PARA_TITLE_RU "Настройки"
|
||||
#define MACHINE_TYPE_CNOFIG_RU "Hастройки принтера"
|
||||
#define MOTOR_CONFIG_RU "Hастройки моторов"
|
||||
#define MACHINE_LEVELING_CONFIG_RU "Hастройки уровня"
|
||||
|
||||
@@ -389,7 +389,7 @@ namespace Language_de {
|
||||
LSTR MSG_ADVANCE_K_E = _UxGT("Vorschubfaktor *");
|
||||
LSTR MSG_CONTRAST = _UxGT("LCD-Kontrast");
|
||||
LSTR MSG_BRIGHTNESS = _UxGT("LCD-Helligkeit");
|
||||
LSTR MSG_LCD_BKL_TIMEOUT = _UxGT("LCD-Ruhezustand (s)");
|
||||
LSTR MSG_LCD_TIMEOUT_SEC = _UxGT("LCD-Ruhezustand (s)");
|
||||
LSTR MSG_BRIGHTNESS_OFF = _UxGT("LCD ausschalten");
|
||||
LSTR MSG_STORE_EEPROM = _UxGT("Konfig. speichern");
|
||||
LSTR MSG_LOAD_EEPROM = _UxGT("Konfig. laden");
|
||||
|
||||
@@ -421,7 +421,8 @@ namespace Language_en {
|
||||
LSTR MSG_ADVANCE_K_E = _UxGT("Advance K *");
|
||||
LSTR MSG_CONTRAST = _UxGT("LCD Contrast");
|
||||
LSTR MSG_BRIGHTNESS = _UxGT("LCD Brightness");
|
||||
LSTR MSG_LCD_BKL_TIMEOUT = _UxGT("LCD Timeout (s)");
|
||||
LSTR MSG_LCD_TIMEOUT_SEC = _UxGT("LCD Timeout (s)");
|
||||
LSTR MSG_SCREEN_TIMEOUT = _UxGT("LCD Timeout (m)");
|
||||
LSTR MSG_BRIGHTNESS_OFF = _UxGT("Backlight Off");
|
||||
LSTR MSG_STORE_EEPROM = _UxGT("Store Settings");
|
||||
LSTR MSG_LOAD_EEPROM = _UxGT("Load Settings");
|
||||
|
||||
@@ -335,7 +335,7 @@ namespace Language_fr {
|
||||
LSTR MSG_ADVANCE_K_E = _UxGT("Avance K *");
|
||||
LSTR MSG_BRIGHTNESS = _UxGT("Luminosité LCD");
|
||||
LSTR MSG_CONTRAST = _UxGT("Contraste LCD");
|
||||
LSTR MSG_LCD_BKL_TIMEOUT = _UxGT("Veille LCD (s)");
|
||||
LSTR MSG_LCD_TIMEOUT_SEC = _UxGT("Veille LCD (s)");
|
||||
LSTR MSG_BRIGHTNESS_OFF = _UxGT("Éteindre l'écran LCD");
|
||||
LSTR MSG_STORE_EEPROM = _UxGT("Enregistrer config.");
|
||||
LSTR MSG_LOAD_EEPROM = _UxGT("Charger config.");
|
||||
|
||||
@@ -472,7 +472,7 @@ namespace Language_uk {
|
||||
LSTR MSG_CONTRAST = _UxGT("Контраст");
|
||||
LSTR MSG_BRIGHTNESS = _UxGT("Яскравість");
|
||||
#endif
|
||||
LSTR MSG_LCD_BKL_TIMEOUT = _UxGT("LCD Таймаут, с");
|
||||
LSTR MSG_LCD_TIMEOUT_SEC = _UxGT("LCD Таймаут, с");
|
||||
LSTR MSG_BRIGHTNESS_OFF = _UxGT("Підсвітка вимк.");
|
||||
LSTR MSG_STORE_EEPROM = _UxGT("Зберегти в EEPROM");
|
||||
LSTR MSG_LOAD_EEPROM = _UxGT("Зчитати з EEPROM");
|
||||
|
||||
@@ -75,7 +75,7 @@ lcd_uint_t lcd_put_u8str_ind_P(PGM_P const pstr, const int8_t ind, PGM_P const i
|
||||
n -= lcd_put_u8str_max_P(inStr, n * (MENU_FONT_WIDTH)) / (MENU_FONT_WIDTH);
|
||||
}
|
||||
else if (ch == '@') {
|
||||
lcd_put_wchar(axis_codes[ind]);
|
||||
lcd_put_wchar(AXIS_CHAR(ind));
|
||||
n--;
|
||||
}
|
||||
else {
|
||||
|
||||
@@ -184,12 +184,23 @@ constexpr uint8_t epps = ENCODER_PULSES_PER_STEP;
|
||||
#endif
|
||||
|
||||
#if LCD_BACKLIGHT_TIMEOUT
|
||||
|
||||
uint16_t MarlinUI::lcd_backlight_timeout; // Initialized by settings.load()
|
||||
millis_t MarlinUI::backlight_off_ms = 0;
|
||||
void MarlinUI::refresh_backlight_timeout() {
|
||||
backlight_off_ms = lcd_backlight_timeout ? millis() + lcd_backlight_timeout * 1000UL : 0;
|
||||
WRITE(LCD_BACKLIGHT_PIN, HIGH);
|
||||
}
|
||||
|
||||
#elif HAS_DISPLAY_SLEEP
|
||||
|
||||
uint8_t MarlinUI::sleep_timeout_minutes; // Initialized by settings.load()
|
||||
millis_t MarlinUI::screen_timeout_millis = 0;
|
||||
void MarlinUI::refresh_screen_timeout() {
|
||||
screen_timeout_millis = sleep_timeout_minutes ? millis() + sleep_timeout_minutes * 60UL * 1000UL : 0;
|
||||
sleep_off();
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
void MarlinUI::init() {
|
||||
@@ -829,7 +840,7 @@ void MarlinUI::init() {
|
||||
TERN_(MULTI_E_MANUAL, axis == E_AXIS ? e_index :) active_extruder
|
||||
);
|
||||
|
||||
//SERIAL_ECHOLNPGM("Add planner.move with Axis ", AS_CHAR(axis_codes[axis]), " at FR ", fr_mm_s);
|
||||
//SERIAL_ECHOLNPGM("Add planner.move with Axis ", AS_CHAR(AXIS_CHAR(axis)), " at FR ", fr_mm_s);
|
||||
|
||||
axis = NO_AXIS_ENUM;
|
||||
|
||||
@@ -846,7 +857,7 @@ void MarlinUI::init() {
|
||||
TERN_(MULTI_E_MANUAL, if (move_axis == E_AXIS) e_index = eindex);
|
||||
start_time = millis() + (menu_scale < 0.99f ? 0UL : 250UL); // delay for bigger moves
|
||||
axis = move_axis;
|
||||
//SERIAL_ECHOLNPGM("Post Move with Axis ", AS_CHAR(axis_codes[axis]), " soon.");
|
||||
//SERIAL_ECHOLNPGM("Post Move with Axis ", AS_CHAR(AXIS_CHAR(axis)), " soon.");
|
||||
}
|
||||
|
||||
#if ENABLED(AUTO_BED_LEVELING_UBL)
|
||||
@@ -1059,6 +1070,8 @@ void MarlinUI::init() {
|
||||
|
||||
#if LCD_BACKLIGHT_TIMEOUT
|
||||
refresh_backlight_timeout();
|
||||
#elif HAS_DISPLAY_SLEEP
|
||||
refresh_screen_timeout();
|
||||
#endif
|
||||
|
||||
refresh(LCDVIEW_REDRAW_NOW);
|
||||
@@ -1170,6 +1183,9 @@ void MarlinUI::init() {
|
||||
WRITE(LCD_BACKLIGHT_PIN, LOW); // Backlight off
|
||||
backlight_off_ms = 0;
|
||||
}
|
||||
#elif HAS_DISPLAY_SLEEP
|
||||
if (screen_timeout_millis && ELAPSED(ms, screen_timeout_millis))
|
||||
sleep_on();
|
||||
#endif
|
||||
|
||||
// Change state of drawing flag between screen updates
|
||||
|
||||
@@ -279,6 +279,14 @@ public:
|
||||
static uint16_t lcd_backlight_timeout;
|
||||
static millis_t backlight_off_ms;
|
||||
static void refresh_backlight_timeout();
|
||||
#elif HAS_DISPLAY_SLEEP
|
||||
#define SLEEP_TIMEOUT_MIN 0
|
||||
#define SLEEP_TIMEOUT_MAX 99
|
||||
static uint8_t sleep_timeout_minutes;
|
||||
static millis_t screen_timeout_millis;
|
||||
static void refresh_screen_timeout();
|
||||
static void sleep_on();
|
||||
static void sleep_off();
|
||||
#endif
|
||||
|
||||
#if HAS_DWIN_E3V2_BASIC
|
||||
|
||||
@@ -210,7 +210,7 @@ void menu_backlash();
|
||||
|
||||
// Helpers for editing PID Ki & Kd values
|
||||
// grab the PID value out of the temp variable; scale it; then update the PID driver
|
||||
void copy_and_scalePID_i(int16_t e) {
|
||||
void copy_and_scalePID_i(const uint8_t e) {
|
||||
switch (e) {
|
||||
#if ENABLED(PIDTEMPBED)
|
||||
case H_BED: thermalManager.temp_bed.pid.Ki = scalePID_i(raw_Ki); break;
|
||||
@@ -226,7 +226,7 @@ void menu_backlash();
|
||||
break;
|
||||
}
|
||||
}
|
||||
void copy_and_scalePID_d(int16_t e) {
|
||||
void copy_and_scalePID_d(const uint8_t e) {
|
||||
switch (e) {
|
||||
#if ENABLED(PIDTEMPBED)
|
||||
case H_BED: thermalManager.temp_bed.pid.Kd = scalePID_d(raw_Kd); break;
|
||||
@@ -242,30 +242,6 @@ void menu_backlash();
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
#define _DEFINE_PIDTEMP_BASE_FUNCS(N) \
|
||||
void copy_and_scalePID_i_E##N() { copy_and_scalePID_i(N); } \
|
||||
void copy_and_scalePID_d_E##N() { copy_and_scalePID_d(N); }
|
||||
|
||||
#else
|
||||
|
||||
#define _DEFINE_PIDTEMP_BASE_FUNCS(N) //
|
||||
|
||||
#endif
|
||||
|
||||
#if ENABLED(PID_AUTOTUNE_MENU)
|
||||
#define DEFINE_PIDTEMP_FUNCS(N) \
|
||||
_DEFINE_PIDTEMP_BASE_FUNCS(N); \
|
||||
void lcd_autotune_callback_E##N() { _lcd_autotune(heater_id_t(N)); }
|
||||
#else
|
||||
#define DEFINE_PIDTEMP_FUNCS(N) _DEFINE_PIDTEMP_BASE_FUNCS(N);
|
||||
#endif
|
||||
|
||||
#if HAS_HOTEND
|
||||
DEFINE_PIDTEMP_FUNCS(0);
|
||||
#if ENABLED(PID_PARAMS_PER_HOTEND)
|
||||
REPEAT_S(1, HOTENDS, DEFINE_PIDTEMP_FUNCS)
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#if BOTH(AUTOTEMP, HAS_TEMP_HOTEND) || EITHER(PID_AUTOTUNE_MENU, PID_EDIT_MENU)
|
||||
@@ -299,14 +275,7 @@ void menu_backlash();
|
||||
// PID-P E5, PID-I E5, PID-D E5, PID-C E5, PID Autotune E5
|
||||
//
|
||||
|
||||
#if ENABLED(PID_EDIT_MENU)
|
||||
#define _PID_EDIT_ITEMS_TMPL(N,T) \
|
||||
raw_Ki = unscalePID_i(T.pid.Ki); \
|
||||
raw_Kd = unscalePID_d(T.pid.Kd); \
|
||||
EDIT_ITEM_FAST_N(float41sign, N, MSG_PID_P_E, &T.pid.Kp, 1, 9990); \
|
||||
EDIT_ITEM_FAST_N(float52sign, N, MSG_PID_I_E, &raw_Ki, 0.01f, 9990, []{ copy_and_scalePID_i(N); }); \
|
||||
EDIT_ITEM_FAST_N(float41sign, N, MSG_PID_D_E, &raw_Kd, 1, 9990, []{ copy_and_scalePID_d(N); })
|
||||
|
||||
#if BOTH(PIDTEMP, PID_EDIT_MENU)
|
||||
#define __PID_HOTEND_MENU_ITEMS(N) \
|
||||
raw_Ki = unscalePID_i(PID_PARAM(Ki, N)); \
|
||||
raw_Kd = unscalePID_d(PID_PARAM(Kd, N)); \
|
||||
@@ -336,17 +305,28 @@ void menu_backlash();
|
||||
|
||||
#endif
|
||||
|
||||
#if ENABLED(PID_AUTOTUNE_MENU)
|
||||
#define HOTEND_PID_EDIT_MENU_ITEMS(N) \
|
||||
_HOTEND_PID_EDIT_MENU_ITEMS(N); \
|
||||
EDIT_ITEM_FAST_N(int3, N, MSG_PID_AUTOTUNE_E, &autotune_temp[N], 150, thermalManager.hotend_max_target(N), []{ _lcd_autotune(heater_id_t(MenuItemBase::itemIndex)); });
|
||||
#else
|
||||
#define HOTEND_PID_EDIT_MENU_ITEMS(N) _HOTEND_PID_EDIT_MENU_ITEMS(N);
|
||||
#if ENABLED(PID_EDIT_MENU) && EITHER(PIDTEMPBED, PIDTEMPCHAMBER)
|
||||
#define _PID_EDIT_ITEMS_TMPL(N,T) \
|
||||
raw_Ki = unscalePID_i(T.pid.Ki); \
|
||||
raw_Kd = unscalePID_d(T.pid.Kd); \
|
||||
EDIT_ITEM_FAST_N(float41sign, N, MSG_PID_P_E, &T.pid.Kp, 1, 9990); \
|
||||
EDIT_ITEM_FAST_N(float52sign, N, MSG_PID_I_E, &raw_Ki, 0.01f, 9990, []{ copy_and_scalePID_i(N); }); \
|
||||
EDIT_ITEM_FAST_N(float41sign, N, MSG_PID_D_E, &raw_Kd, 1, 9990, []{ copy_and_scalePID_d(N); })
|
||||
#endif
|
||||
|
||||
HOTEND_PID_EDIT_MENU_ITEMS(0);
|
||||
#if ENABLED(PID_PARAMS_PER_HOTEND)
|
||||
REPEAT_S(1, HOTENDS, HOTEND_PID_EDIT_MENU_ITEMS)
|
||||
#if ENABLED(PIDTEMP)
|
||||
#if ENABLED(PID_AUTOTUNE_MENU)
|
||||
#define HOTEND_PID_EDIT_MENU_ITEMS(N) \
|
||||
_HOTEND_PID_EDIT_MENU_ITEMS(N); \
|
||||
EDIT_ITEM_FAST_N(int3, N, MSG_PID_AUTOTUNE_E, &autotune_temp[N], 150, thermalManager.hotend_max_target(N), []{ _lcd_autotune(heater_id_t(MenuItemBase::itemIndex)); });
|
||||
#else
|
||||
#define HOTEND_PID_EDIT_MENU_ITEMS(N) _HOTEND_PID_EDIT_MENU_ITEMS(N);
|
||||
#endif
|
||||
|
||||
HOTEND_PID_EDIT_MENU_ITEMS(0);
|
||||
#if ENABLED(PID_PARAMS_PER_HOTEND)
|
||||
REPEAT_S(1, HOTENDS, HOTEND_PID_EDIT_MENU_ITEMS)
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#if ENABLED(PIDTEMPBED)
|
||||
|
||||
@@ -541,8 +541,14 @@ void menu_configuration() {
|
||||
#if HAS_LCD_CONTRAST && LCD_CONTRAST_MIN < LCD_CONTRAST_MAX
|
||||
EDIT_ITEM_FAST(uint8, MSG_CONTRAST, &ui.contrast, LCD_CONTRAST_MIN, LCD_CONTRAST_MAX, ui.refresh_contrast, true);
|
||||
#endif
|
||||
|
||||
//
|
||||
// Set display backlight / sleep timeout
|
||||
//
|
||||
#if LCD_BACKLIGHT_TIMEOUT && LCD_BKL_TIMEOUT_MIN < LCD_BKL_TIMEOUT_MAX
|
||||
EDIT_ITEM(uint16_4, MSG_LCD_BKL_TIMEOUT, &ui.lcd_backlight_timeout, LCD_BKL_TIMEOUT_MIN, LCD_BKL_TIMEOUT_MAX, ui.refresh_backlight_timeout);
|
||||
EDIT_ITEM(uint16_4, MSG_LCD_TIMEOUT_SEC, &ui.lcd_backlight_timeout, LCD_BKL_TIMEOUT_MIN, LCD_BKL_TIMEOUT_MAX, ui.refresh_backlight_timeout);
|
||||
#elif HAS_DISPLAY_SLEEP
|
||||
EDIT_ITEM(uint8, MSG_SCREEN_TIMEOUT, &ui.sleep_timeout_minutes, SLEEP_TIMEOUT_MIN, SLEEP_TIMEOUT_MAX, ui.refresh_screen_timeout);
|
||||
#endif
|
||||
|
||||
#if ENABLED(FWRETRACT)
|
||||
|
||||
@@ -44,7 +44,7 @@
|
||||
#include "../../core/debug_out.h"
|
||||
|
||||
static float z_measured[G35_PROBE_COUNT];
|
||||
static bool z_isvalid[G35_PROBE_COUNT];
|
||||
static Flags<G35_PROBE_COUNT> z_isvalid;
|
||||
static uint8_t tram_index = 0;
|
||||
static int8_t reference_index; // = 0
|
||||
|
||||
@@ -61,7 +61,10 @@ static bool probe_single_point() {
|
||||
move_to_tramming_wait_pos();
|
||||
|
||||
DEBUG_ECHOLNPGM("probe_single_point(", tram_index, ") = ", z_probed_height, "mm");
|
||||
return (z_isvalid[tram_index] = !isnan(z_probed_height));
|
||||
|
||||
const bool v = !isnan(z_probed_height);
|
||||
z_isvalid.set(tram_index, v);
|
||||
return v;
|
||||
}
|
||||
|
||||
static void _menu_single_probe() {
|
||||
@@ -80,7 +83,7 @@ static void tramming_wizard_menu() {
|
||||
|
||||
// Draw a menu item for each tramming point
|
||||
for (tram_index = 0; tram_index < G35_PROBE_COUNT; tram_index++)
|
||||
SUBMENU_P((char*)pgm_read_ptr(&tramming_point_name[tram_index]), _menu_single_probe);
|
||||
SUBMENU_P((PGM_P)pgm_read_ptr(&tramming_point_name[tram_index]), _menu_single_probe);
|
||||
|
||||
ACTION_ITEM(MSG_BUTTON_DONE, []{
|
||||
probe.stow(); // Stow before exiting Tramming Wizard
|
||||
@@ -95,7 +98,7 @@ void goto_tramming_wizard() {
|
||||
ui.defer_status_screen();
|
||||
|
||||
// Initialize measured point flags
|
||||
ZERO(z_isvalid);
|
||||
z_isvalid.reset();
|
||||
reference_index = -1;
|
||||
|
||||
// Inject G28, wait for homing to complete,
|
||||
|
||||
@@ -116,7 +116,7 @@ void TFT_String::add(uint8_t *string, int8_t index, uint8_t *itemString/*=nullpt
|
||||
else if (ch == '$' && itemString)
|
||||
add(itemString);
|
||||
else if (ch == '@')
|
||||
add_character(axis_codes[index]);
|
||||
add_character(AXIS_CHAR(index));
|
||||
else
|
||||
add_character(ch);
|
||||
}
|
||||
|
||||
@@ -412,11 +412,11 @@ uint8_t L64XX_Marlin::get_user_input(uint8_t &driver_count, L64XX_axis_t axis_in
|
||||
}
|
||||
|
||||
uint8_t found_displacement = false;
|
||||
LOOP_LOGICAL_AXES(i) if (uint16_t _displacement = parser.intval(axis_codes[i])) {
|
||||
LOOP_LOGICAL_AXES(i) if (uint16_t _displacement = parser.intval(AXIS_CHAR(i))) {
|
||||
found_displacement = true;
|
||||
displacement = _displacement;
|
||||
uint8_t axis_offset = parser.byteval('J');
|
||||
axis_mon[0][0] = axis_codes[i]; // Axis first character, one of XYZE
|
||||
const uint8_t axis_offset = parser.byteval('J');
|
||||
axis_mon[0][0] = AXIS_CHAR(i); // Axis first character, one of XYZ...E
|
||||
const bool single_or_e = axis_offset >= 2 || axis_mon[0][0] == 'E',
|
||||
one_or_more = !single_or_e && axis_offset == 0;
|
||||
uint8_t driver_count_local = 0; // Can't use "driver_count" directly as a subscript because it's passed by reference
|
||||
@@ -667,7 +667,7 @@ uint8_t L64XX_Marlin::get_user_input(uint8_t &driver_count, L64XX_axis_t axis_in
|
||||
static constexpr float default_max_feedrate[] = DEFAULT_MAX_FEEDRATE;
|
||||
const uint8_t num_feedrates = COUNT(default_max_feedrate);
|
||||
for (j = 0; j < num_feedrates; j++) {
|
||||
if (axis_codes[j] == axis_mon[0][0]) {
|
||||
if (AXIS_CHAR(j) == axis_mon[0][0]) {
|
||||
final_feedrate = default_max_feedrate[j];
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -36,7 +36,7 @@
|
||||
#define HAS_L64XX_EXTRUDER (AXIS_IS_L64XX(E0) || AXIS_IS_L64XX(E1) || AXIS_IS_L64XX(E2) || AXIS_IS_L64XX(E3) || AXIS_IS_L64XX(E4) || AXIS_IS_L64XX(E5) || AXIS_IS_L64XX(E6) || AXIS_IS_L64XX(E7))
|
||||
|
||||
#define _EN_ITEM(N) , E##N
|
||||
enum L64XX_axis_t : uint8_t { NUM_AXIS_LIST(X, Y, Z, I, J, K), X2, Y2, Z2, Z3, Z4 REPEAT(E_STEPPERS, _EN_ITEM), MAX_L64XX };
|
||||
enum L64XX_axis_t : uint8_t { NUM_AXIS_LIST(X, Y, Z, I, J, K, U, V, W), X2, Y2, Z2, Z3, Z4 REPEAT(E_STEPPERS, _EN_ITEM), MAX_L64XX };
|
||||
#undef _EN_ITEM
|
||||
|
||||
class L64XX_Marlin : public L64XXHelper {
|
||||
|
||||
@@ -178,11 +178,12 @@
|
||||
#endif
|
||||
|
||||
#define _EN_ITEM(N) , E##N
|
||||
#define _EN1_ITEM(N) , E##N:1
|
||||
|
||||
typedef struct { uint16_t NUM_AXIS_LIST(X, Y, Z, I, J, K, U, V, W), X2, Y2, Z2, Z3, Z4 REPEAT(E_STEPPERS, _EN_ITEM); } tmc_stepper_current_t;
|
||||
typedef struct { uint32_t NUM_AXIS_LIST(X, Y, Z, I, J, K, U, V, W), X2, Y2, Z2, Z3, Z4 REPEAT(E_STEPPERS, _EN_ITEM); } tmc_hybrid_threshold_t;
|
||||
typedef struct { int16_t NUM_AXIS_LIST(X, Y, Z, I, J, K, U, V, W), X2, Y2, Z2, Z3, Z4; } tmc_sgt_t;
|
||||
typedef struct { bool NUM_AXIS_LIST(X, Y, Z, I, J, K, U, V, W), X2, Y2, Z2, Z3, Z4 REPEAT(E_STEPPERS, _EN_ITEM); } tmc_stealth_enabled_t;
|
||||
typedef struct { uint16_t NUM_AXIS_LIST(X, Y, Z, I, J, K, U, V, W), X2, Y2, Z2, Z3, Z4 REPEAT(E_STEPPERS, _EN_ITEM); } per_stepper_uint16_t;
|
||||
typedef struct { uint32_t NUM_AXIS_LIST(X, Y, Z, I, J, K, U, V, W), X2, Y2, Z2, Z3, Z4 REPEAT(E_STEPPERS, _EN_ITEM); } per_stepper_uint32_t;
|
||||
typedef struct { int16_t NUM_AXIS_LIST(X, Y, Z, I, J, K, U, V, W), X2, Y2, Z2, Z3, Z4; } mot_stepper_int16_t;
|
||||
typedef struct { bool NUM_AXIS_LIST(X:1, Y:1, Z:1, I:1, J:1, K:1, U:1, V:1, W:1), X2:1, Y2:1, Z2:1, Z3:1, Z4:1 REPEAT(E_STEPPERS, _EN1_ITEM); } per_stepper_bool_t;
|
||||
|
||||
#undef _EN_ITEM
|
||||
|
||||
@@ -398,10 +399,12 @@ typedef struct SettingsDataStruct {
|
||||
uint8_t lcd_brightness; // M256 B
|
||||
|
||||
//
|
||||
// LCD_BACKLIGHT_TIMEOUT
|
||||
// Display Sleep
|
||||
//
|
||||
#if LCD_BACKLIGHT_TIMEOUT
|
||||
uint16_t lcd_backlight_timeout; // (G-code needed)
|
||||
uint16_t lcd_backlight_timeout; // M255 S
|
||||
#elif HAS_DISPLAY_SLEEP
|
||||
uint8_t sleep_timeout_minutes; // M255 S
|
||||
#endif
|
||||
|
||||
//
|
||||
@@ -430,10 +433,10 @@ typedef struct SettingsDataStruct {
|
||||
//
|
||||
// HAS_TRINAMIC_CONFIG
|
||||
//
|
||||
tmc_stepper_current_t tmc_stepper_current; // M906 X Y Z X2 Y2 Z2 Z3 Z4 E0 E1 E2 E3 E4 E5
|
||||
tmc_hybrid_threshold_t tmc_hybrid_threshold; // M913 X Y Z X2 Y2 Z2 Z3 Z4 E0 E1 E2 E3 E4 E5
|
||||
tmc_sgt_t tmc_sgt; // M914 X Y Z X2 Y2 Z2 Z3 Z4
|
||||
tmc_stealth_enabled_t tmc_stealth_enabled; // M569 X Y Z X2 Y2 Z2 Z3 Z4 E0 E1 E2 E3 E4 E5
|
||||
per_stepper_uint16_t tmc_stepper_current; // M906 X Y Z I J K U V W X2 Y2 Z2 Z3 Z4 E0 E1 E2 E3 E4 E5
|
||||
per_stepper_uint32_t tmc_hybrid_threshold; // M913 X Y Z I J K U V W X2 Y2 Z2 Z3 Z4 E0 E1 E2 E3 E4 E5
|
||||
mot_stepper_int16_t tmc_sgt; // M914 X Y Z I J K U V W X2 Y2 Z2 Z3 Z4
|
||||
per_stepper_bool_t tmc_stealth_enabled; // M569 X Y Z I J K U V W X2 Y2 Z2 Z3 Z4 E0 E1 E2 E3 E4 E5
|
||||
|
||||
//
|
||||
// LIN_ADVANCE
|
||||
@@ -630,6 +633,8 @@ void MarlinSettings::postprocess() {
|
||||
|
||||
#if LCD_BACKLIGHT_TIMEOUT
|
||||
ui.refresh_backlight_timeout();
|
||||
#elif HAS_DISPLAY_SLEEP
|
||||
ui.refresh_screen_timeout();
|
||||
#endif
|
||||
}
|
||||
|
||||
@@ -1141,10 +1146,12 @@ void MarlinSettings::postprocess() {
|
||||
}
|
||||
|
||||
//
|
||||
// LCD Backlight Timeout
|
||||
// LCD Backlight / Sleep Timeout
|
||||
//
|
||||
#if LCD_BACKLIGHT_TIMEOUT
|
||||
EEPROM_WRITE(ui.lcd_backlight_timeout);
|
||||
#elif HAS_DISPLAY_SLEEP
|
||||
EEPROM_WRITE(ui.sleep_timeout_minutes);
|
||||
#endif
|
||||
|
||||
//
|
||||
@@ -1155,7 +1162,7 @@ void MarlinSettings::postprocess() {
|
||||
#if ENABLED(USE_CONTROLLER_FAN)
|
||||
const controllerFan_settings_t &cfs = controllerFan.settings;
|
||||
#else
|
||||
controllerFan_settings_t cfs = controllerFan_defaults;
|
||||
constexpr controllerFan_settings_t cfs = controllerFan_defaults;
|
||||
#endif
|
||||
EEPROM_WRITE(cfs);
|
||||
}
|
||||
@@ -1220,7 +1227,7 @@ void MarlinSettings::postprocess() {
|
||||
{
|
||||
_FIELD_TEST(tmc_stepper_current);
|
||||
|
||||
tmc_stepper_current_t tmc_stepper_current{0};
|
||||
per_stepper_uint16_t tmc_stepper_current{0};
|
||||
|
||||
#if HAS_TRINAMIC_CONFIG
|
||||
#if AXIS_IS_TMC(X)
|
||||
@@ -1300,7 +1307,7 @@ void MarlinSettings::postprocess() {
|
||||
_FIELD_TEST(tmc_hybrid_threshold);
|
||||
|
||||
#if ENABLED(HYBRID_THRESHOLD)
|
||||
tmc_hybrid_threshold_t tmc_hybrid_threshold{0};
|
||||
per_stepper_uint32_t tmc_hybrid_threshold{0};
|
||||
TERN_(X_HAS_STEALTHCHOP, tmc_hybrid_threshold.X = stepperX.get_pwm_thrs());
|
||||
TERN_(Y_HAS_STEALTHCHOP, tmc_hybrid_threshold.Y = stepperY.get_pwm_thrs());
|
||||
TERN_(Z_HAS_STEALTHCHOP, tmc_hybrid_threshold.Z = stepperZ.get_pwm_thrs());
|
||||
@@ -1325,7 +1332,7 @@ void MarlinSettings::postprocess() {
|
||||
TERN_(E7_HAS_STEALTHCHOP, tmc_hybrid_threshold.E7 = stepperE7.get_pwm_thrs());
|
||||
#else
|
||||
#define _EN_ITEM(N) , .E##N = 30
|
||||
const tmc_hybrid_threshold_t tmc_hybrid_threshold = {
|
||||
const per_stepper_uint32_t tmc_hybrid_threshold = {
|
||||
NUM_AXIS_LIST(.X = 100, .Y = 100, .Z = 3, .I = 3, .J = 3, .K = 3, .U = 3, .V = 3, .W = 3),
|
||||
.X2 = 100, .Y2 = 100, .Z2 = 3, .Z3 = 3, .Z4 = 3
|
||||
REPEAT(E_STEPPERS, _EN_ITEM)
|
||||
@@ -1339,7 +1346,7 @@ void MarlinSettings::postprocess() {
|
||||
// TMC StallGuard threshold
|
||||
//
|
||||
{
|
||||
tmc_sgt_t tmc_sgt{0};
|
||||
mot_stepper_int16_t tmc_sgt{0};
|
||||
#if USE_SENSORLESS
|
||||
NUM_AXIS_CODE(
|
||||
TERN_(X_SENSORLESS, tmc_sgt.X = stepperX.homing_threshold()),
|
||||
@@ -1367,7 +1374,7 @@ void MarlinSettings::postprocess() {
|
||||
{
|
||||
_FIELD_TEST(tmc_stealth_enabled);
|
||||
|
||||
tmc_stealth_enabled_t tmc_stealth_enabled = { false };
|
||||
per_stepper_bool_t tmc_stealth_enabled = { false };
|
||||
TERN_(X_HAS_STEALTHCHOP, tmc_stealth_enabled.X = stepperX.get_stored_stealthChop());
|
||||
TERN_(Y_HAS_STEALTHCHOP, tmc_stealth_enabled.Y = stepperY.get_stored_stealthChop());
|
||||
TERN_(Z_HAS_STEALTHCHOP, tmc_stealth_enabled.Z = stepperZ.get_stored_stealthChop());
|
||||
@@ -2090,10 +2097,12 @@ void MarlinSettings::postprocess() {
|
||||
}
|
||||
|
||||
//
|
||||
// LCD Backlight Timeout
|
||||
// LCD Backlight / Sleep Timeout
|
||||
//
|
||||
#if LCD_BACKLIGHT_TIMEOUT
|
||||
EEPROM_READ(ui.lcd_backlight_timeout);
|
||||
#elif HAS_DISPLAY_SLEEP
|
||||
EEPROM_READ(ui.sleep_timeout_minutes);
|
||||
#endif
|
||||
|
||||
//
|
||||
@@ -2168,7 +2177,7 @@ void MarlinSettings::postprocess() {
|
||||
{
|
||||
_FIELD_TEST(tmc_stepper_current);
|
||||
|
||||
tmc_stepper_current_t currents;
|
||||
per_stepper_uint16_t currents;
|
||||
EEPROM_READ(currents);
|
||||
|
||||
#if HAS_TRINAMIC_CONFIG
|
||||
@@ -2247,7 +2256,7 @@ void MarlinSettings::postprocess() {
|
||||
|
||||
// TMC Hybrid Threshold
|
||||
{
|
||||
tmc_hybrid_threshold_t tmc_hybrid_threshold;
|
||||
per_stepper_uint32_t tmc_hybrid_threshold;
|
||||
_FIELD_TEST(tmc_hybrid_threshold);
|
||||
EEPROM_READ(tmc_hybrid_threshold);
|
||||
|
||||
@@ -2283,7 +2292,7 @@ void MarlinSettings::postprocess() {
|
||||
// TMC StallGuard threshold.
|
||||
//
|
||||
{
|
||||
tmc_sgt_t tmc_sgt;
|
||||
mot_stepper_int16_t tmc_sgt;
|
||||
_FIELD_TEST(tmc_sgt);
|
||||
EEPROM_READ(tmc_sgt);
|
||||
#if USE_SENSORLESS
|
||||
@@ -2312,7 +2321,7 @@ void MarlinSettings::postprocess() {
|
||||
{
|
||||
_FIELD_TEST(tmc_stealth_enabled);
|
||||
|
||||
tmc_stealth_enabled_t tmc_stealth_enabled;
|
||||
per_stepper_bool_t tmc_stealth_enabled;
|
||||
EEPROM_READ(tmc_stealth_enabled);
|
||||
|
||||
#if HAS_TRINAMIC_CONFIG
|
||||
@@ -3167,10 +3176,12 @@ void MarlinSettings::reset() {
|
||||
TERN_(HAS_LCD_BRIGHTNESS, ui.brightness = LCD_BRIGHTNESS_DEFAULT);
|
||||
|
||||
//
|
||||
// LCD Backlight Timeout
|
||||
// LCD Backlight / Sleep Timeout
|
||||
//
|
||||
#if LCD_BACKLIGHT_TIMEOUT
|
||||
ui.lcd_backlight_timeout = LCD_BACKLIGHT_TIMEOUT;
|
||||
#elif HAS_DISPLAY_SLEEP
|
||||
ui.sleep_timeout_minutes = DISPLAY_SLEEP_MINUTES;
|
||||
#endif
|
||||
|
||||
//
|
||||
@@ -3501,6 +3512,11 @@ void MarlinSettings::reset() {
|
||||
//
|
||||
TERN_(HAS_LCD_CONTRAST, gcode.M250_report(forReplay));
|
||||
|
||||
//
|
||||
// Display Sleep
|
||||
//
|
||||
TERN_(HAS_GCODE_M255, gcode.M255_report(forReplay));
|
||||
|
||||
//
|
||||
// LCD Brightness
|
||||
//
|
||||
|
||||
@@ -153,7 +153,7 @@ Stepper stepper; // Singleton
|
||||
#endif
|
||||
#endif
|
||||
|
||||
axis_flags_t Stepper::axis_enabled; // {0}
|
||||
stepper_flags_t Stepper::axis_enabled; // {0}
|
||||
|
||||
// private:
|
||||
|
||||
@@ -3638,7 +3638,7 @@ void Stepper::report_positions() {
|
||||
void Stepper::microstep_ms(const uint8_t driver, const int8_t ms1, const int8_t ms2, const int8_t ms3) {
|
||||
if (ms1 >= 0) switch (driver) {
|
||||
#if HAS_X_MS_PINS || HAS_X2_MS_PINS
|
||||
case 0:
|
||||
case X_AXIS:
|
||||
#if HAS_X_MS_PINS
|
||||
WRITE(X_MS1_PIN, ms1);
|
||||
#endif
|
||||
@@ -3648,7 +3648,7 @@ void Stepper::report_positions() {
|
||||
break;
|
||||
#endif
|
||||
#if HAS_Y_MS_PINS || HAS_Y2_MS_PINS
|
||||
case 1:
|
||||
case Y_AXIS:
|
||||
#if HAS_Y_MS_PINS
|
||||
WRITE(Y_MS1_PIN, ms1);
|
||||
#endif
|
||||
@@ -3658,7 +3658,7 @@ void Stepper::report_positions() {
|
||||
break;
|
||||
#endif
|
||||
#if HAS_SOME_Z_MS_PINS
|
||||
case 2:
|
||||
case Z_AXIS:
|
||||
#if HAS_Z_MS_PINS
|
||||
WRITE(Z_MS1_PIN, ms1);
|
||||
#endif
|
||||
@@ -3673,52 +3673,52 @@ void Stepper::report_positions() {
|
||||
#endif
|
||||
break;
|
||||
#endif
|
||||
#if HAS_E0_MS_PINS
|
||||
case 3: WRITE(E0_MS1_PIN, ms1); break;
|
||||
#endif
|
||||
#if HAS_E1_MS_PINS
|
||||
case 4: WRITE(E1_MS1_PIN, ms1); break;
|
||||
#endif
|
||||
#if HAS_E2_MS_PINS
|
||||
case 5: WRITE(E2_MS1_PIN, ms1); break;
|
||||
#endif
|
||||
#if HAS_E3_MS_PINS
|
||||
case 6: WRITE(E3_MS1_PIN, ms1); break;
|
||||
#endif
|
||||
#if HAS_E4_MS_PINS
|
||||
case 7: WRITE(E4_MS1_PIN, ms1); break;
|
||||
#endif
|
||||
#if HAS_E5_MS_PINS
|
||||
case 8: WRITE(E5_MS1_PIN, ms1); break;
|
||||
#endif
|
||||
#if HAS_E6_MS_PINS
|
||||
case 9: WRITE(E6_MS1_PIN, ms1); break;
|
||||
#endif
|
||||
#if HAS_E7_MS_PINS
|
||||
case 10: WRITE(E7_MS1_PIN, ms1); break;
|
||||
#endif
|
||||
#if HAS_I_MS_PINS
|
||||
case 11: WRITE(I_MS1_PIN, ms1); break
|
||||
case I_AXIS: WRITE(I_MS1_PIN, ms1); break
|
||||
#endif
|
||||
#if HAS_J_MS_PINS
|
||||
case 12: WRITE(J_MS1_PIN, ms1); break
|
||||
case J_AXIS: WRITE(J_MS1_PIN, ms1); break
|
||||
#endif
|
||||
#if HAS_K_MS_PINS
|
||||
case 13: WRITE(K_MS1_PIN, ms1); break
|
||||
case K_AXIS: WRITE(K_MS1_PIN, ms1); break
|
||||
#endif
|
||||
#if HAS_U_MS_PINS
|
||||
case 14: WRITE(U_MS1_PIN, ms1); break
|
||||
case U_AXIS: WRITE(U_MS1_PIN, ms1); break
|
||||
#endif
|
||||
#if HAS_V_MS_PINS
|
||||
case 15: WRITE(V_MS1_PIN, ms1); break
|
||||
case V_AXIS: WRITE(V_MS1_PIN, ms1); break
|
||||
#endif
|
||||
#if HAS_W_MS_PINS
|
||||
case 16: WRITE(W_MS1_PIN, ms1); break
|
||||
case W_AXIS: WRITE(W_MS1_PIN, ms1); break
|
||||
#endif
|
||||
#if HAS_E0_MS_PINS
|
||||
case E_AXIS: WRITE(E0_MS1_PIN, ms1); break;
|
||||
#endif
|
||||
#if HAS_E1_MS_PINS
|
||||
case (E_AXIS + 1): WRITE(E1_MS1_PIN, ms1); break;
|
||||
#endif
|
||||
#if HAS_E2_MS_PINS
|
||||
case (E_AXIS + 2): WRITE(E2_MS1_PIN, ms1); break;
|
||||
#endif
|
||||
#if HAS_E3_MS_PINS
|
||||
case (E_AXIS + 3): WRITE(E3_MS1_PIN, ms1); break;
|
||||
#endif
|
||||
#if HAS_E4_MS_PINS
|
||||
case (E_AXIS + 4): WRITE(E4_MS1_PIN, ms1); break;
|
||||
#endif
|
||||
#if HAS_E5_MS_PINS
|
||||
case (E_AXIS + 5): WRITE(E5_MS1_PIN, ms1); break;
|
||||
#endif
|
||||
#if HAS_E6_MS_PINS
|
||||
case (E_AXIS + 6): WRITE(E6_MS1_PIN, ms1); break;
|
||||
#endif
|
||||
#if HAS_E7_MS_PINS
|
||||
case (E_AXIS + 7): WRITE(E7_MS1_PIN, ms1); break;
|
||||
#endif
|
||||
}
|
||||
if (ms2 >= 0) switch (driver) {
|
||||
#if HAS_X_MS_PINS || HAS_X2_MS_PINS
|
||||
case 0:
|
||||
case X_AXIS:
|
||||
#if HAS_X_MS_PINS
|
||||
WRITE(X_MS2_PIN, ms2);
|
||||
#endif
|
||||
@@ -3728,7 +3728,7 @@ void Stepper::report_positions() {
|
||||
break;
|
||||
#endif
|
||||
#if HAS_Y_MS_PINS || HAS_Y2_MS_PINS
|
||||
case 1:
|
||||
case Y_AXIS:
|
||||
#if HAS_Y_MS_PINS
|
||||
WRITE(Y_MS2_PIN, ms2);
|
||||
#endif
|
||||
@@ -3738,7 +3738,7 @@ void Stepper::report_positions() {
|
||||
break;
|
||||
#endif
|
||||
#if HAS_SOME_Z_MS_PINS
|
||||
case 2:
|
||||
case Z_AXIS:
|
||||
#if HAS_Z_MS_PINS
|
||||
WRITE(Z_MS2_PIN, ms2);
|
||||
#endif
|
||||
@@ -3753,52 +3753,52 @@ void Stepper::report_positions() {
|
||||
#endif
|
||||
break;
|
||||
#endif
|
||||
#if HAS_E0_MS_PINS
|
||||
case 3: WRITE(E0_MS2_PIN, ms2); break;
|
||||
#endif
|
||||
#if HAS_E1_MS_PINS
|
||||
case 4: WRITE(E1_MS2_PIN, ms2); break;
|
||||
#endif
|
||||
#if HAS_E2_MS_PINS
|
||||
case 5: WRITE(E2_MS2_PIN, ms2); break;
|
||||
#endif
|
||||
#if HAS_E3_MS_PINS
|
||||
case 6: WRITE(E3_MS2_PIN, ms2); break;
|
||||
#endif
|
||||
#if HAS_E4_MS_PINS
|
||||
case 7: WRITE(E4_MS2_PIN, ms2); break;
|
||||
#endif
|
||||
#if HAS_E5_MS_PINS
|
||||
case 8: WRITE(E5_MS2_PIN, ms2); break;
|
||||
#endif
|
||||
#if HAS_E6_MS_PINS
|
||||
case 9: WRITE(E6_MS2_PIN, ms2); break;
|
||||
#endif
|
||||
#if HAS_E7_MS_PINS
|
||||
case 10: WRITE(E7_MS2_PIN, ms2); break;
|
||||
#endif
|
||||
#if HAS_I_MS_PINS
|
||||
case 11: WRITE(I_MS2_PIN, ms2); break
|
||||
case I_AXIS: WRITE(I_MS2_PIN, ms2); break
|
||||
#endif
|
||||
#if HAS_J_MS_PINS
|
||||
case 12: WRITE(J_MS2_PIN, ms2); break
|
||||
case J_AXIS: WRITE(J_MS2_PIN, ms2); break
|
||||
#endif
|
||||
#if HAS_K_MS_PINS
|
||||
case 13: WRITE(K_MS2_PIN, ms2); break
|
||||
case K_AXIS: WRITE(K_MS2_PIN, ms2); break
|
||||
#endif
|
||||
#if HAS_U_MS_PINS
|
||||
case 14: WRITE(U_MS2_PIN, ms2); break
|
||||
case U_AXIS: WRITE(U_MS2_PIN, ms2); break
|
||||
#endif
|
||||
#if HAS_V_MS_PINS
|
||||
case 15: WRITE(V_MS2_PIN, ms2); break
|
||||
case V_AXIS: WRITE(V_MS2_PIN, ms2); break
|
||||
#endif
|
||||
#if HAS_W_MS_PINS
|
||||
case 16: WRITE(W_MS2_PIN, ms2); break
|
||||
case W_AXIS: WRITE(W_MS2_PIN, ms2); break
|
||||
#endif
|
||||
#if HAS_E0_MS_PINS
|
||||
case E_AXIS: WRITE(E0_MS2_PIN, ms2); break;
|
||||
#endif
|
||||
#if HAS_E1_MS_PINS
|
||||
case (E_AXIS + 1): WRITE(E1_MS2_PIN, ms2); break;
|
||||
#endif
|
||||
#if HAS_E2_MS_PINS
|
||||
case (E_AXIS + 2): WRITE(E2_MS2_PIN, ms2); break;
|
||||
#endif
|
||||
#if HAS_E3_MS_PINS
|
||||
case (E_AXIS + 3): WRITE(E3_MS2_PIN, ms2); break;
|
||||
#endif
|
||||
#if HAS_E4_MS_PINS
|
||||
case (E_AXIS + 4): WRITE(E4_MS2_PIN, ms2); break;
|
||||
#endif
|
||||
#if HAS_E5_MS_PINS
|
||||
case (E_AXIS + 5): WRITE(E5_MS2_PIN, ms2); break;
|
||||
#endif
|
||||
#if HAS_E6_MS_PINS
|
||||
case (E_AXIS + 6): WRITE(E6_MS2_PIN, ms2); break;
|
||||
#endif
|
||||
#if HAS_E7_MS_PINS
|
||||
case (E_AXIS + 7): WRITE(E7_MS2_PIN, ms2); break;
|
||||
#endif
|
||||
}
|
||||
if (ms3 >= 0) switch (driver) {
|
||||
#if HAS_X_MS_PINS || HAS_X2_MS_PINS
|
||||
case 0:
|
||||
case X_AXIS:
|
||||
#if HAS_X_MS_PINS && PIN_EXISTS(X_MS3)
|
||||
WRITE(X_MS3_PIN, ms3);
|
||||
#endif
|
||||
@@ -3808,7 +3808,7 @@ void Stepper::report_positions() {
|
||||
break;
|
||||
#endif
|
||||
#if HAS_Y_MS_PINS || HAS_Y2_MS_PINS
|
||||
case 1:
|
||||
case Y_AXIS:
|
||||
#if HAS_Y_MS_PINS && PIN_EXISTS(Y_MS3)
|
||||
WRITE(Y_MS3_PIN, ms3);
|
||||
#endif
|
||||
@@ -3818,7 +3818,7 @@ void Stepper::report_positions() {
|
||||
break;
|
||||
#endif
|
||||
#if HAS_SOME_Z_MS_PINS
|
||||
case 2:
|
||||
case Z_AXIS:
|
||||
#if HAS_Z_MS_PINS && PIN_EXISTS(Z_MS3)
|
||||
WRITE(Z_MS3_PIN, ms3);
|
||||
#endif
|
||||
@@ -3833,29 +3833,47 @@ void Stepper::report_positions() {
|
||||
#endif
|
||||
break;
|
||||
#endif
|
||||
#if HAS_I_MS_PINS
|
||||
case I_AXIS: WRITE(I_MS3_PIN, ms3); break
|
||||
#endif
|
||||
#if HAS_J_MS_PINS
|
||||
case J_AXIS: WRITE(J_MS3_PIN, ms3); break
|
||||
#endif
|
||||
#if HAS_K_MS_PINS
|
||||
case K_AXIS: WRITE(K_MS3_PIN, ms3); break
|
||||
#endif
|
||||
#if HAS_U_MS_PINS
|
||||
case U_AXIS: WRITE(U_MS3_PIN, ms3); break
|
||||
#endif
|
||||
#if HAS_V_MS_PINS
|
||||
case V_AXIS: WRITE(V_MS3_PIN, ms3); break
|
||||
#endif
|
||||
#if HAS_W_MS_PINS
|
||||
case W_AXIS: WRITE(W_MS3_PIN, ms3); break
|
||||
#endif
|
||||
#if HAS_E0_MS_PINS && PIN_EXISTS(E0_MS3)
|
||||
case 3: WRITE(E0_MS3_PIN, ms3); break;
|
||||
case E_AXIS: WRITE(E0_MS3_PIN, ms3); break;
|
||||
#endif
|
||||
#if HAS_E1_MS_PINS && PIN_EXISTS(E1_MS3)
|
||||
case 4: WRITE(E1_MS3_PIN, ms3); break;
|
||||
case (E_AXIS + 1): WRITE(E1_MS3_PIN, ms3); break;
|
||||
#endif
|
||||
#if HAS_E2_MS_PINS && PIN_EXISTS(E2_MS3)
|
||||
case 5: WRITE(E2_MS3_PIN, ms3); break;
|
||||
case (E_AXIS + 2): WRITE(E2_MS3_PIN, ms3); break;
|
||||
#endif
|
||||
#if HAS_E3_MS_PINS && PIN_EXISTS(E3_MS3)
|
||||
case 6: WRITE(E3_MS3_PIN, ms3); break;
|
||||
case (E_AXIS + 3): WRITE(E3_MS3_PIN, ms3); break;
|
||||
#endif
|
||||
#if HAS_E4_MS_PINS && PIN_EXISTS(E4_MS3)
|
||||
case 7: WRITE(E4_MS3_PIN, ms3); break;
|
||||
case (E_AXIS + 4): WRITE(E4_MS3_PIN, ms3); break;
|
||||
#endif
|
||||
#if HAS_E5_MS_PINS && PIN_EXISTS(E5_MS3)
|
||||
case 8: WRITE(E5_MS3_PIN, ms3); break;
|
||||
case (E_AXIS + 5): WRITE(E5_MS3_PIN, ms3); break;
|
||||
#endif
|
||||
#if HAS_E6_MS_PINS && PIN_EXISTS(E6_MS3)
|
||||
case 9: WRITE(E6_MS3_PIN, ms3); break;
|
||||
case (E_AXIS + 6): WRITE(E6_MS3_PIN, ms3); break;
|
||||
#endif
|
||||
#if HAS_E7_MS_PINS && PIN_EXISTS(E7_MS3)
|
||||
case 10: WRITE(E7_MS3_PIN, ms3); break;
|
||||
case (E_AXIS + 7): WRITE(E7_MS3_PIN, ms3); break;
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
@@ -261,7 +261,7 @@ typedef struct {
|
||||
};
|
||||
constexpr ena_mask_t linear_bits() { return _BV(NUM_AXES) - 1; }
|
||||
constexpr ena_mask_t e_bits() { return (_BV(EXTRUDERS) - 1) << NUM_AXES; }
|
||||
} axis_flags_t;
|
||||
} stepper_flags_t;
|
||||
|
||||
// All the stepper enable pins
|
||||
constexpr pin_t ena_pins[] = {
|
||||
@@ -596,7 +596,7 @@ class Stepper {
|
||||
static void refresh_motor_power();
|
||||
#endif
|
||||
|
||||
static axis_flags_t axis_enabled; // Axis stepper(s) ENABLED states
|
||||
static stepper_flags_t axis_enabled; // Axis stepper(s) ENABLED states
|
||||
|
||||
static bool axis_is_enabled(const AxisEnum axis E_OPTARG(const uint8_t eindex=0)) {
|
||||
return TEST(axis_enabled.bits, INDEX_OF_AXIS(axis, eindex));
|
||||
|
||||
@@ -1283,7 +1283,7 @@ void Temperature::min_temp_error(const heater_id_t heater_id) {
|
||||
static hotend_pid_t work_pid[HOTENDS];
|
||||
static float temp_iState[HOTENDS] = { 0 },
|
||||
temp_dState[HOTENDS] = { 0 };
|
||||
static bool pid_reset[HOTENDS] = { false };
|
||||
static Flags<HOTENDS> pid_reset;
|
||||
const float pid_error = temp_hotend[ee].target - temp_hotend[ee].celsius;
|
||||
|
||||
float pid_output;
|
||||
@@ -1293,17 +1293,17 @@ void Temperature::min_temp_error(const heater_id_t heater_id) {
|
||||
|| TERN0(HEATER_IDLE_HANDLER, heater_idle[ee].timed_out)
|
||||
) {
|
||||
pid_output = 0;
|
||||
pid_reset[ee] = true;
|
||||
pid_reset.set(ee);
|
||||
}
|
||||
else if (pid_error > PID_FUNCTIONAL_RANGE) {
|
||||
pid_output = PID_MAX;
|
||||
pid_reset[ee] = true;
|
||||
pid_reset.set(ee);
|
||||
}
|
||||
else {
|
||||
if (pid_reset[ee]) {
|
||||
temp_iState[ee] = 0.0;
|
||||
work_pid[ee].Kd = 0.0;
|
||||
pid_reset[ee] = false;
|
||||
pid_reset.clear(ee);
|
||||
}
|
||||
|
||||
work_pid[ee].Kd = work_pid[ee].Kd + PID_K2 * (PID_PARAM(Kd, ee) * (temp_dState[ee] - temp_hotend[ee].celsius) - work_pid[ee].Kd);
|
||||
|
||||
@@ -46,7 +46,7 @@
|
||||
#endif
|
||||
|
||||
#if ENABLED(TOOLCHANGE_FS_INIT_BEFORE_SWAP)
|
||||
bool toolchange_extruder_ready[EXTRUDERS];
|
||||
Flags<EXTRUDERS> toolchange_extruder_ready;
|
||||
#endif
|
||||
|
||||
#if EITHER(MAGNETIC_PARKING_EXTRUDER, TOOL_SENSOR) \
|
||||
@@ -1057,7 +1057,7 @@ void tool_change(const uint8_t new_tool, bool no_move/*=false*/) {
|
||||
if (new_tool == old_tool && !first_tool_is_primed && enable_first_prime) {
|
||||
tool_change_prime();
|
||||
first_tool_is_primed = true;
|
||||
TERN_(TOOLCHANGE_FS_INIT_BEFORE_SWAP, toolchange_extruder_ready[old_tool] = true); // Primed and initialized
|
||||
TERN_(TOOLCHANGE_FS_INIT_BEFORE_SWAP, toolchange_extruder_ready.set(old_tool)); // Primed and initialized
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -1216,7 +1216,7 @@ void tool_change(const uint8_t new_tool, bool no_move/*=false*/) {
|
||||
|
||||
#if ENABLED(TOOLCHANGE_FS_INIT_BEFORE_SWAP)
|
||||
if (!toolchange_extruder_ready[new_tool]) {
|
||||
toolchange_extruder_ready[new_tool] = true;
|
||||
toolchange_extruder_ready.set(new_tool);
|
||||
fr = toolchange_settings.prime_speed; // Next move is a prime
|
||||
unscaled_e_move(0, MMM_TO_MMS(fr)); // Init planner with 0 length move
|
||||
}
|
||||
@@ -1401,7 +1401,7 @@ void tool_change(const uint8_t new_tool, bool no_move/*=false*/) {
|
||||
|
||||
// Migrate the retracted state
|
||||
#if ENABLED(FWRETRACT)
|
||||
fwretract.retracted[migration_extruder] = fwretract.retracted[active_extruder];
|
||||
fwretract.retracted.set(migration_extruder, fwretract.retracted[active_extruder]);
|
||||
#endif
|
||||
|
||||
// Migrate the temperature to the new hotend
|
||||
|
||||
@@ -50,7 +50,7 @@
|
||||
#endif
|
||||
|
||||
#if ENABLED(TOOLCHANGE_FS_INIT_BEFORE_SWAP)
|
||||
extern bool toolchange_extruder_ready[EXTRUDERS];
|
||||
extern Flags<EXTRUDERS> toolchange_extruder_ready;
|
||||
#endif
|
||||
|
||||
#if ENABLED(TOOLCHANGE_MIGRATION_FEATURE)
|
||||
|
||||
@@ -45,10 +45,6 @@
|
||||
#define HAS_SAVED_POSITIONS
|
||||
#endif
|
||||
|
||||
#if ENABLED(HOST_PROMPT_SUPPORT) && DISABLED(EMERGENCY_PARSER)
|
||||
#define HAS_GCODE_M876
|
||||
#endif
|
||||
|
||||
#if ENABLED(DUET_SMART_EFFECTOR) && PIN_EXISTS(SMART_EFFECTOR_MOD)
|
||||
#define HAS_SMART_EFF_MOD
|
||||
#endif
|
||||
|
||||
@@ -31,7 +31,8 @@ exec_test $1 $2 "BigTreeTech GTR | 6 Extruders | Quad Z + Endstops" "$3"
|
||||
restore_configs
|
||||
opt_set MOTHERBOARD BOARD_BTT_GTR_V1_0 SERIAL_PORT -1 \
|
||||
EXTRUDERS 3 TEMP_SENSOR_1 1 TEMP_SENSOR_2 1 \
|
||||
SERVO_DELAY '{ 300, 300, 300 }'
|
||||
SERVO_DELAY '{ 300, 300, 300 }' \
|
||||
SWITCHING_TOOLHEAD_X_POS '{ 215, 0 ,0 }'
|
||||
opt_enable SWITCHING_TOOLHEAD TOOL_SENSOR
|
||||
exec_test $1 $2 "BigTreeTech GTR | Switching Toolhead | Tool Sensors" "$3"
|
||||
|
||||
|
||||
+2
-1
@@ -37,7 +37,7 @@ USES_LIQUIDCRYSTAL_I2C = marcoschwartz/LiquidCrystal_I2C@1.1.4
|
||||
USES_LIQUIDTWI2 = LiquidTWI2@1.2.7
|
||||
HAS_LCDPRINT = src_filter=+<src/lcd/lcdprint.cpp>
|
||||
HAS_MARLINUI_HD44780 = src_filter=+<src/lcd/HD44780>
|
||||
HAS_MARLINUI_U8GLIB = U8glib-HAL@~0.5.0
|
||||
HAS_MARLINUI_U8GLIB = U8glib-HAL@~0.5.2
|
||||
src_filter=+<src/lcd/dogm>
|
||||
HAS_(FSMC|SPI|LTDC)_TFT = src_filter=+<src/HAL/STM32/tft> +<src/HAL/STM32F1/tft> +<src/lcd/tft_io>
|
||||
HAS_FSMC_TFT = src_filter=+<src/HAL/STM32/tft/tft_fsmc.cpp> +<src/HAL/STM32F1/tft/tft_fsmc.cpp>
|
||||
@@ -202,6 +202,7 @@ HAS_RESUME_CONTINUE = src_filter=+<src/gcode/lcd/M0_M1.cpp>
|
||||
LCD_SET_PROGRESS_MANUALLY = src_filter=+<src/gcode/lcd/M73.cpp>
|
||||
HAS_STATUS_MESSAGE = src_filter=+<src/gcode/lcd/M117.cpp>
|
||||
HAS_LCD_CONTRAST = src_filter=+<src/gcode/lcd/M250.cpp>
|
||||
HAS_GCODE_M255 = src_filter=+<src/gcode/lcd/M255.cpp>
|
||||
HAS_LCD_BRIGHTNESS = src_filter=+<src/gcode/lcd/M256.cpp>
|
||||
HAS_BUZZER = src_filter=+<src/gcode/lcd/M300.cpp>
|
||||
TOUCH_SCREEN_CALIBRATION = src_filter=+<src/gcode/lcd/M995.cpp>
|
||||
|
||||
+1
-1
@@ -217,7 +217,7 @@ default_src_filter = +<src/*> -<src/config> -<src/HAL> +<src/HAL/shared>
|
||||
-<src/gcode/lcd/M0_M1.cpp>
|
||||
-<src/gcode/lcd/M73.cpp>
|
||||
-<src/gcode/lcd/M117.cpp>
|
||||
-<src/gcode/lcd/M250.cpp> -<src/gcode/lcd/M256.cpp>
|
||||
-<src/gcode/lcd/M250.cpp> -<src/gcode/lcd/M255.cpp> -<src/gcode/lcd/M256.cpp>
|
||||
-<src/gcode/lcd/M300.cpp>
|
||||
-<src/gcode/lcd/M414.cpp>
|
||||
-<src/gcode/lcd/M995.cpp>
|
||||
|
||||
Reference in New Issue
Block a user