From 349465b1688ae9f3c47cfc94f5d05b98d6ad5654 Mon Sep 17 00:00:00 2001 From: thinkyhead Date: Sun, 11 Oct 2020 00:15:24 +0000 Subject: [PATCH 001/226] [cron] Bump distribution date (2020-10-11) --- Marlin/src/inc/Version.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Marlin/src/inc/Version.h b/Marlin/src/inc/Version.h index 441ea22c2a..2b97b173a2 100644 --- a/Marlin/src/inc/Version.h +++ b/Marlin/src/inc/Version.h @@ -42,7 +42,7 @@ * version was tagged. */ #ifndef STRING_DISTRIBUTION_DATE - #define STRING_DISTRIBUTION_DATE "2020-10-10" + #define STRING_DISTRIBUTION_DATE "2020-10-11" #endif /** From 492ba2a111ce541513d4515c4af3f57ceaa897ea Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Sun, 11 Oct 2020 14:58:35 -0500 Subject: [PATCH 002/226] Digipots refactor / cleanup (#19690) --- Marlin/src/HAL/DUE/fastio/G2_PWM.cpp | 2 +- Marlin/src/HAL/LPC1768/inc/SanityCheck.h | 2 +- Marlin/src/MarlinCore.cpp | 12 ++-- Marlin/src/feature/dac/dac_mcp4728.cpp | 50 ++++++++-------- Marlin/src/feature/dac/dac_mcp4728.h | 25 ++++---- Marlin/src/feature/dac/stepper_dac.cpp | 57 +++++++++--------- Marlin/src/feature/dac/stepper_dac.h | 19 +++--- Marlin/src/feature/digipot/digipot.h | 12 +++- .../src/feature/digipot/digipot_mcp4018.cpp | 12 ++-- .../src/feature/digipot/digipot_mcp4451.cpp | 8 ++- .../src/gcode/feature/digipot/M907-M910.cpp | 52 ++++++++-------- Marlin/src/gcode/gcode.cpp | 6 +- Marlin/src/gcode/gcode.h | 12 ++-- Marlin/src/inc/Conditionals_adv.h | 2 +- Marlin/src/inc/Conditionals_post.h | 2 +- Marlin/src/inc/SanityCheck.h | 2 +- Marlin/src/lcd/menu/menu_advanced.cpp | 8 +-- Marlin/src/module/settings.cpp | 59 ++++++++++++++----- Marlin/src/module/stepper.cpp | 55 ++++++++--------- Marlin/src/module/stepper.h | 22 ++++--- Marlin/src/pins/ramps/pins_RIGIDBOARD_V2.h | 2 +- .../src/pins/teensy2/pins_PRINTRBOARD_REVF.h | 2 +- platformio.ini | 4 +- 23 files changed, 240 insertions(+), 187 deletions(-) diff --git a/Marlin/src/HAL/DUE/fastio/G2_PWM.cpp b/Marlin/src/HAL/DUE/fastio/G2_PWM.cpp index 1682faea66..d9fbabce21 100644 --- a/Marlin/src/HAL/DUE/fastio/G2_PWM.cpp +++ b/Marlin/src/HAL/DUE/fastio/G2_PWM.cpp @@ -154,7 +154,7 @@ void Stepper::digipot_init() { NVIC_SetPriority(PWM_IRQn, NVIC_EncodePriority(0, 10, 0)); // normal priority for PWM module (can stand some jitter on the Vref signals) } -void Stepper::digipot_current(const uint8_t driver, const int16_t current) { +void Stepper::set_digipot_current(const uint8_t driver, const int16_t current) { if (!(PWM->PWM_CH_NUM[0].PWM_CPRD == PWM_PERIOD_US)) digipot_init(); // Init PWM system if needed diff --git a/Marlin/src/HAL/LPC1768/inc/SanityCheck.h b/Marlin/src/HAL/LPC1768/inc/SanityCheck.h index fd82e2884a..f5051d32a1 100644 --- a/Marlin/src/HAL/LPC1768/inc/SanityCheck.h +++ b/Marlin/src/HAL/LPC1768/inc/SanityCheck.h @@ -191,7 +191,7 @@ static_assert(DISABLED(BAUD_RATE_GCODE), "BAUD_RATE_GCODE is not yet supported o // // Flag any i2c pin conflicts // -#if ANY(HAS_I2C_DIGIPOT, DAC_STEPPER_CURRENT, EXPERIMENTAL_I2CBUS, I2C_POSITION_ENCODERS, PCA9632, I2C_EEPROM) +#if ANY(HAS_MOTOR_CURRENT_I2C, HAS_MOTOR_CURRENT_DAC, EXPERIMENTAL_I2CBUS, I2C_POSITION_ENCODERS, PCA9632, I2C_EEPROM) #define USEDI2CDEV_M 1 // /Wire.cpp #if USEDI2CDEV_M == 0 // P0_27 [D57] (AUX-1) .......... P0_28 [D58] (AUX-1) diff --git a/Marlin/src/MarlinCore.cpp b/Marlin/src/MarlinCore.cpp index 672858d05a..3a20cf3ee3 100644 --- a/Marlin/src/MarlinCore.cpp +++ b/Marlin/src/MarlinCore.cpp @@ -97,7 +97,7 @@ #include "feature/closedloop.h" #endif -#if HAS_I2C_DIGIPOT +#if HAS_MOTOR_CURRENT_I2C #include "feature/digipot/digipot.h" #endif @@ -125,7 +125,7 @@ #include "module/servo.h" #endif -#if ENABLED(DAC_STEPPER_CURRENT) +#if ENABLED(HAS_MOTOR_CURRENT_DAC) #include "feature/dac/stepper_dac.h" #endif @@ -1137,12 +1137,12 @@ void setup() { SETUP_RUN(enableStepperDrivers()); #endif - #if HAS_I2C_DIGIPOT - SETUP_RUN(digipot_i2c_init()); + #if HAS_MOTOR_CURRENT_I2C + SETUP_RUN(digipot_i2c.init()); #endif - #if ENABLED(DAC_STEPPER_CURRENT) - SETUP_RUN(dac_init()); + #if ENABLED(HAS_MOTOR_CURRENT_DAC) + SETUP_RUN(stepper_dac.init()); #endif #if EITHER(Z_PROBE_SLED, SOLENOID_PROBE) && HAS_SOLENOID_1 diff --git a/Marlin/src/feature/dac/dac_mcp4728.cpp b/Marlin/src/feature/dac/dac_mcp4728.cpp index 55f10a49ef..81c465cf29 100644 --- a/Marlin/src/feature/dac/dac_mcp4728.cpp +++ b/Marlin/src/feature/dac/dac_mcp4728.cpp @@ -32,16 +32,18 @@ #include "../../inc/MarlinConfig.h" -#if ENABLED(DAC_STEPPER_CURRENT) +#if ENABLED(HAS_MOTOR_CURRENT_DAC) #include "dac_mcp4728.h" -xyze_uint_t mcp4728_values; +MCP4728 mcp4728; + +xyze_uint_t dac_values; /** * Begin I2C, get current values (input register and eeprom) of mcp4728 */ -void mcp4728_init() { +void MCP4728::init() { Wire.begin(); Wire.requestFrom(I2C_ADDRESS(DAC_DEV_ADDRESS), uint8_t(24)); while (Wire.available()) { @@ -50,7 +52,7 @@ void mcp4728_init() { loByte = Wire.read(); if (!(deviceID & 0x08)) - mcp4728_values[(deviceID & 0x30) >> 4] = word((hiByte & 0x0F), loByte); + dac_values[(deviceID & 0x30) >> 4] = word((hiByte & 0x0F), loByte); } } @@ -58,9 +60,9 @@ void mcp4728_init() { * Write input resister value to specified channel using fastwrite method. * Channel : 0-3, Values : 0-4095 */ -uint8_t mcp4728_analogWrite(const uint8_t channel, const uint16_t value) { - mcp4728_values[channel] = value; - return mcp4728_fastWrite(); +uint8_t MCP4728::analogWrite(const uint8_t channel, const uint16_t value) { + dac_values[channel] = value; + return fastWrite(); } /** @@ -68,12 +70,12 @@ uint8_t mcp4728_analogWrite(const uint8_t channel, const uint16_t value) { * This will update both input register and EEPROM value * This will also write current Vref, PowerDown, Gain settings to EEPROM */ -uint8_t mcp4728_eepromWrite() { +uint8_t MCP4728::eepromWrite() { Wire.beginTransmission(I2C_ADDRESS(DAC_DEV_ADDRESS)); Wire.write(SEQWRITE); LOOP_XYZE(i) { - Wire.write(DAC_STEPPER_VREF << 7 | DAC_STEPPER_GAIN << 4 | highByte(mcp4728_values[i])); - Wire.write(lowByte(mcp4728_values[i])); + Wire.write(DAC_STEPPER_VREF << 7 | DAC_STEPPER_GAIN << 4 | highByte(dac_values[i])); + Wire.write(lowByte(dac_values[i])); } return Wire.endTransmission(); } @@ -81,7 +83,7 @@ uint8_t mcp4728_eepromWrite() { /** * Write Voltage reference setting to all input regiters */ -uint8_t mcp4728_setVref_all(const uint8_t value) { +uint8_t MCP4728::setVref_all(const uint8_t value) { Wire.beginTransmission(I2C_ADDRESS(DAC_DEV_ADDRESS)); Wire.write(VREFWRITE | (value ? 0x0F : 0x00)); return Wire.endTransmission(); @@ -89,7 +91,7 @@ uint8_t mcp4728_setVref_all(const uint8_t value) { /** * Write Gain setting to all input regiters */ -uint8_t mcp4728_setGain_all(const uint8_t value) { +uint8_t MCP4728::setGain_all(const uint8_t value) { Wire.beginTransmission(I2C_ADDRESS(DAC_DEV_ADDRESS)); Wire.write(GAINWRITE | (value ? 0x0F : 0x00)); return Wire.endTransmission(); @@ -98,16 +100,16 @@ uint8_t mcp4728_setGain_all(const uint8_t value) { /** * Return Input Register value */ -uint16_t mcp4728_getValue(const uint8_t channel) { return mcp4728_values[channel]; } +uint16_t MCP4728::getValue(const uint8_t channel) { return dac_values[channel]; } #if 0 /** * Steph: Might be useful in the future * Return Vout */ -uint16_t mcp4728_getVout(const uint8_t channel) { +uint16_t MCP4728::getVout(const uint8_t channel) { const uint32_t vref = 2048, - vOut = (vref * mcp4728_values[channel] * (_DAC_STEPPER_GAIN + 1)) / 4096; + vOut = (vref * dac_values[channel] * (_DAC_STEPPER_GAIN + 1)) / 4096; return _MIN(vOut, defaultVDD); } #endif @@ -115,15 +117,15 @@ uint16_t mcp4728_getVout(const uint8_t channel) { /** * Returns DAC values as a 0-100 percentage of drive strength */ -uint8_t mcp4728_getDrvPct(const uint8_t channel) { return uint8_t(100.0 * mcp4728_values[channel] / (DAC_STEPPER_MAX) + 0.5); } +uint8_t MCP4728::getDrvPct(const uint8_t channel) { return uint8_t(100.0 * dac_values[channel] / (DAC_STEPPER_MAX) + 0.5); } /** * Receives all Drive strengths as 0-100 percent values, updates * DAC Values array and calls fastwrite to update the DAC. */ -void mcp4728_setDrvPct(xyze_uint8_t &pct) { - mcp4728_values *= 0.01 * pct * (DAC_STEPPER_MAX); - mcp4728_fastWrite(); +void MCP4728::setDrvPct(xyze_uint8_t &pct) { + dac_values *= 0.01 * pct * (DAC_STEPPER_MAX); + fastWrite(); } /** @@ -131,11 +133,11 @@ void mcp4728_setDrvPct(xyze_uint8_t &pct) { * DAC Input and PowerDown bits update. * No EEPROM update */ -uint8_t mcp4728_fastWrite() { +uint8_t MCP4728::fastWrite() { Wire.beginTransmission(I2C_ADDRESS(DAC_DEV_ADDRESS)); LOOP_XYZE(i) { - Wire.write(highByte(mcp4728_values[i])); - Wire.write(lowByte(mcp4728_values[i])); + Wire.write(highByte(dac_values[i])); + Wire.write(lowByte(dac_values[i])); } return Wire.endTransmission(); } @@ -143,10 +145,10 @@ uint8_t mcp4728_fastWrite() { /** * Common function for simple general commands */ -uint8_t mcp4728_simpleCommand(const byte simpleCommand) { +uint8_t MCP4728::simpleCommand(const byte simpleCommand) { Wire.beginTransmission(I2C_ADDRESS(GENERALCALL)); Wire.write(simpleCommand); return Wire.endTransmission(); } -#endif // DAC_STEPPER_CURRENT +#endif // HAS_MOTOR_CURRENT_DAC diff --git a/Marlin/src/feature/dac/dac_mcp4728.h b/Marlin/src/feature/dac/dac_mcp4728.h index fc69bd8ff4..571716d483 100644 --- a/Marlin/src/feature/dac/dac_mcp4728.h +++ b/Marlin/src/feature/dac/dac_mcp4728.h @@ -65,13 +65,18 @@ // DAC_OR_ADDRESS defined in pins_BOARD.h file #define DAC_DEV_ADDRESS (BASE_ADDR | DAC_OR_ADDRESS) -void mcp4728_init(); -uint8_t mcp4728_analogWrite(const uint8_t channel, const uint16_t value); -uint8_t mcp4728_eepromWrite(); -uint8_t mcp4728_setVref_all(const uint8_t value); -uint8_t mcp4728_setGain_all(const uint8_t value); -uint16_t mcp4728_getValue(const uint8_t channel); -uint8_t mcp4728_fastWrite(); -uint8_t mcp4728_simpleCommand(const byte simpleCommand); -uint8_t mcp4728_getDrvPct(const uint8_t channel); -void mcp4728_setDrvPct(xyze_uint8_t &pct); +class MCP4728 { +public: + static void init(); + static uint8_t analogWrite(const uint8_t channel, const uint16_t value); + static uint8_t eepromWrite(); + static uint8_t setVref_all(const uint8_t value); + static uint8_t setGain_all(const uint8_t value); + static uint16_t getValue(const uint8_t channel); + static uint8_t fastWrite(); + static uint8_t simpleCommand(const byte simpleCommand); + static uint8_t getDrvPct(const uint8_t channel); + static void setDrvPct(xyze_uint8_t &pct); +}; + +extern MCP4728 mcp4728; diff --git a/Marlin/src/feature/dac/stepper_dac.cpp b/Marlin/src/feature/dac/stepper_dac.cpp index 6b140a0025..5f10b4ccfb 100644 --- a/Marlin/src/feature/dac/stepper_dac.cpp +++ b/Marlin/src/feature/dac/stepper_dac.cpp @@ -26,7 +26,7 @@ #include "../../inc/MarlinConfig.h" -#if ENABLED(DAC_STEPPER_CURRENT) +#if ENABLED(HAS_MOTOR_CURRENT_DAC) #include "stepper_dac.h" #include "../../MarlinCore.h" // for SP_X_LBL... @@ -35,56 +35,53 @@ bool dac_present = false; constexpr xyze_uint8_t dac_order = DAC_STEPPER_ORDER; xyze_uint8_t dac_channel_pct = DAC_MOTOR_CURRENT_DEFAULT; -int dac_init() { +StepperDAC stepper_dac; + +int StepperDAC::init() { #if PIN_EXISTS(DAC_DISABLE) OUT_WRITE(DAC_DISABLE_PIN, LOW); // set pin low to enable DAC #endif - mcp4728_init(); + mcp4728.init(); - if (mcp4728_simpleCommand(RESET)) return -1; + if (mcp4728.simpleCommand(RESET)) return -1; dac_present = true; - mcp4728_setVref_all(DAC_STEPPER_VREF); - mcp4728_setGain_all(DAC_STEPPER_GAIN); + mcp4728.setVref_all(DAC_STEPPER_VREF); + mcp4728.setGain_all(DAC_STEPPER_GAIN); - if (mcp4728_getDrvPct(0) < 1 || mcp4728_getDrvPct(1) < 1 || mcp4728_getDrvPct(2) < 1 || mcp4728_getDrvPct(3) < 1 ) { - mcp4728_setDrvPct(dac_channel_pct); - mcp4728_eepromWrite(); + if (mcp4728.getDrvPct(0) < 1 || mcp4728.getDrvPct(1) < 1 || mcp4728.getDrvPct(2) < 1 || mcp4728.getDrvPct(3) < 1 ) { + mcp4728.setDrvPct(dac_channel_pct); + mcp4728.eepromWrite(); } return 0; } -void dac_current_percent(uint8_t channel, float val) { - if (!dac_present) return; - - NOMORE(val, 100); - - mcp4728_analogWrite(dac_order[channel], val * 0.01 * (DAC_STEPPER_MAX)); - mcp4728_simpleCommand(UPDATE); -} - -void dac_current_raw(uint8_t channel, uint16_t val) { +void StepperDAC::set_current_value(const uint8_t channel, uint16_t val) { if (!dac_present) return; NOMORE(val, uint16_t(DAC_STEPPER_MAX)); - mcp4728_analogWrite(dac_order[channel], val); - mcp4728_simpleCommand(UPDATE); + mcp4728.analogWrite(dac_order[channel], val); + mcp4728.simpleCommand(UPDATE); } -static float dac_perc(int8_t n) { return 100.0 * mcp4728_getValue(dac_order[n]) * RECIPROCAL(DAC_STEPPER_MAX); } -static float dac_amps(int8_t n) { return mcp4728_getDrvPct(dac_order[n]) * (DAC_STEPPER_MAX) * 0.125 * RECIPROCAL(DAC_STEPPER_SENSE); } +void StepperDAC::set_current_percent(const uint8_t channel, float val) { + set_current_value(channel, _MIN(val, 100.0f) * (DAC_STEPPER_MAX) / 100.0f); +} -uint8_t dac_current_get_percent(const AxisEnum axis) { return mcp4728_getDrvPct(dac_order[axis]); } -void dac_current_set_percents(xyze_uint8_t &pct) { +static float dac_perc(int8_t n) { return 100.0 * mcp4728.getValue(dac_order[n]) * RECIPROCAL(DAC_STEPPER_MAX); } +static float dac_amps(int8_t n) { return mcp4728.getDrvPct(dac_order[n]) * (DAC_STEPPER_MAX) * 0.125 * RECIPROCAL(DAC_STEPPER_SENSE); } + +uint8_t StepperDAC::get_current_percent(const AxisEnum axis) { return mcp4728.getDrvPct(dac_order[axis]); } +void StepperDAC::set_current_percents(xyze_uint8_t &pct) { LOOP_XYZE(i) dac_channel_pct[i] = pct[dac_order[i]]; - mcp4728_setDrvPct(dac_channel_pct); + mcp4728.setDrvPct(dac_channel_pct); } -void dac_print_values() { +void StepperDAC::print_values() { if (!dac_present) return; SERIAL_ECHO_MSG("Stepper current values in % (Amps):"); SERIAL_ECHO_START(); @@ -94,9 +91,9 @@ void dac_print_values() { SERIAL_ECHOLNPAIR_P(SP_E_LBL, dac_perc(E_AXIS), PSTR(" ("), dac_amps(E_AXIS), PSTR(")")); } -void dac_commit_eeprom() { +void StepperDAC::commit_eeprom() { if (!dac_present) return; - mcp4728_eepromWrite(); + mcp4728.eepromWrite(); } -#endif // DAC_STEPPER_CURRENT +#endif // HAS_MOTOR_CURRENT_DAC diff --git a/Marlin/src/feature/dac/stepper_dac.h b/Marlin/src/feature/dac/stepper_dac.h index 0543b6275e..6836335e98 100644 --- a/Marlin/src/feature/dac/stepper_dac.h +++ b/Marlin/src/feature/dac/stepper_dac.h @@ -27,10 +27,15 @@ #include "dac_mcp4728.h" -int dac_init(); -void dac_current_percent(uint8_t channel, float val); -void dac_current_raw(uint8_t channel, uint16_t val); -void dac_print_values(); -void dac_commit_eeprom(); -uint8_t dac_current_get_percent(AxisEnum axis); -void dac_current_set_percents(xyze_uint8_t &pct); +class StepperDAC { +public: + static int init(); + static void set_current_percent(const uint8_t channel, float val); + static void set_current_value(const uint8_t channel, uint16_t val); + static void print_values(); + static void commit_eeprom(); + static uint8_t get_current_percent(AxisEnum axis); + static void set_current_percents(xyze_uint8_t &pct); +}; + +extern StepperDAC stepper_dac; diff --git a/Marlin/src/feature/digipot/digipot.h b/Marlin/src/feature/digipot/digipot.h index d59f8b930a..c53f8093dd 100644 --- a/Marlin/src/feature/digipot/digipot.h +++ b/Marlin/src/feature/digipot/digipot.h @@ -21,5 +21,13 @@ */ #pragma once -void digipot_i2c_set_current(const uint8_t channel, const float current); -void digipot_i2c_init(); +// +// Header for MCP4018 and MCP4451 current control i2c devices +// +class DigipotI2C { +public: + static void init(); + static void set_current(const uint8_t channel, const float current); +}; + +DigipotI2C digipot_i2c; diff --git a/Marlin/src/feature/digipot/digipot_mcp4018.cpp b/Marlin/src/feature/digipot/digipot_mcp4018.cpp index 35c513a32c..6260185fc3 100644 --- a/Marlin/src/feature/digipot/digipot_mcp4018.cpp +++ b/Marlin/src/feature/digipot/digipot_mcp4018.cpp @@ -24,6 +24,8 @@ #if ENABLED(DIGIPOT_MCP4018) +#include "digipot.h" + #include #include // https://github.com/stawel/SlowSoftI2CMaster @@ -68,7 +70,7 @@ static SlowSoftI2CMaster pots[DIGIPOT_I2C_NUM_CHANNELS] = { #endif }; -static void i2c_send(const uint8_t channel, const byte v) { +static void digipot_i2c_send(const uint8_t channel, const byte v) { if (WITHIN(channel, 0, DIGIPOT_I2C_NUM_CHANNELS - 1)) { pots[channel].i2c_start(((DIGIPOT_I2C_ADDRESS_A) << 1) | I2C_WRITE); pots[channel].i2c_write(v); @@ -77,12 +79,12 @@ static void i2c_send(const uint8_t channel, const byte v) { } // This is for the MCP4018 I2C based digipot -void digipot_i2c_set_current(const uint8_t channel, const float current) { +void DigipotI2C::set_current(const uint8_t channel, const float current) { const float ival = _MIN(_MAX(current, 0), float(DIGIPOT_MCP4018_MAX_VALUE)); - i2c_send(channel, current_to_wiper(ival)); + digipot_i2c_send(channel, current_to_wiper(ival)); } -void digipot_i2c_init() { +void DigipotI2C::init() { LOOP_L_N(i, DIGIPOT_I2C_NUM_CHANNELS) pots[i].i2c_init(); // Init currents according to Configuration_adv.h @@ -94,7 +96,7 @@ void digipot_i2c_init() { #endif ; LOOP_L_N(i, COUNT(digipot_motor_current)) - digipot_i2c_set_current(i, pgm_read_float(&digipot_motor_current[i])); + set_current(i, pgm_read_float(&digipot_motor_current[i])); } #endif // DIGIPOT_MCP4018 diff --git a/Marlin/src/feature/digipot/digipot_mcp4451.cpp b/Marlin/src/feature/digipot/digipot_mcp4451.cpp index 0c8ff04a0b..7e6ace49a0 100644 --- a/Marlin/src/feature/digipot/digipot_mcp4451.cpp +++ b/Marlin/src/feature/digipot/digipot_mcp4451.cpp @@ -24,6 +24,8 @@ #if ENABLED(DIGIPOT_MCP4451) +#include "digipot.h" + #include #include @@ -61,7 +63,7 @@ static void digipot_i2c_send(const byte addr, const byte a, const byte b) { } // This is for the MCP4451 I2C based digipot -void digipot_i2c_set_current(const uint8_t channel, const float current) { +void DigipotI2C::set_current(const uint8_t channel, const float current) { // These addresses are specific to Azteeg X3 Pro, can be set to others. // In this case first digipot is at address A0=0, A1=0, second one is at A0=0, A1=1 const byte addr = channel < 4 ? DIGIPOT_I2C_ADDRESS_A : DIGIPOT_I2C_ADDRESS_B; // channel 0-3 vs 4-7 @@ -75,7 +77,7 @@ void digipot_i2c_set_current(const uint8_t channel, const float current) { digipot_i2c_send(addr, addresses[channel & 0x3], current_to_wiper(_MIN(float(_MAX(current, 0)), DIGIPOT_I2C_MAX_CURRENT))); } -void digipot_i2c_init() { +void DigipotI2C::init() { #if MB(MKS_SBASE) configure_i2c(16); // Set clock_option to 16 ensure I2C is initialized at 400kHz #else @@ -90,7 +92,7 @@ void digipot_i2c_init() { #endif ; LOOP_L_N(i, COUNT(digipot_motor_current)) - digipot_i2c_set_current(i, pgm_read_float(&digipot_motor_current[i])); + set_current(i, pgm_read_float(&digipot_motor_current[i])); } #endif // DIGIPOT_MCP4451 diff --git a/Marlin/src/gcode/feature/digipot/M907-M910.cpp b/Marlin/src/gcode/feature/digipot/M907-M910.cpp index 54599a0451..e463666207 100644 --- a/Marlin/src/gcode/feature/digipot/M907-M910.cpp +++ b/Marlin/src/gcode/feature/digipot/M907-M910.cpp @@ -22,19 +22,19 @@ #include "../../../inc/MarlinConfig.h" -#if ANY(HAS_DIGIPOTSS, HAS_MOTOR_CURRENT_PWM, HAS_I2C_DIGIPOT, DAC_STEPPER_CURRENT) +#if ANY(HAS_MOTOR_CURRENT_SPI, HAS_MOTOR_CURRENT_PWM, HAS_MOTOR_CURRENT_I2C, HAS_MOTOR_CURRENT_DAC) #include "../../gcode.h" -#if HAS_DIGIPOTSS || HAS_MOTOR_CURRENT_PWM +#if HAS_MOTOR_CURRENT_SPI || HAS_MOTOR_CURRENT_PWM #include "../../../module/stepper.h" #endif -#if HAS_I2C_DIGIPOT +#if HAS_MOTOR_CURRENT_I2C #include "../../../feature/digipot/digipot.h" #endif -#if ENABLED(DAC_STEPPER_CURRENT) +#if ENABLED(HAS_MOTOR_CURRENT_DAC) #include "../../../feature/dac/stepper_dac.h" #endif @@ -42,61 +42,61 @@ * M907: Set digital trimpot motor current using axis codes X, Y, Z, E, B, S */ void GcodeSuite::M907() { - #if HAS_DIGIPOTSS + #if HAS_MOTOR_CURRENT_SPI - LOOP_XYZE(i) if (parser.seenval(axis_codes[i])) stepper.digipot_current(i, parser.value_int()); - if (parser.seenval('B')) stepper.digipot_current(4, parser.value_int()); - if (parser.seenval('S')) LOOP_LE_N(i, 4) stepper.digipot_current(i, parser.value_int()); + LOOP_XYZE(i) if (parser.seenval(axis_codes[i])) stepper.set_digipot_current(i, parser.value_int()); + if (parser.seenval('B')) stepper.set_digipot_current(4, parser.value_int()); + if (parser.seenval('S')) LOOP_LE_N(i, 4) stepper.set_digipot_current(i, parser.value_int()); #elif HAS_MOTOR_CURRENT_PWM #if ANY_PIN(MOTOR_CURRENT_PWM_X, MOTOR_CURRENT_PWM_Y, MOTOR_CURRENT_PWM_XY) - if (parser.seenval('X') || parser.seenval('Y')) stepper.digipot_current(0, parser.value_int()); + if (parser.seenval('X') || parser.seenval('Y')) stepper.set_digipot_current(0, parser.value_int()); #endif #if PIN_EXISTS(MOTOR_CURRENT_PWM_Z) - if (parser.seenval('Z')) stepper.digipot_current(1, parser.value_int()); + if (parser.seenval('Z')) stepper.set_digipot_current(1, parser.value_int()); #endif #if PIN_EXISTS(MOTOR_CURRENT_PWM_E) - if (parser.seenval('E')) stepper.digipot_current(2, parser.value_int()); + if (parser.seenval('E')) stepper.set_digipot_current(2, parser.value_int()); #endif #endif - #if HAS_I2C_DIGIPOT + #if HAS_MOTOR_CURRENT_I2C // this one uses actual amps in floating point - LOOP_XYZE(i) if (parser.seenval(axis_codes[i])) digipot_i2c_set_current(i, parser.value_float()); + LOOP_XYZE(i) if (parser.seenval(axis_codes[i])) digipot_i2c.set_current(i, parser.value_float()); // Additional extruders use B,C,D for channels 4,5,6. // TODO: Change these parameters because 'E' is used. B? for (uint8_t i = E_AXIS + 1; i < DIGIPOT_I2C_NUM_CHANNELS; i++) - if (parser.seenval('B' + i - (E_AXIS + 1))) digipot_i2c_set_current(i, parser.value_float()); + if (parser.seenval('B' + i - (E_AXIS + 1))) digipot_i2c.set_current(i, parser.value_float()); #endif - #if ENABLED(DAC_STEPPER_CURRENT) + #if ENABLED(HAS_MOTOR_CURRENT_DAC) if (parser.seenval('S')) { const float dac_percent = parser.value_float(); - LOOP_LE_N(i, 4) dac_current_percent(i, dac_percent); + LOOP_LE_N(i, 4) stepper_dac.set_current_percent(i, dac_percent); } - LOOP_XYZE(i) if (parser.seenval(axis_codes[i])) dac_current_percent(i, parser.value_float()); + LOOP_XYZE(i) if (parser.seenval(axis_codes[i])) stepper_dac.set_current_percent(i, parser.value_float()); #endif } -#if EITHER(HAS_DIGIPOTSS, DAC_STEPPER_CURRENT) +#if EITHER(HAS_MOTOR_CURRENT_SPI, HAS_MOTOR_CURRENT_DAC) /** * M908: Control digital trimpot directly (M908 P S) */ void GcodeSuite::M908() { - TERN_(HAS_DIGIPOTSS, stepper.digitalPotWrite(parser.intval('P'), parser.intval('S'))); - TERN_(DAC_STEPPER_CURRENT, dac_current_raw(parser.byteval('P', -1), parser.ushortval('S', 0))); + TERN_(HAS_MOTOR_CURRENT_SPI, stepper.set_digipot_value_spi(parser.intval('P'), parser.intval('S'))); + TERN_(HAS_MOTOR_CURRENT_DAC, stepper_dac.set_current_value(parser.byteval('P', -1), parser.ushortval('S', 0))); } -#endif // HAS_DIGIPOTSS || DAC_STEPPER_CURRENT + #if ENABLED(HAS_MOTOR_CURRENT_DAC) -#if ENABLED(DAC_STEPPER_CURRENT) + void GcodeSuite::M909() { stepper_dac.print_values(); } + void GcodeSuite::M910() { stepper_dac.commit_eeprom(); } - void GcodeSuite::M909() { dac_print_values(); } - void GcodeSuite::M910() { dac_commit_eeprom(); } + #endif // HAS_MOTOR_CURRENT_DAC -#endif // DAC_STEPPER_CURRENT +#endif // HAS_MOTOR_CURRENT_SPI || HAS_MOTOR_CURRENT_DAC -#endif // HAS_DIGIPOTSS || HAS_MOTOR_CURRENT_PWM || HAS_I2C_DIGIPOT || DAC_STEPPER_CURRENT +#endif // HAS_MOTOR_CURRENT_SPI || HAS_MOTOR_CURRENT_PWM || HAS_MOTOR_CURRENT_I2C || HAS_MOTOR_CURRENT_DAC diff --git a/Marlin/src/gcode/gcode.cpp b/Marlin/src/gcode/gcode.cpp index cbf62e0fcf..1d4e8f9d4d 100644 --- a/Marlin/src/gcode/gcode.cpp +++ b/Marlin/src/gcode/gcode.cpp @@ -823,11 +823,11 @@ void GcodeSuite::process_parsed_command(const bool no_ok/*=false*/) { case 900: M900(); break; // M900: Set advance K factor. #endif - #if ANY(HAS_DIGIPOTSS, HAS_MOTOR_CURRENT_PWM, HAS_I2C_DIGIPOT, DAC_STEPPER_CURRENT) + #if ANY(HAS_MOTOR_CURRENT_SPI, HAS_MOTOR_CURRENT_PWM, HAS_MOTOR_CURRENT_I2C, HAS_MOTOR_CURRENT_DAC) case 907: M907(); break; // M907: Set digital trimpot motor current using axis codes. - #if EITHER(HAS_DIGIPOTSS, DAC_STEPPER_CURRENT) + #if EITHER(HAS_MOTOR_CURRENT_SPI, HAS_MOTOR_CURRENT_DAC) case 908: M908(); break; // M908: Control digital trimpot directly. - #if ENABLED(DAC_STEPPER_CURRENT) + #if ENABLED(HAS_MOTOR_CURRENT_DAC) case 909: M909(); break; // M909: Print digipot/DAC current value case 910: M910(); break; // M910: Commit digipot/DAC value to external EEPROM #endif diff --git a/Marlin/src/gcode/gcode.h b/Marlin/src/gcode/gcode.h index 73a3727813..683642bec6 100644 --- a/Marlin/src/gcode/gcode.h +++ b/Marlin/src/gcode/gcode.h @@ -258,9 +258,9 @@ * M900 - Get or Set Linear Advance K-factor. (Requires LIN_ADVANCE) * M906 - Set or get motor current in milliamps using axis codes X, Y, Z, E. Report values if no axis codes given. (Requires at least one _DRIVER_TYPE defined as TMC2130/2160/5130/5160/2208/2209/2660 or L6470) * M907 - Set digital trimpot motor current using axis codes. (Requires a board with digital trimpots) - * M908 - Control digital trimpot directly. (Requires DAC_STEPPER_CURRENT or DIGIPOTSS_PIN) - * M909 - Print digipot/DAC current value. (Requires DAC_STEPPER_CURRENT) - * M910 - Commit digipot/DAC value to external EEPROM via I2C. (Requires DAC_STEPPER_CURRENT) + * M908 - Control digital trimpot directly. (Requires HAS_MOTOR_CURRENT_DAC or DIGIPOTSS_PIN) + * M909 - Print digipot/DAC current value. (Requires HAS_MOTOR_CURRENT_DAC) + * M910 - Commit digipot/DAC value to external EEPROM via I2C. (Requires HAS_MOTOR_CURRENT_DAC) * M911 - Report stepper driver overtemperature pre-warn condition. (Requires at least one _DRIVER_TYPE defined as TMC2130/2160/5130/5160/2208/2209/2660) * M912 - Clear stepper driver overtemperature pre-warn condition flag. (Requires at least one _DRIVER_TYPE defined as TMC2130/2160/5130/5160/2208/2209/2660) * M913 - Set HYBRID_THRESHOLD speed. (Requires HYBRID_THRESHOLD) @@ -847,11 +847,11 @@ private: static void M918(); #endif - #if ANY(HAS_DIGIPOTSS, HAS_MOTOR_CURRENT_PWM, HAS_I2C_DIGIPOT, DAC_STEPPER_CURRENT) + #if ANY(HAS_MOTOR_CURRENT_SPI, HAS_MOTOR_CURRENT_PWM, HAS_MOTOR_CURRENT_I2C, HAS_MOTOR_CURRENT_DAC) static void M907(); - #if EITHER(HAS_DIGIPOTSS, DAC_STEPPER_CURRENT) + #if EITHER(HAS_MOTOR_CURRENT_SPI, HAS_MOTOR_CURRENT_DAC) static void M908(); - #if ENABLED(DAC_STEPPER_CURRENT) + #if ENABLED(HAS_MOTOR_CURRENT_DAC) static void M909(); static void M910(); #endif diff --git a/Marlin/src/inc/Conditionals_adv.h b/Marlin/src/inc/Conditionals_adv.h index 0952148d19..255470bca6 100644 --- a/Marlin/src/inc/Conditionals_adv.h +++ b/Marlin/src/inc/Conditionals_adv.h @@ -175,7 +175,7 @@ #endif #if EITHER(DIGIPOT_MCP4018, DIGIPOT_MCP4451) - #define HAS_I2C_DIGIPOT 1 + #define HAS_MOTOR_CURRENT_I2C 1 #endif // Multiple Z steppers diff --git a/Marlin/src/inc/Conditionals_post.h b/Marlin/src/inc/Conditionals_post.h index f832137f5b..798bf009c6 100644 --- a/Marlin/src/inc/Conditionals_post.h +++ b/Marlin/src/inc/Conditionals_post.h @@ -1976,7 +1976,7 @@ #define HAS_STEPPER_RESET 1 #endif #if PIN_EXISTS(DIGIPOTSS) - #define HAS_DIGIPOTSS 1 + #define HAS_MOTOR_CURRENT_SPI 1 #endif #if ANY_PIN(MOTOR_CURRENT_PWM_X, MOTOR_CURRENT_PWM_Y, MOTOR_CURRENT_PWM_XY, MOTOR_CURRENT_PWM_Z, MOTOR_CURRENT_PWM_E) #define HAS_MOTOR_CURRENT_PWM 1 diff --git a/Marlin/src/inc/SanityCheck.h b/Marlin/src/inc/SanityCheck.h index c4dcfd54ae..6e97a349f6 100644 --- a/Marlin/src/inc/SanityCheck.h +++ b/Marlin/src/inc/SanityCheck.h @@ -2667,7 +2667,7 @@ static_assert(hbm[Z_AXIS] >= 0, "HOMING_BUMP_MM.Z must be greater than or equal /** * Digipot requirement */ -#if HAS_I2C_DIGIPOT +#if HAS_MOTOR_CURRENT_I2C #if BOTH(DIGIPOT_MCP4018, DIGIPOT_MCP4451) #error "Enable only one of DIGIPOT_MCP4018 or DIGIPOT_MCP4451." #elif !MB(MKS_SBASE) \ diff --git a/Marlin/src/lcd/menu/menu_advanced.cpp b/Marlin/src/lcd/menu/menu_advanced.cpp index 68a10245e9..642d9d84d9 100644 --- a/Marlin/src/lcd/menu/menu_advanced.cpp +++ b/Marlin/src/lcd/menu/menu_advanced.cpp @@ -58,16 +58,16 @@ void menu_tmc(); void menu_backlash(); -#if ENABLED(DAC_STEPPER_CURRENT) +#if ENABLED(HAS_MOTOR_CURRENT_DAC) #include "../../feature/dac/stepper_dac.h" void menu_dac() { static xyze_uint8_t driverPercent; - LOOP_XYZE(i) driverPercent[i] = dac_current_get_percent((AxisEnum)i); + LOOP_XYZE(i) driverPercent[i] = stepper_dac.get_current_percent((AxisEnum)i); START_MENU(); BACK_ITEM(MSG_ADVANCED_SETTINGS); - #define EDIT_DAC_PERCENT(A) EDIT_ITEM(uint8, MSG_DAC_PERCENT_##A, &driverPercent[_AXIS(A)], 0, 100, []{ dac_current_set_percents(driverPercent); }) + #define EDIT_DAC_PERCENT(A) EDIT_ITEM(uint8, MSG_DAC_PERCENT_##A, &driverPercent[_AXIS(A)], 0, 100, []{ stepper_dac.set_current_percents(driverPercent); }) EDIT_DAC_PERCENT(X); EDIT_DAC_PERCENT(Y); EDIT_DAC_PERCENT(Z); @@ -568,7 +568,7 @@ void menu_advanced_settings() { SUBMENU(MSG_BACKLASH, menu_backlash); #endif - #if ENABLED(DAC_STEPPER_CURRENT) + #if ENABLED(HAS_MOTOR_CURRENT_DAC) SUBMENU(MSG_DRIVE_STRENGTH, menu_dac); #endif #if HAS_MOTOR_CURRENT_PWM diff --git a/Marlin/src/module/settings.cpp b/Marlin/src/module/settings.cpp index 3ccd8ffd91..33e5c351ab 100644 --- a/Marlin/src/module/settings.cpp +++ b/Marlin/src/module/settings.cpp @@ -36,7 +36,7 @@ */ // Change EEPROM version if the structure changes -#define EEPROM_VERSION "V81" +#define EEPROM_VERSION "V82" #define EEPROM_OFFSET 100 // Check the integrity of data offsets. @@ -365,7 +365,10 @@ typedef struct SettingsDataStruct { // // HAS_MOTOR_CURRENT_PWM // - uint32_t motor_current_setting[3]; // M907 X Z E + #ifndef MOTOR_CURRENT_COUNT + #define MOTOR_CURRENT_COUNT 3 + #endif + uint32_t motor_current_setting[MOTOR_CURRENT_COUNT]; // M907 X Z E // // CNC_COORDINATE_SYSTEMS @@ -1277,10 +1280,10 @@ void MarlinSettings::postprocess() { { _FIELD_TEST(motor_current_setting); - #if HAS_MOTOR_CURRENT_PWM + #if HAS_MOTOR_CURRENT_SPI || HAS_MOTOR_CURRENT_PWM EEPROM_WRITE(stepper.motor_current_setting); #else - const uint32_t no_current[3] = { 0 }; + const uint32_t no_current[MOTOR_CURRENT_COUNT] = { 0 }; EEPROM_WRITE(no_current); #endif } @@ -2110,10 +2113,16 @@ void MarlinSettings::postprocess() { // Motor Current PWM // { - uint32_t motor_current_setting[3]; _FIELD_TEST(motor_current_setting); + uint32_t motor_current_setting[MOTOR_CURRENT_COUNT] + #if HAS_MOTOR_CURRENT_SPI + = DIGIPOT_MOTOR_CURRENT + #endif + ; + DEBUG_ECHOLNPGM("DIGIPOTS Loading"); EEPROM_READ(motor_current_setting); - #if HAS_MOTOR_CURRENT_PWM + DEBUG_ECHOLNPGM("DIGIPOTS Loaded"); + #if HAS_MOTOR_CURRENT_SPI || HAS_MOTOR_CURRENT_PWM if (!validating) COPY(stepper.motor_current_setting, motor_current_setting); #endif @@ -2791,9 +2800,20 @@ void MarlinSettings::reset() { // #if HAS_MOTOR_CURRENT_PWM - constexpr uint32_t tmp_motor_current_setting[3] = PWM_MOTOR_CURRENT; - LOOP_L_N(q, 3) - stepper.digipot_current(q, (stepper.motor_current_setting[q] = tmp_motor_current_setting[q])); + constexpr uint32_t tmp_motor_current_setting[MOTOR_CURRENT_COUNT] = PWM_MOTOR_CURRENT; + LOOP_L_N(q, MOTOR_CURRENT_COUNT) + stepper.set_digipot_current(q, (stepper.motor_current_setting[q] = tmp_motor_current_setting[q])); + #endif + + // + // DIGIPOTS + // + #if HAS_MOTOR_CURRENT_SPI + static constexpr uint32_t tmp_motor_current_setting[] = DIGIPOT_MOTOR_CURRENT; + DEBUG_ECHOLNPGM("Writing Digipot"); + LOOP_L_N(q, COUNT(tmp_motor_current_setting)) + stepper.set_digipot_current(q, tmp_motor_current_setting[q]); + DEBUG_ECHOLNPGM("Digipot Written"); #endif // @@ -3695,14 +3715,23 @@ void MarlinSettings::reset() { #endif #endif - #if HAS_MOTOR_CURRENT_PWM + #if HAS_MOTOR_CURRENT_SPI || HAS_MOTOR_CURRENT_PWM CONFIG_ECHO_HEADING("Stepper motor currents:"); CONFIG_ECHO_START(); - SERIAL_ECHOLNPAIR_P( - PSTR(" M907 X"), stepper.motor_current_setting[0] - , SP_Z_STR, stepper.motor_current_setting[1] - , SP_E_STR, stepper.motor_current_setting[2] - ); + #if HAS_MOTOR_CURRENT_PWM + SERIAL_ECHOLNPAIR_P( + PSTR(" M907 X"), stepper.motor_current_setting[0] + , SP_Z_STR, stepper.motor_current_setting[1] + , SP_E_STR, stepper.motor_current_setting[2] + ); + #elif HAS_MOTOR_CURRENT_SPI + SERIAL_ECHOPGM(" M907"); + LOOP_L_N(q, MOTOR_CURRENT_COUNT) { + SERIAL_CHAR(' '); + SERIAL_CHAR(axis_codes[q]); + SERIAL_ECHO(stepper.motor_current_setting[q]); + } + #endif #endif /** diff --git a/Marlin/src/module/stepper.cpp b/Marlin/src/module/stepper.cpp index 56a75d1b48..8a5de4b608 100644 --- a/Marlin/src/module/stepper.cpp +++ b/Marlin/src/module/stepper.cpp @@ -83,10 +83,6 @@ Stepper stepper; // Singleton #define BABYSTEPPING_EXTRA_DIR_WAIT -#if HAS_MOTOR_CURRENT_PWM - bool Stepper::initialized; // = false -#endif - #ifdef __AVR__ #include "speed_lookuptable.h" #endif @@ -110,7 +106,7 @@ Stepper stepper; // Singleton #include "../feature/dac/dac_dac084s085.h" #endif -#if HAS_DIGIPOTSS +#if HAS_MOTOR_CURRENT_SPI #include #endif @@ -142,8 +138,12 @@ Stepper stepper; // Singleton bool Stepper::separate_multi_axis = false; #endif -#if HAS_MOTOR_CURRENT_PWM - uint32_t Stepper::motor_current_setting[3]; // Initialized by settings.load() +#if HAS_MOTOR_CURRENT_SPI || HAS_MOTOR_CURRENT_PWM + bool Stepper::initialized; // = false + uint32_t Stepper::motor_current_setting[MOTOR_CURRENT_COUNT]; // Initialized by settings.load() + #if HAS_MOTOR_CURRENT_SPI + constexpr uint32_t Stepper::digipot_count[]; + #endif #endif // private: @@ -2590,8 +2590,8 @@ void Stepper::init() { set_directions(); - #if HAS_DIGIPOTSS || HAS_MOTOR_CURRENT_PWM - TERN_(HAS_MOTOR_CURRENT_PWM, initialized = true); + #if HAS_MOTOR_CURRENT_SPI || HAS_MOTOR_CURRENT_PWM + initialized = true; digipot_init(); #endif } @@ -2930,10 +2930,10 @@ void Stepper::report_positions() { * Software-controlled Stepper Motor Current */ -#if HAS_DIGIPOTSS +#if HAS_MOTOR_CURRENT_SPI // From Arduino DigitalPotControl example - void Stepper::digitalPotWrite(const int16_t address, const int16_t value) { + void Stepper::set_digipot_value_spi(const int16_t address, const int16_t value) { WRITE(DIGIPOTSS_PIN, LOW); // Take the SS pin low to select the chip SPI.transfer(address); // Send the address and value via SPI SPI.transfer(value); @@ -2941,7 +2941,7 @@ void Stepper::report_positions() { //delay(10); } -#endif // HAS_DIGIPOTSS +#endif // HAS_MOTOR_CURRENT_SPI #if HAS_MOTOR_CURRENT_PWM @@ -2958,7 +2958,7 @@ void Stepper::report_positions() { #if ANY_PIN(MOTOR_CURRENT_PWM_E, MOTOR_CURRENT_PWM_E0, MOTOR_CURRENT_PWM_E1) case 2: #endif - digipot_current(i, motor_current_setting[i]); + set_digipot_current(i, motor_current_setting[i]); default: break; } } @@ -2968,22 +2968,23 @@ void Stepper::report_positions() { #if !MB(PRINTRBOARD_G2) - #if HAS_DIGIPOTSS || HAS_MOTOR_CURRENT_PWM + #if HAS_MOTOR_CURRENT_SPI || HAS_MOTOR_CURRENT_PWM - void Stepper::digipot_current(const uint8_t driver, const int16_t current) { + void Stepper::set_digipot_current(const uint8_t driver, const int16_t current) { + if (WITHIN(driver, 0, COUNT(motor_current_setting) - 1)) + motor_current_setting[driver] = current; // update motor_current_setting - #if HAS_DIGIPOTSS + if (!initialized) return; + + #if HAS_MOTOR_CURRENT_SPI + + //SERIAL_ECHOLNPAIR("Digipotss current ", current); const uint8_t digipot_ch[] = DIGIPOT_CHANNELS; - digitalPotWrite(digipot_ch[driver], current); + set_digipot_value_spi(digipot_ch[driver], current); #elif HAS_MOTOR_CURRENT_PWM - if (!initialized) return; - - if (WITHIN(driver, 0, COUNT(motor_current_setting) - 1)) - motor_current_setting[driver] = current; // update motor_current_setting - #define _WRITE_CURRENT_PWM(P) analogWrite(pin_t(MOTOR_CURRENT_PWM_## P ##_PIN), 255L * current / (MOTOR_CURRENT_PWM_RANGE)) switch (driver) { case 0: @@ -3019,17 +3020,13 @@ void Stepper::report_positions() { void Stepper::digipot_init() { - #if HAS_DIGIPOTSS - - static const uint8_t digipot_motor_current[] = DIGIPOT_MOTOR_CURRENT; + #if HAS_MOTOR_CURRENT_SPI SPI.begin(); SET_OUTPUT(DIGIPOTSS_PIN); - LOOP_L_N(i, COUNT(digipot_motor_current)) { - //digitalPotWrite(digipot_ch[i], digipot_motor_current[i]); - digipot_current(i, digipot_motor_current[i]); - } + LOOP_L_N(i, COUNT(motor_current_setting)) + set_digipot_current(i, motor_current_setting[i]); #elif HAS_MOTOR_CURRENT_PWM diff --git a/Marlin/src/module/stepper.h b/Marlin/src/module/stepper.h index da38192d8e..572c3f3f9b 100644 --- a/Marlin/src/module/stepper.h +++ b/Marlin/src/module/stepper.h @@ -245,12 +245,18 @@ class Stepper { static bool separate_multi_axis; #endif - #if HAS_MOTOR_CURRENT_PWM - #ifndef PWM_MOTOR_CURRENT - #define PWM_MOTOR_CURRENT DEFAULT_PWM_MOTOR_CURRENT + #if HAS_MOTOR_CURRENT_SPI || HAS_MOTOR_CURRENT_PWM + #if HAS_MOTOR_CURRENT_PWM + #ifndef PWM_MOTOR_CURRENT + #define PWM_MOTOR_CURRENT DEFAULT_PWM_MOTOR_CURRENT + #endif + #define MOTOR_CURRENT_COUNT 3 + #elif HAS_MOTOR_CURRENT_SPI + static constexpr uint32_t digipot_count[] = DIGIPOT_MOTOR_CURRENT; + #define MOTOR_CURRENT_COUNT COUNT(Stepper::digipot_count) #endif - static uint32_t motor_current_setting[3]; static bool initialized; + static uint32_t motor_current_setting[MOTOR_CURRENT_COUNT]; // Initialized by settings.load() #endif // Last-moved extruder, as set when the last movement was fetched from planner @@ -457,9 +463,9 @@ class Stepper { // Triggered position of an axis in steps static int32_t triggered_position(const AxisEnum axis); - #if HAS_DIGIPOTSS || HAS_MOTOR_CURRENT_PWM - static void digitalPotWrite(const int16_t address, const int16_t value); - static void digipot_current(const uint8_t driver, const int16_t current); + #if HAS_MOTOR_CURRENT_SPI || HAS_MOTOR_CURRENT_PWM + static void set_digipot_value_spi(const int16_t address, const int16_t value); + static void set_digipot_current(const uint8_t driver, const int16_t current); #endif #if HAS_MICROSTEPS @@ -582,7 +588,7 @@ class Stepper { static int32_t _eval_bezier_curve(const uint32_t curr_step); #endif - #if HAS_DIGIPOTSS || HAS_MOTOR_CURRENT_PWM + #if HAS_MOTOR_CURRENT_SPI || HAS_MOTOR_CURRENT_PWM static void digipot_init(); #endif diff --git a/Marlin/src/pins/ramps/pins_RIGIDBOARD_V2.h b/Marlin/src/pins/ramps/pins_RIGIDBOARD_V2.h index 406cbec816..1428de31a2 100644 --- a/Marlin/src/pins/ramps/pins_RIGIDBOARD_V2.h +++ b/Marlin/src/pins/ramps/pins_RIGIDBOARD_V2.h @@ -34,7 +34,7 @@ // // I2C based DAC like on the Printrboard REVF -#define DAC_STEPPER_CURRENT +#define HAS_MOTOR_CURRENT_DAC // Channels available for DAC, For Rigidboard there are 4 #define DAC_STEPPER_ORDER { 0, 1, 2, 3 } diff --git a/Marlin/src/pins/teensy2/pins_PRINTRBOARD_REVF.h b/Marlin/src/pins/teensy2/pins_PRINTRBOARD_REVF.h index 6ffd35dff2..4809cc8d86 100644 --- a/Marlin/src/pins/teensy2/pins_PRINTRBOARD_REVF.h +++ b/Marlin/src/pins/teensy2/pins_PRINTRBOARD_REVF.h @@ -143,7 +143,7 @@ #endif // NO_EXTRUDRBOARD // Enable control of stepper motor currents with the I2C based MCP4728 DAC used on Printrboard REVF -#define DAC_STEPPER_CURRENT +#define HAS_MOTOR_CURRENT_DAC // Set default drive strength percents if not already defined - X, Y, Z, E axis #ifndef DAC_MOTOR_CURRENT_DEFAULT diff --git a/platformio.ini b/platformio.ini index d4beca6519..9d3fafd69e 100644 --- a/platformio.ini +++ b/platformio.ini @@ -211,7 +211,7 @@ HAS_TRINAMIC_CONFIG = TMCStepper@~0.7.1 src_filter=+ + + + + HAS_STEALTHCHOP = src_filter=+ SR_LCD_3W_NL = SailfishLCD=https://github.com/mikeshub/SailfishLCD/archive/master.zip -HAS_I2C_DIGIPOT = SlowSoftI2CMaster +HAS_MOTOR_CURRENT_I2C = SlowSoftI2CMaster src_filter=+ HAS_TMC26X = TMC26XStepper=https://github.com/trinamic/TMC26XStepper/archive/master.zip src_filter=+ @@ -277,7 +277,7 @@ CANCEL_OBJECTS = src_filter=+ + + EXTERNAL_CLOSED_LOOP_CONTROLLER = src_filter=+ + USE_CONTROLLER_FAN = src_filter=+ -DAC_STEPPER_CURRENT = src_filter=+ +HAS_MOTOR_CURRENT_DAC = src_filter=+ DIRECT_STEPPING = src_filter=+ + EMERGENCY_PARSER = src_filter=+ - I2C_POSITION_ENCODERS = src_filter=+ From 45731bd0221beee768e009195ee3aa9a0b0f2a88 Mon Sep 17 00:00:00 2001 From: Jason Smith Date: Sun, 11 Oct 2020 16:13:01 -0700 Subject: [PATCH 003/226] Fix at90usb1286 build (#19687) * Skip check for USBCON during dependency detection * Ignore incompatible Teensy_ADC library, which requires Teensy >= 3 * Add IS_AT90USB Co-authored-by: Scott Lahteine --- Marlin/src/HAL/AVR/HAL.h | 4 ++-- Marlin/src/HAL/AVR/MarlinSerial.cpp | 6 +++--- Marlin/src/HAL/AVR/MarlinSerial.h | 2 +- Marlin/src/HAL/STM32F1/dogm/u8g_com_stm32duino_swspi.cpp | 3 +-- Marlin/src/gcode/control/M111.cpp | 4 ++-- Marlin/src/gcode/queue.cpp | 2 +- Marlin/src/inc/Conditionals_adv.h | 8 ++++---- Marlin/src/inc/SanityCheck.h | 6 +++--- Marlin/src/pins/teensy2/pins_PRINTRBOARD_REVF.h | 2 +- platformio.ini | 1 + 10 files changed, 19 insertions(+), 19 deletions(-) diff --git a/Marlin/src/HAL/AVR/HAL.h b/Marlin/src/HAL/AVR/HAL.h index ce15ed29fb..6e0afa8f10 100644 --- a/Marlin/src/HAL/AVR/HAL.h +++ b/Marlin/src/HAL/AVR/HAL.h @@ -25,7 +25,7 @@ #include "watchdog.h" #include "math.h" -#ifdef USBCON +#ifdef IS_AT90USB #include #else #define HardwareSerial_h // Hack to prevent HardwareSerial.h header inclusion @@ -81,7 +81,7 @@ typedef int8_t pin_t; //extern uint8_t MCUSR; // Serial ports -#ifdef USBCON +#ifdef IS_AT90USB #define MYSERIAL0 TERN(BLUETOOTH, bluetoothSerial, Serial) #else #if !WITHIN(SERIAL_PORT, -1, 3) diff --git a/Marlin/src/HAL/AVR/MarlinSerial.cpp b/Marlin/src/HAL/AVR/MarlinSerial.cpp index 63599efd41..8feac32aa7 100644 --- a/Marlin/src/HAL/AVR/MarlinSerial.cpp +++ b/Marlin/src/HAL/AVR/MarlinSerial.cpp @@ -38,7 +38,7 @@ #include "../../inc/MarlinConfig.h" -#if !defined(USBCON) && (defined(UBRRH) || defined(UBRR0H) || defined(UBRR1H) || defined(UBRR2H) || defined(UBRR3H)) +#if !IS_AT90USB && (defined(UBRRH) || defined(UBRR0H) || defined(UBRR1H) || defined(UBRR2H) || defined(UBRR3H)) #include "MarlinSerial.h" #include "../../MarlinCore.h" @@ -792,10 +792,10 @@ MarlinSerial> customizedSerial1; #endif -#endif // !USBCON && (UBRRH || UBRR0H || UBRR1H || UBRR2H || UBRR3H) +#endif // !IS_AT90USB && (UBRRH || UBRR0H || UBRR1H || UBRR2H || UBRR3H) // For AT90USB targets use the UART for BT interfacing -#if defined(USBCON) && ENABLED(BLUETOOTH) +#if BOTH(IS_AT90USB, BLUETOOTH) HardwareSerial bluetoothSerial; #endif diff --git a/Marlin/src/HAL/AVR/MarlinSerial.h b/Marlin/src/HAL/AVR/MarlinSerial.h index 8a0423d143..3850e2a47e 100644 --- a/Marlin/src/HAL/AVR/MarlinSerial.h +++ b/Marlin/src/HAL/AVR/MarlinSerial.h @@ -327,6 +327,6 @@ #endif // Use the UART for Bluetooth in AT90USB configurations -#if defined(USBCON) && ENABLED(BLUETOOTH) +#if BOTH(IS_AT90USB, BLUETOOTH) extern HardwareSerial bluetoothSerial; #endif diff --git a/Marlin/src/HAL/STM32F1/dogm/u8g_com_stm32duino_swspi.cpp b/Marlin/src/HAL/STM32F1/dogm/u8g_com_stm32duino_swspi.cpp index f88fa88507..60596054e8 100644 --- a/Marlin/src/HAL/STM32F1/dogm/u8g_com_stm32duino_swspi.cpp +++ b/Marlin/src/HAL/STM32F1/dogm/u8g_com_stm32duino_swspi.cpp @@ -22,7 +22,6 @@ #if BOTH(HAS_MARLINUI_U8GLIB, FORCE_SOFT_SPI) -#include "../HAL.h" #include #undef SPI_SPEED @@ -161,5 +160,5 @@ uint8_t u8g_com_HAL_STM32F1_sw_spi_fn(u8g_t *u8g, uint8_t msg, uint8_t arg_val, return 1; } -#endif // HAS_MARLINUI_U8GLIB +#endif // HAS_MARLINUI_U8GLIB && FORCE_SOFT_SPI #endif // STM32F1 diff --git a/Marlin/src/gcode/control/M111.cpp b/Marlin/src/gcode/control/M111.cpp index e31c3e2fb7..cc871bf38b 100644 --- a/Marlin/src/gcode/control/M111.cpp +++ b/Marlin/src/gcode/control/M111.cpp @@ -55,7 +55,7 @@ void GcodeSuite::M111() { } else { SERIAL_ECHOPGM(STR_DEBUG_OFF); - #if !defined(__AVR__) || !defined(USBCON) + #if !IS_AT90USB #if ENABLED(SERIAL_STATS_RX_BUFFER_OVERRUNS) SERIAL_ECHOPAIR("\nBuffer Overruns: ", MYSERIAL0.buffer_overruns()); #endif @@ -71,7 +71,7 @@ void GcodeSuite::M111() { #if ENABLED(SERIAL_STATS_MAX_RX_QUEUED) SERIAL_ECHOPAIR("\nMax RX Queue Size: ", MYSERIAL0.rxMaxEnqueued()); #endif - #endif // !defined(__AVR__) || !defined(USBCON) + #endif // !IS_AT90USB } SERIAL_EOL(); } diff --git a/Marlin/src/gcode/queue.cpp b/Marlin/src/gcode/queue.cpp index b9169d90e1..a02d2c0160 100644 --- a/Marlin/src/gcode/queue.cpp +++ b/Marlin/src/gcode/queue.cpp @@ -624,7 +624,7 @@ void GCodeQueue::advance() { card.closefile(); SERIAL_ECHOLNPGM(STR_FILE_SAVED); - #if !defined(__AVR__) || !defined(USBCON) + #if !IS_AT90USB #if ENABLED(SERIAL_STATS_DROPPED_RX) SERIAL_ECHOLNPAIR("Dropped bytes: ", MYSERIAL0.dropped()); #endif diff --git a/Marlin/src/inc/Conditionals_adv.h b/Marlin/src/inc/Conditionals_adv.h index 255470bca6..bab05e5ff6 100644 --- a/Marlin/src/inc/Conditionals_adv.h +++ b/Marlin/src/inc/Conditionals_adv.h @@ -208,7 +208,10 @@ #define NEEDS_HARDWARE_PWM 1 #endif -#if !defined(__AVR__) || !defined(USBCON) +#if defined(__AVR__) && defined(USBCON) + #define IS_AT90USB 1 + #undef SERIAL_XON_XOFF // Not supported on USB-native devices +#else // Define constants and variables for buffering serial data. // Use only 0 or powers of 2 greater than 1 // : [0, 4, 8, 16, 32, 64, 128, 256, 512, 1024, 2048, ...] @@ -220,9 +223,6 @@ #ifndef TX_BUFFER_SIZE #define TX_BUFFER_SIZE 32 #endif -#else - // SERIAL_XON_XOFF not supported on USB-native devices - #undef SERIAL_XON_XOFF #endif #if ENABLED(HOST_ACTION_COMMANDS) diff --git a/Marlin/src/inc/SanityCheck.h b/Marlin/src/inc/SanityCheck.h index 6e97a349f6..25188906c7 100644 --- a/Marlin/src/inc/SanityCheck.h +++ b/Marlin/src/inc/SanityCheck.h @@ -582,7 +582,7 @@ /** * Serial */ -#if !(defined(__AVR__) && defined(USBCON)) +#if !IS_AT90USB #if ENABLED(SERIAL_XON_XOFF) && RX_BUFFER_SIZE < 1024 #error "SERIAL_XON_XOFF requires RX_BUFFER_SIZE >= 1024 for reliable transfers without drops." #elif RX_BUFFER_SIZE && (RX_BUFFER_SIZE < 2 || !IS_POWER_OF_2(RX_BUFFER_SIZE)) @@ -2104,9 +2104,9 @@ static_assert(hbm[Z_AXIS] >= 0, "HOMING_BUMP_MM.Z must be greater than or equal #endif /** - * emergency-command parser + * Emergency Command Parser */ -#if ENABLED(EMERGENCY_PARSER) && defined(__AVR__) && defined(USBCON) +#if BOTH(IS_AT90USB, EMERGENCY_PARSER) #error "EMERGENCY_PARSER does not work on boards with AT90USB processors (USBCON)." #endif diff --git a/Marlin/src/pins/teensy2/pins_PRINTRBOARD_REVF.h b/Marlin/src/pins/teensy2/pins_PRINTRBOARD_REVF.h index 4809cc8d86..d4f9fc7641 100644 --- a/Marlin/src/pins/teensy2/pins_PRINTRBOARD_REVF.h +++ b/Marlin/src/pins/teensy2/pins_PRINTRBOARD_REVF.h @@ -67,7 +67,7 @@ #error "Oops! Select 'Teensy++ 2.0' or 'Printrboard' in 'Tools > Board.'" #endif -#ifndef USBCON +#if !defined(__MARLIN_DEPS__) && !defined(USBCON) #error "USBCON should be defined by the platform for this board." #endif diff --git a/platformio.ini b/platformio.ini index 9d3fafd69e..d2c7cfafbe 100644 --- a/platformio.ini +++ b/platformio.ini @@ -557,6 +557,7 @@ build_unflags = -g -ggdb platform = teensy extends = common_avr8 board = at90usb1286 +lib_ignore = ${env:common_avr8.lib_ignore} Teensy_ADC # # AT90USB1286 boards using DFU bootloader From c762b7c91b03415d37bbb96c5b2b6b8308ee3ba8 Mon Sep 17 00:00:00 2001 From: Jason Smith Date: Sun, 11 Oct 2020 17:06:57 -0700 Subject: [PATCH 004/226] Fix various errors, warnings in example config builds (#19686) Co-authored-by: Scott Lahteine --- Marlin/src/gcode/bedlevel/G26.cpp | 8 +- Marlin/src/gcode/motion/M290.cpp | 2 +- Marlin/src/lcd/dogm/dogm_Statusscreen.h | 2 +- .../lcd/extui/lib/mks_ui/draw_printing.cpp | 18 +- .../lib/mks_ui/tft_lvgl_configuration.cpp | 52 ++--- .../src/lcd/extui/lib/mks_ui/wifi_upload.cpp | 186 ++++++++---------- Marlin/src/lcd/menu/menu_delta_calibrate.cpp | 2 +- Marlin/src/lcd/menu/menu_ubl.cpp | 3 +- Marlin/src/module/thermistor/thermistor_666.h | 3 +- Marlin/src/pins/sensitive_pins.h | 29 ++- Marlin/src/pins/stm32f1/pins_MKS_ROBIN_PRO.h | 1 + 11 files changed, 141 insertions(+), 165 deletions(-) diff --git a/Marlin/src/gcode/bedlevel/G26.cpp b/Marlin/src/gcode/bedlevel/G26.cpp index c66d4a7d49..661128b04e 100644 --- a/Marlin/src/gcode/bedlevel/G26.cpp +++ b/Marlin/src/gcode/bedlevel/G26.cpp @@ -511,11 +511,9 @@ void GcodeSuite::G26() { g26_keep_heaters_on = parser.boolval('K'); // Accept 'I' if temperature presets are defined - const uint8_t preset_index = (0 - #if PREHEAT_COUNT - + (parser.seenval('I') ? _MIN(parser.value_byte(), PREHEAT_COUNT - 1) + 1 : 0) - #endif - ); + #if PREHEAT_COUNT + const uint8_t preset_index = parser.seenval('I') ? _MIN(parser.value_byte(), PREHEAT_COUNT - 1) + 1 : 0; + #endif #if HAS_HEATED_BED diff --git a/Marlin/src/gcode/motion/M290.cpp b/Marlin/src/gcode/motion/M290.cpp index 7158525ed9..18cc161fce 100644 --- a/Marlin/src/gcode/motion/M290.cpp +++ b/Marlin/src/gcode/motion/M290.cpp @@ -127,7 +127,7 @@ void GcodeSuite::M290() { #else PSTR("Babystep Z") #endif - , babystep.axis_total[BS_AXIS_IND(Z_AXIS)] + , babystep.axis_total[BS_TOTAL_IND(Z_AXIS)] ); } #endif diff --git a/Marlin/src/lcd/dogm/dogm_Statusscreen.h b/Marlin/src/lcd/dogm/dogm_Statusscreen.h index 70802f905e..c6ad566cff 100644 --- a/Marlin/src/lcd/dogm/dogm_Statusscreen.h +++ b/Marlin/src/lcd/dogm/dogm_Statusscreen.h @@ -1341,7 +1341,7 @@ #undef STATUS_LOGO_WIDTH #endif - #if (HAS_MULTI_HOTEND && STATUS_LOGO_WIDTH && BED_OR_CHAMBER_OR_FAN) || (HOTENDS >= 3 && !BED_OR_CHAMBER_OR_FAN) + #if !defined(STATUS_HEATERS_X) && ((HAS_MULTI_HOTEND && STATUS_LOGO_WIDTH && BED_OR_CHAMBER_OR_FAN) || (HOTENDS >= 3 && !BED_OR_CHAMBER_OR_FAN)) #define _STATUS_HEATERS_X(H,S,N) ((LCD_PIXEL_WIDTH - (H * (S + N)) - (_EXTRA_WIDTH) + (STATUS_LOGO_WIDTH)) / 2) #if STATUS_HOTEND1_WIDTH #if HOTENDS > 2 diff --git a/Marlin/src/lcd/extui/lib/mks_ui/draw_printing.cpp b/Marlin/src/lcd/extui/lib/mks_ui/draw_printing.cpp index a81b5b851b..c6369db413 100644 --- a/Marlin/src/lcd/extui/lib/mks_ui/draw_printing.cpp +++ b/Marlin/src/lcd/extui/lib/mks_ui/draw_printing.cpp @@ -46,7 +46,8 @@ extern lv_group_t * g; static lv_obj_t * scr; -static lv_obj_t *labelExt1, * labelExt2, * labelFan, * labelZpos, * labelTime; +static lv_obj_t *labelExt1, * labelFan, * labelZpos, * labelTime; +TERN_(HAS_MULTI_EXTRUDER, static lv_obj_t *labelExt2;) static lv_obj_t *labelPause, * labelStop, * labelOperat; static lv_obj_t * bar1, *bar1ValueText; static lv_obj_t * buttonPause, *buttonOperat, *buttonStop; @@ -137,9 +138,6 @@ static void event_handler(lv_obj_t * obj, lv_event_t event) { } void lv_draw_printing(void) { - lv_obj_t *buttonExt1, *buttonExt2, *buttonFanstate, *buttonZpos, *buttonTime; - TERN_(HAS_HEATED_BED, lv_obj_t * buttonBedstate); - disp_state_stack._disp_index = 0; ZERO(disp_state_stack._disp_state); disp_state_stack._disp_state[disp_state_stack._disp_index] = PRINTING_UI; @@ -162,16 +160,16 @@ void lv_draw_printing(void) { lv_refr_now(lv_refr_get_disp_refreshing()); // Create image buttons - buttonExt1 = lv_img_create(scr, NULL); + lv_obj_t *buttonExt1 = lv_img_create(scr, NULL); #if HAS_MULTI_EXTRUDER - buttonExt2 = lv_img_create(scr, NULL); + lv_obj_t *buttonExt2 = lv_img_create(scr, NULL); #endif #if HAS_HEATED_BED - buttonBedstate = lv_img_create(scr, NULL); + lv_obj_t *buttonBedstate = lv_img_create(scr, NULL); #endif - buttonFanstate = lv_img_create(scr, NULL); - buttonTime = lv_img_create(scr, NULL); - buttonZpos = lv_img_create(scr, NULL); + lv_obj_t *buttonFanstate = lv_img_create(scr, NULL); + lv_obj_t *buttonTime = lv_img_create(scr, NULL); + lv_obj_t *buttonZpos = lv_img_create(scr, NULL); buttonPause = lv_imgbtn_create(scr, NULL); buttonStop = lv_imgbtn_create(scr, NULL); buttonOperat = lv_imgbtn_create(scr, NULL); diff --git a/Marlin/src/lcd/extui/lib/mks_ui/tft_lvgl_configuration.cpp b/Marlin/src/lcd/extui/lib/mks_ui/tft_lvgl_configuration.cpp index 49b44799a6..3f8110feb4 100644 --- a/Marlin/src/lcd/extui/lib/mks_ui/tft_lvgl_configuration.cpp +++ b/Marlin/src/lcd/extui/lib/mks_ui/tft_lvgl_configuration.cpp @@ -799,39 +799,39 @@ void lv_encoder_pin_init() { //static const int8_t encoderDirection = 1; //static int16_t enc_Direction; void lv_update_encoder() { - static uint8_t buttons; static uint32_t encoder_time1; uint32_t tmpTime, diffTime = 0; tmpTime = millis(); diffTime = getTickDiff(tmpTime, encoder_time1); if (diffTime > 50) { - #if ANY_BUTTON(EN1, EN2, ENC, BACK) - - uint8_t newbutton = 0; - - #if BUTTON_EXISTS(EN1) - if (BUTTON_PRESSED(EN1)) newbutton |= EN_A; - #endif - #if BUTTON_EXISTS(EN2) - if (BUTTON_PRESSED(EN2)) newbutton |= EN_B; - #endif - #if BUTTON_EXISTS(ENC) - if (BUTTON_PRESSED(ENC)) newbutton |= EN_C; - #endif - #if BUTTON_EXISTS(BACK) - if (BUTTON_PRESSED(BACK)) newbutton |= EN_D; - #endif - - #else - - constexpr uint8_t newbutton = 0; - - #endif - - buttons = newbutton; - #if HAS_ENCODER_WHEEL + + #if ANY_BUTTON(EN1, EN2, ENC, BACK) + + uint8_t newbutton = 0; + + #if BUTTON_EXISTS(EN1) + if (BUTTON_PRESSED(EN1)) newbutton |= EN_A; + #endif + #if BUTTON_EXISTS(EN2) + if (BUTTON_PRESSED(EN2)) newbutton |= EN_B; + #endif + #if BUTTON_EXISTS(ENC) + if (BUTTON_PRESSED(ENC)) newbutton |= EN_C; + #endif + #if BUTTON_EXISTS(BACK) + if (BUTTON_PRESSED(BACK)) newbutton |= EN_D; + #endif + + #else + + constexpr uint8_t newbutton = 0; + + #endif + + + static uint8_t buttons = newbutton; static uint8_t lastEncoderBits; #define encrot0 0 diff --git a/Marlin/src/lcd/extui/lib/mks_ui/wifi_upload.cpp b/Marlin/src/lcd/extui/lib/mks_ui/wifi_upload.cpp index 77bcb767b7..087a3b2110 100644 --- a/Marlin/src/lcd/extui/lib/mks_ui/wifi_upload.cpp +++ b/Marlin/src/lcd/extui/lib/mks_ui/wifi_upload.cpp @@ -110,24 +110,17 @@ const char *resultMessages[] = { // 230400b always manages to connect. static const uint32_t uploadBaudRates[] = { 460800, 230400, 115200, 74880 }; - - signed char IsReady() { return esp_upload.state == upload_idle; } - - - - void uploadPort_write(const uint8_t *buf, size_t len) { #if 0 int i; - for(i = 0; i < len; i++) { - while (USART_GetFlagStatus(USART1, USART_FLAG_TC) == RESET); - - USART_SendData(USART1, *(buf + i)); + for (i = 0; i < len; i++) { + while (USART_GetFlagStatus(USART1, USART_FLAG_TC) == RESET) { /* nada */ } + USART_SendData(USART1, *(buf + i)); } #endif } @@ -138,28 +131,22 @@ char uploadPort_read() { return retChar; else return 0; - } int uploadPort_available() { return usartFifoAvailable(&WifiRxFifo); } - void uploadPort_begin() { esp_port_begin(1); } void uploadPort_close() { - //WIFI_COM.end(); //WIFI_COM.begin(115200, true); - esp_port_begin(0); - } - void flushInput() { while (uploadPort_available() != 0) { (void)uploadPort_read(); @@ -304,7 +291,6 @@ EspUploadResult readPacket(uint8_t op, uint32_t *valp, size_t *bodyLen, uint32_t *bodyLen = 0; - while (state != done) { uint8_t c; EspUploadResult stat; @@ -322,73 +308,73 @@ EspUploadResult readPacket(uint8_t op, uint32_t *valp, size_t *bodyLen, uint32_t } // sufficient bytes have been received for the current state, process them - switch(state) { - case begin: // expecting frame start - c = uploadPort_read(); - if (c != (uint8_t)0xC0) { - break; - } - state = header; - needBytes = 2; - - break; - case end: // expecting frame end - c = uploadPort_read(); - if (c != (uint8_t)0xC0) { - return slipFrame; - } - state = done; - - break; - - case header: // reading an 8-byte header - case body: // reading the response body - { - int rslt; - // retrieve a byte with SLIP decoding - rslt = ReadByte(&c, 1); - if (rslt != 1 && rslt != 2) { - // some error occurred - stat = (rslt == 0 || rslt == -2) ? slipData : slipFrame; - return stat; + switch (state) { + case begin: // expecting frame start + c = uploadPort_read(); + if (c != (uint8_t)0xC0) { + break; } - else if (state == header) { - //store the header byte - hdr[hdrIdx++] = c; - if (hdrIdx >= headerLength) { - // get the body length, prepare a buffer for it - *bodyLen = (uint16_t)getData(2, hdr, 2); + state = header; + needBytes = 2; - // extract the value, if requested - if (valp != 0) { - *valp = getData(4, hdr, 4); - } + break; + case end: // expecting frame end + c = uploadPort_read(); + if (c != (uint8_t)0xC0) { + return slipFrame; + } + state = done; - if (*bodyLen != 0) { - state = body; + break; + + case header: // reading an 8-byte header + case body: // reading the response body + { + int rslt; + // retrieve a byte with SLIP decoding + rslt = ReadByte(&c, 1); + if (rslt != 1 && rslt != 2) { + // some error occurred + stat = (rslt == 0 || rslt == -2) ? slipData : slipFrame; + return stat; + } + else if (state == header) { + //store the header byte + hdr[hdrIdx++] = c; + if (hdrIdx >= headerLength) { + // get the body length, prepare a buffer for it + *bodyLen = (uint16_t)getData(2, hdr, 2); + + // extract the value, if requested + if (valp != 0) { + *valp = getData(4, hdr, 4); + } + + if (*bodyLen != 0) { + state = body; + } + else { + needBytes = 1; + state = end; + } } - else { + } + else { + // Store the response body byte, check for completion + if (bodyIdx < ARRAY_SIZE(respBuf)) { + respBuf[bodyIdx] = c; + } + ++bodyIdx; + if (bodyIdx >= *bodyLen) { needBytes = 1; state = end; } } } - else { - // Store the response body byte, check for completion - if (bodyIdx < ARRAY_SIZE(respBuf)) { - respBuf[bodyIdx] = c; - } - ++bodyIdx; - if (bodyIdx >= *bodyLen) { - needBytes = 1; - state = end; - } - } - } - break; + break; - default: // this shouldn't happen - return slipState; + default: // this shouldn't happen + return slipState; } } @@ -397,7 +383,7 @@ EspUploadResult readPacket(uint8_t op, uint32_t *valp, size_t *bodyLen, uint32_t opRet = (uint8_t)getData(1, hdr, 1); // Sync packets often provoke a response with a zero opcode instead of ESP_SYNC if (resp != 0x01 || opRet != op) { -//debug//printf("resp %02x %02x\n", resp, opRet); + //printf("resp %02x %02x\n", resp, opRet); //debug return respHeader; } @@ -432,20 +418,19 @@ void _writePacket(const uint8_t *data, size_t len) { // 0xC0 and 0xDB replaced by the two-byte sequences {0xDB, 0xDC} and {0xDB, 0xDD} respectively. void writePacket(const uint8_t *hdr, size_t hdrLen, const uint8_t *data, size_t dataLen) { - - WriteByteRaw(0xC0); // send the packet start character + WriteByteRaw(0xC0); // send the packet start character _writePacket(hdr, hdrLen); // send the header - _writePacket(data, dataLen); // send the data block - WriteByteRaw(0xC0); // send the packet end character + _writePacket(data, dataLen); // send the data block + WriteByteRaw(0xC0); // send the packet end character } // Send a packet to the serial port while performing SLIP framing. The packet data comprises a header and an optional data block. // This is like writePacket except that it does a fast block write for both the header and the main data with no SLIP encoding. Used to send sync commands. void writePacketRaw(const uint8_t *hdr, size_t hdrLen, const uint8_t *data, size_t dataLen) { - WriteByteRaw(0xC0); // send the packet start character - _writePacketRaw(hdr, hdrLen); // send the header + WriteByteRaw(0xC0); // send the packet start character + _writePacketRaw(hdr, hdrLen); // send the header _writePacketRaw(data, dataLen); // send the data block in raw mode - WriteByteRaw(0xC0); // send the packet end character + WriteByteRaw(0xC0); // send the packet end character } // Send a command to the attached device together with the supplied data, if any. @@ -460,12 +445,10 @@ void sendCommand(uint8_t op, uint32_t checkVal, const uint8_t *data, size_t data // send the packet //flushInput(); - if (op == ESP_SYNC) { + if (op == ESP_SYNC) writePacketRaw(hdr, sizeof(hdr), data, dataLen); - } - else { + else writePacket(hdr, sizeof(hdr), data, dataLen); - } } // Send a command to the attached device together with the supplied data, if any, and get the response @@ -476,9 +459,8 @@ EspUploadResult doCommand(uint8_t op, const uint8_t *data, size_t dataLen, uint3 sendCommand(op, checkVal, data, dataLen); stat = readPacket(op, valp, &bodyLen, msTimeout); - if (stat == success && bodyLen != 2) { + if (stat == success && bodyLen != 2) stat = badReply; - } return stat; } @@ -611,6 +593,8 @@ EspUploadResult flashWriteBlock(uint16_t flashParmVal, uint16_t flashParmMask) { //printf("Upload %d\%\n", ftell(&esp_upload.uploadFile) * 100 / esp_upload.fileSize); return stat; + #else + return success; #endif } @@ -625,15 +609,14 @@ void upload_spin() { esp_upload.uploadResult = connected; esp_upload.state = done; } - else{ + else { // Reset the serial port at the new baud rate. Also reset the ESP8266. - // const uint32_t baud = uploadBaudRates[esp_upload.connectAttemptNumber/esp_upload.retriesPerBaudRate]; + // const uint32_t baud = uploadBaudRates[esp_upload.connectAttemptNumber/esp_upload.retriesPerBaudRate]; if (esp_upload.connectAttemptNumber % esp_upload.retriesPerBaudRate == 0) { } - // uploadPort.begin(baud); - // uploadPort_close(); - + //uploadPort.begin(baud); + //uploadPort_close(); uploadPort_begin(); @@ -654,7 +637,7 @@ void upload_spin() { esp_upload.lastAttemptTime = getWifiTick(); if (res == success) { // Successful connection -// //MessageF(" success on attempt %d\n", (connectAttemptNumber % retriesPerBaudRate) + 1); + //MessageF(" success on attempt %d\n", (connectAttemptNumber % retriesPerBaudRate) + 1); //printf("connect success\n"); esp_upload.state = erasing; } @@ -675,14 +658,13 @@ void upload_spin() { const uint32_t sectorSize = 4096; const uint32_t numSectors = (esp_upload.fileSize + sectorSize - 1)/sectorSize; const uint32_t startSector = esp_upload.uploadAddress/sectorSize; - uint32_t headSectors = sectorsPerBlock - (startSector % sectorsPerBlock); - if (numSectors < headSectors) { - headSectors = numSectors; - } - eraseSize = (numSectors < 2 * headSectors) - ? (numSectors + 1) / 2 * sectorSize - : (numSectors - headSectors) * sectorSize; + uint32_t headSectors = sectorsPerBlock - (startSector % sectorsPerBlock); + NOMORE(headSectors, numSectors); + + eraseSize = (numSectors < 2 * headSectors) + ? (numSectors + 1) / 2 * sectorSize + : (numSectors - headSectors) * sectorSize; //MessageF("Erasing %u bytes...\n", fileSize); esp_upload.uploadResult = flashBegin(esp_upload.uploadAddress, eraseSize); @@ -755,7 +737,7 @@ void SendUpdateFile(const char *file, uint32_t address) { if (res != FR_OK) return; - esp_upload.fileSize = f_size(&esp_upload.uploadFile); + esp_upload.fileSize = f_size(&esp_upload.uploadFile); if (esp_upload.fileSize == 0) { f_close(&esp_upload.uploadFile); return; diff --git a/Marlin/src/lcd/menu/menu_delta_calibrate.cpp b/Marlin/src/lcd/menu/menu_delta_calibrate.cpp index 705ec41611..4efcb7c8ed 100644 --- a/Marlin/src/lcd/menu/menu_delta_calibrate.cpp +++ b/Marlin/src/lcd/menu/menu_delta_calibrate.cpp @@ -118,7 +118,7 @@ void lcd_delta_settings() { } void menu_delta_calibrate() { - const bool all_homed = all_axes_homed(); + TERN_(DELTA_CALIBRATION_MENU, const bool all_homed = all_axes_homed()); // Acquire ahead of loop START_MENU(); BACK_ITEM(MSG_MAIN); diff --git a/Marlin/src/lcd/menu/menu_ubl.cpp b/Marlin/src/lcd/menu/menu_ubl.cpp index 2cd300958f..f0f5c21bec 100644 --- a/Marlin/src/lcd/menu/menu_ubl.cpp +++ b/Marlin/src/lcd/menu/menu_ubl.cpp @@ -188,11 +188,10 @@ void _lcd_ubl_edit_mesh() { */ void _lcd_ubl_validate_custom_mesh() { char ubl_lcd_gcode[24]; - const int16_t temp = TERN(HAS_HEATED_BED, custom_bed_temp, 0); sprintf_P(ubl_lcd_gcode, PSTR("G28\nG26 C P H%" PRIi16 TERN_(HAS_HEATED_BED, " B%" PRIi16)) , custom_hotend_temp #if HAS_HEATED_BED - , temp + , custom_bed_temp #endif ); queue.inject(ubl_lcd_gcode); diff --git a/Marlin/src/module/thermistor/thermistor_666.h b/Marlin/src/module/thermistor/thermistor_666.h index 86493988e0..490dbd5f3e 100644 --- a/Marlin/src/module/thermistor/thermistor_666.h +++ b/Marlin/src/module/thermistor/thermistor_666.h @@ -33,8 +33,7 @@ * B: 0.00031362 * C: -2.03978e-07 */ -#define NUMTEMPS 61 -const short temptable_666[NUMTEMPS][2] PROGMEM = { +const temp_entry_t temptable_666[] PROGMEM = { { OV( 1), 794 }, { OV( 18), 288 }, { OV( 35), 234 }, diff --git a/Marlin/src/pins/sensitive_pins.h b/Marlin/src/pins/sensitive_pins.h index 169f74b437..d7eb187245 100644 --- a/Marlin/src/pins/sensitive_pins.h +++ b/Marlin/src/pins/sensitive_pins.h @@ -608,12 +608,6 @@ #define _Z_PROBE #endif -#if TEMP_SENSOR_BED && PIN_EXISTS(HEATER_BED) - #define _HEATER_BED HEATER_BED_PIN, -#else - #define _HEATER_BED -#endif - #if PIN_EXISTS(FAN) #define _FAN0 FAN_PIN, #else @@ -660,21 +654,26 @@ #define _FANC #endif -#if PIN_EXISTS(HEATER_BED) && PIN_EXISTS(TEMP_BED) +#if TEMP_SENSOR_BED && PINS_EXIST(TEMP_BED, HEATER_BED) #define _BED_PINS HEATER_BED_PIN, analogInputToDigitalPin(TEMP_BED_PIN), #else #define _BED_PINS #endif -#if PIN_EXISTS(TEMP_CHAMBER) - #define __CHAMBER_PINS CHAMBER_AUTO_FAN_PIN, analogInputToDigitalPin(TEMP_CHAMBER_PIN), +#if TEMP_SENSOR_CHAMBER && PIN_EXISTS(TEMP_CHAMBER) + #define _CHAMBER_TEMP analogInputToDigitalPin(TEMP_CHAMBER_PIN), #else - #define __CHAMBER_PINS + #define _CHAMBER_TEMP #endif -#if PIN_EXISTS(HEATER_CHAMBER) - #define _CHAMBER_PINS __CHAMBER_PINS HEATER_CHAMBER_PIN, +#if TEMP_SENSOR_CHAMBER && PINS_EXIST(TEMP_CHAMBER, HEATER_CHAMBER) + #define _CHAMBER_HEATER HEATER_CHAMBER_PIN, #else - #define _CHAMBER_PINS + #define _CHAMBER_HEATER +#endif +#if TEMP_SENSOR_CHAMBER && PINS_EXIST(TEMP_CHAMBER, CHAMBER_AUTO_FAN) + #define _CHAMBER_FAN CHAMBER_AUTO_FAN_PIN, +#else + #define _CHAMBER_FAN #endif #ifndef HAL_SENSITIVE_PINS @@ -685,6 +684,6 @@ _X_PINS _Y_PINS _Z_PINS _X2_PINS _Y2_PINS _Z2_PINS _Z3_PINS _Z4_PINS _Z_PROBE \ _E0_PINS _E1_PINS _E2_PINS _E3_PINS _E4_PINS _E5_PINS _E6_PINS _E7_PINS \ _H0_PINS _H1_PINS _H2_PINS _H3_PINS _H4_PINS _H5_PINS _H6_PINS _H7_PINS \ - _PS_ON _HEATER_BED _FAN0 _FAN1 _FAN2 _FAN3 _FAN4 _FAN5 _FAN6 _FAN7 _FANC \ - _BED_PINS _CHAMBER_PINS HAL_SENSITIVE_PINS \ + _PS_ON _FAN0 _FAN1 _FAN2 _FAN3 _FAN4 _FAN5 _FAN6 _FAN7 _FANC \ + _BED_PINS _CHAMBER_TEMP _CHAMBER_HEATER _CHAMBER_FAN HAL_SENSITIVE_PINS \ } diff --git a/Marlin/src/pins/stm32f1/pins_MKS_ROBIN_PRO.h b/Marlin/src/pins/stm32f1/pins_MKS_ROBIN_PRO.h index 12c40b31b3..32203f52ea 100644 --- a/Marlin/src/pins/stm32f1/pins_MKS_ROBIN_PRO.h +++ b/Marlin/src/pins/stm32f1/pins_MKS_ROBIN_PRO.h @@ -200,6 +200,7 @@ #elif SD_CONNECTION_IS(ONBOARD) #define SDIO_SUPPORT #define SD_DETECT_PIN PD12 + #define ONBOARD_SD_CS_PIN PC11 #elif SD_CONNECTION_IS(CUSTOM_CABLE) #error "No custom SD drive cable defined for this board." #endif From bdd555990bc94f3c3243cdc02f59d0f67ac1e9f2 Mon Sep 17 00:00:00 2001 From: thinkyhead Date: Mon, 12 Oct 2020 00:15:08 +0000 Subject: [PATCH 005/226] [cron] Bump distribution date (2020-10-12) --- Marlin/src/inc/Version.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Marlin/src/inc/Version.h b/Marlin/src/inc/Version.h index 2b97b173a2..74f713091d 100644 --- a/Marlin/src/inc/Version.h +++ b/Marlin/src/inc/Version.h @@ -42,7 +42,7 @@ * version was tagged. */ #ifndef STRING_DISTRIBUTION_DATE - #define STRING_DISTRIBUTION_DATE "2020-10-11" + #define STRING_DISTRIBUTION_DATE "2020-10-12" #endif /** From 24fd19259d082718673d762aa3d6d9cc9a6d5c0a Mon Sep 17 00:00:00 2001 From: Jason Smith Date: Sun, 11 Oct 2020 17:23:23 -0700 Subject: [PATCH 006/226] Fix I2C_ADDRESS sign warning (#19685) --- Marlin/src/HAL/HAL.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Marlin/src/HAL/HAL.h b/Marlin/src/HAL/HAL.h index 8b6a978d21..5eca2f7eac 100644 --- a/Marlin/src/HAL/HAL.h +++ b/Marlin/src/HAL/HAL.h @@ -34,7 +34,7 @@ #define HAL_ADC_RANGE _BV(HAL_ADC_RESOLUTION) #ifndef I2C_ADDRESS - #define I2C_ADDRESS(A) (A) + #define I2C_ADDRESS(A) uint8_t(A) #endif // Needed for AVR sprintf_P PROGMEM extension From 18dd0d00a64581264828fad13dcc9b65201bab14 Mon Sep 17 00:00:00 2001 From: Victor Oliveira Date: Sun, 11 Oct 2020 21:26:16 -0300 Subject: [PATCH 007/226] Implement wait_for_user for Color UI (#19694) --- Marlin/src/gcode/config/M43.cpp | 9 ++++++++- Marlin/src/lcd/tft/touch.cpp | 12 ++++++++++++ 2 files changed, 20 insertions(+), 1 deletion(-) diff --git a/Marlin/src/gcode/config/M43.cpp b/Marlin/src/gcode/config/M43.cpp index 1e7374542c..1e780ca05a 100644 --- a/Marlin/src/gcode/config/M43.cpp +++ b/Marlin/src/gcode/config/M43.cpp @@ -46,6 +46,10 @@ #include "../../lcd/extui/ui_api.h" #endif +#if HAS_RESUME_CONTINUE + #include "../../lcd/ultralcd.h" +#endif + #ifndef GET_PIN_MAP_PIN_M43 #define GET_PIN_MAP_PIN_M43(Q) GET_PIN_MAP_PIN(Q) #endif @@ -362,7 +366,10 @@ void GcodeSuite::M43() { } } - if (TERN0(HAS_RESUME_CONTINUE, !wait_for_user)) break; + #if HAS_RESUME_CONTINUE + ui.update(); + if (!wait_for_user) break; + #endif safe_delay(200); } diff --git a/Marlin/src/lcd/tft/touch.cpp b/Marlin/src/lcd/tft/touch.cpp index d19cc4bf1d..80c65f074a 100644 --- a/Marlin/src/lcd/tft/touch.cpp +++ b/Marlin/src/lcd/tft/touch.cpp @@ -50,6 +50,9 @@ touch_calibration_t Touch::calibration; calibrationState Touch::calibration_state = CALIBRATION_NONE; touch_calibration_point_t Touch::calibration_points[4]; #endif +#if HAS_RESUME_CONTINUE + extern bool wait_for_user; +#endif void Touch::init() { calibration_reset(); @@ -80,6 +83,15 @@ void Touch::idle() { now = millis(); if (get_point(&_x, &_y)) { + #if HAS_RESUME_CONTINUE + // UI is waiting for a click anywhere? + if (wait_for_user) { + touch_control_type = CLICK; + ui.lcd_clicked = true; + return; + } + #endif + #if LCD_TIMEOUT_TO_STATUS ui.return_to_status_ms = now + LCD_TIMEOUT_TO_STATUS; #endif From 639b0b8f50b4665b45b4a601e14d93ebe6c6e1b2 Mon Sep 17 00:00:00 2001 From: Victor Oliveira Date: Sun, 11 Oct 2020 21:31:21 -0300 Subject: [PATCH 008/226] Option to prevent (extra) Watchdog init on STM32 (#19693) --- Marlin/src/HAL/STM32/watchdog.cpp | 6 +++++- Marlin/src/HAL/STM32F1/watchdog.cpp | 4 +++- Marlin/src/pins/stm32f1/pins_MALYAN_M200.h | 3 +++ 3 files changed, 11 insertions(+), 2 deletions(-) diff --git a/Marlin/src/HAL/STM32/watchdog.cpp b/Marlin/src/HAL/STM32/watchdog.cpp index 37e5638b05..cc18553149 100644 --- a/Marlin/src/HAL/STM32/watchdog.cpp +++ b/Marlin/src/HAL/STM32/watchdog.cpp @@ -30,7 +30,11 @@ #include "watchdog.h" #include - void watchdog_init() { IWatchdog.begin(4000000); } // 4 sec timeout + void watchdog_init() { + #if DISABLED(DISABLE_WATCHDOG_INIT) + IWatchdog.begin(4000000); // 4 sec timeout + #endif + } void HAL_watchdog_refresh() { IWatchdog.reload(); diff --git a/Marlin/src/HAL/STM32F1/watchdog.cpp b/Marlin/src/HAL/STM32F1/watchdog.cpp index 4123bc3ef0..ca91a6fe43 100644 --- a/Marlin/src/HAL/STM32F1/watchdog.cpp +++ b/Marlin/src/HAL/STM32F1/watchdog.cpp @@ -52,7 +52,9 @@ void watchdogSetup() { * @details The watchdog clock is 40Khz. We need a 4 seconds interval, so use a /256 preescaler and 625 reload value (counts down to 0) */ void watchdog_init() { - //iwdg_init(IWDG_PRE_256, STM32F1_WD_RELOAD); + #if DISABLED(DISABLE_WATCHDOG_INIT) + iwdg_init(IWDG_PRE_256, STM32F1_WD_RELOAD); + #endif } #endif // USE_WATCHDOG diff --git a/Marlin/src/pins/stm32f1/pins_MALYAN_M200.h b/Marlin/src/pins/stm32f1/pins_MALYAN_M200.h index d3c26c497d..95e7e92174 100644 --- a/Marlin/src/pins/stm32f1/pins_MALYAN_M200.h +++ b/Marlin/src/pins/stm32f1/pins_MALYAN_M200.h @@ -33,6 +33,9 @@ #define BOARD_INFO_NAME "Malyan M200" #endif +// Prevents hanging from an extra watchdog init +#define DISABLE_WATCHDOG_INIT + // Assume Flash EEPROM #if NO_EEPROM_SELECTED #define FLASH_EEPROM_EMULATION From edda32e6b4b7ca004eb49f76fe2f7bd72b0293aa Mon Sep 17 00:00:00 2001 From: Jason Smith Date: Sun, 11 Oct 2020 17:42:50 -0700 Subject: [PATCH 009/226] Fix motion compile w/out probe-oriented settings (#19684) --- Marlin/src/module/motion.cpp | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/Marlin/src/module/motion.cpp b/Marlin/src/module/motion.cpp index b904309018..da1cb173e5 100644 --- a/Marlin/src/module/motion.cpp +++ b/Marlin/src/module/motion.cpp @@ -510,7 +510,7 @@ void do_z_clearance(const float &zclear, const bool z_known/*=true*/, const bool const bool rel = raise_on_unknown && !z_known; float zdest = zclear + (rel ? current_position.z : 0.0f); if (!lower_allowed) NOLESS(zdest, current_position.z); - do_blocking_move_to_z(_MIN(zdest, Z_MAX_POS), MMM_TO_MMS(Z_PROBE_SPEED_FAST)); + do_blocking_move_to_z(_MIN(zdest, Z_MAX_POS), MMM_TO_MMS(TERN(HAS_BED_PROBE, Z_PROBE_SPEED_FAST, HOMING_FEEDRATE_Z))); } // @@ -1126,8 +1126,9 @@ bool homing_needed_error(uint8_t axis_bits/*=0x07*/) { * Homing bump feedrate (mm/s) */ feedRate_t get_homing_bump_feedrate(const AxisEnum axis) { - if (TERN0(HOMING_Z_WITH_PROBE, axis == Z_AXIS)) - return MMM_TO_MMS(Z_PROBE_SPEED_SLOW); + #if HOMING_Z_WITH_PROBE + if (axis == Z_AXIS) return MMM_TO_MMS(Z_PROBE_SPEED_SLOW); + #endif static const uint8_t homing_bump_divisor[] PROGMEM = HOMING_BUMP_DIVISOR; uint8_t hbd = pgm_read_byte(&homing_bump_divisor[axis]); if (hbd < 1) { @@ -1588,7 +1589,7 @@ void homeaxis(const AxisEnum axis) { // When homing Z with probe respect probe clearance const bool use_probe_bump = TERN0(HOMING_Z_WITH_PROBE, axis == Z_AXIS && home_bump_mm(Z_AXIS)); const float bump = axis_home_dir * ( - use_probe_bump ? _MAX(Z_CLEARANCE_BETWEEN_PROBES, home_bump_mm(Z_AXIS)) : home_bump_mm(axis) + use_probe_bump ? _MAX(TERN0(HOMING_Z_WITH_PROBE, Z_CLEARANCE_BETWEEN_PROBES), home_bump_mm(Z_AXIS)) : home_bump_mm(axis) ); // If a second homing move is configured... From f21b91f1a722e25c820dee2479f608acfc6a98dc Mon Sep 17 00:00:00 2001 From: qwewer0 <57561110+qwewer0@users.noreply.github.com> Date: Mon, 12 Oct 2020 04:30:18 +0200 Subject: [PATCH 010/226] Add REPORT_TRAMMING_MM option (#19682) Co-authored-by: Scott Lahteine --- Marlin/Configuration_adv.h | 8 +++----- Marlin/src/gcode/bedlevel/G35.cpp | 1 + 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/Marlin/Configuration_adv.h b/Marlin/Configuration_adv.h index 59a1813610..0d14f67cb2 100644 --- a/Marlin/Configuration_adv.h +++ b/Marlin/Configuration_adv.h @@ -806,11 +806,9 @@ #define TRAMMING_POINT_NAME_3 "Back-Right" #define TRAMMING_POINT_NAME_4 "Back-Left" - // Enable to restore leveling setup after operation - #define RESTORE_LEVELING_AFTER_G35 - - // Add a menu item for Assisted Tramming - //#define ASSISTED_TRAMMING_MENU_ITEM + #define RESTORE_LEVELING_AFTER_G35 // Enable to restore leveling setup after operation + //#define REPORT_TRAMMING_MM // Report Z deviation (mm) for each point relative to the first + //#define ASSISTED_TRAMMING_MENU_ITEM // Add a menu item for Assisted Tramming /** * Screw thread: diff --git a/Marlin/src/gcode/bedlevel/G35.cpp b/Marlin/src/gcode/bedlevel/G35.cpp index bd7f4f0411..0ede4e79c6 100755 --- a/Marlin/src/gcode/bedlevel/G35.cpp +++ b/Marlin/src/gcode/bedlevel/G35.cpp @@ -160,6 +160,7 @@ void GcodeSuite::G35() { " ", (screw_thread & 1) == (adjust > 0) ? "CCW" : "CW", " by ", abs(full_turns), " turns"); if (minutes) SERIAL_ECHOPAIR(" and ", abs(minutes), " minutes"); + if (ENABLED(REPORT_TRAMMING_MM)) SERIAL_ECHOPAIR(" (", -diff, "mm)"); SERIAL_EOL(); } } From e7838c5f7904924eed7e996d2ff95fff0f64e30e Mon Sep 17 00:00:00 2001 From: InsanityAutomation <38436470+InsanityAutomation@users.noreply.github.com> Date: Sun, 11 Oct 2020 22:34:27 -0400 Subject: [PATCH 011/226] G34 Mechanical Gantry Calibration (like Prusa M915) (#18972) Co-authored-by: Scott Lahteine --- Marlin/Configuration_adv.h | 19 +++ Marlin/src/gcode/calibrate/G34.cpp | 153 ++++++++++++++++++++++++ Marlin/src/gcode/calibrate/G34_M422.cpp | 98 ++++++++++----- Marlin/src/gcode/gcode.cpp | 2 +- Marlin/src/gcode/gcode.h | 5 +- Marlin/src/inc/SanityCheck.h | 17 ++- Marlin/src/lcd/language/language_en.h | 3 + Marlin/src/lcd/menu/menu_motion.cpp | 2 +- buildroot/tests/LPC1769-tests | 2 +- platformio.ini | 2 + 10 files changed, 269 insertions(+), 34 deletions(-) create mode 100644 Marlin/src/gcode/calibrate/G34.cpp diff --git a/Marlin/Configuration_adv.h b/Marlin/Configuration_adv.h index 0d14f67cb2..db54716cde 100644 --- a/Marlin/Configuration_adv.h +++ b/Marlin/Configuration_adv.h @@ -3376,6 +3376,25 @@ //#define JOYSTICK_DEBUG #endif +/** + * Mechanical Gantry Calibration + * Modern replacement for the Prusa TMC_Z_CALIBRATION. + * Adds capability to work with any adjustable current drivers. + * Implemented as G34 because M915 is deprecated. + */ +//#define MECHANICAL_GANTRY_CALIBRATION +#if ENABLED(MECHANICAL_GANTRY_CALIBRATION) + #define GANTRY_CALIBRATION_CURRENT 600 // Default calibration current in ma + #define GANTRY_CALIBRATION_EXTRA_HEIGHT 15 // Extra distance in mm past Z_###_POS to move + #define GANTRY_CALIBRATION_FEEDRATE 500 // Feedrate for correction move + //#define GANTRY_CALIBRATION_TO_MIN // Enable to calibrate Z in the MIN direction + + //#define GANTRY_CALIBRATION_SAFE_POSITION { X_CENTER, Y_CENTER } // Safe position for nozzle + //#define GANTRY_CALIBRATION_XY_PARK_FEEDRATE 3000 // XY Park Feedrate - MMM + //#define GANTRY_CALIBRATION_COMMANDS_PRE "" + #define GANTRY_CALIBRATION_COMMANDS_POST "G28" // G28 highly recommended to ensure an accurate position +#endif + /** * MAX7219 Debug Matrix * diff --git a/Marlin/src/gcode/calibrate/G34.cpp b/Marlin/src/gcode/calibrate/G34.cpp new file mode 100644 index 0000000000..eb1d32f909 --- /dev/null +++ b/Marlin/src/gcode/calibrate/G34.cpp @@ -0,0 +1,153 @@ +/** + * Marlin 3D Printer Firmware + * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] + * + * Based on Sprinter and grbl. + * Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + * + */ + +#include "../../inc/MarlinConfigPre.h" + +#if ENABLED(MECHANICAL_GANTRY_CALIBRATION) + +#include "../gcode.h" +#include "../../module/motion.h" +#include "../../module/stepper.h" +#include "../../module/endstops.h" + +#if HAS_LEVELING + #include "../../feature/bedlevel/bedlevel.h" +#endif + +#define DEBUG_OUT ENABLED(DEBUG_LEVELING_FEATURE) +#include "../../core/debug_out.h" + +void GcodeSuite::G34() { + + if (homing_needed()) return; + + TEMPORARY_SOFT_ENDSTOP_STATE(false); + TEMPORARY_BED_LEVELING_STATE(false); + TemporaryGlobalEndstopsState unlock_z(false); + + #ifdef GANTRY_CALIBRATION_COMMANDS_PRE + gcode.process_subcommands_now_P(PSTR(GANTRY_CALIBRATION_COMMANDS_PRE)); + if (DEBUGGING(LEVELING)) DEBUG_ECHOLNPGM("Sub Commands Processed"); + #endif + + #ifdef GANTRY_CALIBRATION_SAFE_POSITION + // Move XY to safe position + if (DEBUGGING(LEVELING)) DEBUG_ECHOLNPGM("Parking XY"); + const xy_pos_t safe_pos = GANTRY_CALIBRATION_SAFE_POSITION; + do_blocking_move_to(safe_pos, MMM_TO_MMS(GANTRY_CALIBRATION_XY_PARK_FEEDRATE)); + #endif + + const float move_distance = parser.intval('Z', GANTRY_CALIBRATION_EXTRA_HEIGHT), + zbase = ENABLED(GANTRY_CALIBRATION_TO_MIN) ? Z_MIN_POS : Z_MAX_POS, + zpounce = zbase - move_distance, zgrind = zbase + move_distance; + + // Move Z to pounce position + if (DEBUGGING(LEVELING)) DEBUG_ECHOLNPGM("Setting Z Pounce"); + do_blocking_move_to_z(zpounce, MMM_TO_MMS(HOMING_FEEDRATE_Z)); + + // Store current motor settings, then apply reduced value + + #define _REDUCE_CURRENT ANY(HAS_MOTOR_CURRENT_SPI, HAS_MOTOR_CURRENT_PWM, HAS_MOTOR_CURRENT_DAC, HAS_MOTOR_CURRENT_I2C, HAS_TRINAMIC_CONFIG) + #if _REDUCE_CURRENT + if (DEBUGGING(LEVELING)) DEBUG_ECHOLNPGM("Reducing Current"); + #endif + + #if HAS_MOTOR_CURRENT_SPI + const uint16_t target_current = parser.intval('S', GANTRY_CALIBRATION_CURRENT); + const uint32_t previous_current = stepper.motor_current_setting[Z_AXIS]; + stepper.set_digipot_current(Z_AXIS, target_current); + #elif HAS_MOTOR_CURRENT_PWM + const uint16_t target_current = parser.intval('S', GANTRY_CALIBRATION_CURRENT); + const uint32_t previous_current = stepper.motor_current_setting[Z_AXIS]; + stepper.set_digipot_current(1, target_current); + #elif HAS_MOTOR_CURRENT_DAC + const float target_current = parser.floatval('S', GANTRY_CALIBRATION_CURRENT); + const float previous_current = dac_amps(Z_AXIS, target_current); + stepper_dac.set_current_value(Z_AXIS, target_current); + #elif ENABLED(HAS_MOTOR_CURRENT_I2C) + const uint16_t target_current = parser.intval('S', GANTRY_CALIBRATION_CURRENT); + previous_current = dac_amps(Z_AXIS); + digipot_i2c.set_current(Z_AXIS, target_current) + #elif HAS_TRINAMIC_CONFIG + const uint16_t target_current = parser.intval('S', GANTRY_CALIBRATION_CURRENT); + static uint16_t previous_current_arr[NUM_Z_STEPPER_DRIVERS]; + #if AXIS_IS_TMC(Z) + previous_current_arr[0] = stepperZ.getMilliamps(); + stepperZ.rms_current(target_current); + #endif + #if AXIS_IS_TMC(Z2) + previous_current_arr[1] = stepperZ2.getMilliamps(); + stepperZ2.rms_current(target_current); + #endif + #if AXIS_IS_TMC(Z3) + previous_current_arr[2] = stepperZ3.getMilliamps(); + stepperZ3.rms_current(target_current); + #endif + #if AXIS_IS_TMC(Z4) + previous_current_arr[3] = stepperZ4.getMilliamps(); + stepperZ4.rms_current(target_current); + #endif + #endif + + // Do Final Z move to adjust + if (DEBUGGING(LEVELING)) DEBUG_ECHOLNPGM("Final Z Move"); + do_blocking_move_to_z(zgrind, MMM_TO_MMS(GANTRY_CALIBRATION_FEEDRATE)); + + // Back off end plate, back to normal motion range + if (DEBUGGING(LEVELING)) DEBUG_ECHOLNPGM("Z Backoff"); + do_blocking_move_to_z(zpounce, MMM_TO_MMS(GANTRY_CALIBRATION_FEEDRATE)); + + #if _REDUCE_CURRENT + // Reset current to original values + if (DEBUGGING(LEVELING)) DEBUG_ECHOLNPGM("Restore Current"); + #endif + + #if HAS_MOTOR_CURRENT_SPI + stepper.set_digipot_current(Z_AXIS, previous_current); + #elif HAS_MOTOR_CURRENT_PWM + stepper.set_digipot_current(1, previous_current); + #elif HAS_MOTOR_CURRENT_DAC + stepper_dac.set_current_value(Z_AXIS, previous_current); + #elif ENABLED(HAS_MOTOR_CURRENT_I2C) + digipot_i2c.set_current(Z_AXIS, previous_current) + #elif HAS_TRINAMIC_CONFIG + #if AXIS_IS_TMC(Z) + stepperZ.rms_current(previous_current_arr[0]); + #endif + #if AXIS_IS_TMC(Z2) + stepperZ2.rms_current(previous_current_arr[1]); + #endif + #if AXIS_IS_TMC(Z3) + stepperZ3.rms_current(previous_current_arr[2]); + #endif + #if AXIS_IS_TMC(Z4) + stepperZ4.rms_current(previous_current_arr[3]); + #endif + #endif + + #ifdef GANTRY_CALIBRATION_COMMANDS_POST + if (DEBUGGING(LEVELING)) DEBUG_ECHOLNPGM("Running Post Commands"); + gcode.process_subcommands_now_P(PSTR(GANTRY_CALIBRATION_COMMANDS_POST)); + #endif +} + +#endif // MECHANICAL_GANTRY_CALIBRATION diff --git a/Marlin/src/gcode/calibrate/G34_M422.cpp b/Marlin/src/gcode/calibrate/G34_M422.cpp index 1fd0754ec7..24292477f9 100644 --- a/Marlin/src/gcode/calibrate/G34_M422.cpp +++ b/Marlin/src/gcode/calibrate/G34_M422.cpp @@ -20,28 +20,29 @@ * */ -#include "../../inc/MarlinConfig.h" +#include "../../inc/MarlinConfigPre.h" #if ENABLED(Z_STEPPER_AUTO_ALIGN) #include "../../feature/z_stepper_align.h" #include "../gcode.h" -#include "../../module/planner.h" -#include "../../module/stepper.h" #include "../../module/motion.h" +#include "../../module/stepper.h" +#include "../../module/planner.h" #include "../../module/probe.h" - -#if HAS_MULTI_HOTEND - #include "../../module/tool_change.h" -#endif +#include "../../lcd/ultralcd.h" // for LCD_MESSAGEPGM #if HAS_LEVELING #include "../../feature/bedlevel/bedlevel.h" #endif +#if HAS_MULTI_HOTEND + #include "../../module/tool_change.h" +#endif + #if ENABLED(Z_STEPPER_ALIGN_KNOWN_STEPPER_POSITIONS) - #include "../../libs/least_squares_fit.h" + #include "../../libs/least_squares_fit.h" #endif #define DEBUG_OUT ENABLED(DEBUG_LEVELING_FEATURE) @@ -117,7 +118,7 @@ void GcodeSuite::G34() { // In BLTOUCH HS mode, the probe travels in a deployed state. // Users of G34 might have a badly misaligned bed, so raise Z by the // length of the deployed pin (BLTOUCH stroke < 7mm) - #define Z_BASIC_CLEARANCE Z_CLEARANCE_BETWEEN_PROBES + 7.0f * BOTH(BLTOUCH, BLTOUCH_HS_MODE) + #define Z_BASIC_CLEARANCE (Z_CLEARANCE_BETWEEN_PROBES + 7.0f * BOTH(BLTOUCH, BLTOUCH_HS_MODE)) // Compute a worst-case clearance height to probe from. After the first // iteration this will be re-calculated based on the actual bed position @@ -154,21 +155,29 @@ void GcodeSuite::G34() { z_maxdiff = 0.0f, amplification = z_auto_align_amplification; - // These are needed after the for-loop - uint8_t iteration; - bool err_break = false; - float z_measured_min; - #if DISABLED(Z_STEPPER_ALIGN_KNOWN_STEPPER_POSITIONS) bool adjustment_reverse = false; #endif - // 'iteration' is declared above and is also used after the for-loop. - // *not* the same as LOOP_L_N(iteration, z_auto_align_iterations) - for (iteration = 0; iteration < z_auto_align_iterations; ++iteration) { + #if HAS_DISPLAY + PGM_P const msg_iteration = GET_TEXT(MSG_ITERATION); + const uint8_t iter_str_len = strlen_P(msg_iteration); + #endif + + // Final z and iteration values will be used after breaking the loop + float z_measured_min; + uint8_t iteration = 0; + bool err_break = false; // To break out of nested loops + while (iteration < z_auto_align_iterations) { if (DEBUGGING(LEVELING)) DEBUG_ECHOLNPGM("> probing all positions."); - SERIAL_ECHOLNPAIR("\nITERATION: ", int(iteration + 1)); + const int iter = iteration + 1; + SERIAL_ECHOLNPAIR("\nG34 Iteration: ", iter); + #if HAS_DISPLAY + char str[iter_str_len + 2 + 1]; + sprintf_P(str, msg_iteration, iter); + ui.set_status(str); + #endif // Initialize minimum value z_measured_min = 100000.0f; @@ -190,7 +199,8 @@ void GcodeSuite::G34() { // current_position.z has been manually altered in the "dirty trick" above. const float z_probed_height = probe.probe_at_point(z_stepper_align.xy[iprobe], raise_after, 0, true, false); if (isnan(z_probed_height)) { - SERIAL_ECHOLNPGM("Probing failed."); + SERIAL_ECHOLNPGM("Probing failed"); + LCD_MESSAGEPGM(MSG_LCD_PROBING_FAILED); err_break = true; break; } @@ -249,8 +259,39 @@ void GcodeSuite::G34() { , " Z3-Z1=", ABS(z_measured[2] - z_measured[0]) #endif ); + #if HAS_DISPLAY + char fstr1[10]; + #if NUM_Z_STEPPER_DRIVERS == 2 + char msg[6 + (6 + 5) * 1 + 1]; + #else + char msg[6 + (6 + 5) * 3 + 1], fstr2[10], fstr3[10]; + #endif + sprintf_P(msg, + PSTR("Diffs Z1-Z2=%s" + #if NUM_Z_STEPPER_DRIVERS == 3 + " Z2-Z3=%s" + " Z3-Z1=%s" + #endif + ), dtostrf(ABS(z_measured[0] - z_measured[1]), 1, 3, fstr1) + #if NUM_Z_STEPPER_DRIVERS == 3 + , dtostrf(ABS(z_measured[1] - z_measured[2]), 1, 3, fstr2) + , dtostrf(ABS(z_measured[2] - z_measured[0]), 1, 3, fstr3) + #endif + ); + ui.set_status(msg); + #endif + + auto decreasing_accuracy = [](const float &v1, const float &v2){ + if (v1 < v2 * 0.7f) { + SERIAL_ECHOLNPGM("Decreasing Accuracy Detected."); + LCD_MESSAGEPGM(MSG_DECREASING_ACCURACY); + return true; + } + return false; + }; #if ENABLED(Z_STEPPER_ALIGN_KNOWN_STEPPER_POSITIONS) + // Check if the applied corrections go in the correct direction. // Calculate the sum of the absolute deviations from the mean of the probe measurements. // Compare to the last iteration to ensure it's getting better. @@ -266,11 +307,8 @@ void GcodeSuite::G34() { z_align_level_indicator += ABS(z_measured[zstepper] - z_measured_mean); // If it's getting worse, stop and throw an error - if (last_z_align_level_indicator < z_align_level_indicator * 0.7f) { - SERIAL_ECHOLNPGM("Decreasing accuracy detected."); - err_break = true; - break; - } + err_break = decreasing_accuracy(last_z_align_level_indicator, z_align_level_indicator); + if (err_break) break; last_z_align_level_indicator = z_align_level_indicator; #endif @@ -290,8 +328,7 @@ void GcodeSuite::G34() { if (z_align_abs) amplification = (iteration == 1) ? _MIN(last_z_align_move[zstepper] / z_align_abs, 2.0f) : z_auto_align_amplification; // Check for less accuracy compared to last move - if (last_z_align_move[zstepper] < z_align_abs * 0.7f) { - SERIAL_ECHOLNPGM("Decreasing accuracy detected."); + if (decreasing_accuracy(last_z_align_move[zstepper], z_align_abs)) { if (DEBUGGING(LEVELING)) DEBUG_ECHOLNPAIR("> Z", int(zstepper + 1), " last_z_align_move = ", last_z_align_move[zstepper]); if (DEBUGGING(LEVELING)) DEBUG_ECHOLNPAIR("> Z", int(zstepper + 1), " z_align_abs = ", z_align_abs); adjustment_reverse = !adjustment_reverse; @@ -329,9 +366,14 @@ void GcodeSuite::G34() { if (err_break) break; - if (success_break) { SERIAL_ECHOLNPGM("Target accuracy achieved."); break; } + if (success_break) { + SERIAL_ECHOLNPGM("Target accuracy achieved."); + LCD_MESSAGEPGM(MSG_ACCURACY_ACHIEVED); + break; + } - } // for (iteration) + iteration++; + } // while (iteration < z_auto_align_iterations) if (err_break) SERIAL_ECHOLNPGM("G34 aborted."); diff --git a/Marlin/src/gcode/gcode.cpp b/Marlin/src/gcode/gcode.cpp index 1d4e8f9d4d..f2bd81e670 100644 --- a/Marlin/src/gcode/gcode.cpp +++ b/Marlin/src/gcode/gcode.cpp @@ -327,7 +327,7 @@ void GcodeSuite::process_parsed_command(const bool no_ok/*=false*/) { case 33: G33(); break; // G33: Delta Auto-Calibration #endif - #if ENABLED(Z_STEPPER_AUTO_ALIGN) + #if EITHER(Z_STEPPER_AUTO_ALIGN, MECHANICAL_GANTRY_CALIBRATION) case 34: G34(); break; // G34: Z Stepper automatic alignment using probe #endif diff --git a/Marlin/src/gcode/gcode.h b/Marlin/src/gcode/gcode.h index 683642bec6..3d745eff89 100644 --- a/Marlin/src/gcode/gcode.h +++ b/Marlin/src/gcode/gcode.h @@ -465,11 +465,12 @@ private: TERN_(DELTA_AUTO_CALIBRATION, static void G33()); - #if ENABLED(Z_STEPPER_AUTO_ALIGN) + #if EITHER(Z_STEPPER_AUTO_ALIGN, MECHANICAL_GANTRY_CALIBRATION) static void G34(); - static void M422(); #endif + TERN_(Z_STEPPER_AUTO_ALIGN, static void M422()); + TERN_(ASSISTED_TRAMMING, static void G35()); TERN_(G38_PROBE_TARGET, static void G38(const int8_t subcode)); diff --git a/Marlin/src/inc/SanityCheck.h b/Marlin/src/inc/SanityCheck.h index 25188906c7..c3708c2676 100644 --- a/Marlin/src/inc/SanityCheck.h +++ b/Marlin/src/inc/SanityCheck.h @@ -422,7 +422,7 @@ #elif defined(CHAMBER_HEATER_PIN) #error "CHAMBER_HEATER_PIN is now HEATER_CHAMBER_PIN. Please update your configuration and/or pins." #elif defined(TMC_Z_CALIBRATION) - #error "TMC_Z_CALIBRATION has been deprecated in favor of Z_STEPPER_AUTO_ALIGN. Please update your configuration." + #error "TMC_Z_CALIBRATION has been deprecated in favor of MECHANICAL_GANTRY_CALIBRATION. Please update your configuration." #elif defined(Z_MIN_PROBE_ENDSTOP) #error "Z_MIN_PROBE_ENDSTOP is no longer required. Please remove it from Configuration.h." #elif defined(DUAL_NOZZLE_DUPLICATION_MODE) @@ -2788,6 +2788,21 @@ static_assert( _ARR_TEST(3,0) && _ARR_TEST(3,1) && _ARR_TEST(3,2) #endif #endif +#if ENABLED(MECHANICAL_GANTRY_CALIBRATION) + #if NONE(HAS_MOTOR_CURRENT_DAC, HAS_MOTOR_CURRENT_SPI, HAS_MOTOR_CURRENT_DAC, HAS_TRINAMIC_CONFIG, HAS_MOTOR_CURRENT_PWM) + #error "It is highly recommended to have adjustable current drivers to prevent damage. Disable this line to continue anyway." + #elif !defined(GANTRY_CALIBRATION_CURRENT) + #error "MECHANICAL_GANTRY_CALIBRATION Requires GANTRY_CALIBRATION_CURRENT to be set." + #elif !defined(GANTRY_CALIBRATION_EXTRA_HEIGHT) + #error "MECHANICAL_GANTRY_CALIBRATION Requires GANTRY_CALIBRATION_EXTRA_HEIGHT to be set." + #elif !defined(GANTRY_CALIBRATION_FEEDRATE) + #error "MECHANICAL_GANTRY_CALIBRATION Requires GANTRY_CALIBRATION_FEEDRATE to be set." + #endif + #if defined(GANTRY_CALIBRATION_SAFE_POSITION) && !defined(GANTRY_CALIBRATION_XY_PARK_FEEDRATE) + #error "GANTRY_CALIBRATION_SAFE_POSITION Requires GANTRY_CALIBRATION_XY_PARK_FEEDRATE to be set." + #endif +#endif + #if ENABLED(PRINTCOUNTER) && DISABLED(EEPROM_SETTINGS) #error "PRINTCOUNTER requires EEPROM_SETTINGS. Please update your Configuration." #endif diff --git a/Marlin/src/lcd/language/language_en.h b/Marlin/src/lcd/language/language_en.h index b41515a734..e8b4769cc2 100644 --- a/Marlin/src/lcd/language/language_en.h +++ b/Marlin/src/lcd/language/language_en.h @@ -67,6 +67,9 @@ namespace Language_en { PROGMEM Language_Str MSG_AUTO_HOME_Z = _UxGT("Home Z"); PROGMEM Language_Str MSG_AUTO_Z_ALIGN = _UxGT("Auto Z-Align"); PROGMEM Language_Str MSG_ASSISTED_TRAMMING = _UxGT("Assisted Tramming"); + PROGMEM Language_Str MSG_ITERATION = _UxGT("G34 Iteration: %i"); + PROGMEM Language_Str MSG_DECREASING_ACCURACY = _UxGT("Accuracy Decreasing!"); + PROGMEM Language_Str MSG_ACCURACY_ACHIEVED = _UxGT("Accuracy Achieved"); PROGMEM Language_Str MSG_LEVEL_BED_HOMING = _UxGT("Homing XYZ"); PROGMEM Language_Str MSG_LEVEL_BED_WAITING = _UxGT("Click to Begin"); PROGMEM Language_Str MSG_LEVEL_BED_NEXT_POINT = _UxGT("Next Point"); diff --git a/Marlin/src/lcd/menu/menu_motion.cpp b/Marlin/src/lcd/menu/menu_motion.cpp index dff9895c6b..676ba46ea7 100644 --- a/Marlin/src/lcd/menu/menu_motion.cpp +++ b/Marlin/src/lcd/menu/menu_motion.cpp @@ -358,7 +358,7 @@ void menu_motion() { // // Auto Z-Align // - #if ENABLED(Z_STEPPER_AUTO_ALIGN) + #if EITHER(Z_STEPPER_AUTO_ALIGN, MECHANICAL_GANTRY_CALIBRATION) GCODES_ITEM(MSG_AUTO_Z_ALIGN, PSTR("G34")); #endif diff --git a/buildroot/tests/LPC1769-tests b/buildroot/tests/LPC1769-tests index a7a6456d02..4314b0d5ff 100755 --- a/buildroot/tests/LPC1769-tests +++ b/buildroot/tests/LPC1769-tests @@ -61,7 +61,7 @@ opt_set MOTHERBOARD BOARD_COHESION3D_REMIX opt_set X_DRIVER_TYPE TMC2130 opt_set Y_DRIVER_TYPE TMC2130 opt_set Z_DRIVER_TYPE TMC2130 -opt_enable AUTO_BED_LEVELING_BILINEAR EEPROM_SETTINGS EEPROM_CHITCHAT \ +opt_enable AUTO_BED_LEVELING_BILINEAR EEPROM_SETTINGS EEPROM_CHITCHAT MECHANICAL_GANTRY_CALIBRATION \ TMC_USE_SW_SPI MONITOR_DRIVER_STATUS STEALTHCHOP_XY STEALTHCHOP_Z HYBRID_THRESHOLD \ SENSORLESS_PROBING Z_SAFE_HOMING X_STALL_SENSITIVITY Y_STALL_SENSITIVITY Z_STALL_SENSITIVITY TMC_DEBUG \ EXPERIMENTAL_I2CBUS diff --git a/platformio.ini b/platformio.ini index d2c7cfafbe..4c974e5a87 100644 --- a/platformio.ini +++ b/platformio.ini @@ -110,6 +110,7 @@ default_src_filter = + - - + - - - + - - - - @@ -309,6 +310,7 @@ MK2_MULTIPLEXER = src_filter=+ EXT_SOLENOID|MANUAL_SOLENOID_CONTROL = src_filter=+ + HAS_CUTTER = src_filter=+ + EXPERIMENTAL_I2CBUS = src_filter=+ + +MECHANICAL_GANTRY_CAL.+ = src_filter=+ Z_STEPPER_AUTO_ALIGN = src_filter=+ + G26_MESH_VALIDATION = src_filter=+ ASSISTED_TRAMMING = src_filter=+ From a866a758cc0ac671363fdce462dd967e488aa4e4 Mon Sep 17 00:00:00 2001 From: Jason Smith Date: Sun, 11 Oct 2020 22:40:39 -0700 Subject: [PATCH 012/226] Allow MAX31865 resistance values configuration (#19695) --- Marlin/Configuration.h | 6 ++++++ Marlin/src/inc/SanityCheck.h | 4 ++++ Marlin/src/module/temperature.cpp | 4 ++-- 3 files changed, 12 insertions(+), 2 deletions(-) diff --git a/Marlin/Configuration.h b/Marlin/Configuration.h index ec8b162cd6..59f2be18c6 100644 --- a/Marlin/Configuration.h +++ b/Marlin/Configuration.h @@ -432,6 +432,12 @@ #define DUMMY_THERMISTOR_998_VALUE 25 #define DUMMY_THERMISTOR_999_VALUE 100 +// Resistor values when using a MAX31865 (sensor -5) +// Sensor value is typically 100 (PT100) or 1000 (PT1000) +// Calibration value is typically 430 ohm for AdaFruit PT100 modules and 4300 ohm for AdaFruit PT1000 modules. +//#define MAX31865_SENSOR_OHMS 100 +//#define MAX31865_CALIBRATION_OHMS 430 + // Use temp sensor 1 as a redundant sensor with sensor 0. If the readings // from the two sensors differ too much the print will be aborted. //#define TEMP_SENSOR_1_AS_REDUNDANT diff --git a/Marlin/src/inc/SanityCheck.h b/Marlin/src/inc/SanityCheck.h index c3708c2676..59a74411ef 100644 --- a/Marlin/src/inc/SanityCheck.h +++ b/Marlin/src/inc/SanityCheck.h @@ -1845,6 +1845,10 @@ static_assert(hbm[Z_AXIS] >= 0, "HOMING_BUMP_MM.Z must be greater than or equal #error "TEMP_SENSOR_1 is required with TEMP_SENSOR_1_AS_REDUNDANT." #endif +#if ENABLED(MAX6675_IS_MAX31865) && (!defined(MAX31865_SENSOR_OHMS) || !defined(MAX31865_CALIBRATION_OHMS)) + #error "MAX31865_SENSOR_OHMS and MAX31865_CALIBRATION_OHMS must be set in Configuration.h when using a MAX31865 temperature sensor." +#endif + /** * Test Heater, Temp Sensor, and Extruder Pins */ diff --git a/Marlin/src/module/temperature.cpp b/Marlin/src/module/temperature.cpp index f8ff972f80..9ecbb7c766 100644 --- a/Marlin/src/module/temperature.cpp +++ b/Marlin/src/module/temperature.cpp @@ -1461,7 +1461,7 @@ void Temperature::manage_heater() { #elif ENABLED(HEATER_0_USES_MAX6675) return ( #if ENABLED(MAX6675_IS_MAX31865) - max31865.temperature(100, 400) // 100 ohms = PT100 resistance. 400 ohms = calibration resistor + max31865.temperature(MAX31865_SENSOR_OHMS, MAX31865_CALIBRATION_OHMS) #else raw * 0.25 #endif @@ -2236,7 +2236,7 @@ void Temperature::disable_all_heaters() { next_max6675_ms[hindex] = ms + MAX6675_HEAT_INTERVAL; #if ENABLED(MAX6675_IS_MAX31865) - max6675_temp = int(max31865.temperature(100, 400)); // 100 ohms = PT100 resistance. 400 ohms = calibration resistor + max6675_temp = int(max31865.temperature(MAX31865_SENSOR_OHMS, MAX31865_CALIBRATION_OHMS)); #endif // From bcf65aa503b7e827744ba53bd00a7b6a43af2725 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Mon, 12 Oct 2020 00:59:30 -0500 Subject: [PATCH 013/226] Fix screen click reading too often (#19696) Co-authored-by: andreibobirica <39415547+andreibobirica@users.noreply.github.com> --- Marlin/src/lcd/ultralcd.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/Marlin/src/lcd/ultralcd.cpp b/Marlin/src/lcd/ultralcd.cpp index 58e6d9473b..7003d13fdd 100644 --- a/Marlin/src/lcd/ultralcd.cpp +++ b/Marlin/src/lcd/ultralcd.cpp @@ -1553,12 +1553,15 @@ void MarlinUI::update() { // - On edit screens, touch Up Half for -, Bottom Half to + // void MarlinUI::screen_click(const uint8_t row, const uint8_t col, const uint8_t, const uint8_t) { + const millis_t now = millis(); + if (PENDING(now, next_button_update_ms)) return; + next_button_update_ms = now + repeat_delay; // Assume the repeat delay const int8_t xdir = col < (LCD_WIDTH ) / 2 ? -1 : 1, ydir = row < (LCD_HEIGHT) / 2 ? -1 : 1; if (on_edit_screen) encoderDiff = epps * ydir; else if (screen_items > 0) { - // Last 3 cols act as a scroll :-) + // Last 5 cols act as a scroll :-) if (col > (LCD_WIDTH) - 5) // 2 * LCD_HEIGHT to scroll to bottom of next page. (LCD_HEIGHT would only go 1 item down.) encoderDiff = epps * (encoderLine - encoderTopLine + 2 * (LCD_HEIGHT)) * ydir; From c0920bbf6a2490b7ea66d2a9e828c0f527a6c77b Mon Sep 17 00:00:00 2001 From: Victor Oliveira Date: Mon, 12 Oct 2020 18:38:07 -0300 Subject: [PATCH 014/226] TFT Refactoring (#19192) * split tft folder in two: tft for color ui; tft_io for shared tft code * after the files got moved, now the code was moved to the right place * classic ui using TFT IO init lcd codes * feature to compile tft_io when enabled * compiling fix * lvgl spi tft working with tft io init codes * there is no need for separeted fsmc and spi class in lvgl anymore, as tft io handle everything * remove debug * base for TFT rotation and mirroring API, and ILI9488 support * ST7796S rotate and mirror support * ST7789V rotate and mirror support * ST7735 rotate and mirror support * ILI9341 rotate and mirror support * ILI9328 rotate and mirror support * R61505 rotate and mirror support * MKS TFT definitions * more configs for mks tfts * update config * naming typo * to configure the user interface * ANYCUBIC_TFT35 * tft configs * support for SSD1963 * tft display types * updated conditionals lcd; first board fully working with the new code - all 3 ui! * compatiblity * changed name * move classic ui file name * rename TURN -> ROTATE * GRAPHICAL_TFT_ROTATE_180 deprecated * first fsmc board fully working - chitu v5 * mks robin nano v1.2 + tft 35 ok! * right pin name * anycubic tft tested in a TRIGORILLA_PRO * chitu v6 * nano 32 tft orientation * mks tft43 * mks tft43 rotation * fixed LONGER LK tft setup * GRAPHICAL_TFT_UPSCALE defined by the display type * better offsets defaults * Update Configuration.h * Update tft_fsmc.cpp * Update Conditionals_LCD.h * Tweak comments * update nano tests * Revert "update nano tests" This reverts commit a071ebbfad30e28855a4a5695ec8a726542a1a65. * default tft * outdated comments * to not break non-vscode builds * upscale tft 35 * support tft 180 rotation for color ui * Each TFT Driver is responsible for its default color mode. * use auto detect in mks displays, because some of them could be shipped with diferent drivers * extra s * unused code * wrong -1 * missing mirror options * Smaller regex pattern * Comment updates * Clean up old defines * Apply pins formatting * GRAPHICAL_TFT_ROTATE_180 => TFT_ROTATE_180 * MKS_ROBIN_TFT_V1_1R * merge fix * correct resolution * auto is default, dont need be there, and it will allow the user to configure it even for named displays * to not use rotation with MKS_ROBIN_TFT_V1_1R * i like () in macros * avoid sleepy commits * default for st7789 is rgb * nano follow up * to allow ili9328 rotation * default is rgb * boards merge follow up * to match bootloader orientation * HAS_TOUCH_XPT2046 is not hal specific anymore * lets not forget LPC * 180 rotation for ili9328 and R61505 * Clean up whitespace Co-authored-by: Scott Lahteine Co-authored-by: Scott Lahteine --- Marlin/Configuration.h | 74 ++-- Marlin/Configuration_adv.h | 3 +- Marlin/src/HAL/LPC1768/inc/Conditionals_LCD.h | 7 - Marlin/src/HAL/LPC1768/tft/tft_spi.h | 2 +- Marlin/src/HAL/STM32/tft/tft_fsmc.h | 2 +- Marlin/src/HAL/STM32/tft/tft_spi.h | 2 +- Marlin/src/HAL/STM32F1/inc/Conditionals_LCD.h | 7 - Marlin/src/HAL/STM32F1/tft/tft_fsmc.cpp | 13 - Marlin/src/HAL/STM32F1/tft/tft_fsmc.h | 2 +- Marlin/src/HAL/STM32F1/tft/tft_spi.h | 2 +- Marlin/src/core/macros.h | 6 + Marlin/src/inc/Conditionals_LCD.h | 176 +++++++- Marlin/src/inc/SanityCheck.h | 4 +- ...pp => u8g_dev_tft_upscale_from_128x64.cpp} | 347 +--------------- Marlin/src/lcd/extui/lib/mks_ui/SPI_TFT.cpp | 146 ++----- Marlin/src/lcd/extui/lib/mks_ui/SPI_TFT.h | 18 +- .../extui/lib/mks_ui/draw_error_message.cpp | 6 +- Marlin/src/lcd/extui/lib/mks_ui/draw_ui.cpp | 63 +-- .../extui/lib/mks_ui/mks_hardware_test.cpp | 12 +- Marlin/src/lcd/extui/lib/mks_ui/tft_fsmc.cpp | 60 --- Marlin/src/lcd/extui/lib/mks_ui/tft_fsmc.h | 30 -- .../lib/mks_ui/tft_lvgl_configuration.cpp | 385 +----------------- .../extui/lib/mks_ui/tft_lvgl_configuration.h | 2 +- Marlin/src/lcd/scaled_tft.h | 9 +- Marlin/src/lcd/tft/tft.cpp | 159 +------- Marlin/src/lcd/tft/tft.h | 26 +- Marlin/src/lcd/tft/tft_io.h | 30 -- Marlin/src/lcd/tft/touch.cpp | 4 + Marlin/src/lcd/{tft => tft_io}/ili9328.h | 29 +- Marlin/src/lcd/{tft => tft_io}/ili9341.h | 18 +- Marlin/src/lcd/{tft => tft_io}/ili9488.h | 18 +- Marlin/src/lcd/{tft => tft_io}/r65105.h | 29 +- Marlin/src/lcd/tft_io/ssd1963.h | 131 ++++++ Marlin/src/lcd/{tft => tft_io}/st7735.h | 16 +- Marlin/src/lcd/{tft => tft_io}/st7789v.h | 16 +- Marlin/src/lcd/{tft => tft_io}/st7796s.h | 16 +- Marlin/src/lcd/tft_io/tft_io.cpp | 226 ++++++++++ Marlin/src/lcd/tft_io/tft_io.h | 124 ++++++ Marlin/src/lcd/touch/touch_buttons.cpp | 2 +- Marlin/src/pins/lpc1768/pins_BTT_SKR_V1_4.h | 31 +- Marlin/src/pins/lpc1768/pins_MKS_SBASE.h | 2 +- Marlin/src/pins/lpc1768/pins_RAMPS_RE_ARM.h | 2 +- .../src/pins/lpc1769/pins_BTT_SKR_E3_TURBO.h | 2 +- Marlin/src/pins/lpc1769/pins_MKS_SGEN_L_V2.h | 4 +- Marlin/src/pins/stm32f1/pins_CHITU3D_V5.h | 18 +- Marlin/src/pins/stm32f1/pins_CHITU3D_V6.h | 22 +- .../src/pins/stm32f1/pins_JGAURORA_A5S_A1.h | 2 +- Marlin/src/pins/stm32f1/pins_LONGER3D_LK.h | 11 +- Marlin/src/pins/stm32f1/pins_MKS_ROBIN.h | 4 +- Marlin/src/pins/stm32f1/pins_MKS_ROBIN_E3P.h | 1 + Marlin/src/pins/stm32f1/pins_MKS_ROBIN_NANO.h | 65 +-- .../src/pins/stm32f1/pins_MKS_ROBIN_NANO_V2.h | 18 +- Marlin/src/pins/stm32f1/pins_TRIGORILLA_PRO.h | 50 ++- Marlin/src/pins/teensy4/pins_T41U5XBB.h | 6 +- Marlin/src/pins/teensy4/pins_TEENSY41.h | 10 +- platformio.ini | 6 +- 56 files changed, 1000 insertions(+), 1476 deletions(-) rename Marlin/src/lcd/dogm/{u8g_dev_tft_320x240_upscale_from_128x64.cpp => u8g_dev_tft_upscale_from_128x64.cpp} (60%) delete mode 100644 Marlin/src/lcd/extui/lib/mks_ui/tft_fsmc.cpp delete mode 100644 Marlin/src/lcd/extui/lib/mks_ui/tft_fsmc.h delete mode 100644 Marlin/src/lcd/tft/tft_io.h rename Marlin/src/lcd/{tft => tft_io}/ili9328.h (87%) rename Marlin/src/lcd/{tft => tft_io}/ili9341.h (94%) rename Marlin/src/lcd/{tft => tft_io}/ili9488.h (93%) rename Marlin/src/lcd/{tft => tft_io}/r65105.h (87%) create mode 100644 Marlin/src/lcd/tft_io/ssd1963.h rename Marlin/src/lcd/{tft => tft_io}/st7735.h (92%) rename Marlin/src/lcd/{tft => tft_io}/st7789v.h (93%) rename Marlin/src/lcd/{tft => tft_io}/st7796s.h (93%) create mode 100644 Marlin/src/lcd/tft_io/tft_io.cpp create mode 100644 Marlin/src/lcd/tft_io/tft_io.h diff --git a/Marlin/Configuration.h b/Marlin/Configuration.h index 59f2be18c6..8f37f1e799 100644 --- a/Marlin/Configuration.h +++ b/Marlin/Configuration.h @@ -2205,43 +2205,47 @@ //=============================== Graphical TFTs ============================== //============================================================================= -// -// TFT display with optional touch screen -// Color Marlin UI with standard menu system -// -//#define TFT_320x240 -//#define TFT_320x240_SPI -//#define TFT_480x320 -//#define TFT_480x320_SPI +/** + * TFT Type - Select your Display type + * + * Available options are: + * MKS_TS35_V2_0, + * MKS_ROBIN_TFT24, MKS_ROBIN_TFT28, MKS_ROBIN_TFT32, MKS_ROBIN_TFT35, + * MKS_ROBIN_TFT43, MKS_ROBIN_TFT_V1_1R + * TFT_TRONXY_X5SA, ANYCUBIC_TFT35, LONGER_LK_TFT28 + * TFT_GENERIC + * + * For TFT_GENERIC, you need to configure these 3 options: + * Driver: TFT_DRIVER + * Current Drivers are: AUTO, ST7735, ST7789, ST7796, R61505, ILI9328, ILI9341, ILI9488 + * Resolution: TFT_WIDTH and TFT_HEIGHT + * Interface: TFT_INTERFACE_FSMC or TFT_INTERFACE_SPI + */ +//#define TFT_GENERIC -// -// Skip autodetect and force specific TFT driver -// Mandatory for SPI screens with no MISO line -// Available drivers are: ST7735, ST7789, ST7796, R61505, ILI9328, ILI9341, ILI9488 -// -//#define TFT_DRIVER AUTO +/** + * TFT UI - User Interface Selection. Enable one of the following options: + * + * TFT_CLASSIC_UI - Emulated DOGM - 128x64 Upscaled + * TFT_COLOR_UI - Marlin Default Menus, Touch Friendly, using full TFT capabilities + * TFT_LVGL_UI - A Modern UI using LVGL + * + * For LVGL_UI also copy the 'assets' folder from the build directory to the + * root of your SD card, together with the compiled firmware. + */ +//#define TFT_CLASSIC_UI +//#define TFT_COLOR_UI +//#define TFT_LVGL_UI -// -// SPI display (MKS Robin Nano V2.0, MKS Gen L V2.0) -// Upscaled 128x64 Marlin UI -// -//#define SPI_GRAPHICAL_TFT - -// -// FSMC display (MKS Robin, Alfawise U20, JGAurora A5S, REXYZ A1, etc.) -// Upscaled 128x64 Marlin UI -// -//#define FSMC_GRAPHICAL_TFT - -// -// TFT LVGL UI -// -// Using default MKS icons and fonts from: https://git.io/JJvzK -// Just copy the 'assets' folder from the build directory to the -// root of your SD card, together with the compiled firmware. -// -//#define TFT_LVGL_UI_FSMC // Robin nano v1.2 uses FSMC -//#define TFT_LVGL_UI_SPI // Robin nano v2.0 uses SPI +/** + * TFT Rotation. Set to one of the following values: + * + * TFT_ROTATE_90, TFT_ROTATE_90_MIRROR_X, TFT_ROTATE_90_MIRROR_Y, + * TFT_ROTATE_180, TFT_ROTATE_180_MIRROR_X, TFT_ROTATE_180_MIRROR_Y, + * TFT_ROTATE_270, TFT_ROTATE_270_MIRROR_X, TFT_ROTATE_270_MIRROR_Y, + * TFT_MIRROR_X, TFT_MIRROR_Y, TFT_NO_ROTATION + */ +//#define TFT_ROTATION TFT_NO_ROTATION //============================================================================= //============================ Other Controllers ============================ diff --git a/Marlin/Configuration_adv.h b/Marlin/Configuration_adv.h index db54716cde..bcacddd20d 100644 --- a/Marlin/Configuration_adv.h +++ b/Marlin/Configuration_adv.h @@ -1560,10 +1560,9 @@ #endif // -// FSMC / SPI Graphical TFT +// Classic UI Options // #if TFT_SCALED_DOGLCD - //#define GRAPHICAL_TFT_ROTATE_180 //#define TFT_MARLINUI_COLOR 0xFFFF // White //#define TFT_MARLINBG_COLOR 0x0000 // Black //#define TFT_DISABLED_COLOR 0x0003 // Almost black diff --git a/Marlin/src/HAL/LPC1768/inc/Conditionals_LCD.h b/Marlin/src/HAL/LPC1768/inc/Conditionals_LCD.h index b9bc0bf82e..32ef908d63 100644 --- a/Marlin/src/HAL/LPC1768/inc/Conditionals_LCD.h +++ b/Marlin/src/HAL/LPC1768/inc/Conditionals_LCD.h @@ -24,10 +24,3 @@ #if HAS_FSMC_TFT #error "Sorry! FSMC TFT displays are not current available for HAL/LPC1768." #endif - -// This emulated DOGM has 'touch/xpt2046', not 'tft/xpt2046' -#if ENABLED(TOUCH_SCREEN) && !HAS_GRAPHICAL_TFT - #undef TOUCH_SCREEN - #undef TOUCH_SCREEN_CALIBRATION - #define HAS_TOUCH_XPT2046 1 -#endif diff --git a/Marlin/src/HAL/LPC1768/tft/tft_spi.h b/Marlin/src/HAL/LPC1768/tft/tft_spi.h index 8d3e3127bb..4753fdbae9 100644 --- a/Marlin/src/HAL/LPC1768/tft/tft_spi.h +++ b/Marlin/src/HAL/LPC1768/tft/tft_spi.h @@ -36,7 +36,7 @@ #define DATASIZE_8BIT SSP_DATABIT_8 #define DATASIZE_16BIT SSP_DATABIT_16 -#define TFT_IO TFT_SPI +#define TFT_IO_DRIVER TFT_SPI #define DMA_MINC_ENABLE 1 #define DMA_MINC_DISABLE 0 diff --git a/Marlin/src/HAL/STM32/tft/tft_fsmc.h b/Marlin/src/HAL/STM32/tft/tft_fsmc.h index 8500fee113..cbec7613ef 100644 --- a/Marlin/src/HAL/STM32/tft/tft_fsmc.h +++ b/Marlin/src/HAL/STM32/tft/tft_fsmc.h @@ -38,7 +38,7 @@ #define DATASIZE_8BIT SPI_DATASIZE_8BIT #define DATASIZE_16BIT SPI_DATASIZE_16BIT -#define TFT_IO TFT_FSMC +#define TFT_IO_DRIVER TFT_FSMC #ifdef STM32F1xx #define __IS_DMA_ENABLED(__HANDLE__) ((__HANDLE__)->Instance->CCR & DMA_CCR_EN) diff --git a/Marlin/src/HAL/STM32/tft/tft_spi.h b/Marlin/src/HAL/STM32/tft/tft_spi.h index 1eed45a709..d477b58c00 100644 --- a/Marlin/src/HAL/STM32/tft/tft_spi.h +++ b/Marlin/src/HAL/STM32/tft/tft_spi.h @@ -38,7 +38,7 @@ #define DATASIZE_8BIT SPI_DATASIZE_8BIT #define DATASIZE_16BIT SPI_DATASIZE_16BIT -#define TFT_IO TFT_SPI +#define TFT_IO_DRIVER TFT_SPI class TFT_SPI { private: diff --git a/Marlin/src/HAL/STM32F1/inc/Conditionals_LCD.h b/Marlin/src/HAL/STM32F1/inc/Conditionals_LCD.h index 25110d7c80..f52e6fec2b 100644 --- a/Marlin/src/HAL/STM32F1/inc/Conditionals_LCD.h +++ b/Marlin/src/HAL/STM32F1/inc/Conditionals_LCD.h @@ -25,10 +25,3 @@ //#warning "SD_CHECK_AND_RETRY isn't needed with USE_USB_COMPOSITE." #undef SD_CHECK_AND_RETRY #endif - -// This emulated DOGM has 'touch/xpt2046', not 'tft/xpt2046' -#if ENABLED(TOUCH_SCREEN) && !HAS_GRAPHICAL_TFT - #undef TOUCH_SCREEN - #undef TOUCH_SCREEN_CALIBRATION - #define HAS_TOUCH_XPT2046 1 -#endif diff --git a/Marlin/src/HAL/STM32F1/tft/tft_fsmc.cpp b/Marlin/src/HAL/STM32F1/tft/tft_fsmc.cpp index 008301d9bc..5b52fb416f 100644 --- a/Marlin/src/HAL/STM32F1/tft/tft_fsmc.cpp +++ b/Marlin/src/HAL/STM32F1/tft/tft_fsmc.cpp @@ -89,25 +89,12 @@ void TFT_FSMC::Init() { uint8_t cs = FSMC_CS_PIN, rs = FSMC_RS_PIN; uint32_t controllerAddress; - #if PIN_EXISTS(TFT_BACKLIGHT) - OUT_WRITE(TFT_BACKLIGHT_PIN, DISABLED(DELAYED_BACKLIGHT_INIT)); - #endif - #if ENABLED(LCD_USE_DMA_FSMC) dma_init(FSMC_DMA_DEV); dma_disable(FSMC_DMA_DEV, FSMC_DMA_CHANNEL); dma_set_priority(FSMC_DMA_DEV, FSMC_DMA_CHANNEL, DMA_PRIORITY_MEDIUM); #endif - #if PIN_EXISTS(TFT_RESET) - OUT_WRITE(TFT_RESET_PIN, HIGH); - delay(100); - #endif - - #if PIN_EXISTS(TFT_BACKLIGHT) - OUT_WRITE(TFT_BACKLIGHT_PIN, HIGH); - #endif - struct fsmc_nor_psram_reg_map* fsmcPsramRegion; if (fsmcInit) return; diff --git a/Marlin/src/HAL/STM32F1/tft/tft_fsmc.h b/Marlin/src/HAL/STM32F1/tft/tft_fsmc.h index 6fcfea8a11..11eb1ffa84 100644 --- a/Marlin/src/HAL/STM32F1/tft/tft_fsmc.h +++ b/Marlin/src/HAL/STM32F1/tft/tft_fsmc.h @@ -32,7 +32,7 @@ #define DATASIZE_8BIT DMA_SIZE_8BITS #define DATASIZE_16BIT DMA_SIZE_16BITS -#define TFT_IO TFT_FSMC +#define TFT_IO_DRIVER TFT_FSMC typedef struct { __IO uint16_t REG; diff --git a/Marlin/src/HAL/STM32F1/tft/tft_spi.h b/Marlin/src/HAL/STM32F1/tft/tft_spi.h index bb26fc21b6..da9a8e0c22 100644 --- a/Marlin/src/HAL/STM32F1/tft/tft_spi.h +++ b/Marlin/src/HAL/STM32F1/tft/tft_spi.h @@ -34,7 +34,7 @@ #define DATASIZE_8BIT DATA_SIZE_8BIT #define DATASIZE_16BIT DATA_SIZE_16BIT -#define TFT_IO TFT_SPI +#define TFT_IO_DRIVER TFT_SPI #define DMA_MINC_ENABLE 1 #define DMA_MINC_DISABLE 0 diff --git a/Marlin/src/core/macros.h b/Marlin/src/core/macros.h index 72644b195c..21bb32c4cf 100644 --- a/Marlin/src/core/macros.h +++ b/Marlin/src/core/macros.h @@ -452,6 +452,12 @@ #define HAS_ARGS(V...) _BOOL(FIRST(_END_OF_ARGUMENTS_ V)()) #define _END_OF_ARGUMENTS_() 0 + +// Simple Inline IF Macros, friendly to use in other macro definitions +#define IF(O, A, B) ((O) ? (A) : (B)) +#define IF_0(O, A) IF(O, A, 0) +#define IF_1(O, A) IF(O, A, 1) + // // REPEAT core macros. Recurse N times with ascending I. // diff --git a/Marlin/src/inc/Conditionals_LCD.h b/Marlin/src/inc/Conditionals_LCD.h index 42d82dcc10..56ce2ca5ed 100644 --- a/Marlin/src/inc/Conditionals_LCD.h +++ b/Marlin/src/inc/Conditionals_LCD.h @@ -311,13 +311,40 @@ #define IS_ULTIPANEL #endif +// Compatibility +#if ENABLED(FSMC_GRAPHICAL_TFT) + #define TFT_CLASSIC_UI + #define TFT_INTERFACE_FSMC + #define TFT_GENERIC +#elif ENABLED(SPI_GRAPHICAL_TFT) + #define TFT_CLASSIC_UI + #define TFT_INTERFACE_SPI + #define TFT_GENERIC +#elif EITHER(TFT_320x240, TFT_480x320) + #define TFT_COLOR_UI + #define TFT_INTERFACE_FSMC + #define TFT_GENERIC +#elif EITHER(TFT_320x240_SPI, TFT_480x320_SPI) + #define TFT_COLOR_UI + #define TFT_INTERFACE_SPI + #define TFT_GENERIC +#elif ENABLED(TFT_LVGL_UI_FSMC) + #define TFT_LVGL_UI + #define TFT_INTERFACE_FSMC + #define TFT_GENERIC +#elif ENABLED(TFT_LVGL_UI_SPI) + #define TFT_LVGL_UI + #define TFT_INTERFACE_SPI + #define TFT_GENERIC +#endif + // FSMC/SPI TFT Panels (LVGL) -#if EITHER(TFT_LVGL_UI_SPI, TFT_LVGL_UI_FSMC) +#if ENABLED(TFT_LVGL_UI) #define HAS_TFT_LVGL_UI 1 #endif // FSMC/SPI TFT Panels -#if EITHER(FSMC_GRAPHICAL_TFT, SPI_GRAPHICAL_TFT) +#if ENABLED(TFT_CLASSIC_UI) #define TFT_SCALED_DOGLCD 1 #endif @@ -325,32 +352,16 @@ #define DOGLCD #define IS_ULTIPANEL #define DELAYED_BACKLIGHT_INIT -#elif ENABLED(TFT_LVGL_UI_SPI) +#elif ENABLED(TFT_LVGL_UI) #define DELAYED_BACKLIGHT_INIT #endif -// FSMC/SPI TFT Panels using standard HAL/tft/tft_(fsmc|spi).h -#if ANY(TFT_320x240, TFT_480x320, TFT_LVGL_UI_FSMC, FSMC_GRAPHICAL_TFT) - #define HAS_FSMC_TFT 1 -#elif ANY(TFT_320x240_SPI, TFT_480x320_SPI, TFT_LVGL_UI_SPI, SPI_GRAPHICAL_TFT) - #define HAS_SPI_TFT 1 -#endif - // Color UI -#if ANY(TFT_320x240, TFT_480x320, TFT_320x240_SPI, TFT_480x320_SPI) +#if ENABLED(TFT_COLOR_UI) #define HAS_GRAPHICAL_TFT 1 #define IS_ULTIPANEL #endif -// Fewer lines with touch buttons on-screen -#if EITHER(TFT_320x240, TFT_320x240_SPI) - #define HAS_UI_320x240 1 - #define LCD_HEIGHT TERN(TOUCH_SCREEN, 6, 7) -#elif EITHER(TFT_480x320, TFT_480x320_SPI) - #define HAS_UI_480x320 1 - #define LCD_HEIGHT TERN(TOUCH_SCREEN, 6, 7) -#endif - /** * I2C Panels */ @@ -810,3 +821,128 @@ #ifndef EXTRUDE_MINTEMP #define EXTRUDE_MINTEMP 170 #endif + +/** + * TFT Displays + * + * Configure parameters for TFT displays: + * - TFT_DEFAULT_ORIENTATION + * - TFT_DRIVER + * - TFT_WIDTH + * - TFT_HEIGHT + * - TFT_INTERFACE_(SPI|FSMC) + * - TFT_COLOR + * - GRAPHICAL_TFT_UPSCALE + */ +#if ENABLED(MKS_TS35_V2_0) + // Most common: ST7796 + #define TFT_DEFAULT_ORIENTATION (TFT_EXCHANGE_XY) + #define TFT_WIDTH 480 + #define TFT_HEIGHT 320 + #define TFT_INTERFACE_SPI + #define GRAPHICAL_TFT_UPSCALE 3 +#elif ENABLED(MKS_ROBIN_TFT24) + // Most common: ST7789 + #define TFT_DEFAULT_ORIENTATION (TFT_EXCHANGE_XY | TFT_INVERT_Y) + #define TFT_WIDTH 320 + #define TFT_HEIGHT 240 + #define TFT_INTERFACE_FSMC + #define GRAPHICAL_TFT_UPSCALE 2 +#elif ENABLED(MKS_ROBIN_TFT28) + // Most common: ST7789 + #define TFT_DEFAULT_ORIENTATION (TFT_EXCHANGE_XY | TFT_INVERT_Y) + #define TFT_WIDTH 320 + #define TFT_HEIGHT 240 + #define TFT_INTERFACE_FSMC + #define GRAPHICAL_TFT_UPSCALE 2 +#elif ENABLED(MKS_ROBIN_TFT32) + // Most common: ST7789 + #define TFT_DEFAULT_ORIENTATION (TFT_EXCHANGE_XY | TFT_INVERT_Y) + #define TFT_WIDTH 320 + #define TFT_HEIGHT 240 + #define TFT_INTERFACE_FSMC + #define GRAPHICAL_TFT_UPSCALE 2 +#elif ENABLED(MKS_ROBIN_TFT35) + // Most common: ILI9488 + #define TFT_DEFAULT_ORIENTATION (TFT_EXCHANGE_XY | TFT_INVERT_X | TFT_INVERT_Y) + #define TFT_WIDTH 480 + #define TFT_HEIGHT 320 + #define TFT_INTERFACE_FSMC + #define GRAPHICAL_TFT_UPSCALE 3 +#elif ENABLED(MKS_ROBIN_TFT43) + #define TFT_DEFAULT_ORIENTATION 0 + #define TFT_DRIVER SSD1963 + #define TFT_WIDTH 480 + #define TFT_HEIGHT 272 + #define TFT_INTERFACE_FSMC + #define GRAPHICAL_TFT_UPSCALE 2 +#elif ENABLED(MKS_ROBIN_TFT_V1_1R) + // ILI9328 or R61505 + #define TFT_DEFAULT_ORIENTATION (TFT_INVERT_X | TFT_INVERT_Y | TFT_EXCHANGE_XY) + #define TFT_WIDTH 320 + #define TFT_HEIGHT 240 + #define TFT_INTERFACE_FSMC + #define GRAPHICAL_TFT_UPSCALE 2 +#elif EITHER(TFT_TRONXY_X5SA, ANYCUBIC_TFT35) + #define TFT_DEFAULT_ORIENTATION (TFT_EXCHANGE_XY | TFT_INVERT_X | TFT_INVERT_Y) + #define TFT_DRIVER ILI9488 + #define TFT_WIDTH 480 + #define TFT_HEIGHT 320 + #define TFT_INTERFACE_FSMC + #define GRAPHICAL_TFT_UPSCALE 3 +#elif ENABLED(LONGER_LK_TFT28) + #define TFT_DEFAULT_ORIENTATION (TFT_EXCHANGE_XY | TFT_INVERT_X | TFT_INVERT_Y) + #define TFT_WIDTH 320 + #define TFT_HEIGHT 240 + #define TFT_INTERFACE_FSMC + #define GRAPHICAL_TFT_UPSCALE 2 +#elif ENABLED(TFT_GENERIC) + #define TFT_DEFAULT_ORIENTATION (TFT_EXCHANGE_XY | TFT_INVERT_X | TFT_INVERT_Y) +#endif + +// FSMC/SPI TFT Panels using standard HAL/tft/tft_(fsmc|spi).h +#if ENABLED(TFT_INTERFACE_FSMC) + #define HAS_FSMC_TFT 1 + #if ENABLED(TFT_CLASSIC_UI) + #define FSMC_GRAPHICAL_TFT + #elif ENABLED(TFT_LVGL_UI) + #define TFT_LVGL_UI_FSMC + #endif +#elif ENABLED(TFT_INTERFACE_SPI) + #define HAS_SPI_TFT 1 + #if ENABLED(TFT_CLASSIC_UI) + #define SPI_GRAPHICAL_TFT + #elif ENABLED(TFT_LVGL_UI) + #define TFT_LVGL_UI_SPI + #endif +#endif + +#if ENABLED(TFT_COLOR_UI) && TFT_HEIGHT == 240 + #if ENABLED(TFT_INTERFACE_SPI) + #define TFT_320x240_SPI + #elif ENABLED(TFT_INTERFACE_FSMC) + #define TFT_320x240 + #endif +#elif ENABLED(TFT_COLOR_UI) && TFT_HEIGHT == 320 + #if ENABLED(TFT_INTERFACE_SPI) + #define TFT_480x320_SPI + #elif ENABLED(TFT_INTERFACE_FSMC) + #define TFT_480x320 + #endif +#endif + +// Fewer lines with touch buttons on-screen +#if EITHER(TFT_320x240, TFT_320x240_SPI) + #define HAS_UI_320x240 1 + #define LCD_HEIGHT TERN(TOUCH_SCREEN, 6, 7) +#elif EITHER(TFT_480x320, TFT_480x320_SPI) + #define HAS_UI_480x320 1 + #define LCD_HEIGHT TERN(TOUCH_SCREEN, 6, 7) +#endif + +// This emulated DOGM has 'touch/xpt2046', not 'tft/xpt2046' +#if ENABLED(TOUCH_SCREEN) && !HAS_GRAPHICAL_TFT + #undef TOUCH_SCREEN + #undef TOUCH_SCREEN_CALIBRATION + #define HAS_TOUCH_XPT2046 1 +#endif diff --git a/Marlin/src/inc/SanityCheck.h b/Marlin/src/inc/SanityCheck.h index 59a74411ef..7acb5e70c9 100644 --- a/Marlin/src/inc/SanityCheck.h +++ b/Marlin/src/inc/SanityCheck.h @@ -447,8 +447,6 @@ #error "POWER_SUPPLY is now obsolete. Please remove it from Configuration.h." #elif defined(MKS_ROBIN_TFT) #error "MKS_ROBIN_TFT is now FSMC_GRAPHICAL_TFT. Please update your configuration." -#elif defined(TFT_LVGL_UI) - #error "TFT_LVGL_UI is now TFT_LVGL_UI_FSMC. Please update your configuration." #elif defined(SDPOWER) #error "SDPOWER is now SDPOWER_PIN. Please update your configuration and/or pins." #elif defined(STRING_SPLASH_LINE1) || defined(STRING_SPLASH_LINE2) @@ -535,6 +533,8 @@ #error "ANYCUBIC_TFT_MODEL is now ANYCUBIC_LCD_I3MEGA. Please update your Configuration.h." #elif defined(EVENT_GCODE_SD_STOP) #error "EVENT_GCODE_SD_STOP is now EVENT_GCODE_SD_ABORT. Please update your Configuration.h." +#elif defined(GRAPHICAL_TFT_ROTATE_180) + #error "GRAPHICAL_TFT_ROTATE_180 is now TFT_ROTATION set to TFT_ROTATE_180. Please update your Configuration.h." #elif defined(FIL_RUNOUT_INVERTING) #if FIL_RUNOUT_INVERTING #error "FIL_RUNOUT_INVERTING true is now FIL_RUNOUT_STATE HIGH. Please update your Configuration.h." diff --git a/Marlin/src/lcd/dogm/u8g_dev_tft_320x240_upscale_from_128x64.cpp b/Marlin/src/lcd/dogm/u8g_dev_tft_upscale_from_128x64.cpp similarity index 60% rename from Marlin/src/lcd/dogm/u8g_dev_tft_320x240_upscale_from_128x64.cpp rename to Marlin/src/lcd/dogm/u8g_dev_tft_upscale_from_128x64.cpp index 0f53e45a27..d18b617987 100644 --- a/Marlin/src/lcd/dogm/u8g_dev_tft_320x240_upscale_from_128x64.cpp +++ b/Marlin/src/lcd/dogm/u8g_dev_tft_upscale_from_128x64.cpp @@ -66,12 +66,7 @@ #define HAS_LCD_IO 1 #endif -#if ENABLED(SPI_GRAPHICAL_TFT) - #include HAL_PATH(../../HAL, tft/tft_spi.h) -#elif ENABLED(FSMC_GRAPHICAL_TFT) - #include HAL_PATH(../../HAL, tft/tft_fsmc.h) -#endif - +#include "../tft_io/tft_io.h" TFT_IO tftio; #define WIDTH LCD_PIXEL_WIDTH @@ -132,299 +127,10 @@ TFT_IO tftio; #define TFT_BTOKMENU_COLOR COLOR_RED #endif -static uint32_t lcd_id = 0; - -#define ST7789V_CASET 0x2A /* Column address register */ -#define ST7789V_RASET 0x2B /* Row address register */ -#define ST7789V_WRITE_RAM 0x2C /* Write data to GRAM */ - - -/* Mind the mess: with landscape screen orientation 'Horizontal' is Y and 'Vertical' is X */ -#define ILI9328_HASET 0x20 /* Horizontal GRAM address register (0-255) */ -#define ILI9328_VASET 0x21 /* Vertical GRAM address register (0-511)*/ -#define ILI9328_WRITE_RAM 0x22 /* Write data to GRAM */ - -#define ILI9328_HASTART 0x50 /* Horizontal address start position (0-255) */ -#define ILI9328_HAEND 0x51 /* Horizontal address end position (0-255) */ -#define ILI9328_VASTART 0x52 /* Vertical address start position (0-511) */ -#define ILI9328_VAEND 0x53 /* Vertical address end position (0-511) */ - -static void setWindow_ili9328(u8g_t *u8g, u8g_dev_t *dev, uint16_t Xmin, uint16_t Ymin, uint16_t Xmax, uint16_t Ymax) { - #if HAS_LCD_IO - tftio.DataTransferBegin(DATASIZE_8BIT); - #define IO_REG_DATA(R,D) do { tftio.WriteReg(R); tftio.WriteData(D); }while(0) - #else - #define IO_REG_DATA(R,D) do { u8g_WriteByte(u8g, dev, R); u8g_WriteSequence(u8g, dev, 2, (uint8_t *)&D); }while(0) - #endif - - #if NONE(LCD_USE_DMA_FSMC, LCD_USE_DMA_SPI) - u8g_SetAddress(u8g, dev, 0); - #endif - - IO_REG_DATA(ILI9328_HASTART, Ymin); - IO_REG_DATA(ILI9328_HAEND, Ymax); - IO_REG_DATA(ILI9328_VASTART, Xmin); - IO_REG_DATA(ILI9328_VAEND, Xmax); - - IO_REG_DATA(ILI9328_HASET, Ymin); - IO_REG_DATA(ILI9328_VASET, Xmin); - - #if HAS_LCD_IO - tftio.WriteReg(ILI9328_WRITE_RAM); - tftio.DataTransferEnd(); - #else - u8g_WriteByte(u8g, dev, ILI9328_WRITE_RAM); - u8g_SetAddress(u8g, dev, 1); - #endif +static void setWindow(u8g_t *u8g, u8g_dev_t *dev, uint16_t Xmin, uint16_t Ymin, uint16_t Xmax, uint16_t Ymax) { + tftio.set_window(Xmin, Ymin, Xmax, Ymax); } -static void setWindow_st7789v(u8g_t *u8g, u8g_dev_t *dev, uint16_t Xmin, uint16_t Ymin, uint16_t Xmax, uint16_t Ymax) { - #if HAS_LCD_IO - tftio.DataTransferBegin(DATASIZE_8BIT); - tftio.WriteReg(ST7789V_CASET); - tftio.WriteData((Xmin >> 8) & 0xFF); - tftio.WriteData(Xmin & 0xFF); - tftio.WriteData((Xmax >> 8) & 0xFF); - tftio.WriteData(Xmax & 0xFF); - - tftio.WriteReg(ST7789V_RASET); - tftio.WriteData((Ymin >> 8) & 0xFF); - tftio.WriteData(Ymin & 0xFF); - tftio.WriteData((Ymax >> 8) & 0xFF); - tftio.WriteData(Ymax & 0xFF); - - tftio.WriteReg(ST7789V_WRITE_RAM); - tftio.DataTransferEnd(); - #else - u8g_SetAddress(u8g, dev, 0); u8g_WriteByte(u8g, dev, ST7789V_CASET); u8g_SetAddress(u8g, dev, 1); - u8g_WriteByte(u8g, dev, (Xmin >> 8) & 0xFF); - u8g_WriteByte(u8g, dev, Xmin & 0xFF); - u8g_WriteByte(u8g, dev, (Xmax >> 8) & 0xFF); - u8g_WriteByte(u8g, dev, Xmax & 0xFF); - - u8g_SetAddress(u8g, dev, 0); u8g_WriteByte(u8g, dev, ST7789V_RASET); u8g_SetAddress(u8g, dev, 1); - u8g_WriteByte(u8g, dev, (Ymin >> 8) & 0xFF); - u8g_WriteByte(u8g, dev, Ymin & 0xFF); - u8g_WriteByte(u8g, dev, (Ymax >> 8) & 0xFF); - u8g_WriteByte(u8g, dev, Ymax & 0xFF); - - u8g_SetAddress(u8g, dev, 0); u8g_WriteByte(u8g, dev, ST7789V_WRITE_RAM); u8g_SetAddress(u8g, dev, 1); - #endif -} - -static void setWindow_none(u8g_t *u8g, u8g_dev_t *dev, uint16_t Xmin, uint16_t Ymin, uint16_t Xmax, uint16_t Ymax) {} -void (*setWindow)(u8g_t *u8g, u8g_dev_t *dev, uint16_t Xmin, uint16_t Ymin, uint16_t Xmax, uint16_t Ymax) = setWindow_none; - -#define ESC_REG(x) 0xFFFF, 0x00FF & (uint16_t)x -#define ESC_DELAY(x) 0xFFFF, 0x8000 | (x & 0x7FFF) -#define ESC_END 0xFFFF, 0x7FFF -#define ESC_FFFF 0xFFFF, 0xFFFF - -#if HAS_LCD_IO - void writeEscSequence(const uint16_t *sequence) { - uint16_t data; - for (;;) { - data = *sequence++; - if (data != 0xFFFF) { - tftio.WriteData(data); - continue; - } - data = *sequence++; - if (data == 0x7FFF) return; - if (data == 0xFFFF) { - tftio.WriteData(data); - } else if (data & 0x8000) { - delay(data & 0x7FFF); - } else if ((data & 0xFF00) == 0) { - tftio.WriteReg(data); - } - } - } - #define WRITE_ESC_SEQUENCE(V) writeEscSequence(V) - #define WRITE_ESC_SEQUENCE16(V) writeEscSequence(V) -#else - void writeEscSequence8(u8g_t *u8g, u8g_dev_t *dev, const uint16_t *sequence) { - uint16_t data; - u8g_SetAddress(u8g, dev, 1); - for (;;) { - data = *sequence++; - if (data != 0xFFFF) { - u8g_WriteByte(u8g, dev, data & 0xFF); - continue; - } - data = *sequence++; - if (data == 0x7FFF) return; - if (data == 0xFFFF) { - u8g_WriteByte(u8g, dev, data & 0xFF); - } else if (data & 0x8000) { - delay(data & 0x7FFF); - } else if ((data & 0xFF00) == 0) { - u8g_SetAddress(u8g, dev, 0); - u8g_WriteByte(u8g, dev, data & 0xFF); - u8g_SetAddress(u8g, dev, 1); - } - } - } - - #define WRITE_ESC_SEQUENCE(V) writeEscSequence8(u8g, dev, V) - - void writeEscSequence16(u8g_t *u8g, u8g_dev_t *dev, const uint16_t *sequence) { - uint16_t data; - u8g_SetAddress(u8g, dev, 0); - for (;;) { - data = *sequence++; - if (data != 0xFFFF) { - u8g_WriteSequence(u8g, dev, 2, (uint8_t *)&data); - continue; - } - data = *sequence++; - if (data == 0x7FFF) return; - if (data == 0xFFFF) { - u8g_WriteSequence(u8g, dev, 2, (uint8_t *)&data); - } else if (data & 0x8000) { - delay(data & 0x7FFF); - } else if ((data & 0xFF00) == 0) { - u8g_WriteByte(u8g, dev, data & 0xFF); - } - } - u8g_SetAddress(u8g, dev, 1); - } - - #define WRITE_ESC_SEQUENCE16(V) writeEscSequence16(u8g, dev, V) -#endif - -static const uint16_t st7789v_init[] = { - ESC_REG(0x0010), ESC_DELAY(10), - ESC_REG(0x0001), ESC_DELAY(200), - ESC_REG(0x0011), ESC_DELAY(120), - ESC_REG(0x0036), TERN(GRAPHICAL_TFT_ROTATE_180, 0x0060, 0x00A0), - ESC_REG(0x003A), 0x0055, - ESC_REG(0x002A), 0x0000, 0x0000, 0x0001, 0x003F, - ESC_REG(0x002B), 0x0000, 0x0000, 0x0000, 0x00EF, - ESC_REG(0x00B2), 0x000C, 0x000C, 0x0000, 0x0033, 0x0033, - ESC_REG(0x00B7), 0x0035, - ESC_REG(0x00BB), 0x001F, - ESC_REG(0x00C0), 0x002C, - ESC_REG(0x00C2), 0x0001, 0x00C3, - ESC_REG(0x00C4), 0x0020, - ESC_REG(0x00C6), 0x000F, - ESC_REG(0x00D0), 0x00A4, 0x00A1, - ESC_REG(0x0029), - ESC_REG(0x0011), - ESC_END -}; - -static const uint16_t ili9328_init[] = { - ESC_REG(0x0001), 0x0100, - ESC_REG(0x0002), 0x0400, - ESC_REG(0x0003), 0x1038, - ESC_REG(0x0004), 0x0000, - ESC_REG(0x0008), 0x0202, - ESC_REG(0x0009), 0x0000, - ESC_REG(0x000A), 0x0000, - ESC_REG(0x000C), 0x0000, - ESC_REG(0x000D), 0x0000, - ESC_REG(0x000F), 0x0000, - ESC_REG(0x0010), 0x0000, - ESC_REG(0x0011), 0x0007, - ESC_REG(0x0012), 0x0000, - ESC_REG(0x0013), 0x0000, - ESC_REG(0x0007), 0x0001, - ESC_DELAY(200), - ESC_REG(0x0010), 0x1690, - ESC_REG(0x0011), 0x0227, - ESC_DELAY(50), - ESC_REG(0x0012), 0x008C, - ESC_DELAY(50), - ESC_REG(0x0013), 0x1500, - ESC_REG(0x0029), 0x0004, - ESC_REG(0x002B), 0x000D, - ESC_DELAY(50), - ESC_REG(0x0050), 0x0000, - ESC_REG(0x0051), 0x00EF, - ESC_REG(0x0052), 0x0000, - ESC_REG(0x0053), 0x013F, - ESC_REG(0x0020), 0x0000, - ESC_REG(0x0021), 0x0000, - ESC_REG(0x0060), 0x2700, - ESC_REG(0x0061), 0x0001, - ESC_REG(0x006A), 0x0000, - ESC_REG(0x0080), 0x0000, - ESC_REG(0x0081), 0x0000, - ESC_REG(0x0082), 0x0000, - ESC_REG(0x0083), 0x0000, - ESC_REG(0x0084), 0x0000, - ESC_REG(0x0085), 0x0000, - ESC_REG(0x0090), 0x0010, - ESC_REG(0x0092), 0x0600, - ESC_REG(0x0007), 0x0133, - ESC_REG(0x0022), - ESC_END -}; - -static const uint16_t ili9341_init[] = { - ESC_REG(0x0010), ESC_DELAY(10), - ESC_REG(0x0001), ESC_DELAY(200), - ESC_REG(0x0036), TERN(GRAPHICAL_TFT_ROTATE_180, 0x0028, 0x00E8), - ESC_REG(0x003A), 0x0055, - ESC_REG(0x002A), 0x0000, 0x0000, 0x0001, 0x003F, - ESC_REG(0x002B), 0x0000, 0x0000, 0x0000, 0x00EF, - ESC_REG(0x00C5), 0x003E, 0x0028, - ESC_REG(0x00C7), 0x0086, - ESC_REG(0x00B1), 0x0000, 0x0018, - ESC_REG(0x00C0), 0x0023, - ESC_REG(0x00C1), 0x0010, - ESC_REG(0x0029), - ESC_REG(0x0011), - ESC_DELAY(100), - ESC_END -}; - -static const uint16_t ili9488_init[] = { - ESC_REG(0x00E0), 0x0000, 0x0007, 0x000F, 0x000D, 0x001B, 0x000A, 0x003C, 0x0078, 0x004A, 0x0007, 0x000E, 0x0009, 0x001B, 0x001E, 0x000F, - ESC_REG(0x00E1), 0x0000, 0x0022, 0x0024, 0x0006, 0x0012, 0x0007, 0x0036, 0x0047, 0x0047, 0x0006, 0x000A, 0x0007, 0x0030, 0x0037, 0x000F, - ESC_REG(0x00C0), 0x0010, 0x0010, - ESC_REG(0x00C1), 0x0041, - ESC_REG(0x00C5), 0x0000, 0x0022, 0x0080, - ESC_REG(0x0036), TERN(GRAPHICAL_TFT_ROTATE_180, 0x00A8, 0x0068), - ESC_REG(0x003A), 0x0055, - ESC_REG(0x00B0), 0x0000, - ESC_REG(0x00B1), 0x00B0, 0x0011, - ESC_REG(0x00B4), 0x0002, - ESC_REG(0x00B6), 0x0002, 0x0042, - ESC_REG(0x00B7), 0x00C6, - ESC_REG(0x00E9), 0x0000, - ESC_REG(0x00F0), 0x00A9, 0x0051, 0x002C, 0x0082, - ESC_REG(0x0029), - ESC_REG(0x0011), - ESC_DELAY(100), - ESC_END -}; - -static const uint16_t st7796_init[] = { - ESC_REG(0x0010), ESC_DELAY(120), - ESC_REG(0x0001), ESC_DELAY(120), - ESC_REG(0x0011), ESC_DELAY(120), - ESC_REG(0x00F0), 0x00C3, - ESC_REG(0x00F0), 0x0096, - ESC_REG(0x0036), TERN(GRAPHICAL_TFT_ROTATE_180, 0x00E8, 0x0028), - ESC_REG(0x003A), 0x0055, - ESC_REG(0x00B4), 0x0001, - ESC_REG(0x00B7), 0x00C6, - ESC_REG(0x00E8), 0x0040, 0x008A, 0x0000, 0x0000, 0x0029, 0x0019, 0x00A5, 0x0033, - ESC_REG(0x00C1), 0x0006, - ESC_REG(0x00C2), 0x00A7, - ESC_REG(0x00C5), 0x0018, - ESC_REG(0x00E0), 0x00F0, 0x0009, 0x000B, 0x0006, 0x0004, 0x0015, 0x002F, 0x0054, 0x0042, 0x003C, 0x0017, 0x0014, 0x0018, 0x001B, - ESC_REG(0x00E1), 0x00F0, 0x0009, 0x000B, 0x0006, 0x0004, 0x0003, 0x002D, 0x0043, 0x0042, 0x003B, 0x0016, 0x0014, 0x0017, 0x001B, - ESC_REG(0x00F0), 0x003C, - ESC_REG(0x00F0), 0x0069, ESC_DELAY(120), - ESC_REG(0x0029), - ESC_REG(0x0011), - ESC_DELAY(100), - ESC_END -}; - #if HAS_TOUCH_XPT2046 static const uint8_t buttonD[] = { @@ -640,43 +346,9 @@ uint8_t u8g_dev_tft_320x240_upscale_from_128x64_fn(u8g_t *u8g, u8g_dev_t *dev, u switch (msg) { case U8G_DEV_MSG_INIT: - dev->com_fn(u8g, U8G_COM_MSG_INIT, U8G_SPI_CLK_CYCLE_NONE, &lcd_id); - tftio.DataTransferBegin(DATASIZE_8BIT); - switch (lcd_id & 0xFFFF) { - case 0x8552: // ST7789V - WRITE_ESC_SEQUENCE(st7789v_init); - setWindow = setWindow_st7789v; - break; - case 0x9328: // ILI9328 - WRITE_ESC_SEQUENCE16(ili9328_init); - setWindow = setWindow_ili9328; - break; - case 0x9341: // ILI9341 - WRITE_ESC_SEQUENCE(ili9341_init); - setWindow = setWindow_st7789v; - break; - case 0x8066: // Anycubic / TronXY TFTs (480x320) - WRITE_ESC_SEQUENCE(ili9488_init); - setWindow = setWindow_st7789v; - break; - case 0x7796: - WRITE_ESC_SEQUENCE(st7796_init); - setWindow = setWindow_st7789v; - break; - case 0x9488: - WRITE_ESC_SEQUENCE(ili9488_init); - setWindow = setWindow_st7789v; - case 0x0404: // No connected display on FSMC - lcd_id = 0; - return 0; - case 0xFFFF: // No connected display on SPI - lcd_id = 0; - return 0; - default: - setWindow = (lcd_id & 0xFF000000) ? setWindow_st7789v : setWindow_ili9328; - break; - } - tftio.DataTransferEnd(); + dev->com_fn(u8g, U8G_COM_MSG_INIT, U8G_SPI_CLK_CYCLE_NONE, NULL); + tftio.Init(); + tftio.InitTFT(); if (preinit) { preinit = false; @@ -771,14 +443,7 @@ uint8_t u8g_com_hal_tft_fn(u8g_t *u8g, uint8_t msg, uint8_t arg_val, void *arg_p case U8G_COM_MSG_STOP: break; case U8G_COM_MSG_INIT: u8g_SetPIOutput(u8g, U8G_PI_RESET); - u8g_Delay(50); - - tftio.Init(); - - if (arg_ptr) { - *((uint32_t *)arg_ptr) = tftio.GetID(); - } isCommand = 0; break; diff --git a/Marlin/src/lcd/extui/lib/mks_ui/SPI_TFT.cpp b/Marlin/src/lcd/extui/lib/mks_ui/SPI_TFT.cpp index 351d033d01..394ce48075 100644 --- a/Marlin/src/lcd/extui/lib/mks_ui/SPI_TFT.cpp +++ b/Marlin/src/lcd/extui/lib/mks_ui/SPI_TFT.cpp @@ -22,7 +22,7 @@ #include "../../../../inc/MarlinConfigPre.h" -#if ENABLED(TFT_LVGL_UI_SPI) +#if HAS_TFT_LVGL_UI #include "SPI_TFT.h" #include "pic_manager.h" @@ -32,6 +32,8 @@ #include +#include "draw_ui.h" + TFT SPI_TFT; // use SPI1 for the spi tft. @@ -39,142 +41,48 @@ void TFT::spi_init(uint8_t spiRate) { tftio.Init(); } -void TFT::LCD_WR_REG(uint8_t cmd) { - tftio.WriteReg(cmd); -} - -void TFT::LCD_WR_DATA(uint8_t data) { - tftio.WriteData(data); -} - void TFT::SetPoint(uint16_t x, uint16_t y, uint16_t point) { if ((x > 480) || (y > 320)) return; - SetWindows(x, y, 1, 1); + setWindow(x, y, 1, 1); tftio.WriteMultiple(point, (uint16_t)1); } -void TFT::SetWindows(uint16_t x, uint16_t y, uint16_t with, uint16_t height) { - tftio.DataTransferBegin(DATASIZE_8BIT); - - LCD_WR_REG(0x2A); - LCD_WR_DATA(x >> 8); - LCD_WR_DATA(x); - LCD_WR_DATA((x + with - 1) >> 8); - LCD_WR_DATA((x + with - 1)); - - LCD_WR_REG(0x2B); - LCD_WR_DATA(y >> 8); - LCD_WR_DATA(y); - LCD_WR_DATA((y + height - 1) >> 8); - LCD_WR_DATA(y + height - 1); - - LCD_WR_REG(0X2C); - - tftio.DataTransferEnd(); +void TFT::setWindow(uint16_t x, uint16_t y, uint16_t with, uint16_t height) { + tftio.set_window(x, y, (x + with - 1), (y + height - 1)); } void TFT::LCD_init() { - TFT_BLK_L; - TFT_RST_H; - delay(150); - TFT_RST_L; - delay(150); - TFT_RST_H; - - tftio.DataTransferBegin(DATASIZE_8BIT); - - delay(120); - LCD_WR_REG(0x11); - delay(120); - - LCD_WR_REG(0xF0); - LCD_WR_DATA(0xC3); - LCD_WR_REG(0xF0); - LCD_WR_DATA(0x96); - - LCD_WR_REG(0x36); - LCD_WR_DATA(0x28 + TERN0(GRAPHICAL_TFT_ROTATE_180, 0x80)); - LCD_WR_REG(0x3A); - LCD_WR_DATA(0x55); - - LCD_WR_REG(0xB4); - LCD_WR_DATA(0x01); - LCD_WR_REG(0xB7); - LCD_WR_DATA(0xC6); - LCD_WR_REG(0xE8); - LCD_WR_DATA(0x40); - LCD_WR_DATA(0x8A); - LCD_WR_DATA(0x00); - LCD_WR_DATA(0x00); - LCD_WR_DATA(0x29); - LCD_WR_DATA(0x19); - LCD_WR_DATA(0xA5); - LCD_WR_DATA(0x33); - LCD_WR_REG(0xC1); - LCD_WR_DATA(0x06); - LCD_WR_REG(0xC2); - LCD_WR_DATA(0xA7); - LCD_WR_REG(0xC5); - LCD_WR_DATA(0x18); - LCD_WR_REG(0xE0); // Positive Voltage Gamma Control - LCD_WR_DATA(0xF0); - LCD_WR_DATA(0x09); - LCD_WR_DATA(0x0B); - LCD_WR_DATA(0x06); - LCD_WR_DATA(0x04); - LCD_WR_DATA(0x15); - LCD_WR_DATA(0x2F); - LCD_WR_DATA(0x54); - LCD_WR_DATA(0x42); - LCD_WR_DATA(0x3C); - LCD_WR_DATA(0x17); - LCD_WR_DATA(0x14); - LCD_WR_DATA(0x18); - LCD_WR_DATA(0x1B); - LCD_WR_REG(0xE1); // Negative Voltage Gamma Control - LCD_WR_DATA(0xF0); - LCD_WR_DATA(0x09); - LCD_WR_DATA(0x0B); - LCD_WR_DATA(0x06); - LCD_WR_DATA(0x04); - LCD_WR_DATA(0x03); - LCD_WR_DATA(0x2D); - LCD_WR_DATA(0x43); - LCD_WR_DATA(0x42); - LCD_WR_DATA(0x3B); - LCD_WR_DATA(0x16); - LCD_WR_DATA(0x14); - LCD_WR_DATA(0x17); - LCD_WR_DATA(0x1B); - LCD_WR_REG(0xF0); - LCD_WR_DATA(0x3C); - LCD_WR_REG(0xF0); - LCD_WR_DATA(0x69); - delay(120); // Delay 120ms - LCD_WR_REG(0x29); // Display ON - - tftio.DataTransferEnd(); - - LCD_clear(0x0000); // + tftio.InitTFT(); + #if PIN_EXISTS(TFT_BACKLIGHT) + OUT_WRITE(TFT_BACKLIGHT_PIN, LOW); + #endif + delay(100); + LCD_clear(0x0000); LCD_Draw_Logo(); - TFT_BLK_H; - delay(2000); + #if PIN_EXISTS(TFT_BACKLIGHT) + OUT_WRITE(TFT_BACKLIGHT_PIN, HIGH); + #endif + #if HAS_LOGO_IN_FLASH + delay(2000); + #endif } void TFT::LCD_clear(uint16_t color) { - SetWindows(0, 0, (TFT_WIDTH) - 1, (TFT_HEIGHT) - 1); + setWindow(0, 0, (TFT_WIDTH), (TFT_HEIGHT)); tftio.WriteMultiple(color, (uint32_t)(TFT_WIDTH) * (TFT_HEIGHT)); } extern unsigned char bmp_public_buf[17 * 1024]; void TFT::LCD_Draw_Logo() { - SetWindows(0, 0, TFT_WIDTH, TFT_HEIGHT); - for (uint16_t i = 0; i < (TFT_HEIGHT); i ++) { - Pic_Logo_Read((uint8_t *)"", (uint8_t *)bmp_public_buf, (TFT_WIDTH) * 2); - tftio.WriteSequence((uint16_t *)bmp_public_buf, TFT_WIDTH); - } + #if HAS_LOGO_IN_FLASH + setWindow(0, 0, TFT_WIDTH, TFT_HEIGHT); + for (uint16_t i = 0; i < (TFT_HEIGHT); i ++) { + Pic_Logo_Read((uint8_t *)"", (uint8_t *)bmp_public_buf, (TFT_WIDTH) * 2); + tftio.WriteSequence((uint16_t *)bmp_public_buf, TFT_WIDTH); + } + #endif } -#endif // HAS_TFT_LVGL_UI_SPI +#endif // HAS_TFT_LVGL_UI diff --git a/Marlin/src/lcd/extui/lib/mks_ui/SPI_TFT.h b/Marlin/src/lcd/extui/lib/mks_ui/SPI_TFT.h index e40039fe86..696bc16974 100644 --- a/Marlin/src/lcd/extui/lib/mks_ui/SPI_TFT.h +++ b/Marlin/src/lcd/extui/lib/mks_ui/SPI_TFT.h @@ -23,29 +23,21 @@ #include "../../inc/MarlinConfigPre.h" -#if ENABLED(TFT_LVGL_UI_SPI) - #include HAL_PATH(../../HAL, tft/tft_spi.h) -#elif ENABLED(TFT_LVGL_UI_FSMC) - #include HAL_PATH(../../HAL, tft/tft_fsmc.h) -#endif +#if HAS_TFT_LVGL_UI -#define TFT_RST_H OUT_WRITE(TFT_RESET_PIN, HIGH) -#define TFT_RST_L OUT_WRITE(TFT_RESET_PIN, LOW) - -#define TFT_BLK_H OUT_WRITE(LCD_BACKLIGHT_PIN, HIGH) -#define TFT_BLK_L OUT_WRITE(LCD_BACKLIGHT_PIN, LOW) +#include "../../../tft_io/tft_io.h" class TFT { public: TFT_IO tftio; void spi_init(uint8_t spiRate); - void LCD_WR_REG(uint8_t cmd); - void LCD_WR_DATA(uint8_t data); void SetPoint(uint16_t x, uint16_t y, uint16_t point); - void SetWindows(uint16_t x, uint16_t y, uint16_t with, uint16_t height); + void setWindow(uint16_t x, uint16_t y, uint16_t with, uint16_t height); void LCD_init(); void LCD_clear(uint16_t color); void LCD_Draw_Logo(); }; extern TFT SPI_TFT; + +#endif // HAS_TFT_LVGL_UI diff --git a/Marlin/src/lcd/extui/lib/mks_ui/draw_error_message.cpp b/Marlin/src/lcd/extui/lib/mks_ui/draw_error_message.cpp index 1bcdccda41..c21ee3612c 100644 --- a/Marlin/src/lcd/extui/lib/mks_ui/draw_error_message.cpp +++ b/Marlin/src/lcd/extui/lib/mks_ui/draw_error_message.cpp @@ -23,9 +23,7 @@ #if HAS_TFT_LVGL_UI -#if ENABLED(TFT_LVGL_UI_SPI) - #include "SPI_TFT.h" -#endif +#include "SPI_TFT.h" #include "lv_conf.h" #include "draw_ui.h" @@ -77,7 +75,7 @@ void lv_draw_error_message(PGM_P const msg) { lv_task_handler(); #endif - TERN(TFT_LVGL_UI_SPI, SPI_TFT.LCD_clear, LCD_Clear)(0x0000); + SPI_TFT.LCD_clear(0x0000); if (msg) disp_string((TFT_WIDTH - strlen(msg) * 16) / 2, 100, msg, 0xFFFF, 0x0000); disp_string((TFT_WIDTH - strlen("PRINTER HALTED") * 16) / 2, 140, "PRINTER HALTED", 0xFFFF, 0x0000); disp_string((TFT_WIDTH - strlen("Please Reset") * 16) / 2, 180, "Please Reset", 0xFFFF, 0x0000); diff --git a/Marlin/src/lcd/extui/lib/mks_ui/draw_ui.cpp b/Marlin/src/lcd/extui/lib/mks_ui/draw_ui.cpp index 458620801b..d600b09a5f 100644 --- a/Marlin/src/lcd/extui/lib/mks_ui/draw_ui.cpp +++ b/Marlin/src/lcd/extui/lib/mks_ui/draw_ui.cpp @@ -23,9 +23,7 @@ #if HAS_TFT_LVGL_UI -#if ENABLED(TFT_LVGL_UI_SPI) - #include "SPI_TFT.h" -#endif +#include "SPI_TFT.h" #include "tft_lvgl_configuration.h" @@ -165,7 +163,7 @@ void gCfgItems_init() { W25QXX.SPI_FLASH_BufferWrite((uint8_t *)&custom_gcode_command[4], OTHERS_COMMAND_ADDR_4, 100); } - const byte rot = TERN0(GRAPHICAL_TFT_ROTATE_180, 0xEE); + const byte rot = (TFT_ROTATION & TFT_ROTATE_180) ? 0xEE : 0x00; if (gCfgItems.disp_rotation_180 != rot) { gCfgItems.disp_rotation_180 = rot; update_spi_flash(); @@ -655,12 +653,7 @@ char *creat_title_text() { } card.setIndex((gPicturePreviewStart + To_pre_view) + size * row + 8); - #if ENABLED(TFT_LVGL_UI_SPI) - SPI_TFT.SetWindows(xpos_pixel, ypos_pixel + row, 200, 1); - #else - LCD_setWindowArea(xpos_pixel, ypos_pixel + row, 200, 1); - LCD_WriteRAM_Prepare(); - #endif + SPI_TFT.setWindow(xpos_pixel, ypos_pixel + row, 200, 1); j = i = 0; @@ -673,20 +666,11 @@ char *creat_title_text() { } if (j >= 400) break; } - #if ENABLED(TFT_LVGL_UI_SPI) - for (i = 0; i < 400; i += 2) { - p_index = (uint16_t *)(&bmp_public_buf[i]); - if (*p_index == 0x0000) *p_index = LV_COLOR_BACKGROUND.full; - } - SPI_TFT.tftio.WriteSequence((uint16_t*)bmp_public_buf, 200); - #else - for (i = 0; i < 400;) { - p_index = (uint16_t *)(&bmp_public_buf[i]); - if (*p_index == 0x0000) *p_index = LV_COLOR_BACKGROUND.full; //gCfgItems.preview_bk_color; - LCD_IO_WriteData(*p_index); - i += 2; - } - #endif + for (i = 0; i < 400; i += 2) { + p_index = (uint16_t *)(&bmp_public_buf[i]); + if (*p_index == 0x0000) *p_index = LV_COLOR_BACKGROUND.full; + } + SPI_TFT.tftio.WriteSequence((uint16_t*)bmp_public_buf, 200); #if HAS_BAK_VIEW_IN_FLASH W25QXX.init(SPI_QUARTER_SPEED); if (row < 20) W25QXX.SPI_FLASH_SectorErase(BAK_VIEW_ADDR_TFT35 + row * 4096); @@ -768,7 +752,7 @@ char *creat_title_text() { card.setIndex((PREVIEW_LITTLE_PIC_SIZE + To_pre_view) + size * row + 8); #if ENABLED(TFT_LVGL_UI_SPI) - SPI_TFT.SetWindows(xpos_pixel, ypos_pixel + row, 200, 1); + SPI_TFT.setWindow(xpos_pixel, ypos_pixel + row, 200, 1); #else LCD_setWindowArea(xpos_pixel, ypos_pixel + row, 200, 1); LCD_WriteRAM_Prepare(); @@ -901,34 +885,9 @@ char *creat_title_text() { default_view_Read(bmp_public_buf, DEFAULT_VIEW_MAX_SIZE / 10); // 8k #endif - #if ENABLED(TFT_LVGL_UI_SPI) - SPI_TFT.SetWindows(xpos_pixel, y_off * 20 + ypos_pixel, 200, 20); // 200*200 - SPI_TFT.tftio.WriteSequence((uint16_t*)(bmp_public_buf), DEFAULT_VIEW_MAX_SIZE / 20); - #else - int x_off = 0; - uint16_t temp_p; - int i = 0; - uint16_t *p_index; - LCD_setWindowArea(xpos_pixel, y_off * 20 + ypos_pixel, 200, 20); // 200*200 + SPI_TFT.setWindow(xpos_pixel, y_off * 20 + ypos_pixel, 200, 20); // 200*200 + SPI_TFT.tftio.WriteSequence((uint16_t*)(bmp_public_buf), DEFAULT_VIEW_MAX_SIZE / 20); - LCD_WriteRAM_Prepare(); - - for (int _y = y_off * 20; _y < (y_off + 1) * 20; _y++) { - for (x_off = 0; x_off < 200; x_off++) { - if (sel == 1) { - temp_p = (uint16_t)(bmp_public_buf[i] | bmp_public_buf[i + 1] << 8); - p_index = &temp_p; - } - else { - p_index = (uint16_t *)(&bmp_public_buf[i]); - } - if (*p_index == 0x0000) *p_index = LV_COLOR_BACKGROUND.full; //gCfgItems.preview_bk_color; - LCD_IO_WriteData(*p_index); - i += 2; - } - if (i >= 8000) break; - } - #endif // TFT_LVGL_UI_SPI y_off++; } W25QXX.init(SPI_QUARTER_SPEED); diff --git a/Marlin/src/lcd/extui/lib/mks_ui/mks_hardware_test.cpp b/Marlin/src/lcd/extui/lib/mks_ui/mks_hardware_test.cpp index eeb6bae706..bc329aa82b 100644 --- a/Marlin/src/lcd/extui/lib/mks_ui/mks_hardware_test.cpp +++ b/Marlin/src/lcd/extui/lib/mks_ui/mks_hardware_test.cpp @@ -23,9 +23,7 @@ #if HAS_TFT_LVGL_UI -#if ENABLED(TFT_LVGL_UI_SPI) - #include "SPI_TFT.h" -#endif +#include "SPI_TFT.h" #include "tft_lvgl_configuration.h" #include "draw_ready_print.h" @@ -626,10 +624,8 @@ static const uint16_t ASCII_Table_16x24[] PROGMEM = { void disp_char_1624(uint16_t x, uint16_t y, uint8_t c, uint16_t charColor, uint16_t bkColor) { for (uint16_t i = 0; i < 24; i++) { const uint16_t tmp_char = pgm_read_word(&ASCII_Table_16x24[((c - 0x20) * 24) + i]); - for (uint16_t j = 0; j < 16; j++) { - TERN(TFT_LVGL_UI_SPI, SPI_TFT.SetPoint, tft_set_point) - (x + j, y + i, ((tmp_char >> j) & 0x01) ? charColor : bkColor); - } + for (uint16_t j = 0; j < 16; j++) + SPI_TFT.SetPoint(x + j, y + i, ((tmp_char >> j) & 0x01) ? charColor : bkColor); } } @@ -643,7 +639,7 @@ void disp_string(uint16_t x, uint16_t y, const char * string, uint16_t charColor //static lv_obj_t * scr_test; void disp_assets_update() { - TERN(TFT_LVGL_UI_SPI,, LCD_Clear(0x0000)); + SPI_TFT.LCD_clear(0x0000); disp_string(100, 140, "Assets Updating...", 0xFFFF, 0x0000); } diff --git a/Marlin/src/lcd/extui/lib/mks_ui/tft_fsmc.cpp b/Marlin/src/lcd/extui/lib/mks_ui/tft_fsmc.cpp deleted file mode 100644 index 62967b9d80..0000000000 --- a/Marlin/src/lcd/extui/lib/mks_ui/tft_fsmc.cpp +++ /dev/null @@ -1,60 +0,0 @@ -/** - * Marlin 3D Printer Firmware - * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] - * - * Based on Sprinter and grbl. - * Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - * - */ - -#include "../../../../inc/MarlinConfig.h" - -#if ENABLED(TFT_LVGL_UI_FSMC) - -#include HAL_PATH(../../HAL, tft/tft_fsmc.h) -TFT_IO tftio; - -void LCD_IO_Init(uint8_t cs, uint8_t rs); -void LCD_IO_WriteData(uint16_t RegValue); -void LCD_IO_WriteReg(uint16_t Reg); -#ifdef LCD_USE_DMA_FSMC - void LCD_IO_WriteMultiple(uint16_t data, uint32_t count); - void LCD_IO_WriteSequence(uint16_t *data, uint16_t length); -#endif - -void LCD_IO_Init(uint8_t cs, uint8_t rs) { - tftio.Init(); -} - -void LCD_IO_WriteData(uint16_t RegValue) { - tftio.WriteData(RegValue); -} - -void LCD_IO_WriteReg(uint16_t Reg) { - tftio.WriteReg(Reg); -} - -#ifdef LCD_USE_DMA_FSMC - void LCD_IO_WriteMultiple(uint16_t color, uint32_t count) { - tftio.WriteMultiple(color, count); - } - - void LCD_IO_WriteSequence(uint16_t *data, uint16_t length) { - tftio.WriteSequence(data, length); - } -#endif // LCD_USE_DMA_FSMC - -#endif // HAS_TFT_LVGL_UI diff --git a/Marlin/src/lcd/extui/lib/mks_ui/tft_fsmc.h b/Marlin/src/lcd/extui/lib/mks_ui/tft_fsmc.h deleted file mode 100644 index b2e19d66f8..0000000000 --- a/Marlin/src/lcd/extui/lib/mks_ui/tft_fsmc.h +++ /dev/null @@ -1,30 +0,0 @@ -/** - * Marlin 3D Printer Firmware - * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] - * - * Based on Sprinter and grbl. - * Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - * - */ -#pragma once - -#ifdef __cplusplus - extern "C" { /* C-declarations for C++ */ -#endif - -#ifdef __cplusplus - } /* C-declarations for C++ */ -#endif diff --git a/Marlin/src/lcd/extui/lib/mks_ui/tft_lvgl_configuration.cpp b/Marlin/src/lcd/extui/lib/mks_ui/tft_lvgl_configuration.cpp index 3f8110feb4..ecd4eb482a 100644 --- a/Marlin/src/lcd/extui/lib/mks_ui/tft_lvgl_configuration.cpp +++ b/Marlin/src/lcd/extui/lib/mks_ui/tft_lvgl_configuration.cpp @@ -29,9 +29,7 @@ #if HAS_TFT_LVGL_UI -#if ENABLED(TFT_LVGL_UI_SPI) - #include "SPI_TFT.h" -#endif +#include "SPI_TFT.h" #include "tft_lvgl_configuration.h" #include "draw_ready_print.h" @@ -74,24 +72,6 @@ lv_group_t* g; uint16_t DeviceCode = 0x9488; extern uint8_t sel_id; -#define SetCs -#define ClrCs - -#define HDP 799 // Horizontal Display Period -#define HT 1000 // Horizontal Total -#define HPS 51 // LLINE Pulse Start Position -#define LPS 3 // Horizontal Display Period Start Position -#define HPW 8 // LLINE Pulse Width - -#define VDP 479 // Vertical Display Period -#define VT 530 // Vertical Total -#define VPS 24 // LFRAME Pulse Start Position -#define FPS 23 // Vertical Display Period Start Positio -#define VPW 3 // LFRAME Pulse Width - -#define MAX_HZ_POSX HDP+1 -#define MAX_HZ_POSY VDP+1 - extern uint8_t gcode_preview_over, flash_preview_begin, default_preview_flg; uint8_t bmp_public_buf[17 * 1024]; @@ -125,317 +105,7 @@ void SysTick_Callback() { } } -#if DISABLED(TFT_LVGL_UI_SPI) - - extern void LCD_IO_Init(uint8_t cs, uint8_t rs); - extern void LCD_IO_WriteData(uint16_t RegValue); - extern void LCD_IO_WriteReg(uint16_t Reg); - - extern void LCD_IO_WriteMultiple(uint16_t color, uint32_t count); - void tft_set_cursor(uint16_t x, uint16_t y) { - LCD_IO_WriteReg(0x002A); - LCD_IO_WriteData(x >> 8); - LCD_IO_WriteData(x & 0x00FF); - LCD_IO_WriteData(x >> 8); - LCD_IO_WriteData(x & 0x00FF); - //ILI9488_WriteData(0x01); - //ILI9488_WriteData(0xDF); - LCD_IO_WriteReg(0x002B); - LCD_IO_WriteData(y >> 8); - LCD_IO_WriteData(y & 0x00FF); - LCD_IO_WriteData(y >> 8); - LCD_IO_WriteData(y & 0x00FF); - //ILI9488_WriteData(0x01); - //ILI9488_WriteData(0x3F); - } - - void LCD_WriteRAM_Prepare(void) { - #if 0 - switch (DeviceCode) { - case 0x9325: case 0x9328: case 0x8989: { - ClrCs - LCD->LCD_REG = R34; - SetCs - } break; - default: LCD_WrtReg(0x002C); - } - #else - LCD_IO_WriteReg(0x002C); - #endif - } - - void tft_set_point(uint16_t x, uint16_t y, uint16_t point) { - //if (DeviceCode == 0x9488) { - if (x > (TFT_WIDTH) || y > (TFT_HEIGHT)) return; - //} - tft_set_cursor(x, y); - - LCD_WriteRAM_Prepare(); - //LCD_WriteRAM(point); - LCD_IO_WriteData(point); - } - - void LCD_WriteReg(uint16_t LCD_Reg, uint16_t LCD_RegValue) { - /* Write 16-bit Index, then Write Reg */ - ClrCs - LCD_IO_WriteReg(LCD_Reg); - /* Write 16-bit Reg */ - LCD_IO_WriteData(LCD_RegValue); - SetCs - } - - void LCD_setWindowArea(uint16_t StartX, uint16_t StartY, uint16_t width, uint16_t heigh) { - uint16_t s_h, s_l, e_h, e_l; - uint16_t xEnd, yEnd; - xEnd = StartX + width; - yEnd = StartY + heigh - 1; - if (DeviceCode == 0x8989) { - /*LCD_WriteReg(0x0044, (StartX & 0xFF) | (xEnd << 8)); - LCD_WriteReg(0x0045, StartY); - LCD_WriteReg(0x0046, yEnd);*/ - LCD_WriteReg(0x0044, (StartY & 0xFF) | (yEnd << 8)); - LCD_WriteReg(0x0045, StartX); - LCD_WriteReg(0x0046, xEnd); - } - else if (DeviceCode == 0x9488) { - s_h = (StartX >> 8) & 0x00FF; - s_l = StartX & 0x00FF; - e_h = ((StartX + width - 1) >> 8) & 0x00FF; - e_l = (StartX + width - 1) & 0x00FF; - - LCD_IO_WriteReg(0x002A); - LCD_IO_WriteData(s_h); - LCD_IO_WriteData(s_l); - LCD_IO_WriteData(e_h); - LCD_IO_WriteData(e_l); - - s_h = (StartY >> 8) & 0x00FF; - s_l = StartY & 0x00FF; - e_h = ((StartY + heigh - 1) >> 8) & 0x00FF; - e_l = (StartY + heigh - 1) & 0x00FF; - - LCD_IO_WriteReg(0x002B); - LCD_IO_WriteData(s_h); - LCD_IO_WriteData(s_l); - LCD_IO_WriteData(e_h); - LCD_IO_WriteData(e_l); - } - else if ((DeviceCode == 0x9325) || (DeviceCode == 0x9328) || (DeviceCode == 0x1505)) { - /* LCD_WriteReg(0x0050, StartX); - LCD_WriteReg(0x0052, StartY); - LCD_WriteReg(0x0051, xEnd); - LCD_WriteReg(0x0053, yEnd);*/ - LCD_WriteReg(0x0050, StartY); // Specify the start/end positions of the window address in the horizontal direction by an address unit - LCD_WriteReg(0x0051, yEnd); // Specify the start positions of the window address in the vertical direction by an address unit - LCD_WriteReg(0x0052, (TFT_HEIGHT) - xEnd); - LCD_WriteReg(0x0053, (TFT_HEIGHT) - StartX - 1); // Specify the end positions of the window address in the vertical direction by an address unit - - } - else { - s_h = (StartX >> 8) & 0xFF; - s_l = StartX & 0xFF; - e_h = ((StartX + width - 1) >> 8) & 0xFF; - e_l = (StartX + width - 1) & 0xFF; - - LCD_IO_WriteReg(0x2A); - LCD_IO_WriteData(s_h); - LCD_IO_WriteData(s_l); - LCD_IO_WriteData(e_h); - LCD_IO_WriteData(e_l); - - s_h = (StartY >> 8) & 0xFF; - s_l = StartY & 0xFF; - e_h = ((StartY + heigh - 1) >> 8) & 0xFF; - e_l = (StartY + heigh - 1) & 0xFF; - - LCD_IO_WriteReg(0x2B); - LCD_IO_WriteData(s_h); - LCD_IO_WriteData(s_l); - LCD_IO_WriteData(e_h); - LCD_IO_WriteData(e_l); - } - } - - void LCD_Clear(uint16_t Color) { - uint32_t index = 0; - unsigned int count; - - if (DeviceCode == 0x9488) { - tft_set_cursor(0, 0); - LCD_setWindowArea(0, 0, TFT_WIDTH, TFT_HEIGHT); - LCD_WriteRAM_Prepare(); - #ifdef LCD_USE_DMA_FSMC - LCD_IO_WriteMultiple(Color, (TFT_WIDTH) * (TFT_HEIGHT)); - #else - //index = (TFT_HEIGHT) / 2 * (TFT_WIDTH); - for (index = 0; index < (TFT_HEIGHT) * (TFT_WIDTH); index++) - LCD_IO_WriteData(Color); - #endif - //LCD_IO_WriteMultiple(Color, (TFT_WIDTH) * (TFT_HEIGHT)); - //while(index --) LCD_IO_WriteData(Color); - } - else if (DeviceCode == 0x5761) { - LCD_IO_WriteReg(0x002A); - LCD_IO_WriteData(0); - LCD_IO_WriteData(0); - LCD_IO_WriteData(HDP >> 8); - LCD_IO_WriteData(HDP & 0x00FF); - LCD_IO_WriteReg(0x002B); - LCD_IO_WriteData(0); - LCD_IO_WriteData(0); - LCD_IO_WriteData(VDP >> 8); - LCD_IO_WriteData(VDP & 0x00FF); - LCD_IO_WriteReg(0x002C); - LCD_IO_WriteReg(0x002C); - for (count = 0; count < (HDP + 1) * (VDP + 1); count++) - LCD_IO_WriteData(Color); - } - else { - tft_set_cursor(0, 0); - LCD_WriteRAM_Prepare(); /* Prepare to write GRAM */ - for (index = 0; index < 76800; index++) - LCD_IO_WriteData(Color); - } - } - - #include HAL_PATH(../../HAL, tft/tft_fsmc.h) - extern TFT_IO tftio; - void fsmc_tft_init() { - uint16_t i; - - TERN_(HAS_LCD_CONTRAST, refresh_contrast()); - - #ifdef LCD_USE_DMA_FSMC - dma_init(FSMC_DMA_DEV); - dma_disable(FSMC_DMA_DEV, FSMC_DMA_CHANNEL); - dma_set_priority(FSMC_DMA_DEV, FSMC_DMA_CHANNEL, DMA_PRIORITY_MEDIUM); - #endif - - LCD_IO_Init(FSMC_CS_PIN, FSMC_RS_PIN); - - _delay_ms(5); - - DeviceCode = tftio.GetID() & 0xFFFF; - // Chitu and others - if (DeviceCode == 0x8066) DeviceCode = 0x9488; - - if (DeviceCode == 0x9488) { - LCD_IO_WriteReg(0x00E0); - LCD_IO_WriteData(0x0000); - LCD_IO_WriteData(0x0007); - LCD_IO_WriteData(0x000F); - LCD_IO_WriteData(0x000D); - LCD_IO_WriteData(0x001B); - LCD_IO_WriteData(0x000A); - LCD_IO_WriteData(0x003C); - LCD_IO_WriteData(0x0078); - LCD_IO_WriteData(0x004A); - LCD_IO_WriteData(0x0007); - LCD_IO_WriteData(0x000E); - LCD_IO_WriteData(0x0009); - LCD_IO_WriteData(0x001B); - LCD_IO_WriteData(0x001E); - LCD_IO_WriteData(0x000F); - - LCD_IO_WriteReg(0x00E1); - LCD_IO_WriteData(0x0000); - LCD_IO_WriteData(0x0022); - LCD_IO_WriteData(0x0024); - LCD_IO_WriteData(0x0006); - LCD_IO_WriteData(0x0012); - LCD_IO_WriteData(0x0007); - LCD_IO_WriteData(0x0036); - LCD_IO_WriteData(0x0047); - LCD_IO_WriteData(0x0047); - LCD_IO_WriteData(0x0006); - LCD_IO_WriteData(0x000A); - LCD_IO_WriteData(0x0007); - LCD_IO_WriteData(0x0030); - LCD_IO_WriteData(0x0037); - LCD_IO_WriteData(0x000F); - - LCD_IO_WriteReg(0x00C0); - LCD_IO_WriteData(0x0010); - LCD_IO_WriteData(0x0010); - - LCD_IO_WriteReg(0x00C1); - LCD_IO_WriteData(0x0041); - - LCD_IO_WriteReg(0x00C5); - LCD_IO_WriteData(0x0000); - LCD_IO_WriteData(0x0022); - LCD_IO_WriteData(0x0080); - - LCD_IO_WriteReg(0x0036); - LCD_IO_WriteData(TERN(GRAPHICAL_TFT_ROTATE_180, 0xE8, 0x0068)); - - LCD_IO_WriteReg(0x003A); //Interface Mode Control - LCD_IO_WriteData(0x0055); - - LCD_IO_WriteReg(0x00B0); //Interface Mode Control - LCD_IO_WriteData(0x0000); - LCD_IO_WriteReg(0x00B1); //Frame rate 70HZ - LCD_IO_WriteData(0x00B0); - LCD_IO_WriteData(0x0011); - LCD_IO_WriteReg(0x00B4); - LCD_IO_WriteData(0x0002); - LCD_IO_WriteReg(0x00B6); //RGB/MCU Interface Control - LCD_IO_WriteData(0x0002); - LCD_IO_WriteData(0x0042); - - LCD_IO_WriteReg(0x00B7); - LCD_IO_WriteData(0x00C6); - - //WriteComm(0xBE); - //WriteData(0x00); - //WriteData(0x04); - - LCD_IO_WriteReg(0x00E9); - LCD_IO_WriteData(0x0000); - - LCD_IO_WriteReg(0x00F7); - LCD_IO_WriteData(0x00A9); - LCD_IO_WriteData(0x0051); - LCD_IO_WriteData(0x002C); - LCD_IO_WriteData(0x0082); - - LCD_IO_WriteReg(0x0011); - for (i = 0; i < 65535; i++) { /* do nothing */ } - LCD_IO_WriteReg(0x0029); - - LCD_setWindowArea(0, 0, TFT_WIDTH, TFT_HEIGHT); - - OUT_WRITE(LCD_BACKLIGHT_PIN, LOW); - LCD_Clear(0x0000); - - TERN_(HAS_LOGO_IN_FLASH, lcd_draw_logo()); - - OUT_WRITE(LCD_BACKLIGHT_PIN, HIGH); - delay(2000); - } - } - - extern void LCD_IO_WriteSequence(uint16_t *data, uint16_t length); - - void lcd_draw_logo() { - LCD_setWindowArea(0, 0, TFT_WIDTH, TFT_HEIGHT); - LCD_WriteRAM_Prepare(); - - for (uint16_t i = 0; i < (TFT_HEIGHT); i ++) { - Pic_Logo_Read((uint8_t *)"", (uint8_t *)bmp_public_buf, (TFT_WIDTH) * 2); - #ifdef LCD_USE_DMA_FSMC - LCD_IO_WriteSequence((uint16_t *)bmp_public_buf, TFT_WIDTH); - #else - int index = 0;,x_off = 0; - for (x_off = 0; x_off < TFT_WIDTH; x_off++) { - LCD_IO_WriteData((uint16_t)bmp_public_buf[index]); - index += 2; - } - #endif - } - } - -#endif // !TFT_LVGL_UI_SPI +extern uint8_t bmp_public_buf[17 * 1024]; void tft_lvgl_init() { @@ -448,12 +118,8 @@ void tft_lvgl_init() { disp_language_init(); //init tft first! - #if ENABLED(TFT_LVGL_UI_SPI) - SPI_TFT.spi_init(SPI_FULL_SPEED); - SPI_TFT.LCD_init(); - #else - fsmc_tft_init(); - #endif + SPI_TFT.spi_init(SPI_FULL_SPEED); + SPI_TFT.LCD_init(); //spi_flash_read_test(); #if ENABLED(SDSUPPORT) @@ -548,41 +214,18 @@ void tft_lvgl_init() { } void my_disp_flush(lv_disp_drv_t * disp, const lv_area_t * area, lv_color_t * color_p) { - #if ENABLED(TFT_LVGL_UI_SPI) - uint16_t i, width, height; + uint16_t i, width, height; - width = area->x2 - area->x1 + 1; - height = area->y2 - area->y1 + 1; + width = area->x2 - area->x1 + 1; + height = area->y2 - area->y1 + 1; - SPI_TFT.SetWindows((uint16_t)area->x1, (uint16_t)area->y1, width, height); - for (i = 0; i < height; i++) { - SPI_TFT.tftio.WriteSequence((uint16_t*)(color_p + width * i), width); - } - lv_disp_flush_ready(disp); /* Indicate you are ready with the flushing*/ + SPI_TFT.setWindow((uint16_t)area->x1, (uint16_t)area->y1, width, height); + for (i = 0; i < height; i++) { + SPI_TFT.tftio.WriteSequence((uint16_t*)(color_p + width * i), width); + } + lv_disp_flush_ready(disp); /* Indicate you are ready with the flushing*/ - W25QXX.init(SPI_QUARTER_SPEED); - - #else // !TFT_LVGL_UI_SPI - - #if 1 - uint16_t i, width, height; - //uint16_t clr_temp; - width = area->x2 - area->x1 + 1; - height = area->y2 - area->y1 + 1; - LCD_setWindowArea((uint16_t)area->x1, (uint16_t)area->y1, width, height); - LCD_WriteRAM_Prepare(); - for (i = 0; i < width * height - 2; i++) { - //clr_temp = (uint16_t)(((uint16_t)color_p->ch.red << 11) - //| ((uint16_t)color_p->ch.green << 5) - //| ((uint16_t)color_p->ch.blue)); - LCD_IO_WriteData(color_p->full); - color_p++; - } - - lv_disp_flush_ready(disp); /* Indicate you are ready with the flushing*/ - #endif - - #endif // !TFT_LVGL_UI_SPI + W25QXX.init(SPI_QUARTER_SPEED); } #define TICK_CYCLE 1 @@ -599,7 +242,7 @@ static bool get_point(int16_t *x, int16_t *y) { *y = int16_t((int32_t(*y) * XPT2046_Y_CALIBRATION) >> 16) + XPT2046_Y_OFFSET; } - #if ENABLED(GRAPHICAL_TFT_ROTATE_180) + #if (TFT_ROTATION & TFT_ROTATE_180) *x = int16_t((TFT_WIDTH) - (int)(*x)); *y = int16_t((TFT_HEIGHT) - (int)(*y)); #endif diff --git a/Marlin/src/lcd/extui/lib/mks_ui/tft_lvgl_configuration.h b/Marlin/src/lcd/extui/lib/mks_ui/tft_lvgl_configuration.h index 7e24f948fd..727ab33aea 100644 --- a/Marlin/src/lcd/extui/lib/mks_ui/tft_lvgl_configuration.h +++ b/Marlin/src/lcd/extui/lib/mks_ui/tft_lvgl_configuration.h @@ -32,7 +32,7 @@ #include -//#define GRAPHICAL_TFT_ROTATE_180 +//#define TFT_ROTATION TFT_ROTATE_180 #define USE_WIFI_FUNCTION 0 extern void tft_lvgl_init(); diff --git a/Marlin/src/lcd/scaled_tft.h b/Marlin/src/lcd/scaled_tft.h index be846f70a9..2c05e5f26d 100644 --- a/Marlin/src/lcd/scaled_tft.h +++ b/Marlin/src/lcd/scaled_tft.h @@ -43,8 +43,13 @@ #endif #ifndef TFT_PIXEL_OFFSET_X - #define TFT_PIXEL_OFFSET_X 48 + #if GRAPHICAL_TFT_UPSCALE == 2 + #define TFT_PIXEL_OFFSET_X 32 + #else + #define TFT_PIXEL_OFFSET_X 48 + #endif #endif #ifndef TFT_PIXEL_OFFSET_Y - #define TFT_PIXEL_OFFSET_Y 48 + // 32 is better for both 320x240 and 480x320 + #define TFT_PIXEL_OFFSET_Y 32 #endif diff --git a/Marlin/src/lcd/tft/tft.cpp b/Marlin/src/lcd/tft/tft.cpp index 81fe6788e7..fa3c2c241f 100644 --- a/Marlin/src/lcd/tft/tft.cpp +++ b/Marlin/src/lcd/tft/tft.cpp @@ -25,173 +25,16 @@ #if HAS_GRAPHICAL_TFT #include "tft.h" -#include "st7735.h" -#include "st7789v.h" -#include "st7796s.h" -#include "r65105.h" -#include "ili9328.h" -#include "ili9341.h" -#include "ili9488.h" //#define DEBUG_GRAPHICAL_TFT #define DEBUG_OUT ENABLED(DEBUG_GRAPHICAL_TFT) #include "../../core/debug_out.h" uint16_t TFT::buffer[]; -uint32_t TFT::lcd_id = 0xFFFFFFFF; void TFT::init() { - if (lcd_id != 0xFFFFFFFF) return; - io.Init(); - - #if TFT_DRIVER != AUTO - lcd_id = TFT_DRIVER; - #endif - - #if TFT_DRIVER == ST7735 - write_esc_sequence(st7735_init); - #elif TFT_DRIVER == ST7789 - write_esc_sequence(st7789v_init); - #elif TFT_DRIVER == ST7796 - write_esc_sequence(st7796s_init); - #elif TFT_DRIVER == R61505 - write_esc_sequence(r61505_init); - #elif TFT_DRIVER == ILI9328 - write_esc_sequence(ili9328_init); - #elif TFT_DRIVER == ILI9341 - write_esc_sequence(ili9341_init); - #elif TFT_DRIVER == ILI9488 - write_esc_sequence(ili9488_init); - #elif TFT_DRIVER == LERDGE_ST7796 - lcd_id = ST7796; - write_esc_sequence(lerdge_st7796s_init); - - #elif TFT_DRIVER == AUTO // autodetect - - lcd_id = io.GetID() & 0xFFFF; - - switch (lcd_id) { - case ST7796: // ST7796S 480x320 - DEBUG_ECHO_MSG(" ST7796S"); - write_esc_sequence(st7796s_init); - break; - case ST7789: // ST7789V 320x240 - DEBUG_ECHO_MSG(" ST7789V"); - write_esc_sequence(st7789v_init); - break; - case ST7735: // ST7735 160x128 - DEBUG_ECHO_MSG(" ST7735"); - write_esc_sequence(st7735_init); - break; - case R61505: // R61505U 320x240 - DEBUG_ECHO_MSG(" R61505U"); - write_esc_sequence(r61505_init); - break; - case ILI9328: // ILI9328 320x240 - DEBUG_ECHO_MSG(" ILI9328"); - write_esc_sequence(ili9328_init); - break; - case ILI9341: // ILI9341 320x240 - DEBUG_ECHO_MSG(" ILI9341"); - write_esc_sequence(ili9341_init); - break; - case ILI9488: // ILI9488 480x320 - DEBUG_ECHO_MSG(" ILI9488"); - write_esc_sequence(ili9488_init); - break; - default: - lcd_id = 0; - } - #else - #error Unsupported TFT driver - #endif -} - -void TFT::set_window(uint16_t Xmin, uint16_t Ymin, uint16_t Xmax, uint16_t Ymax) { - #ifdef OFFSET_X - Xmin += OFFSET_X; Xmax += OFFSET_X; - #endif - #ifdef OFFSET_Y - Ymin += OFFSET_Y; Ymax += OFFSET_Y; - #endif - - switch (lcd_id) { - case ST7735: // ST7735 160x128 - case ST7789: // ST7789V 320x240 - case ST7796: // ST7796 480x320 - case ILI9341: // ILI9341 320x240 - case ILI9488: // ILI9488 480x320 - io.DataTransferBegin(DATASIZE_8BIT); - - // CASET: Column Address Set - io.WriteReg(ILI9341_CASET); - io.WriteData((Xmin >> 8) & 0xFF); - io.WriteData(Xmin & 0xFF); - io.WriteData((Xmax >> 8) & 0xFF); - io.WriteData(Xmax & 0xFF); - - // RASET: Row Address Set - io.WriteReg(ILI9341_PASET); - io.WriteData((Ymin >> 8) & 0xFF); - io.WriteData(Ymin & 0xFF); - io.WriteData((Ymax >> 8) & 0xFF); - io.WriteData(Ymax & 0xFF); - - // RAMWR: Memory Write - io.WriteReg(ILI9341_RAMWR); - break; - case R61505: // R61505U 320x240 - case ILI9328: // ILI9328 320x240 - io.DataTransferBegin(DATASIZE_16BIT); - - // Mind the mess: with landscape screen orientation 'Horizontal' is Y and 'Vertical' is X - io.WriteReg(ILI9328_HASTART); - io.WriteData(Ymin); - io.WriteReg(ILI9328_HAEND); - io.WriteData(Ymax); - io.WriteReg(ILI9328_VASTART); - io.WriteData(Xmin); - io.WriteReg(ILI9328_VAEND); - io.WriteData(Xmax); - - io.WriteReg(ILI9328_HASET); - io.WriteData(Ymin); - io.WriteReg(ILI9328_VASET); - io.WriteData(Xmin); - - io.WriteReg(ILI9328_RAMWR); - break; - default: - break; - } - - io.DataTransferEnd(); -} - -void TFT::write_esc_sequence(const uint16_t *Sequence) { - uint16_t dataWidth, data; - - dataWidth = *Sequence++; - io.DataTransferBegin(dataWidth); - - for (;;) { - data = *Sequence++; - if (data != 0xFFFF) { - io.WriteData(data); - continue; - } - data = *Sequence++; - if (data == 0x7FFF) return; - if (data == 0xFFFF) - io.WriteData(0xFFFF); - else if (data & 0x8000) - delay(data & 0x7FFF); - else if ((data & 0xFF00) == 0) - io.WriteReg(data); - } - - io.DataTransferEnd(); + io.InitTFT(); } TFT tft; diff --git a/Marlin/src/lcd/tft/tft.h b/Marlin/src/lcd/tft/tft.h index 6d429109c8..ed3d5e35c1 100644 --- a/Marlin/src/lcd/tft/tft.h +++ b/Marlin/src/lcd/tft/tft.h @@ -26,7 +26,7 @@ #include "tft_color.h" #include "tft_string.h" #include "tft_image.h" -#include "tft_io.h" +#include "../tft_io/tft_io.h" #include "../../inc/MarlinConfig.h" @@ -40,20 +40,6 @@ #error "Unsupported display resolution!" #endif -#define ST7735 0x89F0 -#define ST7789 0x8552 -#define ST7796 0x7796 -#define R61505 0x1505 -#define ILI9328 0x9328 -#define ILI9341 0x9341 -#define ILI9488 0x9488 -#define LERDGE_ST7796 0xFFFE -#define AUTO 0xFFFF - -#ifndef TFT_DRIVER - #define TFT_DRIVER AUTO -#endif - #ifndef TFT_BUFFER_SIZE #ifdef STM32F103xB #define TFT_BUFFER_SIZE 1024 @@ -71,14 +57,8 @@ #error "TFT_BUFFER_SIZE can not exceed 65535" #endif -#define ESC_REG(x) 0xFFFF, 0x00FF & (uint16_t)x -#define ESC_DELAY(x) 0xFFFF, 0x8000 | (x & 0x7FFF) -#define ESC_END 0xFFFF, 0x7FFF -#define ESC_FFFF 0xFFFF, 0xFFFF - class TFT { private: - static uint32_t lcd_id; static TFT_String string; static TFT_IO io; @@ -91,13 +71,11 @@ class TFT { static inline void set_font(const uint8_t *Font) { string.set_font(Font); } static inline void add_glyphs(const uint8_t *Font) { string.add_glyphs(Font); } - static void set_window(uint16_t Xmin, uint16_t Ymin, uint16_t Xmax, uint16_t Ymax); - static void write_esc_sequence(const uint16_t *Sequence); - static inline bool is_busy() { return io.isBusy(); } static inline void abort() { io.Abort(); } static inline void write_multiple(uint16_t Data, uint16_t Count) { io.WriteMultiple(Data, Count); } static inline void write_sequence(uint16_t *Data, uint16_t Count) { io.WriteSequence(Data, Count); } + static inline void set_window(uint16_t Xmin, uint16_t Ymin, uint16_t Xmax, uint16_t Ymax) { io.set_window(Xmin, Ymin, Xmax, Ymax); } static inline void fill(uint16_t x, uint16_t y, uint16_t width, uint16_t height, uint16_t color) { queue.fill(x, y, width, height, color); } static inline void canvas(uint16_t x, uint16_t y, uint16_t width, uint16_t height) { queue.canvas(x, y, width, height); } diff --git a/Marlin/src/lcd/tft/tft_io.h b/Marlin/src/lcd/tft/tft_io.h deleted file mode 100644 index bffe92b0ff..0000000000 --- a/Marlin/src/lcd/tft/tft_io.h +++ /dev/null @@ -1,30 +0,0 @@ -/** - * Marlin 3D Printer Firmware - * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] - * - * Based on Sprinter and grbl. - * Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - * - */ -#pragma once - -#include "../../inc/MarlinConfig.h" - -#if HAS_SPI_TFT - #include HAL_PATH(../../HAL, tft/tft_spi.h) -#elif HAS_FSMC_TFT - #include HAL_PATH(../../HAL, tft/tft_fsmc.h) -#endif diff --git a/Marlin/src/lcd/tft/touch.cpp b/Marlin/src/lcd/tft/touch.cpp index 80c65f074a..2124a42e28 100644 --- a/Marlin/src/lcd/tft/touch.cpp +++ b/Marlin/src/lcd/tft/touch.cpp @@ -295,6 +295,10 @@ bool Touch::get_point(int16_t *x, int16_t *y) { if (is_touched && calibration.orientation != TOUCH_ORIENTATION_NONE) { *x = int16_t((int32_t(*x) * calibration.x) >> 16) + calibration.offset_x; *y = int16_t((int32_t(*y) * calibration.y) >> 16) + calibration.offset_y; + #if (TFT_ROTATION & TFT_ROTATE_180) + *x = TFT_WIDTH - *x; + *y = TFT_HEIGHT - *y; + #endif } return is_touched; } diff --git a/Marlin/src/lcd/tft/ili9328.h b/Marlin/src/lcd/tft_io/ili9328.h similarity index 87% rename from Marlin/src/lcd/tft/ili9328.h rename to Marlin/src/lcd/tft_io/ili9328.h index 85edfa7bee..818dd05b34 100644 --- a/Marlin/src/lcd/tft/ili9328.h +++ b/Marlin/src/lcd/tft_io/ili9328.h @@ -21,7 +21,7 @@ */ #pragma once -#include "tft.h" +#include "tft_io.h" #include "../../inc/MarlinConfig.h" @@ -40,8 +40,29 @@ #define ILI9328_ETMOD_AM 0x0008 // 0 - Horizontal / 1 - Vertical // MKS Robin TFT v1.1 - 320x240 ; Cable on the left side -#define ILI9328_DRVCTL_DATA ILI9328_DRVCTL_SS -#define ILI9328_ETMOD_DATA ILI9328_ETMOD_BGR | ILI9328_ETMOD_ID1 | ILI9328_ETMOD_ID0 | ILI9328_ETMOD_AM + +#if TFT_ROTATION == TFT_ROTATE_180 + #define ILI9328_DRVCTL_DATA 0x0000 + #define ILI9328_GATE_SCANCTL1_DATA 0xA700 +#else + #define ILI9328_DRVCTL_DATA ILI9328_DRVCTL_SS + #define ILI9328_GATE_SCANCTL1_DATA 0x2700 +#endif + +// #define ILI9328_ETMOD_ORIENTATION IF_0((TFT_ORIENTATION) & TFT_EXCHANGE_XY, ILI9328_ETMOD_AM) | \ +// IF_0((TFT_ORIENTATION) & TFT_INVERT_X, ILI9328_ETMOD_ID1) | \ +// IF_0((TFT_ORIENTATION) & TFT_INVERT_Y, ILI9328_ETMOD_ID0) + +#define ILI9328_ETMOD_ORIENTATION (ILI9328_ETMOD_AM | ILI9328_ETMOD_ID1 | ILI9328_ETMOD_ID0) + +#if !defined(TFT_COLOR) || TFT_COLOR == TFT_COLOR_BGR + #define ILI9328_ETMOD_COLOR ILI9328_ETMOD_BGR +#elif TFT_COLOR == TFT_COLOR_RGB + #define ILI9328_ETMOD_COLOR ILI9328_ETMOD_RGB +#endif + +#define ILI9328_ETMOD_DATA (ILI9328_ETMOD_ORIENTATION) | (ILI9328_ETMOD_COLOR) + #define ILI9328_RDDID 0x00 // ID code - 0x9328 #define ILI9328_DRVCTL 0x01 // Driver Output Control @@ -134,7 +155,7 @@ static const uint16_t ili9328_init[] = { ESC_REG(ILI9328_PWCTRL7), 0x0004, ESC_REG(ILI9328_FRMCTR), 0x000D, ESC_DELAY(50), - ESC_REG(ILI9328_GATE_SCANCTL1), 0x2700, + ESC_REG(ILI9328_GATE_SCANCTL1), ILI9328_GATE_SCANCTL1_DATA, ESC_REG(ILI9328_GATE_SCANCTL2), 0x0001, ESC_REG(ILI9328_GATE_SCANCTL3), 0x0000, ESC_REG(ILI9328_PLTPOS1), 0x0000, diff --git a/Marlin/src/lcd/tft/ili9341.h b/Marlin/src/lcd/tft_io/ili9341.h similarity index 94% rename from Marlin/src/lcd/tft/ili9341.h rename to Marlin/src/lcd/tft_io/ili9341.h index d4a493412f..dda326df6d 100644 --- a/Marlin/src/lcd/tft/ili9341.h +++ b/Marlin/src/lcd/tft_io/ili9341.h @@ -21,7 +21,7 @@ */ #pragma once -#include "tft.h" +#include "tft_io.h" #include "../../inc/MarlinConfig.h" @@ -38,13 +38,17 @@ #define ILI9341_ORIENTATION_LEFT ILI9341_MADCTL_MY | ILI9341_MADCTL_MX | ILI9341_MADCTL_MV // 320x240 ; Cable on the left side #define ILI9341_ORIENTATION_DOWN ILI9341_MADCTL_MX // 240x320 ; Cable on the upper side -#ifndef ILI9341_COLOR_RGB - #define ILI9341_COLOR_BGR +#define ILI9341_ORIENTATION IF_0((TFT_ORIENTATION) & TFT_EXCHANGE_XY, ILI9341_MADCTL_MV) | \ + IF_0((TFT_ORIENTATION) & TFT_INVERT_X, ILI9341_MADCTL_MX) | \ + IF_0((TFT_ORIENTATION) & TFT_INVERT_Y, ILI9341_MADCTL_MY) + +#if !defined(TFT_COLOR) || TFT_COLOR == TFT_COLOR_BGR + #define ILI9341_COLOR ILI9341_MADCTL_BGR +#elif TFT_COLOR == TFT_COLOR_RGB + #define ILI9341_COLOR ILI9341_MADCTL_RGB #endif -#ifndef ILI9341_ORIENTATION - #define ILI9341_ORIENTATION ILI9341_ORIENTATION_LEFT -#endif -#define ILI9341_MADCTL_DATA (ILI9341_ORIENTATION | TERN(ILI9341_COLOR_BGR, ILI9341_MADCTL_BGR, ILI9341_MADCTL_RGB)) + +#define ILI9341_MADCTL_DATA (ILI9341_ORIENTATION) | (ILI9341_COLOR) #define ILI9341_NOP 0x00 // No Operation #define ILI9341_SWRESET 0x01 // Software Reset diff --git a/Marlin/src/lcd/tft/ili9488.h b/Marlin/src/lcd/tft_io/ili9488.h similarity index 93% rename from Marlin/src/lcd/tft/ili9488.h rename to Marlin/src/lcd/tft_io/ili9488.h index 19fdc78e0a..e71c0d16d7 100644 --- a/Marlin/src/lcd/tft/ili9488.h +++ b/Marlin/src/lcd/tft_io/ili9488.h @@ -21,7 +21,7 @@ */ #pragma once -#include "tft.h" +#include "tft_io.h" #include "../../inc/MarlinConfig.h" @@ -38,13 +38,17 @@ #define ILI9488_ORIENTATION_LEFT ILI9488_MADCTL_MY | ILI9488_MADCTL_MX | ILI9488_MADCTL_MV // 480x320 ; Cable on the left side #define ILI9488_ORIENTATION_DOWN ILI9488_MADCTL_MX // 320x480 ; Cable on the upper side -#ifndef ILI9488_COLOR_RGB - #define ILI9488_COLOR_BGR +#define ILI9488_ORIENTATION IF_0((TFT_ORIENTATION) & TFT_EXCHANGE_XY, ILI9488_MADCTL_MV) | \ + IF_0((TFT_ORIENTATION) & TFT_INVERT_X, ILI9488_MADCTL_MX) | \ + IF_0((TFT_ORIENTATION) & TFT_INVERT_Y, ILI9488_MADCTL_MY) + +#if !defined(TFT_COLOR) || TFT_COLOR == TFT_COLOR_BGR + #define ILI9488_COLOR ILI9488_MADCTL_BGR +#elif TFT_COLOR == TFT_COLOR_RGB + #define ILI9488_COLOR ILI9488_MADCTL_RGB #endif -#ifndef ILI9488_ORIENTATION - #define ILI9488_ORIENTATION ILI9488_ORIENTATION_LEFT -#endif -#define ILI9488_MADCTL_DATA (ILI9488_ORIENTATION | TERN(ILI9488_COLOR_BGR, ILI9488_MADCTL_BGR, ILI9488_MADCTL_RGB)) + +#define ILI9488_MADCTL_DATA (ILI9488_ORIENTATION) | (ILI9488_COLOR) #define ILI9488_NOP 0x00 // No Operation #define ILI9488_SWRESET 0x01 // Software Reset diff --git a/Marlin/src/lcd/tft/r65105.h b/Marlin/src/lcd/tft_io/r65105.h similarity index 87% rename from Marlin/src/lcd/tft/r65105.h rename to Marlin/src/lcd/tft_io/r65105.h index 8d073f5d0d..a813c3260b 100644 --- a/Marlin/src/lcd/tft/r65105.h +++ b/Marlin/src/lcd/tft_io/r65105.h @@ -21,7 +21,7 @@ */ #pragma once -#include "tft.h" +#include "tft_io.h" #include "../../inc/MarlinConfig.h" @@ -42,9 +42,28 @@ #define R61505_DRVCTRL_GS 0x8000 // Gate Scan direction // MKS Robin TFT v1.1 - 320x240 ; Cable on the left side -#define R61505_DRVCTL_DATA R61505_DRVCTL_SS -#define R61505_ETMOD_DATA R61505_ETMOD_BGR | R61505_ETMOD_ID1 | R61505_ETMOD_ID0 | R61505_ETMOD_AM -#define R61505_DRVCTRL_GSDIR R61505_DRVCTRL_GS + +#if TFT_ROTATION == TFT_ROTATE_180 + #define R61505_DRVCTL_DATA 0x0000 + #define R61505_DRVCTRL_DATA (0x2700 | R61505_DRVCTRL_GS) +#else + #define R61505_DRVCTL_DATA R61505_DRVCTL_SS + #define R61505_DRVCTRL_DATA 0x2700 +#endif + +// #define R61505_ETMOD_ORIENTATION IF_0((TFT_ORIENTATION) & TFT_EXCHANGE_XY, R61505_ETMOD_AM) | \ +// IF_0((TFT_ORIENTATION) & TFT_INVERT_X, R61505_ETMOD_ID0) | \ +// IF_0((TFT_ORIENTATION) & TFT_INVERT_Y, R61505_ETMOD_ID1) + +#define R61505_ETMOD_ORIENTATION (R61505_ETMOD_AM | R61505_ETMOD_ID0 | R61505_ETMOD_ID1) + +#if !defined(TFT_COLOR) || TFT_COLOR == TFT_COLOR_BGR + #define R61505_ETMOD_COLOR R61505_ETMOD_BGR +#elif TFT_COLOR == TFT_COLOR_RGB + #define R61505_ETMOD_COLOR R61505_ETMOD_RGB +#endif + +#define R61505_ETMOD_DATA (R61505_ETMOD_ORIENTATION) | (R61505_ETMOD_COLOR) #define R61505_RDDID 0x00 // ID code - 0x1505 @@ -141,7 +160,7 @@ static const uint16_t r61505_init[] = { ESC_REG(R61505_GAMCTRL9), 0x0700, ESC_REG(R61505_GAMCTRLA), 0x0A1F, - ESC_REG(R61505_DRVCTRL), R61505_DRVCTRL_GSDIR | 0x2700, + ESC_REG(R61505_DRVCTRL), R61505_DRVCTRL_DATA, ESC_REG(R61505_BASE_IMAGE_CTRL), 0x0001, ESC_REG(R61505_VSCROLL_CTRL), 0x0000, diff --git a/Marlin/src/lcd/tft_io/ssd1963.h b/Marlin/src/lcd/tft_io/ssd1963.h new file mode 100644 index 0000000000..4953a96233 --- /dev/null +++ b/Marlin/src/lcd/tft_io/ssd1963.h @@ -0,0 +1,131 @@ +/** + * Marlin 3D Printer Firmware + * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] + * + * Based on Sprinter and grbl. + * Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + * + */ +#pragma once + +#include "tft_io.h" + +#include "../../inc/MarlinConfig.h" + +#define SSD1963_MADCTL_MY 0x80 // Row Address Order +#define SSD1963_MADCTL_MX 0x40 // Column Address Order +#define SSD1963_MADCTL_MV 0x20 // Row/Column Exchange +#define SSD1963_MADCTL_MH 0x10 // Horizontal Refresh Order +#define SSD1963_MADCTL_BGR 0x08 // RGB-BGR ORDER +#define SSD1963_MADCTL_RGB 0x00 +#define SSD1963_MADCTL_ML 0x04 // Vertical Refresh Order +#define SSD1963_MADCTL_FH 0x02 // Flip Horizontal +#define SSD1963_MADCTL_FV 0x01 // Flip Vertical + +#define SSD1963_ORIENTATION IF_0((TFT_ORIENTATION) & TFT_EXCHANGE_XY, SSD1963_MADCTL_MV) | \ + IF_0((TFT_ORIENTATION) & TFT_INVERT_X, SSD1963_MADCTL_FH) | \ + IF_0((TFT_ORIENTATION) & TFT_INVERT_Y, SSD1963_MADCTL_FV) + +#if !defined(TFT_COLOR) || TFT_COLOR == TFT_COLOR_BGR + #define SSD1963_COLOR SSD1963_MADCTL_BGR +#elif TFT_COLOR == TFT_COLOR_RGB + #define SSD1963_COLOR SSD1963_MADCTL_RGB +#endif + +#define SSD1963_MADCTL_DATA (SSD1963_ORIENTATION) | (SSD1963_COLOR) + +#define SSD1963_NOP 0x00 // No Operation +#define SSD1963_SWRESET 0x01 // Software reset +#define SSD1963_RDDPM 0x0A // Read Display Power Mode +#define SSD1963_RDDMADCTL 0x0B // Read Display MADCTL +#define SSD1963_RDDCOLMOD 0x0C // Read Display Pixel Format +#define SSD1963_RDDIM 0x0D // Read Display Image Mode +#define SSD1963_RDDSM 0x0E // Read Display Signal Mode +#define SSD1963_SLPIN 0x10 // Sleep In +#define SSD1963_SLPOUT 0x11 // Sleep Out +#define SSD1963_PTLON 0x12 // Partial Display Mode On +#define SSD1963_NORON 0x13 // Normal Display Mode On +#define SSD1963_INVOFF 0x20 // Display Inversion Off +#define SSD1963_INVON 0x21 // Display Inversion On +#define SSD1963_GAMSET 0x26 // Gamma Set +#define SSD1963_DISPOFF 0x28 // Display Off +#define SSD1963_DISPON 0x29 // Display On +#define SSD1963_CASET 0x2A // Column Address Set +#define SSD1963_RASET 0x2B // Row Address Set +#define SSD1963_RAMWR 0x2C // Memory Write +#define SSD1963_RAMRD 0x2E // Memory Read +#define SSD1963_PTLAR 0x30 // Partial Area +#define SSD1963_VSCRDEF 0x33 // Vertical Scrolling Definition +#define SSD1963_TEOFF 0x34 // Tearing Effect Line OFF +#define SSD1963_TEON 0x35 // Tearing Effect Line ON +#define SSD1963_MADCTL 0x36 // Memory Data Access Control +#define SSD1963_VSCSAD 0x37 // Vertical Scroll Start Address of RAM +#define SSD1963_IDMOFF 0x38 // Idle Mode Off +#define SSD1963_IDMON 0x39 // Idle Mode On +#define SSD1963_WRMEMC 0x3C // Write Memory Continue +#define SSD1963_RDMEMC 0x3E // Read Memory Continue +#define SSD1963_STE 0x44 // Set Tear Scanline +#define SSD1963_GSCAN 0x45 // Get Scanline +#define SSD1963_WRDISBV 0x51 // Write Display Brightness +#define SSD1963_RDDISBV 0x52 // Read Display Brightness +#define SSD1963_WRCTRLD 0x53 // Write CTRL Display +#define SSD1963_RDCTRLD 0x54 // Read CTRL Value Display +#define SSD1963_WRCACE 0x55 // Write Content Adaptive Brightness Control and Color Enhancement +#define SSD1963_RDCABC 0x56 // Read Content Adaptive Brightness Control +#define SSD1963_WRCABCMB 0x5E // Write CABC Minimum Brightness +#define SSD1963_RDCABCMB 0x5F // Read CABC Minimum Brightness +#define SSD1963_RDABCSDR 0x68 // Read Automatic Brightness Control Self-Diagnostic Result +#define SSD1963_RDDDB 0xA1 // Read Device Descriptor Block +#define SSD1963_SLCDMODE 0xB0 // Set the LCD panel mode and resolution +#define SSD1963_SHSYNC 0xB4 // Set HSYNC +#define SSD1963_GHSYNC 0xB5 // Get HSYNC +#define SSD1963_SVSYNC 0xB6 // Set VSYNC +#define SSD1963_GVSYNC 0xB7 // Get VSYNC +#define SSD1963_SGPIOCFG 0xB8 // Set GPIO Conf +#define SSD1963_SGPIOV 0xBA // Set GPIO Value +#define SSD1963_SPWMCFG 0xBE // Set PWM Conf +#define SSD1963_GPWMCFG 0xBF // Get PWM Conf +#define SSD1963_SDBCCFG 0xD0 // Set Dynamic Back Light Config +#define SSD1963_GDBCCFG 0xD1 // Get Dynamic Back Light Config +#define SSD1963_PLLON 0xE0 // PLL Enable +#define SSD1963_PLLMN 0xE2 // Set PLL Multiplier +#define SSD1963_SLSHIFT 0xE6 // Set the LSHIFT (pixel clock) frequency +#define SSD1963_COLMOD 0xF0 // Interface Pixel Format + +static const uint16_t ssd1963_init[] = { + DATASIZE_8BIT, + ESC_REG(SSD1963_PLLMN), 0x0023, 0x0002, 0x0054, + ESC_REG(SSD1963_PLLON), 0x0001, ESC_DELAY(10), + ESC_REG(SSD1963_PLLON), 0x0003, ESC_DELAY(10), + ESC_REG(SSD1963_SWRESET), ESC_DELAY(100), + + ESC_REG(SSD1963_SLSHIFT), 0x0001, 0x001F, 0x00FF, + ESC_REG(SSD1963_SLCDMODE), 0x0020, 0x0000, 0x0001, 0x00DF, 0x0001, 0x000F, 0x0000, + ESC_REG(SSD1963_SHSYNC), 0x0002, 0x0013, 0x0000, 0x0008, 0x002B, 0x0000, 0x0002, 0x0000, + ESC_REG(SSD1963_SVSYNC), 0x0001, 0x0020, 0x0000, 0x0004, 0x000C, 0x0000, 0x0002, + ESC_REG(SSD1963_SGPIOV), 0x000F, + ESC_REG(SSD1963_SGPIOCFG), 0x0007, 0x0001, + + ESC_REG(SSD1963_MADCTL), SSD1963_MADCTL_DATA, + ESC_REG(SSD1963_COLMOD), 0x0003, ESC_DELAY(1),//RBG 565 + + ESC_REG(SSD1963_NORON), + ESC_REG(SSD1963_DISPON), + + ESC_REG(SSD1963_SPWMCFG), 0x0006, 0x00f0, 0x0001, 0x00f0, 0x0000, 0x0000, + ESC_REG(SSD1963_SDBCCFG), 0x000D, + ESC_END +}; diff --git a/Marlin/src/lcd/tft/st7735.h b/Marlin/src/lcd/tft_io/st7735.h similarity index 92% rename from Marlin/src/lcd/tft/st7735.h rename to Marlin/src/lcd/tft_io/st7735.h index 62f93d5044..1b0d23b6c4 100644 --- a/Marlin/src/lcd/tft/st7735.h +++ b/Marlin/src/lcd/tft_io/st7735.h @@ -21,7 +21,7 @@ */ #pragma once -#include "tft.h" +#include "tft_io.h" #include "../../inc/MarlinConfig.h" @@ -38,9 +38,17 @@ #define ST7735_ORIENTATION_LEFT ST7735_MADCTL_MV | ST7735_MADCTL_MX // 160x128 ; Cable on the left side #define ST7735_ORIENTATION_DOWN ST7735_MADCTL_MX | ST7735_MADCTL_MY // 128x160 ; Cable on the lower side -//#define ST7735_COLOR_BGR -#define ST7735_ORIENTATION ST7735_ORIENTATION_DOWN -#define ST7735_MADCTL_DATA (ST7735_ORIENTATION | TERN(ST7735_COLOR_BGR, ST7735_MADCTL_BGR, ST7735_MADCTL_RGB)) +#define ST7735_ORIENTATION IF_0((TFT_ORIENTATION) & TFT_EXCHANGE_XY, ST7735_MADCTL_MV) | \ + IF_0((TFT_ORIENTATION) & TFT_INVERT_X, ST7735_MADCTL_MX) | \ + IF_0((TFT_ORIENTATION) & TFT_INVERT_Y, ST7735_MADCTL_MY) + +#if !defined(TFT_COLOR) || TFT_COLOR == TFT_COLOR_RGB + #define ST7735_COLOR ST7735_MADCTL_RGB +#elif TFT_COLOR == TFT_COLOR_BGR + #define ST7735_COLOR ST7735_MADCTL_BGR +#endif + +#define ST7735_MADCTL_DATA (ST7735_ORIENTATION) | (ST7735_COLOR) #define ST7735_NOP 0x00 // No Operation #define ST7735_SWRESET 0x01 // Software reset diff --git a/Marlin/src/lcd/tft/st7789v.h b/Marlin/src/lcd/tft_io/st7789v.h similarity index 93% rename from Marlin/src/lcd/tft/st7789v.h rename to Marlin/src/lcd/tft_io/st7789v.h index 67da67966d..d0cf969c66 100644 --- a/Marlin/src/lcd/tft/st7789v.h +++ b/Marlin/src/lcd/tft_io/st7789v.h @@ -21,7 +21,7 @@ */ #pragma once -#include "tft.h" +#include "tft_io.h" #include "../../inc/MarlinConfig.h" @@ -38,11 +38,17 @@ #define ST7789V_ORIENTATION_LEFT ST7789V_MADCTL_MY | ST7789V_MADCTL_MV // 320x240 ; Cable on the left side #define ST7789V_ORIENTATION_DOWN 0 // 240x320 ; Cable on the lower side -//#define ST7789V_COLOR_BGR -#ifndef ST7789V_ORIENTATION - #define ST7789V_ORIENTATION ST7789V_ORIENTATION_LEFT +#define ST7789V_ORIENTATION IF_0((TFT_ORIENTATION) & TFT_EXCHANGE_XY, ST7789V_MADCTL_MV) | \ + IF_0((TFT_ORIENTATION) & TFT_INVERT_X, ST7789V_MADCTL_MX) | \ + IF_0((TFT_ORIENTATION) & TFT_INVERT_Y, ST7789V_MADCTL_MY) + +#if !defined(TFT_COLOR) || TFT_COLOR == TFT_COLOR_RGB + #define ST7789V_COLOR ST7789V_MADCTL_RGB +#elif TFT_COLOR == TFT_COLOR_BGR + #define ST7789V_COLOR ST7789V_MADCTL_BGR #endif -#define ST7789V_MADCTL_DATA (ST7789V_ORIENTATION | TERN(ST7789V_COLOR_BGR, ST7789V_MADCTL_BGR, ST7789V_MADCTL_RGB)) + +#define ST7789V_MADCTL_DATA (ST7789V_ORIENTATION) | (ST7789V_COLOR) #define ST7789V_NOP 0x00 // No Operation #define ST7789V_SWRESET 0x01 // Software reset diff --git a/Marlin/src/lcd/tft/st7796s.h b/Marlin/src/lcd/tft_io/st7796s.h similarity index 93% rename from Marlin/src/lcd/tft/st7796s.h rename to Marlin/src/lcd/tft_io/st7796s.h index 10452293de..8653a49ca2 100644 --- a/Marlin/src/lcd/tft/st7796s.h +++ b/Marlin/src/lcd/tft_io/st7796s.h @@ -21,7 +21,7 @@ */ #pragma once -#include "tft.h" +#include "tft_io.h" #include "../../inc/MarlinConfig.h" @@ -33,9 +33,17 @@ #define ST7796S_MADCTL_RGB 0x00 #define ST7796S_MADCTL_MH 0x04 // Horizontal Refresh Order -#define ST7796S_COLOR_BGR -#define ST7796S_ORIENTATION ST7796S_MADCTL_MV -#define ST7796S_MADCTL_DATA (ST7796S_ORIENTATION | TERN(ST7796S_COLOR_BGR, ST7796S_MADCTL_BGR, ST7796S_MADCTL_RGB)) +#define ST7796S_ORIENTATION IF_0((TFT_ORIENTATION) & TFT_EXCHANGE_XY, ST7796S_MADCTL_MV) | \ + IF_0((TFT_ORIENTATION) & TFT_INVERT_X, ST7796S_MADCTL_MX) | \ + IF_0((TFT_ORIENTATION) & TFT_INVERT_Y, ST7796S_MADCTL_MY) + +#if !defined(TFT_COLOR) || TFT_COLOR == TFT_COLOR_BGR + #define ST7796S_COLOR ST7796S_MADCTL_BGR +#elif TFT_COLOR == TFT_COLOR_RGB + #define ST7796S_COLOR ST7796S_MADCTL_RGB +#endif + +#define ST7796S_MADCTL_DATA (ST7796S_ORIENTATION) | (ST7796S_COLOR) #define ST7796S_NOP 0x00 // No Operation #define ST7796S_SWRESET 0x01 // Software reset diff --git a/Marlin/src/lcd/tft_io/tft_io.cpp b/Marlin/src/lcd/tft_io/tft_io.cpp new file mode 100644 index 0000000000..cd535458a1 --- /dev/null +++ b/Marlin/src/lcd/tft_io/tft_io.cpp @@ -0,0 +1,226 @@ +/** + * Marlin 3D Printer Firmware + * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] + * + * Based on Sprinter and grbl. + * Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + * + */ + +#include "tft_io.h" + +#if HAS_SPI_TFT || HAS_FSMC_TFT + +#include "st7735.h" +#include "st7789v.h" +#include "st7796s.h" +#include "r65105.h" +#include "ili9328.h" +#include "ili9341.h" +#include "ili9488.h" +#include "ssd1963.h" + +#define DEBUG_OUT ENABLED(DEBUG_GRAPHICAL_TFT) +#include "../../core/debug_out.h" + +TFT_IO_DRIVER TFT_IO::io; +uint32_t TFT_IO::lcd_id = 0xFFFFFFFF; + +void TFT_IO::InitTFT() { +if (lcd_id != 0xFFFFFFFF) return; + + #if PIN_EXISTS(TFT_BACKLIGHT) + OUT_WRITE(TFT_BACKLIGHT_PIN, LOW); + #endif + + #if PIN_EXISTS(TFT_RESET) + OUT_WRITE(TFT_RESET_PIN, HIGH); + delay(10); + OUT_WRITE(TFT_RESET_PIN, LOW); + delay(10); + OUT_WRITE(TFT_RESET_PIN, HIGH); + #endif + + #if PIN_EXISTS(TFT_BACKLIGHT) + OUT_WRITE(TFT_BACKLIGHT_PIN, DISABLED(DELAYED_BACKLIGHT_INIT)); + #endif + + // io.Init(); + delay(100); + + #if TFT_DRIVER != AUTO + lcd_id = TFT_DRIVER; + #endif + + #if TFT_DRIVER == ST7735 + write_esc_sequence(st7735_init); + #elif TFT_DRIVER == SSD1963 + write_esc_sequence(ssd1963_init); + #elif TFT_DRIVER == ST7789 + write_esc_sequence(st7789v_init); + #elif TFT_DRIVER == ST7796 + write_esc_sequence(st7796s_init); + #elif TFT_DRIVER == R61505 + write_esc_sequence(r61505_init); + #elif TFT_DRIVER == ILI9328 + write_esc_sequence(ili9328_init); + #elif TFT_DRIVER == ILI9341 + write_esc_sequence(ili9341_init); + #elif TFT_DRIVER == ILI9488 + write_esc_sequence(ili9488_init); + #elif TFT_DRIVER == LERDGE_ST7796 + lcd_id = ST7796; + write_esc_sequence(lerdge_st7796s_init); + + #elif TFT_DRIVER == AUTO // autodetect + + lcd_id = io.GetID() & 0xFFFF; + + switch (lcd_id) { + case ST7796: // ST7796S 480x320 + DEBUG_ECHO_MSG(" ST7796S"); + write_esc_sequence(st7796s_init); + break; + case ST7789: // ST7789V 320x240 + DEBUG_ECHO_MSG(" ST7789V"); + write_esc_sequence(st7789v_init); + break; + case SSD1963: // SSD1963 + DEBUG_ECHO_MSG(" SSD1963"); + write_esc_sequence(ssd1963_init); + break; + case ST7735: // ST7735 160x128 + DEBUG_ECHO_MSG(" ST7735"); + write_esc_sequence(st7735_init); + break; + case R61505: // R61505U 320x240 + DEBUG_ECHO_MSG(" R61505U"); + write_esc_sequence(r61505_init); + break; + case ILI9328: // ILI9328 320x240 + DEBUG_ECHO_MSG(" ILI9328"); + write_esc_sequence(ili9328_init); + break; + case ILI9341: // ILI9341 320x240 + DEBUG_ECHO_MSG(" ILI9341"); + write_esc_sequence(ili9341_init); + break; + case ILI9488: // ILI9488 480x320 + case ILI9488_ID1: // 0x8066 ILI9488 480x320 + DEBUG_ECHO_MSG(" ILI9488"); + write_esc_sequence(ili9488_init); + break; + default: + lcd_id = 0; + } + #else + #error Unsupported TFT driver + #endif + + #if PIN_EXISTS(TFT_BACKLIGHT) && ENABLED(DELAYED_BACKLIGHT_INIT) + OUT_WRITE(TFT_BACKLIGHT_PIN, HIGH); + #endif +} + +void TFT_IO::set_window(uint16_t Xmin, uint16_t Ymin, uint16_t Xmax, uint16_t Ymax) { + #ifdef OFFSET_X + Xmin += OFFSET_X; Xmax += OFFSET_X; + #endif + #ifdef OFFSET_Y + Ymin += OFFSET_Y; Ymax += OFFSET_Y; + #endif + + switch (lcd_id) { + case ST7735: // ST7735 160x128 + case ST7789: // ST7789V 320x240 + case ST7796: // ST7796 480x320 + case ILI9341: // ILI9341 320x240 + case ILI9488: // ILI9488 480x320 + case SSD1963: // SSD1963 + case ILI9488_ID1: // 0x8066 ILI9488 480x320 + io.DataTransferBegin(DATASIZE_8BIT); + + // CASET: Column Address Set + io.WriteReg(ILI9341_CASET); + io.WriteData((Xmin >> 8) & 0xFF); + io.WriteData(Xmin & 0xFF); + io.WriteData((Xmax >> 8) & 0xFF); + io.WriteData(Xmax & 0xFF); + + // RASET: Row Address Set + io.WriteReg(ILI9341_PASET); + io.WriteData((Ymin >> 8) & 0xFF); + io.WriteData(Ymin & 0xFF); + io.WriteData((Ymax >> 8) & 0xFF); + io.WriteData(Ymax & 0xFF); + + // RAMWR: Memory Write + io.WriteReg(ILI9341_RAMWR); + break; + case R61505: // R61505U 320x240 + case ILI9328: // ILI9328 320x240 + io.DataTransferBegin(DATASIZE_16BIT); + + // Mind the mess: with landscape screen orientation 'Horizontal' is Y and 'Vertical' is X + io.WriteReg(ILI9328_HASTART); + io.WriteData(Ymin); + io.WriteReg(ILI9328_HAEND); + io.WriteData(Ymax); + io.WriteReg(ILI9328_VASTART); + io.WriteData(Xmin); + io.WriteReg(ILI9328_VAEND); + io.WriteData(Xmax); + + io.WriteReg(ILI9328_HASET); + io.WriteData(Ymin); + io.WriteReg(ILI9328_VASET); + io.WriteData(Xmin); + + io.WriteReg(ILI9328_RAMWR); + break; + default: + break; + } + + io.DataTransferEnd(); +} + +void TFT_IO::write_esc_sequence(const uint16_t *Sequence) { + uint16_t dataWidth, data; + + dataWidth = *Sequence++; + io.DataTransferBegin(dataWidth); + + for (;;) { + data = *Sequence++; + if (data != 0xFFFF) { + io.WriteData(data); + continue; + } + data = *Sequence++; + if (data == 0x7FFF) return; + if (data == 0xFFFF) + io.WriteData(0xFFFF); + else if (data & 0x8000) + delay(data & 0x7FFF); + else if ((data & 0xFF00) == 0) + io.WriteReg(data); + } + + io.DataTransferEnd(); +} + +#endif // HAS_SPI_TFT || HAS_FSMC_TFT diff --git a/Marlin/src/lcd/tft_io/tft_io.h b/Marlin/src/lcd/tft_io/tft_io.h new file mode 100644 index 0000000000..63d6936ac0 --- /dev/null +++ b/Marlin/src/lcd/tft_io/tft_io.h @@ -0,0 +1,124 @@ +/** + * Marlin 3D Printer Firmware + * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] + * + * Based on Sprinter and grbl. + * Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + * + */ +#pragma once + +#include "../../inc/MarlinConfig.h" + +#if HAS_SPI_TFT || HAS_FSMC_TFT + +#if HAS_SPI_TFT + #include HAL_PATH(../../HAL, tft/tft_spi.h) +#elif HAS_FSMC_TFT + #include HAL_PATH(../../HAL, tft/tft_fsmc.h) +#else + #error "TFT IO only supports SPI or FSMC interface" +#endif + +#define TFT_EXCHANGE_XY (1UL << 1) +#define TFT_INVERT_X (1UL << 2) +#define TFT_INVERT_Y (1UL << 3) + +#define TFT_NO_ROTATION (0x00) +#define TFT_ROTATE_90 (TFT_EXCHANGE_XY | TFT_INVERT_X) +#define TFT_ROTATE_180 (TFT_INVERT_X | TFT_INVERT_Y) +#define TFT_ROTATE_270 (TFT_EXCHANGE_XY | TFT_INVERT_Y) + +#define TFT_MIRROR_X (TFT_INVERT_Y) +#define TFT_MIRROR_Y (TFT_INVERT_X) + +#define TFT_ROTATE_90_MIRROR_X (TFT_ROTATE_90 ^ TFT_INVERT_Y) +#define TFT_ROTATE_90_MIRROR_Y (TFT_ROTATE_90 ^ TFT_INVERT_X) + +#define TFT_ROTATE_180_MIRROR_X (TFT_ROTATE_180 ^ TFT_INVERT_Y) +#define TFT_ROTATE_180_MIRROR_Y (TFT_ROTATE_180 ^ TFT_INVERT_X) + +#define TFT_ROTATE_270_MIRROR_X (TFT_ROTATE_270 ^ TFT_INVERT_Y) +#define TFT_ROTATE_270_MIRROR_Y (TFT_ROTATE_270 ^ TFT_INVERT_X) + +// TFT_ROTATION is user configurable +#ifndef TFT_ROTATION + #define TFT_ROTATION TFT_NO_ROTATION +#endif + + +// TFT_ORIENTATION is the "sum" of TFT_DEFAULT_ORIENTATION plus user TFT_ROTATION +#define TFT_ORIENTATION ((TFT_DEFAULT_ORIENTATION) ^ (TFT_ROTATION)) + +#define TFT_COLOR_RGB (1UL << 3) +#define TFT_COLOR_BGR (1UL << 4) + +// Each TFT Driver is responsible for its default color mode. +// #ifndef TFT_COLOR +// #define TFT_COLOR TFT_COLOR_RGB +// #endif + +#define SSD1963 0x5761 +#define ST7735 0x89F0 +#define ST7789 0x8552 +#define ST7796 0x7796 +#define R61505 0x1505 +#define ILI9328 0x9328 +#define ILI9341 0x9341 +#define ILI9488 0x9488 +#define ILI9488_ID1 0x8066 //Some ILI9488 have 0x8066 in the 0x04 +#define LERDGE_ST7796 0xFFFE +#define AUTO 0xFFFF + +#ifndef TFT_DRIVER + #define TFT_DRIVER AUTO +#endif + +#define ESC_REG(x) 0xFFFF, 0x00FF & (uint16_t)x +#define ESC_DELAY(x) 0xFFFF, 0x8000 | (x & 0x7FFF) +#define ESC_END 0xFFFF, 0x7FFF +#define ESC_FFFF 0xFFFF, 0xFFFF + +class TFT_IO { +public: + static TFT_IO_DRIVER io; + + static void InitTFT(); + static void set_window(uint16_t Xmin, uint16_t Ymin, uint16_t Xmax, uint16_t Ymax); + static void write_esc_sequence(const uint16_t *Sequence); + + // Deletaged methods + inline static void Init() { io.Init(); }; + inline static bool isBusy() { return io.isBusy(); }; + inline static void Abort() { io.Abort(); }; + inline static uint32_t GetID() { return io.GetID(); }; + + inline static void DataTransferBegin(uint16_t DataWidth = DATASIZE_16BIT) { io.DataTransferBegin(DataWidth); } + inline static void DataTransferEnd() { io.DataTransferEnd(); }; + // inline static void DataTransferAbort() { io.DataTransferAbort(); }; + + inline static void WriteData(uint16_t Data) { io.WriteData(Data); }; + inline static void WriteReg(uint16_t Reg) { io.WriteReg(Reg); }; + + inline static void WriteSequence(uint16_t *Data, uint16_t Count) { io.WriteSequence(Data, Count); }; + // static void WriteMultiple(uint16_t Color, uint16_t Count) { static uint16_t Data; Data = Color; TransmitDMA(DMA_MINC_DISABLE, &Data, Count); } + inline static void WriteMultiple(uint16_t Color, uint32_t Count) { io.WriteMultiple(Color, Count); }; + +protected: + static uint32_t lcd_id; +}; + +#endif // HAS_SPI_TFT || HAS_FSMC_TFT diff --git a/Marlin/src/lcd/touch/touch_buttons.cpp b/Marlin/src/lcd/touch/touch_buttons.cpp index c97018c379..7d25c0df7e 100644 --- a/Marlin/src/lcd/touch/touch_buttons.cpp +++ b/Marlin/src/lcd/touch/touch_buttons.cpp @@ -82,7 +82,7 @@ uint8_t TouchButtons::read_buttons() { x = uint16_t((uint32_t(x) * XPT2046_X_CALIBRATION) >> 16) + XPT2046_X_OFFSET; y = uint16_t((uint32_t(y) * XPT2046_Y_CALIBRATION) >> 16) + XPT2046_Y_OFFSET; - #if ENABLED(GRAPHICAL_TFT_ROTATE_180) + #if (TFT_ROTATION & TFT_ROTATE_180) x = TOUCH_SENSOR_WIDTH - x; y = TOUCH_SENSOR_HEIGHT - y; #endif diff --git a/Marlin/src/pins/lpc1768/pins_BTT_SKR_V1_4.h b/Marlin/src/pins/lpc1768/pins_BTT_SKR_V1_4.h index 5bb32a420a..4686e984b0 100644 --- a/Marlin/src/pins/lpc1768/pins_BTT_SKR_V1_4.h +++ b/Marlin/src/pins/lpc1768/pins_BTT_SKR_V1_4.h @@ -296,25 +296,44 @@ #ifndef GRAPHICAL_TFT_UPSCALE #define GRAPHICAL_TFT_UPSCALE 3 #endif + // SPI 1 + #define SCK_PIN P0_15 + #define MISO_PIN P0_17 + #define MOSI_PIN P0_18 // Disable any LCD related PINs config #define LCD_PINS_ENABLE -1 #define LCD_PINS_RS -1 - // Emulated DOGM have xpt calibration values independent of display resolution - #if ENABLED(SPI_GRAPHICAL_TFT) + // XPT2046 Touch Screen calibration + #if ENABLED(TFT_CLASSIC_UI) #ifndef XPT2046_X_CALIBRATION - #define XPT2046_X_CALIBRATION -11245 + #define XPT2046_X_CALIBRATION -11245 #endif #ifndef XPT2046_Y_CALIBRATION - #define XPT2046_Y_CALIBRATION 8629 + #define XPT2046_Y_CALIBRATION 8629 #endif #ifndef XPT2046_X_OFFSET - #define XPT2046_X_OFFSET 685 + #define XPT2046_X_OFFSET 685 #endif #ifndef XPT2046_Y_OFFSET - #define XPT2046_Y_OFFSET -285 + #define XPT2046_Y_OFFSET -285 #endif + #elif ENABLED(TFT_480x320_SPI) + #ifndef XPT2046_X_CALIBRATION + #define XPT2046_X_CALIBRATION -17232 + #endif + #ifndef XPT2046_Y_CALIBRATION + #define XPT2046_Y_CALIBRATION 11196 + #endif + #ifndef XPT2046_X_OFFSET + #define XPT2046_X_OFFSET 1047 + #endif + #ifndef XPT2046_Y_OFFSET + #define XPT2046_Y_OFFSET -358 + #endif + + #define TFT_BUFFER_SIZE 2400 #endif #elif IS_TFTGLCD_PANEL diff --git a/Marlin/src/pins/lpc1768/pins_MKS_SBASE.h b/Marlin/src/pins/lpc1768/pins_MKS_SBASE.h index 196503c822..6c6a9ea306 100644 --- a/Marlin/src/pins/lpc1768/pins_MKS_SBASE.h +++ b/Marlin/src/pins/lpc1768/pins_MKS_SBASE.h @@ -220,7 +220,7 @@ #if IS_TFTGLCD_PANEL #if ENABLED(TFTGLCD_PANEL_SPI) - #define TFTGLCD_CS P3_25 // EXP2.3 + #define TFTGLCD_CS P3_25 // EXP2.3 #endif #if SD_CONNECTION_IS(LCD) diff --git a/Marlin/src/pins/lpc1768/pins_RAMPS_RE_ARM.h b/Marlin/src/pins/lpc1768/pins_RAMPS_RE_ARM.h index c602af1c30..294e7527a8 100644 --- a/Marlin/src/pins/lpc1768/pins_RAMPS_RE_ARM.h +++ b/Marlin/src/pins/lpc1768/pins_RAMPS_RE_ARM.h @@ -371,7 +371,7 @@ #endif #if ANY(VIKI2, miniVIKI) - // #define LCD_SCREEN_ROT_180 + //#define LCD_SCREEN_ROT_180 #define DOGLCD_CS P0_16 // (16) #define DOGLCD_A0 P2_06 // (59) J3-8 & AUX-2 diff --git a/Marlin/src/pins/lpc1769/pins_BTT_SKR_E3_TURBO.h b/Marlin/src/pins/lpc1769/pins_BTT_SKR_E3_TURBO.h index 76c54c3bba..6d6d7557f5 100644 --- a/Marlin/src/pins/lpc1769/pins_BTT_SKR_E3_TURBO.h +++ b/Marlin/src/pins/lpc1769/pins_BTT_SKR_E3_TURBO.h @@ -161,7 +161,7 @@ // #define TEMP_0_PIN P0_24 #define TEMP_1_PIN P0_23 -//#define TEMP_2_PIN P1_30 // Onboard thermistor +//#define TEMP_2_PIN P1_30 // Onboard thermistor #define TEMP_BED_PIN P0_25 // diff --git a/Marlin/src/pins/lpc1769/pins_MKS_SGEN_L_V2.h b/Marlin/src/pins/lpc1769/pins_MKS_SGEN_L_V2.h index cbbe8a9416..62660935f5 100644 --- a/Marlin/src/pins/lpc1769/pins_MKS_SGEN_L_V2.h +++ b/Marlin/src/pins/lpc1769/pins_MKS_SGEN_L_V2.h @@ -39,7 +39,7 @@ //#define SDCARD_EEPROM_EMULATION //#define I2C_EEPROM // AT24C32 #define FLASH_EEPROM_EMULATION - #define MARLIN_EEPROM_SIZE 0x1000 // 4KB + #define MARLIN_EEPROM_SIZE 0x1000 // 4KB #endif // @@ -190,7 +190,7 @@ #define E1_SERIAL_RX_PIN P1_17 // Reduce baud rate to improve software serial reliability - #define TMC_BAUD_RATE 19200 + #define TMC_BAUD_RATE 19200 #endif // HAS_TMC_UART // diff --git a/Marlin/src/pins/stm32f1/pins_CHITU3D_V5.h b/Marlin/src/pins/stm32f1/pins_CHITU3D_V5.h index 5d81d1eca9..b02d414089 100644 --- a/Marlin/src/pins/stm32f1/pins_CHITU3D_V5.h +++ b/Marlin/src/pins/stm32f1/pins_CHITU3D_V5.h @@ -129,8 +129,6 @@ #define TOUCH_MISO_PIN PA6 // SPI1_MISO #define TOUCH_MOSI_PIN PA7 // SPI1_MOSI - #define LCD_RESET_PIN PF11 - #define LCD_BACKLIGHT_PIN PD13 #define TFT_RESET_PIN PF11 #define TFT_BACKLIGHT_PIN PD13 @@ -140,14 +138,9 @@ #define FSMC_DMA_DEV DMA2 #define FSMC_DMA_CHANNEL DMA_CH5 - #define TFT_WIDTH 480 - #define TFT_HEIGHT 320 - #define TFT_PIXEL_OFFSET_X 48 - #define TFT_PIXEL_OFFSET_Y 32 - #endif -#if HAS_TFT_LVGL_UI +#if ENABLED(TFT_LVGL_UI) // LVGL #define HAS_SPI_FLASH_FONT 1 #define HAS_GCODE_PREVIEW 1 @@ -155,16 +148,17 @@ #define HAS_LANG_SELECT_SCREEN 1 #define HAS_BAK_VIEW_IN_FLASH 0 #define HAS_LOGO_IN_FLASH 0 -#elif ENABLED(TFT_480x320) +#elif ENABLED(TFT_COLOR_UI) // Color UI #define TFT_DRIVER ILI9488 #define TFT_BUFFER_SIZE 14400 -#elif ENABLED(FSMC_GRAPHICAL_TFT) +#elif ENABLED(TFT_CLASSIC_UI) // Emulated DOGM #define GRAPHICAL_TFT_UPSCALE 3 #endif -#if EITHER(HAS_TFT_LVGL_UI, TFT_480x320) +// XPT2046 Touch Screen calibration +#if EITHER(TFT_LVGL_UI, TFT_COLOR_UI) #ifndef XPT2046_X_CALIBRATION #define XPT2046_X_CALIBRATION -17181 #endif @@ -177,7 +171,7 @@ #ifndef XPT2046_Y_OFFSET #define XPT2046_Y_OFFSET -9 #endif -#elif ENABLED(FSMC_GRAPHICAL_TFT) +#elif ENABLED(TFT_CLASSIC_UI) #ifndef XPT2046_X_CALIBRATION #define XPT2046_X_CALIBRATION -12316 #endif diff --git a/Marlin/src/pins/stm32f1/pins_CHITU3D_V6.h b/Marlin/src/pins/stm32f1/pins_CHITU3D_V6.h index e6c9b33a5a..cafd50dcf2 100644 --- a/Marlin/src/pins/stm32f1/pins_CHITU3D_V6.h +++ b/Marlin/src/pins/stm32f1/pins_CHITU3D_V6.h @@ -135,15 +135,15 @@ // TronXY TFT Support // -// Shared FSMC Configs #if HAS_FSMC_TFT + + // Shared FSMC + #define TOUCH_CS_PIN PB7 // SPI1_NSS #define TOUCH_SCK_PIN PA5 // SPI1_SCK #define TOUCH_MISO_PIN PA6 // SPI1_MISO #define TOUCH_MOSI_PIN PA7 // SPI1_MOSI - #define LCD_RESET_PIN PF11 - #define LCD_BACKLIGHT_PIN PD13 #define TFT_RESET_PIN PF11 #define TFT_BACKLIGHT_PIN PD13 @@ -153,14 +153,9 @@ #define FSMC_DMA_DEV DMA2 #define FSMC_DMA_CHANNEL DMA_CH5 - #define TFT_WIDTH 480 - #define TFT_HEIGHT 320 - #define TFT_PIXEL_OFFSET_X 48 - #define TFT_PIXEL_OFFSET_Y 32 - #endif -#if HAS_TFT_LVGL_UI +#if ENABLED(TFT_LVGL_UI) // LVGL #define HAS_SPI_FLASH_FONT 1 #define HAS_GCODE_PREVIEW 1 @@ -168,16 +163,17 @@ #define HAS_LANG_SELECT_SCREEN 1 #define HAS_BAK_VIEW_IN_FLASH 0 #define HAS_LOGO_IN_FLASH 0 -#elif ENABLED(TFT_480x320) +#elif ENABLED(TFT_COLOR_UI) // Color UI #define TFT_DRIVER ILI9488 #define TFT_BUFFER_SIZE 14400 -#elif ENABLED(FSMC_GRAPHICAL_TFT) +#elif ENABLED(TFT_CLASSIC_UI) // Emulated DOGM #define GRAPHICAL_TFT_UPSCALE 3 #endif -#if EITHER(HAS_TFT_LVGL_UI, TFT_480x320) +// XPT2046 Touch Screen calibration +#if EITHER(TFT_LVGL_UI, TFT_COLOR_UI) #ifndef XPT2046_X_CALIBRATION #define XPT2046_X_CALIBRATION -17181 #endif @@ -190,7 +186,7 @@ #ifndef XPT2046_Y_OFFSET #define XPT2046_Y_OFFSET -9 #endif -#elif ENABLED(FSMC_GRAPHICAL_TFT) +#elif ENABLED(TFT_CLASSIC_UI) #ifndef XPT2046_X_CALIBRATION #define XPT2046_X_CALIBRATION -12316 #endif diff --git a/Marlin/src/pins/stm32f1/pins_JGAURORA_A5S_A1.h b/Marlin/src/pins/stm32f1/pins_JGAURORA_A5S_A1.h index 64948039ba..3c277233d7 100644 --- a/Marlin/src/pins/stm32f1/pins_JGAURORA_A5S_A1.h +++ b/Marlin/src/pins/stm32f1/pins_JGAURORA_A5S_A1.h @@ -39,7 +39,7 @@ #define STM32_XL_DENSITY #endif -// #define MCU_STM32F103ZE // not yet required +//#define MCU_STM32F103ZE // not yet required // Enable EEPROM Emulation for this board, so that we don't overwrite factory data //#define I2C_EEPROM // AT24C64 diff --git a/Marlin/src/pins/stm32f1/pins_LONGER3D_LK.h b/Marlin/src/pins/stm32f1/pins_LONGER3D_LK.h index 47d7118b53..af81bbebe2 100644 --- a/Marlin/src/pins/stm32f1/pins_LONGER3D_LK.h +++ b/Marlin/src/pins/stm32f1/pins_LONGER3D_LK.h @@ -118,7 +118,6 @@ * because Marlin uses the reset as a failsafe to revive a glitchy LCD. */ -#define LCD_RESET_PIN PC4 // pin 33 #define TFT_RESET_PIN PC4 // pin 33 #define TFT_BACKLIGHT_PIN PD12 // pin 59 #define FSMC_CS_PIN PD7 // pin 88 = FSMC_NE1 @@ -131,13 +130,11 @@ #define DOGLCD_MOSI -1 // Prevent auto-define by Conditionals_post.h #define DOGLCD_SCK -1 -#define GRAPHICAL_TFT_UPSCALE 2 -#define TFT_WIDTH 320 -#define TFT_HEIGHT 240 -#define TFT_PIXEL_OFFSET_X 32 -#define TFT_PIXEL_OFFSET_Y 32 +// Longer/Alfawise TFT +#define LONGER_LK_TFT28 -//#define TFT_DRIVER ILI9341 +// Buffer for Color UI +#define TFT_BUFFER_SIZE 3200 /** * Note: Alfawise U20/U30 boards DON'T use SPI2, as the hardware designer diff --git a/Marlin/src/pins/stm32f1/pins_MKS_ROBIN.h b/Marlin/src/pins/stm32f1/pins_MKS_ROBIN.h index 26a0c9260e..8831d6804b 100644 --- a/Marlin/src/pins/stm32f1/pins_MKS_ROBIN.h +++ b/Marlin/src/pins/stm32f1/pins_MKS_ROBIN.h @@ -143,8 +143,8 @@ #define LCD_BACKLIGHT_PIN PG11 #define FSMC_CS_PIN PG12 // NE4 #define FSMC_RS_PIN PF0 // A0 - #define TFT_CS_PIN FSMC_CS_PIN - #define TFT_RS_PIN FSMC_RS_PIN + #define TFT_CS_PIN FSMC_CS_PIN + #define TFT_RS_PIN FSMC_RS_PIN #define LCD_USE_DMA_FSMC // Use DMA transfers to send data to the TFT #define FSMC_DMA_DEV DMA2 diff --git a/Marlin/src/pins/stm32f1/pins_MKS_ROBIN_E3P.h b/Marlin/src/pins/stm32f1/pins_MKS_ROBIN_E3P.h index d9ba4e3c40..94a28953cc 100644 --- a/Marlin/src/pins/stm32f1/pins_MKS_ROBIN_E3P.h +++ b/Marlin/src/pins/stm32f1/pins_MKS_ROBIN_E3P.h @@ -290,6 +290,7 @@ #define TFT_BUFFER_SIZE 14400 #endif +// XPT2046 Touch Screen calibration #if EITHER(HAS_TFT_LVGL_UI, TFT_480x320_SPI) #ifndef XPT2046_X_CALIBRATION #define XPT2046_X_CALIBRATION -17253 diff --git a/Marlin/src/pins/stm32f1/pins_MKS_ROBIN_NANO.h b/Marlin/src/pins/stm32f1/pins_MKS_ROBIN_NANO.h index 35909ed430..16d6d2ffc4 100644 --- a/Marlin/src/pins/stm32f1/pins_MKS_ROBIN_NANO.h +++ b/Marlin/src/pins/stm32f1/pins_MKS_ROBIN_NANO.h @@ -171,6 +171,9 @@ // Shared FSMC Configs #if HAS_FSMC_TFT + #define DOGLCD_MOSI -1 // prevent redefine Conditionals_post.h + #define DOGLCD_SCK -1 + #define FSMC_CS_PIN PD7 // NE4 #define FSMC_RS_PIN PD11 // A0 @@ -179,9 +182,6 @@ #define TOUCH_MISO_PIN PB14 // SPI2_MISO #define TOUCH_MOSI_PIN PB15 // SPI2_MOSI - #define LCD_RESET_PIN PC6 // FSMC_RST - #define LCD_BACKLIGHT_PIN PD13 - #define TFT_RESET_PIN PC6 // FSMC_RST #define TFT_BACKLIGHT_PIN PD13 @@ -193,60 +193,11 @@ #define TOUCH_BUTTONS_HW_SPI #define TOUCH_BUTTONS_HW_SPI_DEVICE 2 + + #define TFT_BUFFER_SIZE 14400 #endif -#if ENABLED(FSMC_GRAPHICAL_TFT) - // Emulated DOGM - #define DOGLCD_MOSI -1 // prevent redefine Conditionals_post.h - #define DOGLCD_SCK -1 - - #ifndef GRAPHICAL_TFT_UPSCALE - #define GRAPHICAL_TFT_UPSCALE 3 - #endif - #ifndef TFT_WIDTH - #define TFT_WIDTH 480 - #endif - #ifndef TFT_PIXEL_OFFSET_X - #define TFT_PIXEL_OFFSET_X 48 - #endif - #ifndef TFT_HEIGHT - #define TFT_HEIGHT 320 - #endif - #ifndef TFT_PIXEL_OFFSET_Y - #define TFT_PIXEL_OFFSET_Y 32 - #endif - -#elif ENABLED(TFT_320x240) // TFT32/28 - #define TFT_RESET_PIN PC6 - #define TFT_BACKLIGHT_PIN PD13 - - #define LCD_USE_DMA_FSMC // Use DMA transfers to send data to the TFT - #define FSMC_CS_PIN PD7 - #define FSMC_RS_PIN PD11 - #define FSMC_DMA_DEV DMA2 - #define FSMC_DMA_CHANNEL DMA_CH5 - - #define TOUCH_CS_PIN PA7 // SPI2_NSS - #define TOUCH_SCK_PIN PB13 // SPI2_SCK - #define TOUCH_MISO_PIN PB14 // SPI2_MISO - #define TOUCH_MOSI_PIN PB15 // SPI2_MOSI - - #define TFT_DRIVER ILI9341 - #define TFT_BUFFER_SIZE 14400 - - // YV for normal screen mounting - //#define ILI9341_ORIENTATION ILI9341_MADCTL_MY | ILI9341_MADCTL_MV - // XV for 180° rotated screen mounting - #define ILI9341_ORIENTATION ILI9341_MADCTL_MX | ILI9341_MADCTL_MV - - #define ILI9341_COLOR_RGB - -#elif ENABLED(TFT_480x320) - #define TFT_DRIVER ILI9488 - #define TFT_BUFFER_SIZE 14400 - #define ILI9488_ORIENTATION ILI9488_MADCTL_MX | ILI9488_MADCTL_MV -#endif - +// XPT2046 Touch Screen calibration #if EITHER(TFT_LVGL_UI_FSMC, TFT_480x320) #ifndef XPT2046_X_CALIBRATION #define XPT2046_X_CALIBRATION 17880 @@ -260,7 +211,7 @@ #ifndef XPT2046_Y_OFFSET #define XPT2046_Y_OFFSET 349 #endif -#elif ENABLED(FSMC_GRAPHICAL_TFT) +#elif ENABLED(TFT_CLASSIC_UI) #ifndef XPT2046_X_CALIBRATION #define XPT2046_X_CALIBRATION 12149 #endif @@ -273,7 +224,7 @@ #ifndef XPT2046_Y_OFFSET #define XPT2046_Y_OFFSET 256 #endif -#elif ENABLED(TFT_320x240) // TFT32/28 +#elif ENABLED(TFT_320x240) #ifndef XPT2046_X_CALIBRATION #define XPT2046_X_CALIBRATION -12246 #endif diff --git a/Marlin/src/pins/stm32f1/pins_MKS_ROBIN_NANO_V2.h b/Marlin/src/pins/stm32f1/pins_MKS_ROBIN_NANO_V2.h index b40c66496a..846fe80a08 100644 --- a/Marlin/src/pins/stm32f1/pins_MKS_ROBIN_NANO_V2.h +++ b/Marlin/src/pins/stm32f1/pins_MKS_ROBIN_NANO_V2.h @@ -269,19 +269,11 @@ #define TOUCH_BUTTONS_HW_SPI #define TOUCH_BUTTONS_HW_SPI_DEVICE 1 - #ifndef TFT_WIDTH - #define TFT_WIDTH 480 - #endif - #ifndef TFT_HEIGHT - #define TFT_HEIGHT 320 - #endif - - #define LCD_READ_ID 0xD3 #define LCD_USE_DMA_SPI #endif -#if ENABLED(SPI_GRAPHICAL_TFT) +#if ENABLED(TFT_CLASSIC_UI) // Emulated DOGM SPI #ifndef GRAPHICAL_TFT_UPSCALE #define GRAPHICAL_TFT_UPSCALE 3 @@ -297,12 +289,12 @@ #define LCD_PINS_ENABLE PD13 #define LCD_PINS_RS PC6 -#elif ENABLED(TFT_480x320_SPI) - #define TFT_DRIVER ST7796 +#elif ENABLED(TFT_COLOR_UI) #define TFT_BUFFER_SIZE 14400 #endif -#if EITHER(TFT_LVGL_UI_SPI, TFT_480x320_SPI) +// XPT2046 Touch Screen calibration +#if EITHER(TFT_LVGL_UI, TFT_COLOR_UI) #ifndef XPT2046_X_CALIBRATION #define XPT2046_X_CALIBRATION -17253 #endif @@ -315,7 +307,7 @@ #ifndef XPT2046_Y_OFFSET #define XPT2046_Y_OFFSET -24 #endif -#elif ENABLED(SPI_GRAPHICAL_TFT) +#elif ENABLED(TFT_CLASSIC_UI) #ifndef XPT2046_X_CALIBRATION #define XPT2046_X_CALIBRATION -11386 #endif diff --git a/Marlin/src/pins/stm32f1/pins_TRIGORILLA_PRO.h b/Marlin/src/pins/stm32f1/pins_TRIGORILLA_PRO.h index 4745641ea9..bfd1f2abdc 100644 --- a/Marlin/src/pins/stm32f1/pins_TRIGORILLA_PRO.h +++ b/Marlin/src/pins/stm32f1/pins_TRIGORILLA_PRO.h @@ -120,14 +120,50 @@ * Setting an 'LCD_RESET_PIN' may cause a flicker when entering the LCD menu * because Marlin uses the reset as a failsafe to revive a glitchy LCD. */ -#define LCD_RESET_PIN PF11 -#define LCD_BACKLIGHT_PIN PD13 -#define FSMC_CS_PIN PD7 // NE4 -#define FSMC_RS_PIN PD11 // A0 +#if HAS_FSMC_TFT + #define TFT_RESET_PIN PF11 + #define TFT_BACKLIGHT_PIN PD13 + #define FSMC_CS_PIN PD7 // NE4 + #define FSMC_RS_PIN PD11 // A0 -#define LCD_USE_DMA_FSMC // Use DMA transfers to send data to the TFT -#define FSMC_DMA_DEV DMA2 -#define FSMC_DMA_CHANNEL DMA_CH5 + #define LCD_USE_DMA_FSMC // Use DMA transfers to send data to the TFT + #define FSMC_DMA_DEV DMA2 + #define FSMC_DMA_CHANNEL DMA_CH5 + + #define ANYCUBIC_TFT35 +#else + #define LCD_RESET_PIN PF11 + #define LCD_BACKLIGHT_PIN PD13 +#endif + +// XPT2046 Touch Screen calibration +#if ENABLED(TFT_COLOR_UI) || ENABLED(TFT_LVGL_UI) + #ifndef XPT2046_X_CALIBRATION + #define XPT2046_X_CALIBRATION -17181 + #endif + #ifndef XPT2046_Y_CALIBRATION + #define XPT2046_Y_CALIBRATION 11434 + #endif + #ifndef XPT2046_X_OFFSET + #define XPT2046_X_OFFSET 501 + #endif + #ifndef XPT2046_Y_OFFSET + #define XPT2046_Y_OFFSET -9 + #endif +#elif ENABLED(TFT_CLASSIC_UI) + #ifndef XPT2046_X_CALIBRATION + #define XPT2046_X_CALIBRATION -12316 + #endif + #ifndef XPT2046_Y_CALIBRATION + #define XPT2046_Y_CALIBRATION 8981 + #endif + #ifndef XPT2046_X_OFFSET + #define XPT2046_X_OFFSET 340 + #endif + #ifndef XPT2046_Y_OFFSET + #define XPT2046_Y_OFFSET -20 + #endif +#endif #if NEED_TOUCH_PINS #define TOUCH_CS_PIN PB7 // SPI2_NSS diff --git a/Marlin/src/pins/teensy4/pins_T41U5XBB.h b/Marlin/src/pins/teensy4/pins_T41U5XBB.h index 830637bebd..5f62bb05a6 100644 --- a/Marlin/src/pins/teensy4/pins_T41U5XBB.h +++ b/Marlin/src/pins/teensy4/pins_T41U5XBB.h @@ -85,17 +85,17 @@ #define X_STEP_PIN 2 #define X_DIR_PIN 3 #define X_ENABLE_PIN 10 -//#define X_CS_PIN 30 +//#define X_CS_PIN 30 #define Y_STEP_PIN 4 #define Y_DIR_PIN 5 #define Y_ENABLE_PIN 40 -//#define Y_CS_PIN 31 +//#define Y_CS_PIN 31 #define Z_STEP_PIN 6 #define Z_DIR_PIN 7 #define Z_ENABLE_PIN 39 -//#define Z_CS_PIN 32 +//#define Z_CS_PIN 32 #define E0_STEP_PIN 8 #define E0_DIR_PIN 9 diff --git a/Marlin/src/pins/teensy4/pins_TEENSY41.h b/Marlin/src/pins/teensy4/pins_TEENSY41.h index 31c6fda5c9..21a1ff675f 100644 --- a/Marlin/src/pins/teensy4/pins_TEENSY41.h +++ b/Marlin/src/pins/teensy4/pins_TEENSY41.h @@ -81,17 +81,17 @@ #define X_STEP_PIN 0 #define X_DIR_PIN 1 #define X_ENABLE_PIN 6 -//#define X_CS_PIN 30 +//#define X_CS_PIN 30 #define Y_STEP_PIN 2 #define Y_DIR_PIN 3 #define Y_ENABLE_PIN 7 -//#define Y_CS_PIN 31 +//#define Y_CS_PIN 31 #define Z_STEP_PIN 4 #define Z_DIR_PIN 5 #define Z_ENABLE_PIN 8 -//#define Z_CS_PIN 32 +//#define Z_CS_PIN 32 #define E0_STEP_PIN 9 #define E0_DIR_PIN 10 @@ -123,8 +123,8 @@ // #define LED_PIN 13 #define SOL0_PIN 28 -//#define PS_ON_PIN 1 -//#define FILWIDTH_PIN 6 // A6 +//#define PS_ON_PIN 1 +//#define FILWIDTH_PIN 6 // A6 #ifndef SDCARD_CONNECTION #define SDCARD_CONNECTION ONBOARD diff --git a/platformio.ini b/platformio.ini index 4c974e5a87..9c9460d1a3 100644 --- a/platformio.ini +++ b/platformio.ini @@ -26,7 +26,7 @@ include_dir = Marlin # [common] default_src_filter = + - - + - - - - - - + - - - - - - - - - - - - @@ -227,7 +227,7 @@ HAS_WIRED_LCD = src_filter=+ HAS_MARLINUI_HD44780 = src_filter=+ HAS_MARLINUI_U8GLIB = U8glib-HAL@~0.4.1 src_filter=+ -HAS_(FSMC|SPI)_TFT = src_filter=+ + +HAS_(FSMC|SPI)_TFT = src_filter=+ + + HAS_FSMC_TFT = src_filter=+ + HAS_SPI_TFT = src_filter=+ + HAS_GRAPHICAL_TFT = src_filter=+ @@ -909,8 +909,6 @@ build_flags = ${common_stm32f1.build_flags} # # MKS Robin Nano (STM32F103VET6) -# v1.2 - Emulated Graphical 128x64 (DOGM) UI and LVGL UI -# v2.0 - LVGL UI # [env:mks_robin_nano35] platform = ${common_stm32f1.platform} From f5139f8bf433b5c2bfd4022e14e91a51ac46d951 Mon Sep 17 00:00:00 2001 From: Jason Smith Date: Mon, 12 Oct 2020 14:39:31 -0700 Subject: [PATCH 015/226] Add D100 Watchdog Test (#19697) --- Marlin/src/gcode/gcode_d.cpp | 82 ++++++++++++++++++++++-------------- 1 file changed, 50 insertions(+), 32 deletions(-) diff --git a/Marlin/src/gcode/gcode_d.cpp b/Marlin/src/gcode/gcode_d.cpp index 4bc3b6c6c3..1f38a85b91 100644 --- a/Marlin/src/gcode/gcode_d.cpp +++ b/Marlin/src/gcode/gcode_d.cpp @@ -25,8 +25,10 @@ #include "gcode.h" #include "../module/settings.h" + #include "../module/temperature.h" #include "../libs/hex_print.h" #include "../HAL/shared/eeprom_if.h" + #include "../HAL/shared/Delay.h" /** * Dn: G-code for development and testing @@ -84,40 +86,23 @@ } } break; - case 3: { // D3 Read / Write EEPROM - uint8_t *pointer = parser.hex_adr_val('A'); - uint16_t len = parser.ushortval('C', 1); - uintptr_t addr = (uintptr_t)pointer; - #ifndef MARLIN_EEPROM_SIZE - #define MARLIN_EEPROM_SIZE size_t(E2END + 1) - #endif - NOMORE(addr, (size_t)(MARLIN_EEPROM_SIZE - 1)); - NOMORE(len, MARLIN_EEPROM_SIZE - addr); - if (parser.seenval('X')) { - uint16_t val = parser.hex_val('X'); - #if ENABLED(EEPROM_SETTINGS) - persistentStore.access_start(); - while(len--) { - int pos = 0; - persistentStore.write_data(pos, (uint8_t *)&val, sizeof(val)); - } - SERIAL_EOL(); - persistentStore.access_finish(); - #else - SERIAL_ECHOLN("NO EEPROM"); + #if ENABLED(EEPROM_SETTINGS) + case 3: { // D3 Read / Write EEPROM + uint8_t *pointer = parser.hex_adr_val('A'); + uint16_t len = parser.ushortval('C', 1); + uintptr_t addr = (uintptr_t)pointer; + #ifndef MARLIN_EEPROM_SIZE + #define MARLIN_EEPROM_SIZE size_t(E2END + 1) #endif - } - else { - while (len--) { - // Read bytes from EEPROM + NOMORE(addr, (size_t)(MARLIN_EEPROM_SIZE - 1)); + NOMORE(len, MARLIN_EEPROM_SIZE - addr); + if (parser.seenval('X')) { + uint16_t val = parser.hex_val('X'); #if ENABLED(EEPROM_SETTINGS) persistentStore.access_start(); - uint8_t val; while(len--) { int pos = 0; - if (!persistentStore.read_data(pos, (uint8_t *)&val, sizeof(val))) { - print_hex_byte(val); - } + persistentStore.write_data(pos, (uint8_t *)&val, sizeof(val)); } SERIAL_EOL(); persistentStore.access_finish(); @@ -125,9 +110,28 @@ SERIAL_ECHOLN("NO EEPROM"); #endif } - SERIAL_EOL(); - } - } break; + else { + while (len--) { + // Read bytes from EEPROM + #if ENABLED(EEPROM_SETTINGS) + persistentStore.access_start(); + uint8_t val; + while(len--) { + int pos = 0; + if (!persistentStore.read_data(pos, (uint8_t *)&val, sizeof(val))) { + print_hex_byte(val); + } + } + SERIAL_EOL(); + persistentStore.access_finish(); + #else + SERIAL_ECHOLN("NO EEPROM"); + #endif + } + SERIAL_EOL(); + } + } break; + #endif case 4: { // D4 Read / Write PIN // const uint8_t pin = parser.byteval('P'); @@ -167,6 +171,20 @@ SERIAL_EOL(); } } break; + + case 100: { // D100 Disable heaters and attempt a hard hang (Watchdog Test) + SERIAL_ECHOLN("Disabling heaters and attempting to trigger Watchdog"); + SERIAL_ECHOLN("(USE_WATCHDOG " TERN(USE_WATCHDOG, "ENABLED", "DISABLED") ")"); + thermalManager.disable_all_heaters(); + delay(1000); // Allow time to print + DISABLE_ISRS(); + // Use a low-level delay that does not rely on interrupts to function + // Do not spin forever, to avoid thermal risks if heaters are enabled and + // watchdog does not work. + DELAY_US(10000000); + ENABLE_ISRS(); + SERIAL_ECHOLN("FAILURE: Watchdog did not trigger board reset."); + } } } From 193c0a52d9f1fbd31e42a29734f551aa26ed269a Mon Sep 17 00:00:00 2001 From: "Earle F. Philhower, III" Date: Mon, 12 Oct 2020 14:48:04 -0700 Subject: [PATCH 016/226] Add loose soft endstop state, apply to UBL fine-tune (#19681) Co-authored-by: Scott Lahteine --- Marlin/src/feature/bedlevel/ubl/ubl_G29.cpp | 4 ++ Marlin/src/gcode/bedlevel/abl/G29.cpp | 16 +++--- Marlin/src/gcode/bedlevel/mbl/G29.cpp | 16 ++---- Marlin/src/gcode/calibrate/G28.cpp | 5 +- Marlin/src/gcode/calibrate/G34.cpp | 4 +- Marlin/src/gcode/calibrate/G425.cpp | 9 ++-- Marlin/src/gcode/control/M211.cpp | 4 +- Marlin/src/gcode/feature/clean/G12.cpp | 4 +- Marlin/src/lcd/extui/ui_api.cpp | 28 ++-------- Marlin/src/lcd/menu/menu_motion.cpp | 27 ++-------- Marlin/src/lcd/menu/menu_probe_offset.cpp | 8 +-- Marlin/src/lcd/tft/ui_480x320.cpp | 24 ++------- Marlin/src/libs/nozzle.cpp | 2 +- Marlin/src/module/motion.cpp | 21 ++++---- Marlin/src/module/motion.h | 59 ++++++++++++++++----- Marlin/src/module/tool_change.cpp | 8 +-- 16 files changed, 106 insertions(+), 133 deletions(-) diff --git a/Marlin/src/feature/bedlevel/ubl/ubl_G29.cpp b/Marlin/src/feature/bedlevel/ubl/ubl_G29.cpp index dc91b7d6b1..e41af9f3cd 100644 --- a/Marlin/src/feature/bedlevel/ubl/ubl_G29.cpp +++ b/Marlin/src/feature/bedlevel/ubl/ubl_G29.cpp @@ -1009,6 +1009,8 @@ lcd_mesh_edit_setup(new_z); + SET_SOFT_ENDSTOP_LOOSE(true); + do { idle(); new_z = lcd_mesh_edit(); @@ -1016,6 +1018,8 @@ SERIAL_FLUSH(); // Prevent host M105 buffer overrun. } while (!ui.button_pressed()); + SET_SOFT_ENDSTOP_LOOSE(false); + if (!lcd_map_control) ui.return_to_status(); // Just editing a single point? Return to status if (click_and_hold(abort_fine_tune)) break; // Button held down? Abort editing diff --git a/Marlin/src/gcode/bedlevel/abl/G29.cpp b/Marlin/src/gcode/bedlevel/abl/G29.cpp index e9b6e0e3a6..f7de6c8cee 100644 --- a/Marlin/src/gcode/bedlevel/abl/G29.cpp +++ b/Marlin/src/gcode/bedlevel/abl/G29.cpp @@ -201,10 +201,6 @@ G29_TYPE GcodeSuite::G29() { ABL_VAR int abl_probe_index; #endif - #if BOTH(HAS_SOFTWARE_ENDSTOPS, PROBE_MANUALLY) - ABL_VAR bool saved_soft_endstops_state = true; - #endif - #if ABL_GRID #if ENABLED(PROBE_MANUALLY) @@ -461,7 +457,7 @@ G29_TYPE GcodeSuite::G29() { // Abort current G29 procedure, go back to idle state if (seenA && g29_in_progress) { SERIAL_ECHOLNPGM("Manual G29 aborted"); - TERN_(HAS_SOFTWARE_ENDSTOPS, soft_endstops_enabled = saved_soft_endstops_state); + SET_SOFT_ENDSTOP_LOOSE(false); set_bed_leveling_enabled(abl_should_enable); g29_in_progress = false; TERN_(LCD_BED_LEVELING, ui.wait_for_move = false); @@ -482,7 +478,7 @@ G29_TYPE GcodeSuite::G29() { if (abl_probe_index == 0) { // For the initial G29 S2 save software endstop state - TERN_(HAS_SOFTWARE_ENDSTOPS, saved_soft_endstops_state = soft_endstops_enabled); + SET_SOFT_ENDSTOP_LOOSE(true); // Move close to the bed before the first point do_blocking_move_to_z(0); } @@ -552,14 +548,14 @@ G29_TYPE GcodeSuite::G29() { _manual_goto_xy(probePos); // Can be used here too! // Disable software endstops to allow manual adjustment // If G29 is not completed, they will not be re-enabled - TERN_(HAS_SOFTWARE_ENDSTOPS, soft_endstops_enabled = false); + SET_SOFT_ENDSTOP_LOOSE(true); G29_RETURN(false); } else { // Leveling done! Fall through to G29 finishing code below SERIAL_ECHOLNPGM("Grid probing done."); // Re-enable software endstops, if needed - TERN_(HAS_SOFTWARE_ENDSTOPS, soft_endstops_enabled = saved_soft_endstops_state); + SET_SOFT_ENDSTOP_LOOSE(false); } #elif ENABLED(AUTO_BED_LEVELING_3POINT) @@ -570,7 +566,7 @@ G29_TYPE GcodeSuite::G29() { _manual_goto_xy(probePos); // Disable software endstops to allow manual adjustment // If G29 is not completed, they will not be re-enabled - TERN_(HAS_SOFTWARE_ENDSTOPS, soft_endstops_enabled = false); + SET_SOFT_ENDSTOP_LOOSE(true); G29_RETURN(false); } else { @@ -578,7 +574,7 @@ G29_TYPE GcodeSuite::G29() { SERIAL_ECHOLNPGM("3-point probing done."); // Re-enable software endstops, if needed - TERN_(HAS_SOFTWARE_ENDSTOPS, soft_endstops_enabled = saved_soft_endstops_state); + SET_SOFT_ENDSTOP_LOOSE(false); if (!dryrun) { vector_3 planeNormal = vector_3::cross(points[0] - points[1], points[2] - points[1]).get_normal(); diff --git a/Marlin/src/gcode/bedlevel/mbl/G29.cpp b/Marlin/src/gcode/bedlevel/mbl/G29.cpp index 5da99386ad..d94c16052b 100644 --- a/Marlin/src/gcode/bedlevel/mbl/G29.cpp +++ b/Marlin/src/gcode/bedlevel/mbl/G29.cpp @@ -61,7 +61,6 @@ inline void echo_not_entered(const char c) { SERIAL_CHAR(c); SERIAL_ECHOLNPGM(" void GcodeSuite::G29() { static int mbl_probe_index = -1; - TERN_(HAS_SOFTWARE_ENDSTOPS, static bool saved_soft_endstops_state); MeshLevelingState state = (MeshLevelingState)parser.byteval('S', (int8_t)MeshReport); if (!WITHIN(state, 0, 5)) { @@ -98,26 +97,19 @@ void GcodeSuite::G29() { } // For each G29 S2... if (mbl_probe_index == 0) { - #if HAS_SOFTWARE_ENDSTOPS - // For the initial G29 S2 save software endstop state - saved_soft_endstops_state = soft_endstops_enabled; - #endif // Move close to the bed before the first point do_blocking_move_to_z(0); } else { // Save Z for the previous mesh position mbl.set_zigzag_z(mbl_probe_index - 1, current_position.z); - TERN_(HAS_SOFTWARE_ENDSTOPS, soft_endstops_enabled = saved_soft_endstops_state); + SET_SOFT_ENDSTOP_LOOSE(false); } // If there's another point to sample, move there with optional lift. if (mbl_probe_index < GRID_MAX_POINTS) { - #if HAS_SOFTWARE_ENDSTOPS - // Disable software endstops to allow manual adjustment - // If G29 is not completed, they will not be re-enabled - soft_endstops_enabled = false; - #endif - + // Disable software endstops to allow manual adjustment + // If G29 is left hanging without completion they won't be re-enabled! + SET_SOFT_ENDSTOP_LOOSE(true); mbl.zigzag(mbl_probe_index++, ix, iy); _manual_goto_xy({ mbl.index_to_xpos[ix], mbl.index_to_ypos[iy] }); } diff --git a/Marlin/src/gcode/calibrate/G28.cpp b/Marlin/src/gcode/calibrate/G28.cpp index 7bc40b2127..3420956803 100644 --- a/Marlin/src/gcode/calibrate/G28.cpp +++ b/Marlin/src/gcode/calibrate/G28.cpp @@ -222,8 +222,9 @@ void GcodeSuite::G28() { return; } - // Wait for planner moves to finish! - planner.synchronize(); + planner.synchronize(); // Wait for planner moves to finish! + + SET_SOFT_ENDSTOP_LOOSE(false); // Reset a leftover 'loose' motion state // Disable the leveling matrix before homing #if HAS_LEVELING diff --git a/Marlin/src/gcode/calibrate/G34.cpp b/Marlin/src/gcode/calibrate/G34.cpp index eb1d32f909..fd876d3fe9 100644 --- a/Marlin/src/gcode/calibrate/G34.cpp +++ b/Marlin/src/gcode/calibrate/G34.cpp @@ -40,7 +40,7 @@ void GcodeSuite::G34() { if (homing_needed()) return; - TEMPORARY_SOFT_ENDSTOP_STATE(false); + SET_SOFT_ENDSTOP_LOOSE(true); TEMPORARY_BED_LEVELING_STATE(false); TemporaryGlobalEndstopsState unlock_z(false); @@ -148,6 +148,8 @@ void GcodeSuite::G34() { if (DEBUGGING(LEVELING)) DEBUG_ECHOLNPGM("Running Post Commands"); gcode.process_subcommands_now_P(PSTR(GANTRY_CALIBRATION_COMMANDS_POST)); #endif + + SET_SOFT_ENDSTOP_LOOSE(false); } #endif // MECHANICAL_GANTRY_CALIBRATION diff --git a/Marlin/src/gcode/calibrate/G425.cpp b/Marlin/src/gcode/calibrate/G425.cpp index 746cb10876..8968f78999 100644 --- a/Marlin/src/gcode/calibrate/G425.cpp +++ b/Marlin/src/gcode/calibrate/G425.cpp @@ -581,13 +581,12 @@ void GcodeSuite::G425() { GcodeSuite::process_subcommands_now_P(PSTR(CALIBRATION_SCRIPT_PRE)); #endif - TEMPORARY_SOFT_ENDSTOP_STATE(false); - TEMPORARY_BED_LEVELING_STATE(false); - if (homing_needed_error()) return; - measurements_t m; + TEMPORARY_BED_LEVELING_STATE(false); + SET_SOFT_ENDSTOP_LOOSE(true); + measurements_t m; float uncertainty = parser.seenval('U') ? parser.value_float() : CALIBRATION_MEASUREMENT_UNCERTAIN; if (parser.seen('B')) @@ -612,6 +611,8 @@ void GcodeSuite::G425() { else calibrate_all(); + SET_SOFT_ENDSTOP_LOOSE(false); + #ifdef CALIBRATION_SCRIPT_POST GcodeSuite::process_subcommands_now_P(PSTR(CALIBRATION_SCRIPT_POST)); #endif diff --git a/Marlin/src/gcode/control/M211.cpp b/Marlin/src/gcode/control/M211.cpp index ffad722f3f..2049f1eb69 100644 --- a/Marlin/src/gcode/control/M211.cpp +++ b/Marlin/src/gcode/control/M211.cpp @@ -37,8 +37,8 @@ void GcodeSuite::M211() { l_soft_max = soft_endstop.max.asLogical(); SERIAL_ECHO_START(); SERIAL_ECHOPGM(STR_SOFT_ENDSTOPS); - if (parser.seen('S')) soft_endstops_enabled = parser.value_bool(); - serialprint_onoff(soft_endstops_enabled); + if (parser.seen('S')) soft_endstop._enabled = parser.value_bool(); + serialprint_onoff(soft_endstop._enabled); print_xyz(l_soft_min, PSTR(STR_SOFT_MIN), PSTR(" ")); print_xyz(l_soft_max, PSTR(STR_SOFT_MAX)); } diff --git a/Marlin/src/gcode/feature/clean/G12.cpp b/Marlin/src/gcode/feature/clean/G12.cpp index f91db39703..216db5bae3 100644 --- a/Marlin/src/gcode/feature/clean/G12.cpp +++ b/Marlin/src/gcode/feature/clean/G12.cpp @@ -70,9 +70,11 @@ void GcodeSuite::G12() { TEMPORARY_BED_LEVELING_STATE(!TEST(cleans, Z_AXIS) && planner.leveling_active); #endif - TEMPORARY_SOFT_ENDSTOP_STATE(parser.boolval('E')); + SET_SOFT_ENDSTOP_LOOSE(!parser.boolval('E')); nozzle.clean(pattern, strokes, radius, objects, cleans); + + SET_SOFT_ENDSTOP_LOOSE(false); } #endif // NOZZLE_CLEAN_FEATURE diff --git a/Marlin/src/lcd/extui/ui_api.cpp b/Marlin/src/lcd/extui/ui_api.cpp index 0acfc9c025..30cf696f3e 100644 --- a/Marlin/src/lcd/extui/ui_api.cpp +++ b/Marlin/src/lcd/extui/ui_api.cpp @@ -305,27 +305,9 @@ namespace ExtUI { } void setAxisPosition_mm(const float position, const axis_t axis, const feedRate_t feedrate/*=0*/) { - // Start with no limits to movement - float min = current_position[axis] - 1000, - max = current_position[axis] + 1000; - - // Limit to software endstops, if enabled - #if HAS_SOFTWARE_ENDSTOPS - if (soft_endstops_enabled) switch (axis) { - case X_AXIS: - TERN_(MIN_SOFTWARE_ENDSTOP_X, min = soft_endstop.min.x); - TERN_(MAX_SOFTWARE_ENDSTOP_X, max = soft_endstop.max.x); - break; - case Y_AXIS: - TERN_(MIN_SOFTWARE_ENDSTOP_Y, min = soft_endstop.min.y); - TERN_(MAX_SOFTWARE_ENDSTOP_Y, max = soft_endstop.max.y); - break; - case Z_AXIS: - TERN_(MIN_SOFTWARE_ENDSTOP_Z, min = soft_endstop.min.z); - TERN_(MAX_SOFTWARE_ENDSTOP_Z, max = soft_endstop.max.z); - default: break; - } - #endif // HAS_SOFTWARE_ENDSTOPS + // Get motion limit from software endstops, if any + float min, max; + soft_endstop.get_manual_axis_limits((AxisEnum)axis, min, max); // Delta limits XY based on the current offset from center // This assumes the center is 0,0 @@ -389,8 +371,8 @@ namespace ExtUI { } #if HAS_SOFTWARE_ENDSTOPS - bool getSoftEndstopState() { return soft_endstops_enabled; } - void setSoftEndstopState(const bool value) { soft_endstops_enabled = value; } + bool getSoftEndstopState() { return soft_endstop._enabled; } + void setSoftEndstopState(const bool value) { soft_endstop._enabled = value; } #endif #if HAS_TRINAMIC_CONFIG diff --git a/Marlin/src/lcd/menu/menu_motion.cpp b/Marlin/src/lcd/menu/menu_motion.cpp index 676ba46ea7..2972920f34 100644 --- a/Marlin/src/lcd/menu/menu_motion.cpp +++ b/Marlin/src/lcd/menu/menu_motion.cpp @@ -57,28 +57,9 @@ static void _lcd_move_xyz(PGM_P const name, const AxisEnum axis) { if (ui.use_click()) return ui.goto_previous_screen_no_defer(); if (ui.encoderPosition && !ui.manual_move.processing) { - - // Start with no limits to movement - float min = current_position[axis] - 1000, - max = current_position[axis] + 1000; - - // Limit to software endstops, if enabled - #if HAS_SOFTWARE_ENDSTOPS - if (soft_endstops_enabled) switch (axis) { - case X_AXIS: - TERN_(MIN_SOFTWARE_ENDSTOP_X, min = soft_endstop.min.x); - TERN_(MAX_SOFTWARE_ENDSTOP_X, max = soft_endstop.max.x); - break; - case Y_AXIS: - TERN_(MIN_SOFTWARE_ENDSTOP_Y, min = soft_endstop.min.y); - TERN_(MAX_SOFTWARE_ENDSTOP_Y, max = soft_endstop.max.y); - break; - case Z_AXIS: - TERN_(MIN_SOFTWARE_ENDSTOP_Z, min = soft_endstop.min.z); - TERN_(MAX_SOFTWARE_ENDSTOP_Z, max = soft_endstop.max.z); - default: break; - } - #endif // HAS_SOFTWARE_ENDSTOPS + // Get motion limit from software endstops, if any + float min, max; + soft_endstop.get_manual_axis_limits(axis, min, max); // Delta limits XY based on the current offset from center // This assumes the center is 0,0 @@ -238,7 +219,7 @@ void menu_move() { BACK_ITEM(MSG_MOTION); #if BOTH(HAS_SOFTWARE_ENDSTOPS, SOFT_ENDSTOPS_MENU_ITEM) - EDIT_ITEM(bool, MSG_LCD_SOFT_ENDSTOPS, &soft_endstops_enabled); + EDIT_ITEM(bool, MSG_LCD_SOFT_ENDSTOPS, &soft_endstop._enabled); #endif if (NONE(IS_KINEMATIC, NO_MOTION_BEFORE_HOMING) || all_axes_homed()) { diff --git a/Marlin/src/lcd/menu/menu_probe_offset.cpp b/Marlin/src/lcd/menu/menu_probe_offset.cpp index 87957e6207..6b7830b853 100644 --- a/Marlin/src/lcd/menu/menu_probe_offset.cpp +++ b/Marlin/src/lcd/menu/menu_probe_offset.cpp @@ -48,16 +48,12 @@ float z_offset_backup, calculated_z_offset; TERN_(HAS_LEVELING, bool leveling_was_active); -TERN_(HAS_SOFTWARE_ENDSTOPS, bool store_soft_endstops_enabled); void prepare_for_calibration() { z_offset_backup = probe.offset.z; // Disable soft endstops for free Z movement - #if HAS_SOFTWARE_ENDSTOPS - store_soft_endstops_enabled = soft_endstops_enabled; - soft_endstops_enabled = false; - #endif + SET_SOFT_ENDSTOP_LOOSE(true); // Disable leveling for raw planner motion #if HAS_LEVELING @@ -68,7 +64,7 @@ void prepare_for_calibration() { void set_offset_and_go_back(const float &z) { probe.offset.z = z; - TERN_(HAS_SOFTWARE_ENDSTOPS, soft_endstops_enabled = store_soft_endstops_enabled); + SET_SOFT_ENDSTOP_LOOSE(false); TERN_(HAS_LEVELING, set_bed_leveling_enabled(leveling_was_active)); ui.goto_previous_screen_no_defer(); } diff --git a/Marlin/src/lcd/tft/ui_480x320.cpp b/Marlin/src/lcd/tft/ui_480x320.cpp index 549cbc4d9b..3dab9418f5 100644 --- a/Marlin/src/lcd/tft/ui_480x320.cpp +++ b/Marlin/src/lcd/tft/ui_480x320.cpp @@ -813,27 +813,9 @@ static void moveAxis(AxisEnum axis, const int8_t direction) { } if (!ui.manual_move.processing) { - // Start with no limits to movement - float min = current_position[axis] - 1000, - max = current_position[axis] + 1000; - - // Limit to software endstops, if enabled - #if HAS_SOFTWARE_ENDSTOPS - if (soft_endstops_enabled) switch (axis) { - case X_AXIS: - TERN_(MIN_SOFTWARE_ENDSTOP_X, min = soft_endstop.min.x); - TERN_(MAX_SOFTWARE_ENDSTOP_X, max = soft_endstop.max.x); - break; - case Y_AXIS: - TERN_(MIN_SOFTWARE_ENDSTOP_Y, min = soft_endstop.min.y); - TERN_(MAX_SOFTWARE_ENDSTOP_Y, max = soft_endstop.max.y); - break; - case Z_AXIS: - TERN_(MIN_SOFTWARE_ENDSTOP_Z, min = soft_endstop.min.z); - TERN_(MAX_SOFTWARE_ENDSTOP_Z, max = soft_endstop.max.z); - default: break; - } - #endif // HAS_SOFTWARE_ENDSTOPS + // Get motion limit from software endstops, if any + float min, max; + soft_endstop.get_manual_axis_limits(axis, min, max); // Delta limits XY based on the current offset from center // This assumes the center is 0,0 diff --git a/Marlin/src/libs/nozzle.cpp b/Marlin/src/libs/nozzle.cpp index f93e552481..10021005e5 100644 --- a/Marlin/src/libs/nozzle.cpp +++ b/Marlin/src/libs/nozzle.cpp @@ -161,7 +161,7 @@ Nozzle nozzle; LIMIT( end[arrPos].A, soft_endstop.min.A, soft_endstop.max.A); \ }while(0) - if (soft_endstops_enabled) { + if (soft_endstop.enabled()) { LIMIT_AXIS(x); LIMIT_AXIS(y); diff --git a/Marlin/src/module/motion.cpp b/Marlin/src/module/motion.cpp index da1cb173e5..92712b0c22 100644 --- a/Marlin/src/module/motion.cpp +++ b/Marlin/src/module/motion.cpp @@ -534,12 +534,11 @@ void restore_feedrate_and_scaling() { #if HAS_SOFTWARE_ENDSTOPS - bool soft_endstops_enabled = true; - // Software Endstops are based on the configured limits. - axis_limits_t soft_endstop = { + soft_endstops_t soft_endstop = { { X_MIN_POS, Y_MIN_POS, Z_MIN_POS }, - { X_MAX_POS, Y_MAX_POS, Z_MAX_POS } + { X_MAX_POS, Y_MAX_POS, Z_MAX_POS }, + { true, false } }; /** @@ -624,9 +623,9 @@ void restore_feedrate_and_scaling() { #endif - if (DEBUGGING(LEVELING)) - SERIAL_ECHOLNPAIR("Axis ", XYZ_CHAR(axis), " min:", soft_endstop.min[axis], " max:", soft_endstop.max[axis]); -} + if (DEBUGGING(LEVELING)) + SERIAL_ECHOLNPAIR("Axis ", XYZ_CHAR(axis), " min:", soft_endstop.min[axis], " max:", soft_endstop.max[axis]); + } /** * Constrain the given coordinates to the software endstops. @@ -636,7 +635,7 @@ void restore_feedrate_and_scaling() { */ void apply_motion_limits(xyz_pos_t &target) { - if (!soft_endstops_enabled) return; + if (!soft_endstop._enabled) return; #if IS_KINEMATIC @@ -688,7 +687,11 @@ void restore_feedrate_and_scaling() { } } -#endif // HAS_SOFTWARE_ENDSTOPS +#else // !HAS_SOFTWARE_ENDSTOPS + + soft_endstops_t soft_endstop; + +#endif // !HAS_SOFTWARE_ENDSTOPS #if !UBL_SEGMENTED diff --git a/Marlin/src/module/motion.h b/Marlin/src/module/motion.h index 2b108b0531..338eb387cf 100644 --- a/Marlin/src/module/motion.h +++ b/Marlin/src/module/motion.h @@ -148,26 +148,61 @@ inline float home_bump_mm(const AxisEnum axis) { constexpr xyz_pos_t hotend_offset[1] = { { 0 } }; #endif -typedef struct { xyz_pos_t min, max; } axis_limits_t; #if HAS_SOFTWARE_ENDSTOPS - extern bool soft_endstops_enabled; - extern axis_limits_t soft_endstop; + + typedef struct { + xyz_pos_t min, max; + struct { + bool _enabled:1; + bool _loose:1; + }; + bool enabled() { return _enabled && !_loose; } + void get_manual_axis_limits(const AxisEnum axis, float &amin, float &amax) { + amin = -100000; amax = 100000; // "No limits" + #if HAS_SOFTWARE_ENDSTOPS + if (enabled()) switch (axis) { + case X_AXIS: + TERN_(MIN_SOFTWARE_ENDSTOP_X, amin = min.x); + TERN_(MAX_SOFTWARE_ENDSTOP_X, amax = max.x); + break; + case Y_AXIS: + TERN_(MIN_SOFTWARE_ENDSTOP_Y, amin = min.y); + TERN_(MAX_SOFTWARE_ENDSTOP_Y, amax = max.y); + break; + case Z_AXIS: + TERN_(MIN_SOFTWARE_ENDSTOP_Z, amin = min.z); + TERN_(MAX_SOFTWARE_ENDSTOP_Z, amax = max.z); + default: break; + } + #endif + } + } soft_endstops_t; + + extern soft_endstops_t soft_endstop; void apply_motion_limits(xyz_pos_t &target); void update_software_endstops(const AxisEnum axis #if HAS_HOTEND_OFFSET , const uint8_t old_tool_index=0, const uint8_t new_tool_index=0 #endif ); - #define TEMPORARY_SOFT_ENDSTOP_STATE(enable) REMEMBER(tes, soft_endstops_enabled, enable); -#else - constexpr bool soft_endstops_enabled = false; - //constexpr axis_limits_t soft_endstop = { - // { X_MIN_POS, Y_MIN_POS, Z_MIN_POS }, - // { X_MAX_POS, Y_MAX_POS, Z_MAX_POS } }; - #define apply_motion_limits(V) NOOP + #define SET_SOFT_ENDSTOP_LOOSE(loose) (soft_endstop._loose = loose) + +#else // !HAS_SOFTWARE_ENDSTOPS + + typedef struct { + bool enabled() { return false; } + void get_manual_axis_limits(const AxisEnum axis, float &amin, float &amax) { + // No limits + amin = current_position[axis] - 1000; + amax = current_position[axis] + 1000; + } + } soft_endstops_t; + extern soft_endstops_t soft_endstop; + #define apply_motion_limits(V) NOOP #define update_software_endstops(...) NOOP - #define TEMPORARY_SOFT_ENDSTOP_STATE(...) NOOP -#endif + #define SET_SOFT_ENDSTOP_LOOSE() NOOP + +#endif // !HAS_SOFTWARE_ENDSTOPS void report_real_position(); void report_current_position(); diff --git a/Marlin/src/module/tool_change.cpp b/Marlin/src/module/tool_change.cpp index 0f823cfbd0..4ab818f41d 100644 --- a/Marlin/src/module/tool_change.cpp +++ b/Marlin/src/module/tool_change.cpp @@ -1017,14 +1017,10 @@ void tool_change(const uint8_t new_tool, bool no_move/*=false*/) { // Raise by a configured distance to avoid workpiece, except with // SWITCHING_NOZZLE_TWO_SERVOS, as both nozzles will lift instead. if (!no_move) { - #if HAS_SOFTWARE_ENDSTOPS - const float maxz = _MIN(soft_endstop.max.z, Z_MAX_POS); - #else - constexpr float maxz = Z_MAX_POS; - #endif + const float newz = current_position.z + _MAX(-diff.z, 0.0); // Check if Z has space to compensate at least z_offset, and if not, just abort now - const float newz = current_position.z + _MAX(-diff.z, 0.0); + const float maxz = _MIN(TERN(HAS_SOFTWARE_ENDSTOPS, soft_endstop.max.z, Z_MAX_POS), Z_MAX_POS); if (newz > maxz) return; current_position.z = _MIN(newz + toolchange_settings.z_raise, maxz); From f9f8fd37debb795cd042975d19aa7f4ec181a23e Mon Sep 17 00:00:00 2001 From: Keith Bennett <13375512+thisiskeithb@users.noreply.github.com> Date: Mon, 12 Oct 2020 14:52:56 -0700 Subject: [PATCH 017/226] Sanity-check mutually-exclusive G34 features (#19706) --- Marlin/src/inc/SanityCheck.h | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Marlin/src/inc/SanityCheck.h b/Marlin/src/inc/SanityCheck.h index 7acb5e70c9..2cffde0907 100644 --- a/Marlin/src/inc/SanityCheck.h +++ b/Marlin/src/inc/SanityCheck.h @@ -2807,6 +2807,10 @@ static_assert( _ARR_TEST(3,0) && _ARR_TEST(3,1) && _ARR_TEST(3,2) #endif #endif +#if BOTH(Z_STEPPER_AUTO_ALIGN, MECHANICAL_GANTRY_CALIBRATION) + #error "You cannot use Z_STEPPER_AUTO_ALIGN and MECHANICAL_GANTRY_CALIBRATION at the same time." +#endif + #if ENABLED(PRINTCOUNTER) && DISABLED(EEPROM_SETTINGS) #error "PRINTCOUNTER requires EEPROM_SETTINGS. Please update your Configuration." #endif From cc4db8e4a99db81a441a765a1e86e98e2e53a04d Mon Sep 17 00:00:00 2001 From: Victor Oliveira Date: Mon, 12 Oct 2020 20:01:03 -0300 Subject: [PATCH 018/226] Fix UTF8 handling for Color UI (#19708) --- Marlin/src/lcd/tft/tft_string.cpp | 11 +++++++++++ Marlin/src/lcd/tft/tft_string.h | 2 +- 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/Marlin/src/lcd/tft/tft_string.cpp b/Marlin/src/lcd/tft/tft_string.cpp index 7e66c3d29c..663ed97c36 100644 --- a/Marlin/src/lcd/tft/tft_string.cpp +++ b/Marlin/src/lcd/tft/tft_string.cpp @@ -116,6 +116,17 @@ void TFT_String::add(uint8_t *string, int8_t index, uint8_t *itemString) { eol(); } +void TFT_String::add(uint8_t *string) { + wchar_t wchar; + while (*string) { + string = get_utf8_value_cb(string, read_byte, &wchar); + if (wchar > 255) wchar |= 0x0080; + uint8_t ch = uint8_t(wchar & 0x00FF); + add_character(ch); + } + eol(); +} + void TFT_String::add_character(uint8_t character) { if (length < MAX_STRING_LENGTH) { data[length] = character; diff --git a/Marlin/src/lcd/tft/tft_string.h b/Marlin/src/lcd/tft/tft_string.h index d83d3af702..924d6de430 100644 --- a/Marlin/src/lcd/tft/tft_string.h +++ b/Marlin/src/lcd/tft/tft_string.h @@ -85,7 +85,7 @@ class TFT_String { static void set(); static void add(uint8_t character) { add_character(character); eol(); } - static void add(uint8_t *string) { while (*string) { add_character(*string++); } eol(); } + static void add(uint8_t *string); static void add(uint8_t *string, int8_t index, uint8_t *itemString = NULL); static void set(uint8_t *string) { set(); add(string); }; static void set(uint8_t *string, int8_t index, const char *itemString = NULL) { set(); add(string, index, (uint8_t *)itemString); }; From ae36ed390312c80b03fb36225755fddf9f9205b7 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Mon, 12 Oct 2020 17:48:50 -0500 Subject: [PATCH 019/226] Move @section temperature --- Marlin/Configuration.h | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/Marlin/Configuration.h b/Marlin/Configuration.h index 8f37f1e799..db266b524b 100644 --- a/Marlin/Configuration.h +++ b/Marlin/Configuration.h @@ -346,11 +346,10 @@ #endif #endif -// @section temperature - //=========================================================================== //============================= Thermal Settings ============================ //=========================================================================== +// @section temperature /** * --NORMAL IS 4.7kohm PULLUP!-- 1kohm pullup can be used on hotend sensor, using correct resistor and table From da79674f84ef65cb014288a27d60f8709b1f0936 Mon Sep 17 00:00:00 2001 From: thinkyhead Date: Tue, 13 Oct 2020 00:15:19 +0000 Subject: [PATCH 020/226] [cron] Bump distribution date (2020-10-13) --- Marlin/src/inc/Version.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Marlin/src/inc/Version.h b/Marlin/src/inc/Version.h index 74f713091d..b1576c06be 100644 --- a/Marlin/src/inc/Version.h +++ b/Marlin/src/inc/Version.h @@ -42,7 +42,7 @@ * version was tagged. */ #ifndef STRING_DISTRIBUTION_DATE - #define STRING_DISTRIBUTION_DATE "2020-10-12" + #define STRING_DISTRIBUTION_DATE "2020-10-13" #endif /** From 2132efa9817fa1ee5d4e0773c2b8dcfac4da161a Mon Sep 17 00:00:00 2001 From: Victor Oliveira Date: Tue, 13 Oct 2020 13:58:50 -0300 Subject: [PATCH 021/226] TFT followup fixes (#19710) --- .../src/lcd/extui/lib/mks_ui/tft_lvgl_configuration.cpp | 3 ++- Marlin/src/lcd/tft/touch.cpp | 4 ---- Marlin/src/lcd/tft_io/ili9328.h | 8 +++++--- Marlin/src/lcd/tft_io/r65105.h | 8 +++++--- 4 files changed, 12 insertions(+), 11 deletions(-) diff --git a/Marlin/src/lcd/extui/lib/mks_ui/tft_lvgl_configuration.cpp b/Marlin/src/lcd/extui/lib/mks_ui/tft_lvgl_configuration.cpp index ecd4eb482a..ccb6a8e4dc 100644 --- a/Marlin/src/lcd/extui/lib/mks_ui/tft_lvgl_configuration.cpp +++ b/Marlin/src/lcd/extui/lib/mks_ui/tft_lvgl_configuration.cpp @@ -474,7 +474,8 @@ void lv_encoder_pin_init() { #endif - static uint8_t buttons = newbutton; + static uint8_t buttons = 0; + buttons = newbutton; static uint8_t lastEncoderBits; #define encrot0 0 diff --git a/Marlin/src/lcd/tft/touch.cpp b/Marlin/src/lcd/tft/touch.cpp index 2124a42e28..80c65f074a 100644 --- a/Marlin/src/lcd/tft/touch.cpp +++ b/Marlin/src/lcd/tft/touch.cpp @@ -295,10 +295,6 @@ bool Touch::get_point(int16_t *x, int16_t *y) { if (is_touched && calibration.orientation != TOUCH_ORIENTATION_NONE) { *x = int16_t((int32_t(*x) * calibration.x) >> 16) + calibration.offset_x; *y = int16_t((int32_t(*y) * calibration.y) >> 16) + calibration.offset_y; - #if (TFT_ROTATION & TFT_ROTATE_180) - *x = TFT_WIDTH - *x; - *y = TFT_HEIGHT - *y; - #endif } return is_touched; } diff --git a/Marlin/src/lcd/tft_io/ili9328.h b/Marlin/src/lcd/tft_io/ili9328.h index 818dd05b34..b50517adfe 100644 --- a/Marlin/src/lcd/tft_io/ili9328.h +++ b/Marlin/src/lcd/tft_io/ili9328.h @@ -49,9 +49,11 @@ #define ILI9328_GATE_SCANCTL1_DATA 0x2700 #endif -// #define ILI9328_ETMOD_ORIENTATION IF_0((TFT_ORIENTATION) & TFT_EXCHANGE_XY, ILI9328_ETMOD_AM) | \ -// IF_0((TFT_ORIENTATION) & TFT_INVERT_X, ILI9328_ETMOD_ID1) | \ -// IF_0((TFT_ORIENTATION) & TFT_INVERT_Y, ILI9328_ETMOD_ID0) +/* +#define ILI9328_ETMOD_ORIENTATION IF_0((TFT_ORIENTATION) & TFT_EXCHANGE_XY, ILI9328_ETMOD_AM) | \ + IF_0((TFT_ORIENTATION) & TFT_INVERT_X, ILI9328_ETMOD_ID1) | \ + IF_0((TFT_ORIENTATION) & TFT_INVERT_Y, ILI9328_ETMOD_ID0) +*/ #define ILI9328_ETMOD_ORIENTATION (ILI9328_ETMOD_AM | ILI9328_ETMOD_ID1 | ILI9328_ETMOD_ID0) diff --git a/Marlin/src/lcd/tft_io/r65105.h b/Marlin/src/lcd/tft_io/r65105.h index a813c3260b..8be2afe442 100644 --- a/Marlin/src/lcd/tft_io/r65105.h +++ b/Marlin/src/lcd/tft_io/r65105.h @@ -51,9 +51,11 @@ #define R61505_DRVCTRL_DATA 0x2700 #endif -// #define R61505_ETMOD_ORIENTATION IF_0((TFT_ORIENTATION) & TFT_EXCHANGE_XY, R61505_ETMOD_AM) | \ -// IF_0((TFT_ORIENTATION) & TFT_INVERT_X, R61505_ETMOD_ID0) | \ -// IF_0((TFT_ORIENTATION) & TFT_INVERT_Y, R61505_ETMOD_ID1) +/* +#define R61505_ETMOD_ORIENTATION IF_0((TFT_ORIENTATION) & TFT_EXCHANGE_XY, R61505_ETMOD_AM) | \ + IF_0((TFT_ORIENTATION) & TFT_INVERT_X, R61505_ETMOD_ID0) | \ + IF_0((TFT_ORIENTATION) & TFT_INVERT_Y, R61505_ETMOD_ID1) +*/ #define R61505_ETMOD_ORIENTATION (R61505_ETMOD_AM | R61505_ETMOD_ID0 | R61505_ETMOD_ID1) From 733eb127e9abb6910f4cc0f1adabb4c696eeb571 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Tue, 13 Oct 2020 14:54:56 -0500 Subject: [PATCH 022/226] Simple bool in soft_endstops_t --- Marlin/src/module/motion.cpp | 4 ++-- Marlin/src/module/motion.h | 8 +++----- 2 files changed, 5 insertions(+), 7 deletions(-) diff --git a/Marlin/src/module/motion.cpp b/Marlin/src/module/motion.cpp index 92712b0c22..5b3fab10b1 100644 --- a/Marlin/src/module/motion.cpp +++ b/Marlin/src/module/motion.cpp @@ -536,9 +536,9 @@ void restore_feedrate_and_scaling() { // Software Endstops are based on the configured limits. soft_endstops_t soft_endstop = { + true, false, { X_MIN_POS, Y_MIN_POS, Z_MIN_POS }, - { X_MAX_POS, Y_MAX_POS, Z_MAX_POS }, - { true, false } + { X_MAX_POS, Y_MAX_POS, Z_MAX_POS } }; /** diff --git a/Marlin/src/module/motion.h b/Marlin/src/module/motion.h index 338eb387cf..550168e8a8 100644 --- a/Marlin/src/module/motion.h +++ b/Marlin/src/module/motion.h @@ -151,12 +151,10 @@ inline float home_bump_mm(const AxisEnum axis) { #if HAS_SOFTWARE_ENDSTOPS typedef struct { - xyz_pos_t min, max; - struct { - bool _enabled:1; - bool _loose:1; - }; + bool _enabled, _loose; bool enabled() { return _enabled && !_loose; } + + xyz_pos_t min, max; void get_manual_axis_limits(const AxisEnum axis, float &amin, float &amax) { amin = -100000; amax = 100000; // "No limits" #if HAS_SOFTWARE_ENDSTOPS From 54315252c7c70513f7b39f4c37d975dbf539d490 Mon Sep 17 00:00:00 2001 From: Jason Smith Date: Tue, 13 Oct 2020 16:03:09 -0700 Subject: [PATCH 023/226] Add NUCLEO-F767ZI dev board (#19373) Co-authored-by: Lorenzo Delana --- .../src/HAL/shared/backtrace/unwmemaccess.cpp | 2 +- Marlin/src/core/boards.h | 1 + Marlin/src/pins/pins.h | 2 + Marlin/src/pins/stm32f7/pins_NUCLEO_F767ZI.h | 201 ++++++++++++++++++ platformio.ini | 11 + 5 files changed, 216 insertions(+), 1 deletion(-) create mode 100644 Marlin/src/pins/stm32f7/pins_NUCLEO_F767ZI.h diff --git a/Marlin/src/HAL/shared/backtrace/unwmemaccess.cpp b/Marlin/src/HAL/shared/backtrace/unwmemaccess.cpp index 4b085f90ce..c93494d485 100644 --- a/Marlin/src/HAL/shared/backtrace/unwmemaccess.cpp +++ b/Marlin/src/HAL/shared/backtrace/unwmemaccess.cpp @@ -85,7 +85,7 @@ #define START_FLASH_ADDR 0x08000000 #define END_FLASH_ADDR 0x08100000 -#elif MB(REMRAM_V1) +#elif MB(REMRAM_V1, NUCLEO_F767ZI) // For STM32F765VI in RemRam v1 // SRAM (0x20000000 - 0x20080000) (512kb) diff --git a/Marlin/src/core/boards.h b/Marlin/src/core/boards.h index 8658c85785..da7d15ec33 100644 --- a/Marlin/src/core/boards.h +++ b/Marlin/src/core/boards.h @@ -363,6 +363,7 @@ #define BOARD_REMRAM_V1 5001 // RemRam v1 #define BOARD_TEENSY41 5002 // Teensy 4.1 #define BOARD_T41U5XBB 5003 // T41U5XBB Teensy 4.1 breakout board +#define BOARD_NUCLEO_F767ZI 5004 // ST NUCLEO-F767ZI Dev Board // // Espressif ESP32 WiFi diff --git a/Marlin/src/pins/pins.h b/Marlin/src/pins/pins.h index a7888e54d4..c5dbd20876 100644 --- a/Marlin/src/pins/pins.h +++ b/Marlin/src/pins/pins.h @@ -634,6 +634,8 @@ #include "stm32f7/pins_THE_BORG.h" // STM32F7 env:STM32F7 #elif MB(REMRAM_V1) #include "stm32f7/pins_REMRAM_V1.h" // STM32F7 env:STM32F7 +#elif MB(NUCLEO_F767ZI) + #include "stm32f7/pins_NUCLEO_F767ZI.h" // STM32F7 env:NUCLEO_F767ZI #elif MB(TEENSY41) #include "teensy4/pins_TEENSY41.h" // Teensy-4.x env:teensy41 #elif MB(T41U5XBB) diff --git a/Marlin/src/pins/stm32f7/pins_NUCLEO_F767ZI.h b/Marlin/src/pins/stm32f7/pins_NUCLEO_F767ZI.h new file mode 100644 index 0000000000..5e3d5f4ab5 --- /dev/null +++ b/Marlin/src/pins/stm32f7/pins_NUCLEO_F767ZI.h @@ -0,0 +1,201 @@ +/** + * Marlin 3D Printer Firmware + * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] + * + * Based on Sprinter and grbl. + * Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + * + */ +#pragma once + +#ifndef STM32F767xx + #error "Oops! Select an STM32F767 environment" +#endif + +#define BOARD_INFO_NAME "NUCLEO-F767ZI" +#define DEFAULT_MACHINE_NAME "Prototype Board" + +#if NO_EEPROM_SELECTED + #define FLASH_EEPROM_EMULATION // Use Flash-based EEPROM emulation +#endif + +#if ENABLED(FLASH_EEPROM_EMULATION) + // Decrease delays and flash wear by spreading writes across the + // 128 kB sector allocated for EEPROM emulation. + // Not yet supported on F7 hardware + // #define FLASH_EEPROM_LEVELING +#endif + +/** + * Timer assignments + * + * TIM1 - + * TIM2 - Hardware PWM (Fan/Heater Pins) + * TIM3 - Hardware PWM (Servo Pins) + * TIM4 - STEP_TIMER (Marlin) + * TIM5 - + * TIM6 - TIMER_TONE (variant.h) + * TIM7 - TIMER_SERVO (variant.h) + * TIM9 - TIMER_SERIAL (platformio.ini) + * TIM10 - For some reason trips Watchdog when used for SW Serial + * TIM11 - + * TIM12 - + * TIM13 - + * TIM14 - TEMP_TIMER (Marlin) + * + */ +#define STEP_TIMER 4 +#define TEMP_TIMER 14 + + +/** + * These pin assignments are arbitrary and intending for testing purposes. + * Assignments may not be ideal, and not every assignment has been tested. + * Proceed at your own risk. + * _CN7_ + * (X_STEP) PC6 | · · | PB8 (X_EN) + * (X_DIR) PB15 | · · | PB9 (X_CS) + * (LCD_D4) PB13 | · · | AVDD + * _CN8_ PB12 | · · | GND + * NC | · · | PC8 (HEATER_0) PA15 | · · | PA5 (SCLK) + * IOREF | · · | PC9 (BEEPER) PC7 | · · | PA6 (MISO) + * RESET | · · | PC10 (SERVO1_PIN) PB5 | · · | PA7 (MOSI) + * +3.3V | · · | PC11 (HEATER_BED) PB3 | · · | PD14 (SD_DETECT) + * +5V | · · | PC12 (SDSS) PA4 | · · | PD15 (LCD_ENABLE) + * GND | · · | PD2 (SERVO0_PIN) PB4 | · · | PF12 (LCD_RS) + * GND | · · | PG2  ̄ ̄ ̄ + * VIN | · · | PG3 +_*  ̄ ̄ ̄ _CN10 + * AVDD | · · | PF13 (BTN_EN1) + * _CN9_ AGND | · · | PE9 (BTN_EN2) + * (TEMP_0) PA3 | · · | PD7 GND | · · | PE11 (BTN_ENC) + * (TEMP_BED) PC0 | · · | PD6 PB1 | · · | PF14 + * PC3 | · · | PD5 PC2 | · · | PE13 + * PF3 | · · | PD4 PF4 | · · | PF15 + * PF5 | · · | PD3 (E_STEP) PB6 | · · | PG14 (E_EN) + * PF10 | · · | GND (E_DIR) PB2 | · · | PG9 (E_CS) + * NC | · · | PE2 GND | · · | PE8 + * PA7 | · · | PE4 PD13 | · · | PE7 + * PF2 | · · | PE5 PD12 | · · | GND + * (Y_STEP) PF1 | · · | PE6 (Y_EN) (Z_STEP) PD11 | · · | PE10 (Z_EN) + * (Y_DIR) PF0 | · · | PE3 (Y_CS) (Z_DIR) PE2 | · · | PE12 (Z_CS) + * GND | · · | PF8 GND | · · | PE14 + * (Z_MAX) PD0 | · · | PF7 (X_MIN) PA0 | · · | PE15 + * (Z_MIN) PD1 | · · | PF9 (X_MAX) PB0 | · · | PB10 (FAN) + * (Y_MAX) PG0 | · · | PG1 (Y_MIN) PE0 | · · | PB11 (FAN1) + *  ̄ ̄ ̄  ̄ ̄ ̄ ̄ + */ + +#define X_MIN_PIN PF7 +#define X_MAX_PIN PF9 +#define Y_MIN_PIN PG1 +#define Y_MAX_PIN PG0 +#define Z_MIN_PIN PD1 +#define Z_MAX_PIN PD0 + +// +// Steppers +// +#define X_STEP_PIN PC6 +#define X_DIR_PIN PB15 +#define X_ENABLE_PIN PB8 +#define X_CS_PIN PB9 + +#define Y_STEP_PIN PF1 +#define Y_DIR_PIN PF0 +#define Y_ENABLE_PIN PE6 +#define Y_CS_PIN PE3 + +#define Z_STEP_PIN PD11 +#define Z_DIR_PIN PE2 +#define Z_ENABLE_PIN PE10 +#define Z_CS_PIN PE12 + +#define E0_STEP_PIN PB6 +#define E0_DIR_PIN PB2 +#define E0_ENABLE_PIN PG14 +#define E0_CS_PIN PG9 + +#if HAS_TMC_UART + #define X_SERIAL_TX_PIN PB9 + #define X_SERIAL_RX_PIN PB9 + + #define Y_SERIAL_TX_PIN PE3 + #define Y_SERIAL_RX_PIN PE3 + + #define Z_SERIAL_TX_PIN PE12 + #define Z_SERIAL_RX_PIN PE12 + + #define E_SERIAL_TX_PIN PG9 + #define E_SERIAL_RX_PIN PG9 +#endif + +// +// Temperature Sensors +// +#define TEMP_0_PIN PA3 +#define TEMP_BED_PIN PC0 + +// +// Heaters / Fans +// +#define HEATER_0_PIN PA15 // PWM Capable, TIM2_CH1 +#define HEATER_BED_PIN PB3 // PWM Capable, TIM2_CH2 + +#ifndef FAN_PIN + #define FAN_PIN PB10 // PWM Capable, TIM2_CH3 +#endif +#define FAN1_PIN PB11 // PWM Capable, TIM2_CH4 + +#ifndef E0_AUTO_FAN_PIN + #define E0_AUTO_FAN_PIN FAN1_PIN +#endif + +// +// Servos +// +#define SERVO0_PIN PB4 // PWM Capable, TIM3_CH1 +#define SERVO1_PIN PB5 // PWM Capable, TIM3_CH2 + +// SPI for external SD Card (Not entirely sure this will work) +#define SCK_PIN PA5 +#define MISO_PIN PA6 +#define MOSI_PIN PA7 +#define SS_PIN PA4 +#define SDSS PA4 + +#define LED_PIN LED_BLUE + +// +// LCD / Controller +// +#if ENABLED(REPRAP_DISCOUNT_FULL_GRAPHIC_SMART_CONTROLLER) + #define BEEPER_PIN PC7 // LCD_BEEPER + #define BTN_ENC PE11 // BTN_ENC + #define SD_DETECT_PIN PD14 + #define LCD_PINS_RS PF12 // LCD_RS + #define LCD_PINS_ENABLE PD15 // LCD_EN + #define LCD_PINS_D4 PB13 // LCD_D4 + // #define LCD_PINS_D5 + // #define LCD_PINS_D6 + // #define LCD_PINS_D7 + #define BTN_EN1 PF13 // BTN_EN1 + #define BTN_EN2 PE9 // BTN_EN2 + + #define BOARD_ST7920_DELAY_1 DELAY_NS(125) + #define BOARD_ST7920_DELAY_2 DELAY_NS(63) + #define BOARD_ST7920_DELAY_3 DELAY_NS(780) +#endif diff --git a/platformio.ini b/platformio.ini index 9c9460d1a3..bb5cc243e5 100644 --- a/platformio.ini +++ b/platformio.ini @@ -856,6 +856,17 @@ board = remram_v1 build_flags = ${common.build_flags} -DUSE_STM32GENERIC -DSTM32GENERIC -DSTM32F7 -DMENU_USB_SERIAL -DMENU_SERIAL=SerialUSB -DHAL_IWDG_MODULE_ENABLED src_filter = ${common.default_src_filter} + - +# +# ST NUCLEO-F767ZI Development Board +# This environment is for testing purposes prior to control boards +# being readily available based on STM32F7 MCUs +# +[env:NUCLEO_F767ZI] +platform = ${common_stm32.platform} +extends = common_stm32 +board = nucleo_f767zi +build_flags = ${common_stm32.build_flags} -DTIMER_SERIAL=TIM9 + # # ARMED (STM32) # From bf33b2f862a0141e1eabc7d864f80de2d97bf9d2 Mon Sep 17 00:00:00 2001 From: Victor Oliveira Date: Tue, 13 Oct 2020 20:12:34 -0300 Subject: [PATCH 024/226] Watchdog Refresh for LVGL Asset Load (#19724) --- Marlin/src/lcd/extui/lib/mks_ui/pic_manager.cpp | 17 +++++++++++++++-- .../extui/lib/mks_ui/tft_lvgl_configuration.cpp | 3 +++ 2 files changed, 18 insertions(+), 2 deletions(-) diff --git a/Marlin/src/lcd/extui/lib/mks_ui/pic_manager.cpp b/Marlin/src/lcd/extui/lib/mks_ui/pic_manager.cpp index d6f5fbf8b5..07ac563802 100644 --- a/Marlin/src/lcd/extui/lib/mks_ui/pic_manager.cpp +++ b/Marlin/src/lcd/extui/lib/mks_ui/pic_manager.cpp @@ -266,19 +266,24 @@ void spiFlashErase_PIC() { W25QXX.init(SPI_QUARTER_SPEED); //erase 0x001000 -64K for (pic_sectorcnt = 0; pic_sectorcnt < (64 - 4) / 4; pic_sectorcnt++) { + watchdog_refresh(); W25QXX.SPI_FLASH_SectorErase(PICINFOADDR + pic_sectorcnt * 4 * 1024); } //erase 64K -- 6M - for (pic_sectorcnt = 0; pic_sectorcnt < (PIC_SIZE_xM * 1024 / 64 - 1); pic_sectorcnt++) + for (pic_sectorcnt = 0; pic_sectorcnt < (PIC_SIZE_xM * 1024 / 64 - 1); pic_sectorcnt++) { + watchdog_refresh(); W25QXX.SPI_FLASH_BlockErase((pic_sectorcnt + 1) * 64 * 1024); + } } #if HAS_SPI_FLASH_FONT void spiFlashErase_FONT() { volatile uint32_t Font_sectorcnt = 0; W25QXX.init(SPI_QUARTER_SPEED); - for (Font_sectorcnt = 0; Font_sectorcnt < 32-1; Font_sectorcnt++) + for (Font_sectorcnt = 0; Font_sectorcnt < 32-1; Font_sectorcnt++) { + watchdog_refresh(); W25QXX.SPI_FLASH_BlockErase(FONTINFOADDR + Font_sectorcnt * 64 * 1024); + } } #endif @@ -410,6 +415,7 @@ uint8_t public_buf[512]; return; } + watchdog_refresh(); disp_assets_update_progress(fn); W25QXX.init(SPI_QUARTER_SPEED); @@ -422,18 +428,21 @@ uint8_t public_buf[512]; totalSizeLoaded += pfileSize; if (assetType == ASSET_TYPE_LOGO) { do { + watchdog_refresh(); pbr = file.read(public_buf, BMP_WRITE_BUF_LEN); Pic_Logo_Write((uint8_t *)fn, public_buf, pbr); } while (pbr >= BMP_WRITE_BUF_LEN); } else if (assetType == ASSET_TYPE_TITLE_LOGO) { do { + watchdog_refresh(); pbr = file.read(public_buf, BMP_WRITE_BUF_LEN); Pic_TitleLogo_Write((uint8_t *)fn, public_buf, pbr); } while (pbr >= BMP_WRITE_BUF_LEN); } else if (assetType == ASSET_TYPE_G_PREVIEW) { do { + watchdog_refresh(); pbr = file.read(public_buf, BMP_WRITE_BUF_LEN); default_view_Write(public_buf, pbr); } while (pbr >= BMP_WRITE_BUF_LEN); @@ -443,6 +452,7 @@ uint8_t public_buf[512]; SPIFlash.beginWrite(Pic_Write_Addr); #if HAS_SPI_FLASH_COMPRESSION do { + watchdog_refresh(); pbr = file.read(public_buf, SPI_FLASH_PageSize); TERN_(MARLIN_DEV_MODE, totalSizes += pbr); SPIFlash.writeData(public_buf, SPI_FLASH_PageSize); @@ -463,6 +473,7 @@ uint8_t public_buf[512]; else if (assetType == ASSET_TYPE_FONT) { Pic_Write_Addr = UNIGBK_FLASH_ADDR; do { + watchdog_refresh(); pbr = file.read(public_buf, BMP_WRITE_BUF_LEN); W25QXX.SPI_FLASH_BufferWrite(public_buf, Pic_Write_Addr, pbr); Pic_Write_Addr += pbr; @@ -482,9 +493,11 @@ uint8_t public_buf[512]; disp_assets_update(); disp_assets_update_progress("Erasing pics..."); + watchdog_refresh(); spiFlashErase_PIC(); #if HAS_SPI_FLASH_FONT disp_assets_update_progress("Erasing fonts..."); + watchdog_refresh(); spiFlashErase_FONT(); #endif diff --git a/Marlin/src/lcd/extui/lib/mks_ui/tft_lvgl_configuration.cpp b/Marlin/src/lcd/extui/lib/mks_ui/tft_lvgl_configuration.cpp index ccb6a8e4dc..c0cd14d70d 100644 --- a/Marlin/src/lcd/extui/lib/mks_ui/tft_lvgl_configuration.cpp +++ b/Marlin/src/lcd/extui/lib/mks_ui/tft_lvgl_configuration.cpp @@ -123,8 +123,11 @@ void tft_lvgl_init() { //spi_flash_read_test(); #if ENABLED(SDSUPPORT) + watchdog_refresh(); UpdateAssets(); #endif + + watchdog_refresh(); mks_test_get(); touch.Init(); From 64711e0d56e6f388dd661375d0e3cd14626bbf72 Mon Sep 17 00:00:00 2001 From: Keith Bennett <13375512+thisiskeithb@users.noreply.github.com> Date: Tue, 13 Oct 2020 16:13:25 -0700 Subject: [PATCH 025/226] If needed, home before G34 (#19713) --- Marlin/src/gcode/calibrate/G34.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Marlin/src/gcode/calibrate/G34.cpp b/Marlin/src/gcode/calibrate/G34.cpp index fd876d3fe9..0ca4490eb6 100644 --- a/Marlin/src/gcode/calibrate/G34.cpp +++ b/Marlin/src/gcode/calibrate/G34.cpp @@ -38,7 +38,8 @@ void GcodeSuite::G34() { - if (homing_needed()) return; + // Home before the alignment procedure + if (!all_axes_known()) home_all_axes(); SET_SOFT_ENDSTOP_LOOSE(true); TEMPORARY_BED_LEVELING_STATE(false); From 87b07d6f2f8ca25e59e2a8751afd79b0b80b22ba Mon Sep 17 00:00:00 2001 From: thinkyhead Date: Wed, 14 Oct 2020 00:15:03 +0000 Subject: [PATCH 026/226] [cron] Bump distribution date (2020-10-14) --- Marlin/src/inc/Version.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Marlin/src/inc/Version.h b/Marlin/src/inc/Version.h index b1576c06be..4b5c0cb7fd 100644 --- a/Marlin/src/inc/Version.h +++ b/Marlin/src/inc/Version.h @@ -42,7 +42,7 @@ * version was tagged. */ #ifndef STRING_DISTRIBUTION_DATE - #define STRING_DISTRIBUTION_DATE "2020-10-13" + #define STRING_DISTRIBUTION_DATE "2020-10-14" #endif /** From 9507c49b18b2710b81a80b2780f14db7185b32fe Mon Sep 17 00:00:00 2001 From: Jason Smith Date: Wed, 14 Oct 2020 11:43:36 -0700 Subject: [PATCH 027/226] Fix mega2560ext environment (#19730) --- platformio.ini | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/platformio.ini b/platformio.ini index bb5cc243e5..0abb4ac388 100644 --- a/platformio.ini +++ b/platformio.ini @@ -445,7 +445,7 @@ board = megaatmega2560 # [env:mega2560ext] platform = atmelavr -extends = mega2560 +extends = env:mega2560 board = megaatmega2560 board_build.variant = megaextendedpins extra_scripts = ${common.extra_scripts} From 79d51581badbb08a528a1f669630d7240da81df2 Mon Sep 17 00:00:00 2001 From: Jason Smith Date: Wed, 14 Oct 2020 11:44:03 -0700 Subject: [PATCH 028/226] Fix digipot compilation (#19731) --- Marlin/src/feature/digipot/digipot.h | 2 +- Marlin/src/feature/digipot/digipot_mcp4018.cpp | 2 ++ Marlin/src/feature/digipot/digipot_mcp4451.cpp | 2 ++ 3 files changed, 5 insertions(+), 1 deletion(-) diff --git a/Marlin/src/feature/digipot/digipot.h b/Marlin/src/feature/digipot/digipot.h index c53f8093dd..3fbd1f3662 100644 --- a/Marlin/src/feature/digipot/digipot.h +++ b/Marlin/src/feature/digipot/digipot.h @@ -30,4 +30,4 @@ public: static void set_current(const uint8_t channel, const float current); }; -DigipotI2C digipot_i2c; +extern DigipotI2C digipot_i2c; diff --git a/Marlin/src/feature/digipot/digipot_mcp4018.cpp b/Marlin/src/feature/digipot/digipot_mcp4018.cpp index 6260185fc3..4b90cc4ead 100644 --- a/Marlin/src/feature/digipot/digipot_mcp4018.cpp +++ b/Marlin/src/feature/digipot/digipot_mcp4018.cpp @@ -99,4 +99,6 @@ void DigipotI2C::init() { set_current(i, pgm_read_float(&digipot_motor_current[i])); } +DigipotI2C digipot_i2c; + #endif // DIGIPOT_MCP4018 diff --git a/Marlin/src/feature/digipot/digipot_mcp4451.cpp b/Marlin/src/feature/digipot/digipot_mcp4451.cpp index 7e6ace49a0..1b4cf43923 100644 --- a/Marlin/src/feature/digipot/digipot_mcp4451.cpp +++ b/Marlin/src/feature/digipot/digipot_mcp4451.cpp @@ -95,4 +95,6 @@ void DigipotI2C::init() { set_current(i, pgm_read_float(&digipot_motor_current[i])); } +DigipotI2C digipot_i2c; + #endif // DIGIPOT_MCP4451 From 90d364fc37de5880582aec9537da11f4b125d660 Mon Sep 17 00:00:00 2001 From: Jason Smith Date: Wed, 14 Oct 2020 11:48:46 -0700 Subject: [PATCH 029/226] Revert at90usb1286 conditional (#19733) --- Marlin/src/HAL/AVR/HAL.h | 4 ++-- Marlin/src/HAL/AVR/MarlinSerial.cpp | 6 +++--- Marlin/src/HAL/AVR/MarlinSerial.h | 2 +- Marlin/src/gcode/control/M111.cpp | 4 ++-- Marlin/src/gcode/queue.cpp | 2 +- Marlin/src/inc/Conditionals_adv.h | 8 ++++---- Marlin/src/inc/SanityCheck.h | 6 +++--- 7 files changed, 16 insertions(+), 16 deletions(-) diff --git a/Marlin/src/HAL/AVR/HAL.h b/Marlin/src/HAL/AVR/HAL.h index 6e0afa8f10..ce15ed29fb 100644 --- a/Marlin/src/HAL/AVR/HAL.h +++ b/Marlin/src/HAL/AVR/HAL.h @@ -25,7 +25,7 @@ #include "watchdog.h" #include "math.h" -#ifdef IS_AT90USB +#ifdef USBCON #include #else #define HardwareSerial_h // Hack to prevent HardwareSerial.h header inclusion @@ -81,7 +81,7 @@ typedef int8_t pin_t; //extern uint8_t MCUSR; // Serial ports -#ifdef IS_AT90USB +#ifdef USBCON #define MYSERIAL0 TERN(BLUETOOTH, bluetoothSerial, Serial) #else #if !WITHIN(SERIAL_PORT, -1, 3) diff --git a/Marlin/src/HAL/AVR/MarlinSerial.cpp b/Marlin/src/HAL/AVR/MarlinSerial.cpp index 8feac32aa7..63599efd41 100644 --- a/Marlin/src/HAL/AVR/MarlinSerial.cpp +++ b/Marlin/src/HAL/AVR/MarlinSerial.cpp @@ -38,7 +38,7 @@ #include "../../inc/MarlinConfig.h" -#if !IS_AT90USB && (defined(UBRRH) || defined(UBRR0H) || defined(UBRR1H) || defined(UBRR2H) || defined(UBRR3H)) +#if !defined(USBCON) && (defined(UBRRH) || defined(UBRR0H) || defined(UBRR1H) || defined(UBRR2H) || defined(UBRR3H)) #include "MarlinSerial.h" #include "../../MarlinCore.h" @@ -792,10 +792,10 @@ MarlinSerial> customizedSerial1; #endif -#endif // !IS_AT90USB && (UBRRH || UBRR0H || UBRR1H || UBRR2H || UBRR3H) +#endif // !USBCON && (UBRRH || UBRR0H || UBRR1H || UBRR2H || UBRR3H) // For AT90USB targets use the UART for BT interfacing -#if BOTH(IS_AT90USB, BLUETOOTH) +#if defined(USBCON) && ENABLED(BLUETOOTH) HardwareSerial bluetoothSerial; #endif diff --git a/Marlin/src/HAL/AVR/MarlinSerial.h b/Marlin/src/HAL/AVR/MarlinSerial.h index 3850e2a47e..8a0423d143 100644 --- a/Marlin/src/HAL/AVR/MarlinSerial.h +++ b/Marlin/src/HAL/AVR/MarlinSerial.h @@ -327,6 +327,6 @@ #endif // Use the UART for Bluetooth in AT90USB configurations -#if BOTH(IS_AT90USB, BLUETOOTH) +#if defined(USBCON) && ENABLED(BLUETOOTH) extern HardwareSerial bluetoothSerial; #endif diff --git a/Marlin/src/gcode/control/M111.cpp b/Marlin/src/gcode/control/M111.cpp index cc871bf38b..38cb065322 100644 --- a/Marlin/src/gcode/control/M111.cpp +++ b/Marlin/src/gcode/control/M111.cpp @@ -55,7 +55,7 @@ void GcodeSuite::M111() { } else { SERIAL_ECHOPGM(STR_DEBUG_OFF); - #if !IS_AT90USB + #if !defined(__AVR__) || !defined(USBCON) #if ENABLED(SERIAL_STATS_RX_BUFFER_OVERRUNS) SERIAL_ECHOPAIR("\nBuffer Overruns: ", MYSERIAL0.buffer_overruns()); #endif @@ -71,7 +71,7 @@ void GcodeSuite::M111() { #if ENABLED(SERIAL_STATS_MAX_RX_QUEUED) SERIAL_ECHOPAIR("\nMax RX Queue Size: ", MYSERIAL0.rxMaxEnqueued()); #endif - #endif // !IS_AT90USB + #endif // !__AVR__ || !USBCON } SERIAL_EOL(); } diff --git a/Marlin/src/gcode/queue.cpp b/Marlin/src/gcode/queue.cpp index a02d2c0160..b9169d90e1 100644 --- a/Marlin/src/gcode/queue.cpp +++ b/Marlin/src/gcode/queue.cpp @@ -624,7 +624,7 @@ void GCodeQueue::advance() { card.closefile(); SERIAL_ECHOLNPGM(STR_FILE_SAVED); - #if !IS_AT90USB + #if !defined(__AVR__) || !defined(USBCON) #if ENABLED(SERIAL_STATS_DROPPED_RX) SERIAL_ECHOLNPAIR("Dropped bytes: ", MYSERIAL0.dropped()); #endif diff --git a/Marlin/src/inc/Conditionals_adv.h b/Marlin/src/inc/Conditionals_adv.h index bab05e5ff6..255470bca6 100644 --- a/Marlin/src/inc/Conditionals_adv.h +++ b/Marlin/src/inc/Conditionals_adv.h @@ -208,10 +208,7 @@ #define NEEDS_HARDWARE_PWM 1 #endif -#if defined(__AVR__) && defined(USBCON) - #define IS_AT90USB 1 - #undef SERIAL_XON_XOFF // Not supported on USB-native devices -#else +#if !defined(__AVR__) || !defined(USBCON) // Define constants and variables for buffering serial data. // Use only 0 or powers of 2 greater than 1 // : [0, 4, 8, 16, 32, 64, 128, 256, 512, 1024, 2048, ...] @@ -223,6 +220,9 @@ #ifndef TX_BUFFER_SIZE #define TX_BUFFER_SIZE 32 #endif +#else + // SERIAL_XON_XOFF not supported on USB-native devices + #undef SERIAL_XON_XOFF #endif #if ENABLED(HOST_ACTION_COMMANDS) diff --git a/Marlin/src/inc/SanityCheck.h b/Marlin/src/inc/SanityCheck.h index 2cffde0907..e4f278b22b 100644 --- a/Marlin/src/inc/SanityCheck.h +++ b/Marlin/src/inc/SanityCheck.h @@ -582,7 +582,7 @@ /** * Serial */ -#if !IS_AT90USB +#if !(defined(__AVR__) && defined(USBCON)) #if ENABLED(SERIAL_XON_XOFF) && RX_BUFFER_SIZE < 1024 #error "SERIAL_XON_XOFF requires RX_BUFFER_SIZE >= 1024 for reliable transfers without drops." #elif RX_BUFFER_SIZE && (RX_BUFFER_SIZE < 2 || !IS_POWER_OF_2(RX_BUFFER_SIZE)) @@ -2108,9 +2108,9 @@ static_assert(hbm[Z_AXIS] >= 0, "HOMING_BUMP_MM.Z must be greater than or equal #endif /** - * Emergency Command Parser + * emergency-command parser */ -#if BOTH(IS_AT90USB, EMERGENCY_PARSER) +#if ENABLED(EMERGENCY_PARSER) && defined(__AVR__) && defined(USBCON) #error "EMERGENCY_PARSER does not work on boards with AT90USB processors (USBCON)." #endif From 9a23fb58639dec170d41415976293793131b667a Mon Sep 17 00:00:00 2001 From: Jason Smith Date: Wed, 14 Oct 2020 11:50:03 -0700 Subject: [PATCH 030/226] Fix SET_SOFT_ENDSTOP_LOOSE w/out soft endstops (#19734) --- Marlin/src/module/motion.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Marlin/src/module/motion.h b/Marlin/src/module/motion.h index 550168e8a8..85b70c057a 100644 --- a/Marlin/src/module/motion.h +++ b/Marlin/src/module/motion.h @@ -198,7 +198,7 @@ inline float home_bump_mm(const AxisEnum axis) { extern soft_endstops_t soft_endstop; #define apply_motion_limits(V) NOOP #define update_software_endstops(...) NOOP - #define SET_SOFT_ENDSTOP_LOOSE() NOOP + #define SET_SOFT_ENDSTOP_LOOSE(V) NOOP #endif // !HAS_SOFTWARE_ENDSTOPS From 04c27573d69bfff64de5cd32a2dd5f30cab608d3 Mon Sep 17 00:00:00 2001 From: thinkyhead Date: Thu, 15 Oct 2020 00:15:10 +0000 Subject: [PATCH 031/226] [cron] Bump distribution date (2020-10-15) --- Marlin/src/inc/Version.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Marlin/src/inc/Version.h b/Marlin/src/inc/Version.h index 4b5c0cb7fd..9133752844 100644 --- a/Marlin/src/inc/Version.h +++ b/Marlin/src/inc/Version.h @@ -42,7 +42,7 @@ * version was tagged. */ #ifndef STRING_DISTRIBUTION_DATE - #define STRING_DISTRIBUTION_DATE "2020-10-14" + #define STRING_DISTRIBUTION_DATE "2020-10-15" #endif /** From f6ffbe548c81abfeecc996c8f2bffd27cabe0014 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Thu, 15 Oct 2020 03:00:27 -0500 Subject: [PATCH 032/226] TFT Presets, Generic options, Sanity checks (#19723) --- Marlin/Configuration.h | 91 ++++++- Marlin/Configuration_adv.h | 6 +- Marlin/src/HAL/LPC1768/inc/SanityCheck.h | 2 +- Marlin/src/HAL/STM32F1/HAL.cpp | 6 +- Marlin/src/core/macros.h | 4 +- Marlin/src/feature/bedlevel/ubl/ubl.h | 2 +- Marlin/src/inc/Conditionals_LCD.h | 256 ++++++++---------- Marlin/src/inc/Conditionals_adv.h | 4 +- Marlin/src/inc/Conditionals_post.h | 4 +- Marlin/src/inc/SanityCheck.h | 199 +++++++------- Marlin/src/inc/Version.h | 2 +- Marlin/src/lcd/TFTGLCD/ultralcd_TFTGLCD.cpp | 2 +- Marlin/src/lcd/dogm/HAL_LCD_com_defines.h | 2 +- .../dogm/u8g_dev_tft_upscale_from_128x64.cpp | 4 +- Marlin/src/lcd/dogm/ultralcd_DOGM.h | 2 +- .../lcd/extui/lib/mks_ui/draw_print_file.cpp | 6 +- Marlin/src/lcd/extui/lib/mks_ui/draw_ui.cpp | 4 +- Marlin/src/lcd/scaled_tft.h | 4 +- Marlin/src/lcd/ultralcd.cpp | 8 +- Marlin/src/lcd/ultralcd.h | 11 +- Marlin/src/pins/esp32/pins_MRR_ESPE.h | 2 +- Marlin/src/pins/linux/pins_RAMPS_LINUX.h | 14 +- Marlin/src/pins/lpc1768/pins_BIQU_B300_V1.0.h | 4 +- Marlin/src/pins/lpc1768/pins_BIQU_BQ111_A4.h | 4 +- Marlin/src/pins/lpc1768/pins_BTT_SKR_V1_3.h | 2 +- Marlin/src/pins/lpc1768/pins_BTT_SKR_V1_4.h | 5 +- Marlin/src/pins/lpc1768/pins_GMARSH_X6_REV1.h | 2 +- Marlin/src/pins/lpc1768/pins_MKS_SBASE.h | 2 +- Marlin/src/pins/lpc1768/pins_MKS_SGEN_L.h | 2 +- Marlin/src/pins/lpc1768/pins_RAMPS_RE_ARM.h | 8 +- Marlin/src/pins/lpc1768/pins_SELENA_COMPACT.h | 4 +- Marlin/src/pins/lpc1769/pins_AZTEEG_X5_MINI.h | 6 +- Marlin/src/pins/lpc1769/pins_MKS_SGEN_L_V2.h | 2 +- Marlin/src/pins/lpc1769/pins_SMOOTHIEBOARD.h | 2 +- Marlin/src/pins/mega/pins_CHEAPTRONICv2.h | 2 +- Marlin/src/pins/mega/pins_GT2560_REV_A.h | 6 +- Marlin/src/pins/mega/pins_GT2560_V3.h | 2 +- Marlin/src/pins/mega/pins_GT2560_V3_A20.h | 2 +- Marlin/src/pins/mega/pins_HJC2560C_REV2.h | 4 +- Marlin/src/pins/mega/pins_MEGATRONICS.h | 4 +- Marlin/src/pins/mega/pins_MEGATRONICS_2.h | 2 +- Marlin/src/pins/mega/pins_MIGHTYBOARD_REVE.h | 2 +- Marlin/src/pins/mega/pins_OVERLORD.h | 2 +- Marlin/src/pins/pins.h | 4 +- Marlin/src/pins/rambo/pins_EINSY_RAMBO.h | 4 +- Marlin/src/pins/rambo/pins_EINSY_RETRO.h | 4 +- Marlin/src/pins/rambo/pins_MINIRAMBO.h | 4 +- Marlin/src/pins/rambo/pins_RAMBO.h | 6 +- Marlin/src/pins/ramps/pins_3DRAG.h | 6 +- Marlin/src/pins/ramps/pins_FELIX2.h | 4 +- Marlin/src/pins/ramps/pins_FORMBOT_RAPTOR.h | 2 +- .../src/pins/ramps/pins_FORMBOT_TREX2PLUS.h | 2 +- Marlin/src/pins/ramps/pins_FORMBOT_TREX3.h | 2 +- Marlin/src/pins/ramps/pins_FYSETC_F6_13.h | 2 +- Marlin/src/pins/ramps/pins_K8600.h | 2 +- Marlin/src/pins/ramps/pins_K8800.h | 2 +- Marlin/src/pins/ramps/pins_ORTUR_4.h | 2 +- Marlin/src/pins/ramps/pins_RAMPS.h | 19 +- Marlin/src/pins/ramps/pins_RAMPS_PLUS.h | 2 +- Marlin/src/pins/ramps/pins_RIGIDBOARD.h | 2 +- Marlin/src/pins/ramps/pins_RUMBA.h | 2 +- Marlin/src/pins/ramps/pins_TENLOG_D3_HERO.h | 4 +- Marlin/src/pins/ramps/pins_TRIGORILLA_14.h | 4 +- Marlin/src/pins/ramps/pins_TT_OSCAR.h | 16 +- Marlin/src/pins/ramps/pins_ULTIMAKER.h | 6 +- Marlin/src/pins/ramps/pins_ULTIMAKER_OLD.h | 8 +- Marlin/src/pins/sam/pins_ALLIGATOR_R2.h | 4 +- Marlin/src/pins/sam/pins_ARCHIM1.h | 4 +- Marlin/src/pins/sam/pins_ARCHIM2.h | 14 +- Marlin/src/pins/sam/pins_DUE3DOM.h | 2 +- Marlin/src/pins/sam/pins_DUE3DOM_MINI.h | 2 +- Marlin/src/pins/sam/pins_RADDS.h | 2 +- Marlin/src/pins/sam/pins_RAMPS_DUO.h | 8 +- Marlin/src/pins/sam/pins_RAMPS_FD_V1.h | 4 +- Marlin/src/pins/sam/pins_RURAMPS4D_11.h | 8 +- Marlin/src/pins/sam/pins_RURAMPS4D_13.h | 8 +- Marlin/src/pins/samd/pins_RAMPS_144.h | 16 +- Marlin/src/pins/sanguino/pins_ANET_10.h | 4 +- .../src/pins/sanguino/pins_SANGUINOLOLU_11.h | 8 +- Marlin/src/pins/sanguino/pins_ZMIB_V2.h | 2 +- .../src/pins/stm32f1/pins_BTT_SKR_MINI_V1_1.h | 2 +- Marlin/src/pins/stm32f1/pins_CHITU3D.h | 12 +- Marlin/src/pins/stm32f1/pins_CHITU3D_V5.h | 3 - Marlin/src/pins/stm32f1/pins_CHITU3D_V6.h | 3 - Marlin/src/pins/stm32f1/pins_FYSETC_AIO_II.h | 2 +- Marlin/src/pins/stm32f1/pins_FYSETC_CHEETAH.h | 2 +- Marlin/src/pins/stm32f1/pins_GTM32_MINI.h | 4 +- Marlin/src/pins/stm32f1/pins_GTM32_MINI_A30.h | 2 +- Marlin/src/pins/stm32f1/pins_GTM32_PRO_VB.h | 4 +- Marlin/src/pins/stm32f1/pins_GTM32_REV_B.h | 2 +- Marlin/src/pins/stm32f1/pins_MKS_ROBIN.h | 13 +- Marlin/src/pins/stm32f1/pins_MKS_ROBIN_E3P.h | 19 +- .../pins/stm32f1/pins_MKS_ROBIN_E3_common.h | 2 +- Marlin/src/pins/stm32f1/pins_MKS_ROBIN_LITE.h | 2 +- .../src/pins/stm32f1/pins_MKS_ROBIN_LITE3.h | 2 +- Marlin/src/pins/stm32f1/pins_MKS_ROBIN_MINI.h | 75 ++--- Marlin/src/pins/stm32f1/pins_MKS_ROBIN_NANO.h | 2 +- .../src/pins/stm32f1/pins_MKS_ROBIN_NANO_V2.h | 15 +- Marlin/src/pins/stm32f1/pins_MKS_ROBIN_PRO.h | 4 +- Marlin/src/pins/stm32f1/pins_STM32F1R.h | 12 +- Marlin/src/pins/stm32f1/pins_STM3R_MINI.h | 12 +- Marlin/src/pins/stm32f4/pins_BEAST.h | 12 +- .../src/pins/stm32f4/pins_BTT_BTT002_V1_0.h | 2 +- Marlin/src/pins/stm32f4/pins_BTT_GTR_V1_0.h | 2 +- .../pins/stm32f4/pins_BTT_SKR_PRO_common.h | 2 +- Marlin/src/pins/stm32f4/pins_FYSETC_S6.h | 2 +- Marlin/src/pins/stm32f4/pins_RUMBA32_common.h | 2 +- Marlin/src/pins/stm32f7/pins_NUCLEO_F767ZI.h | 12 +- Marlin/src/pins/teensy2/pins_PRINTRBOARD.h | 4 +- Marlin/src/pins/teensy2/pins_TEENSY2.h | 2 +- Marlin/src/pins/teensy2/pins_TEENSYLU.h | 4 +- Marlin/src/pins/teensy3/pins_TEENSY35_36.h | 4 +- buildroot/tests/STM32F103VE_longer-tests | 2 - buildroot/tests/mks_robin-tests | 4 +- buildroot/tests/mks_robin_nano35-tests | 41 ++- buildroot/tests/mks_robin_pro-tests | 4 +- 116 files changed, 593 insertions(+), 599 deletions(-) diff --git a/Marlin/Configuration.h b/Marlin/Configuration.h index db266b524b..1f6b0db946 100644 --- a/Marlin/Configuration.h +++ b/Marlin/Configuration.h @@ -35,7 +35,7 @@ * * Advanced settings can be found in Configuration_adv.h */ -#define CONFIGURATION_H_VERSION 020007 +#define CONFIGURATION_H_VERSION 020008 //=========================================================================== //============================= Getting Started ============================= @@ -2205,22 +2205,83 @@ //============================================================================= /** - * TFT Type - Select your Display type - * - * Available options are: - * MKS_TS35_V2_0, - * MKS_ROBIN_TFT24, MKS_ROBIN_TFT28, MKS_ROBIN_TFT32, MKS_ROBIN_TFT35, - * MKS_ROBIN_TFT43, MKS_ROBIN_TFT_V1_1R - * TFT_TRONXY_X5SA, ANYCUBIC_TFT35, LONGER_LK_TFT28 - * TFT_GENERIC - * - * For TFT_GENERIC, you need to configure these 3 options: - * Driver: TFT_DRIVER - * Current Drivers are: AUTO, ST7735, ST7789, ST7796, R61505, ILI9328, ILI9341, ILI9488 - * Resolution: TFT_WIDTH and TFT_HEIGHT - * Interface: TFT_INTERFACE_FSMC or TFT_INTERFACE_SPI + * Specific TFT Model Presets. Enable one of the following options + * or enable TFT_GENERIC and set sub-options. */ + +// +// 480x320, 3.5", SPI Display From MKS +// Normally used in MKS Robin Nano V2 +// +//#define MKS_TS35_V2_0 + +// +// 320x240, 2.4", FSMC Display From MKS +// Normally used in MKS Robin Nano V1.2 +// +//#define MKS_ROBIN_TFT24 + +// +// 320x240, 2.8", FSMC Display From MKS +// Normally used in MKS Robin Nano V1.2 +// +//#define MKS_ROBIN_TFT28 + +// +// 320x240, 3.2", FSMC Display From MKS +// Normally used in MKS Robin Nano V1.2 +// +//#define MKS_ROBIN_TFT32 + +// +// 480x320, 3.5", FSMC Display From MKS +// Normally used in MKS Robin Nano V1.2 +// +//#define MKS_ROBIN_TFT35 + +// +// 480x272, 4.3", FSMC Display From MKS +// +//#define MKS_ROBIN_TFT43 + +// +// 320x240, 3.2", FSMC Display From MKS +// Normally used in MKS Robin +// +//#define MKS_ROBIN_TFT_V1_1R + +// +// 480x320, 3.5", FSMC Stock Display from TronxXY +// +//#define TFT_TRONXY_X5SA + +// +// 480x320, 3.5", FSMC Stock Display from AnyCubic +// +//#define ANYCUBIC_TFT35 + +// +// 320x240, 2.8", FSMC Stock Display from Longer/Alfawise +// +//#define LONGER_LK_TFT28 + +// +// Generic TFT with detailed options +// //#define TFT_GENERIC +#if ENABLED(TFT_GENERIC) + // :[ 'AUTO', 'ST7735', 'ST7789', 'ST7796', 'R61505', 'ILI9328', 'ILI9341', 'ILI9488' ] + #define TFT_DRIVER AUTO + + // Interface. Enable one of the following options: + //#define TFT_INTERFACE_FSMC + //#define TFT_INTERFACE_SPI + + // TFT Resolution. Enable one of the following options: + //#define TFT_RES_320x240 + //#define TFT_RES_480x272 + //#define TFT_RES_480x320 +#endif /** * TFT UI - User Interface Selection. Enable one of the following options: diff --git a/Marlin/Configuration_adv.h b/Marlin/Configuration_adv.h index bcacddd20d..714bcb288f 100644 --- a/Marlin/Configuration_adv.h +++ b/Marlin/Configuration_adv.h @@ -30,7 +30,7 @@ * * Basic settings can be found in Configuration.h */ -#define CONFIGURATION_ADV_H_VERSION 020007 +#define CONFIGURATION_ADV_H_VERSION 020008 //=========================================================================== //============================= Thermal Settings ============================ @@ -1048,10 +1048,10 @@ // @section lcd -#if EITHER(ULTIPANEL, EXTENSIBLE_UI) +#if EITHER(IS_ULTIPANEL, EXTENSIBLE_UI) #define MANUAL_FEEDRATE { 50*60, 50*60, 4*60, 2*60 } // (mm/min) Feedrates for manual moves along X, Y, Z, E from panel #define SHORT_MANUAL_Z_MOVE 0.025 // (mm) Smallest manual Z move (< 0.1mm) - #if ENABLED(ULTIPANEL) + #if IS_ULTIPANEL #define MANUAL_E_MOVES_RELATIVE // Display extruder move distance rather than "position" #define ULTIPANEL_FEEDMULTIPLY // Encoder sets the feedrate multiplier on the Status Screen #endif diff --git a/Marlin/src/HAL/LPC1768/inc/SanityCheck.h b/Marlin/src/HAL/LPC1768/inc/SanityCheck.h index f5051d32a1..8b7d27742d 100644 --- a/Marlin/src/HAL/LPC1768/inc/SanityCheck.h +++ b/Marlin/src/HAL/LPC1768/inc/SanityCheck.h @@ -72,7 +72,7 @@ static_assert(!(NUM_SERVOS && ENABLED(FAST_PWM_FAN)), "BLTOUCH and Servos are in //#endif #if MB(RAMPS_14_RE_ARM_EFB, RAMPS_14_RE_ARM_EEB, RAMPS_14_RE_ARM_EFF, RAMPS_14_RE_ARM_EEF, RAMPS_14_RE_ARM_SF) - #if ENABLED(REPRAP_DISCOUNT_FULL_GRAPHIC_SMART_CONTROLLER) && HAS_DRIVER(TMC2130) && DISABLED(TMC_USE_SW_SPI) + #if IS_RRD_FG_SC && HAS_DRIVER(TMC2130) && DISABLED(TMC_USE_SW_SPI) #error "Re-ARM with REPRAP_DISCOUNT_FULL_GRAPHIC_SMART_CONTROLLER and TMC2130 requires TMC_USE_SW_SPI." #endif #endif diff --git a/Marlin/src/HAL/STM32F1/HAL.cpp b/Marlin/src/HAL/STM32F1/HAL.cpp index cd1efc1659..6733aead6d 100644 --- a/Marlin/src/HAL/STM32F1/HAL.cpp +++ b/Marlin/src/HAL/STM32F1/HAL.cpp @@ -130,7 +130,7 @@ const uint8_t adc_pins[] = { #if ENABLED(FILAMENT_WIDTH_SENSOR) FILWIDTH_PIN, #endif - #if ENABLED(ADC_KEYPAD) + #if HAS_ADC_BUTTONS ADC_KEYPAD_PIN, #endif #if HAS_JOY_ADC_X @@ -187,7 +187,7 @@ enum TempPinIndex : char { #if ENABLED(FILAMENT_WIDTH_SENSOR) FILWIDTH, #endif - #if ENABLED(ADC_KEYPAD) + #if HAS_ADC_BUTTONS ADC_KEY, #endif #if HAS_JOY_ADC_X @@ -389,7 +389,7 @@ void HAL_adc_start_conversion(const uint8_t adc_pin) { #if ENABLED(FILAMENT_WIDTH_SENSOR) case FILWIDTH_PIN: pin_index = FILWIDTH; break; #endif - #if ENABLED(ADC_KEYPAD) + #if HAS_ADC_BUTTONS case ADC_KEYPAD_PIN: pin_index = ADC_KEY; break; #endif #if ENABLED(POWER_MONITOR_CURRENT) diff --git a/Marlin/src/core/macros.h b/Marlin/src/core/macros.h index 21bb32c4cf..7948e8ce87 100644 --- a/Marlin/src/core/macros.h +++ b/Marlin/src/core/macros.h @@ -170,7 +170,7 @@ #define _DO_12(W,C,A,V...) (_##W##_1(A) C _DO_11(W,C,V)) #define __DO_N(W,C,N,V...) _DO_##N(W,C,V) #define _DO_N(W,C,N,V...) __DO_N(W,C,N,V) -#define DO(W,C,V...) _DO_N(W,C,NUM_ARGS(V),V) +#define DO(W,C,V...) (_DO_N(W,C,NUM_ARGS(V),V)) // Macros to support option testing #define _CAT(a,V...) a##V @@ -186,6 +186,7 @@ #define _DIS_1(O) NOT(_ENA_1(O)) #define ENABLED(V...) DO(ENA,&&,V) #define DISABLED(V...) DO(DIS,&&,V) +#define COUNT_ENABLED(V...) DO(ENA,+,V) #define TERN(O,A,B) _TERN(_ENA_1(O),B,A) // OPTION converted to '0' or '1' #define TERN0(O,A) _TERN(_ENA_1(O),0,A) // OPTION converted to A or '0' @@ -200,6 +201,7 @@ #define ALL(V...) ENABLED(V) #define BOTH(V1,V2) ALL(V1,V2) #define EITHER(V1,V2) ANY(V1,V2) +#define MANY(V...) (COUNT_ENABLED(V) > 1) // Macros to support pins/buttons exist testing #define PIN_EXISTS(PN) (defined(PN##_PIN) && PN##_PIN >= 0) diff --git a/Marlin/src/feature/bedlevel/ubl/ubl.h b/Marlin/src/feature/bedlevel/ubl/ubl.h index 9ac9de1806..22ca1f69ec 100644 --- a/Marlin/src/feature/bedlevel/ubl/ubl.h +++ b/Marlin/src/feature/bedlevel/ubl/ubl.h @@ -59,7 +59,7 @@ class unified_bed_leveling { static int g29_grid_size; #endif - #if ENABLED(NEWPANEL) + #if IS_NEWPANEL static void move_z_with_encoder(const float &multiplier); static float measure_point_with_encoder(); static float measure_business_card_thickness(float in_height); diff --git a/Marlin/src/inc/Conditionals_LCD.h b/Marlin/src/inc/Conditionals_LCD.h index 56ce2ca5ed..4eeb0e8a44 100644 --- a/Marlin/src/inc/Conditionals_LCD.h +++ b/Marlin/src/inc/Conditionals_LCD.h @@ -46,7 +46,7 @@ * * DOGLCD : Run a Graphical LCD through U8GLib (with MarlinUI) * IS_ULTIPANEL : Define LCD_PINS_D5/6/7 for direct-connected "Ultipanel" LCDs - * IS_ULTRA_LCD : Ultra LCD, not necessarily Ultipanel. Used most often with NEWPANEL. + * IS_ULTRA_LCD : Ultra LCD, not necessarily Ultipanel. * IS_RRD_SC : Common RRD Smart Controller digital interface pins * IS_RRD_FG_SC : Common RRD Full Graphical Smart Controller digital interface pins * U8GLIB_ST7920 : Most common DOGM display SPI interface, supporting a "lightweight" display mode. @@ -63,22 +63,21 @@ #elif ENABLED(CARTESIO_UI) #define DOGLCD - #define IS_ULTIPANEL + #define IS_ULTIPANEL 1 #elif EITHER(DWIN_MARLINUI_PORTRAIT, DWIN_MARLINUI_LANDSCAPE) #define IS_DWIN_MARLINUI 1 - #define IS_ULTIPANEL + #define IS_ULTIPANEL 1 #elif ENABLED(ZONESTAR_LCD) - #define ADC_KEYPAD - #define IS_RRW_KEYPAD + #define HAS_ADC_BUTTONS 1 #define REPRAPWORLD_KEYPAD_MOVE_STEP 10.0 #define ADC_KEY_NUM 8 - #define IS_ULTIPANEL + #define IS_ULTIPANEL 1 - // This helps to implement ADC_KEYPAD menus + // This helps to implement HAS_ADC_BUTTONS menus #define REVERSE_MENU_DIRECTION #define ENCODER_PULSES_PER_STEP 1 #define ENCODER_STEPS_PER_MENU_ITEM 1 @@ -86,29 +85,25 @@ #elif ENABLED(ZONESTAR_12864LCD) #define DOGLCD - #define IS_RRD_SC + #define IS_RRD_SC 1 #define U8GLIB_ST7920 #elif ENABLED(ZONESTAR_12864OLED) - #define IS_RRD_SC + #define IS_RRD_SC 1 #define U8GLIB_SH1106 #elif ENABLED(ZONESTAR_12864OLED_SSD1306) - #define IS_RRD_SC + #define IS_RRD_SC 1 #define IS_U8GLIB_SSD1306 #elif ENABLED(RADDS_DISPLAY) - #define IS_ULTIPANEL + #define IS_ULTIPANEL 1 #define ENCODER_PULSES_PER_STEP 2 -#elif EITHER(ANET_FULL_GRAPHICS_LCD, BQ_LCD_SMART_CONTROLLER) - - #define IS_RRD_FG_SC - #elif ANY(miniVIKI, VIKI2, ELB_FULL_GRAPHIC_CONTROLLER, AZSMZ_12864) #define DOGLCD - #define IS_ULTIPANEL + #define IS_ULTIPANEL 1 #if ENABLED(miniVIKI) #define U8GLIB_ST7565_64128N @@ -123,40 +118,33 @@ #elif ENABLED(OLED_PANEL_TINYBOY2) #define IS_U8GLIB_SSD1306 - #define IS_ULTIPANEL + #define IS_ULTIPANEL 1 #elif ENABLED(RA_CONTROL_PANEL) #define LCD_I2C_TYPE_PCA8574 #define LCD_I2C_ADDRESS 0x27 // I2C Address of the port expander - #define IS_ULTIPANEL + #define IS_ULTIPANEL 1 #elif ENABLED(REPRAPWORLD_GRAPHICAL_LCD) #define DOGLCD #define U8GLIB_ST7920 - #define IS_ULTIPANEL - -#elif ENABLED(CR10_STOCKDISPLAY) - - #define IS_RRD_FG_SC - #define BOARD_ST7920_DELAY_1 DELAY_NS(125) - #define BOARD_ST7920_DELAY_2 DELAY_NS(125) - #define BOARD_ST7920_DELAY_3 DELAY_NS(125) + #define IS_ULTIPANEL 1 #elif ENABLED(MKS_12864OLED) - #define IS_RRD_SC + #define IS_RRD_SC 1 #define U8GLIB_SH1106 #elif ENABLED(MKS_12864OLED_SSD1306) - #define IS_RRD_SC + #define IS_RRD_SC 1 #define IS_U8GLIB_SSD1306 #elif ENABLED(FYSETC_242_OLED_12864) - #define IS_RRD_SC + #define IS_RRD_SC 1 #define U8GLIB_SH1106 #define LED_CONTROL_MENU @@ -179,7 +167,7 @@ #define FYSETC_MINI_12864 #define DOGLCD - #define IS_ULTIPANEL + #define IS_ULTIPANEL 1 #define LED_COLORS_REDUCE_GREEN #if ENABLED(PSU_CONTROL) && EITHER(FYSETC_MINI_12864_2_0, FYSETC_MINI_12864_2_1) #define LED_BACKLIGHT_TIMEOUT 10000 @@ -205,7 +193,7 @@ #elif ENABLED(ULTI_CONTROLLER) - #define IS_ULTIPANEL + #define IS_ULTIPANEL 1 #define U8GLIB_SSD1309 #define LCD_RESET_PIN LCD_PINS_D6 // This controller need a reset pin #define ENCODER_PULSES_PER_STEP 2 @@ -213,14 +201,14 @@ #elif ENABLED(MAKEBOARD_MINI_2_LINE_DISPLAY_1602) - #define IS_RRD_SC + #define IS_RRD_SC 1 #define LCD_WIDTH 16 #define LCD_HEIGHT 2 #elif EITHER(TFTGLCD_PANEL_SPI, TFTGLCD_PANEL_I2C) #define IS_TFTGLCD_PANEL 1 - #define IS_ULTIPANEL // Note that IS_ULTIPANEL leads to HAS_WIRED_LCD + #define IS_ULTIPANEL 1 // Note that IS_ULTIPANEL leads to HAS_WIRED_LCD #if ENABLED(SDSUPPORT) && DISABLED(LCD_PROGRESS_BAR) #define LCD_PROGRESS_BAR @@ -239,14 +227,35 @@ #define CONVERT_TO_EXT_ASCII // Use extended 128-255 symbols from ASCII table. // At this time present conversion only for cyrillic - bg, ru and uk languages. // First 7 ASCII symbols in panel font must be replaced with Marlin's special symbols. + +#elif ENABLED(CR10_STOCKDISPLAY) + + #define IS_RRD_FG_SC 1 + #define BOARD_ST7920_DELAY_1 DELAY_NS(125) + #define BOARD_ST7920_DELAY_2 DELAY_NS(125) + #define BOARD_ST7920_DELAY_3 DELAY_NS(125) + +#elif ANY(REPRAP_DISCOUNT_FULL_GRAPHIC_SMART_CONTROLLER, ANET_FULL_GRAPHICS_LCD, BQ_LCD_SMART_CONTROLLER) + + #define IS_RRD_FG_SC 1 + +#elif ENABLED(REPRAP_DISCOUNT_SMART_CONTROLLER) + + // RepRapDiscount LCD or Graphical LCD with rotary click encoder + #define IS_RRD_SC 1 + #endif -#if ENABLED(IS_RRD_FG_SC) - #define REPRAP_DISCOUNT_FULL_GRAPHIC_SMART_CONTROLLER +// ST7920-based graphical displays +#if ANY(IS_RRD_FG_SC, LCD_FOR_MELZI, SILVER_GATE_GLCD_CONTROLLER) + #define DOGLCD + #define U8GLIB_ST7920 + #define IS_RRD_SC 1 #endif +// ST7565 / 64128N graphical displays #if EITHER(MAKRPANEL, MINIPANEL) - #define IS_ULTIPANEL + #define IS_ULTIPANEL 1 #define DOGLCD #if ENABLED(MAKRPANEL) #define U8GLIB_ST7565_64128N @@ -258,7 +267,7 @@ #endif #if ENABLED(OVERLORD_OLED) - #define IS_ULTIPANEL + #define IS_ULTIPANEL 1 #define U8GLIB_SH1106 /** * PCA9632 for buzzer and LEDs via i2c @@ -278,64 +287,44 @@ // 128x64 I2C OLED LCDs - SSD1306/SSD1309/SH1106 #if ANY(U8GLIB_SSD1306, U8GLIB_SSD1309, U8GLIB_SH1106) #define HAS_U8GLIB_I2C_OLED 1 -#endif -#if HAS_U8GLIB_I2C_OLED - #define IS_ULTRA_LCD + #define IS_ULTRA_LCD 1 #define DOGLCD #endif -// ST7920-based graphical displays -#if ANY(REPRAP_DISCOUNT_FULL_GRAPHIC_SMART_CONTROLLER, LCD_FOR_MELZI, SILVER_GATE_GLCD_CONTROLLER) - #define DOGLCD - #define U8GLIB_ST7920 - #define IS_RRD_SC -#endif - -// RepRapDiscount LCD or Graphical LCD with rotary click encoder -#if ENABLED(IS_RRD_SC) - #define REPRAP_DISCOUNT_SMART_CONTROLLER -#endif - /** * SPI Ultipanels */ // Basic Ultipanel-like displays -#if ANY(ULTIMAKERCONTROLLER, REPRAP_DISCOUNT_SMART_CONTROLLER, G3D_PANEL, RIGIDBOT_PANEL, PANEL_ONE, U8GLIB_SH1106) - #define IS_ULTIPANEL +#if ANY(ULTIMAKERCONTROLLER, IS_RRD_SC, G3D_PANEL, RIGIDBOT_PANEL, PANEL_ONE, U8GLIB_SH1106) + #define IS_ULTIPANEL 1 #endif // Einstart OLED has Cardinal nav via pins defined in pins_EINSTART-S.h #if ENABLED(U8GLIB_SH1106_EINSTART) #define DOGLCD - #define IS_ULTIPANEL + #define IS_ULTIPANEL 1 #endif -// Compatibility -#if ENABLED(FSMC_GRAPHICAL_TFT) +// TFT Compatibility +#if ANY(FSMC_GRAPHICAL_TFT, SPI_GRAPHICAL_TFT, TFT_320x240, TFT_480x320, TFT_320x240_SPI, TFT_480x320_SPI, TFT_LVGL_UI_FSMC, TFT_LVGL_UI_SPI) + #define IS_LEGACY_TFT 1 + #define TFT_GENERIC + #warning "Don't forget to update your TFT settings in Configuration.h." +#endif + +#if ANY(FSMC_GRAPHICAL_TFT, TFT_320x240, TFT_480x320, TFT_LVGL_UI_FSMC) + #define TFT_INTERFACE_FSMC +#elif ANY(SPI_GRAPHICAL_TFT, TFT_320x240_SPI, TFT_480x320_SPI, TFT_LVGL_UI_SPI) + #define TFT_INTERFACE_SPI +#endif + +#if EITHER(FSMC_GRAPHICAL_TFT, SPI_GRAPHICAL_TFT) #define TFT_CLASSIC_UI - #define TFT_INTERFACE_FSMC - #define TFT_GENERIC -#elif ENABLED(SPI_GRAPHICAL_TFT) - #define TFT_CLASSIC_UI - #define TFT_INTERFACE_SPI - #define TFT_GENERIC -#elif EITHER(TFT_320x240, TFT_480x320) +#elif ANY(TFT_320x240, TFT_480x320, TFT_320x240_SPI, TFT_480x320_SPI) #define TFT_COLOR_UI - #define TFT_INTERFACE_FSMC - #define TFT_GENERIC -#elif EITHER(TFT_320x240_SPI, TFT_480x320_SPI) - #define TFT_COLOR_UI - #define TFT_INTERFACE_SPI - #define TFT_GENERIC -#elif ENABLED(TFT_LVGL_UI_FSMC) +#elif EITHER(TFT_LVGL_UI_FSMC, TFT_LVGL_UI_SPI) #define TFT_LVGL_UI - #define TFT_INTERFACE_FSMC - #define TFT_GENERIC -#elif ENABLED(TFT_LVGL_UI_SPI) - #define TFT_LVGL_UI - #define TFT_INTERFACE_SPI - #define TFT_GENERIC #endif // FSMC/SPI TFT Panels (LVGL) @@ -350,7 +339,7 @@ #if TFT_SCALED_DOGLCD #define DOGLCD - #define IS_ULTIPANEL + #define IS_ULTIPANEL 1 #define DELAYED_BACKLIGHT_INIT #elif ENABLED(TFT_LVGL_UI) #define DELAYED_BACKLIGHT_INIT @@ -359,7 +348,7 @@ // Color UI #if ENABLED(TFT_COLOR_UI) #define HAS_GRAPHICAL_TFT 1 - #define IS_ULTIPANEL + #define IS_ULTIPANEL 1 #endif /** @@ -383,7 +372,7 @@ #define LCD_I2C_TYPE_MCP23017 #define LCD_I2C_ADDRESS 0x20 // I2C Address of the port expander #define LCD_USE_I2C_BUZZER // Enable buzzer on LCD (optional) - #define IS_ULTIPANEL + #define IS_ULTIPANEL 1 #elif ENABLED(LCD_I2C_VIKI) @@ -398,7 +387,7 @@ #define LCD_I2C_TYPE_MCP23017 #define LCD_I2C_ADDRESS 0x20 // I2C Address of the port expander #define LCD_USE_I2C_BUZZER // Enable buzzer on LCD (requires LiquidTWI2 v1.2.3 or later) - #define IS_ULTIPANEL + #define IS_ULTIPANEL 1 #define ENCODER_FEEDRATE_DEADZONE 4 @@ -410,7 +399,7 @@ #define STD_ENCODER_PULSES_PER_STEP 2 #define STD_ENCODER_STEPS_PER_MENU_ITEM 1 -#elif ANY(REPRAP_DISCOUNT_SMART_CONTROLLER, miniVIKI, VIKI2, ELB_FULL_GRAPHIC_CONTROLLER, AZSMZ_12864, OLED_PANEL_TINYBOY2, BQ_LCD_SMART_CONTROLLER, LCD_I2C_PANELOLU2) +#elif ANY(IS_RRD_SC, miniVIKI, VIKI2, ELB_FULL_GRAPHIC_CONTROLLER, AZSMZ_12864, OLED_PANEL_TINYBOY2, BQ_LCD_SMART_CONTROLLER, LCD_I2C_PANELOLU2) #define STD_ENCODER_PULSES_PER_STEP 4 #define STD_ENCODER_STEPS_PER_MENU_ITEM 1 @@ -443,30 +432,24 @@ // https://bitbucket.org/fmalpartida/new-liquidcrystal/wiki/schematics#!shiftregister-connection #if ENABLED(FF_INTERFACEBOARD) #define SR_LCD_3W_NL // Non latching 3 wire shift register - #define IS_ULTIPANEL + #define IS_ULTIPANEL 1 #elif ENABLED(SAV_3DLCD) #define SR_LCD_2W_NL // Non latching 2 wire shift register - #define IS_ULTIPANEL + #define IS_ULTIPANEL 1 +#elif ENABLED(ULTIPANEL) + #define IS_ULTIPANEL 1 #endif -#if ENABLED(IS_ULTIPANEL) - #define ULTIPANEL -#endif -#if ENABLED(ULTIPANEL) - #define IS_ULTRA_LCD - #define NEWPANEL -#endif -#if ENABLED(IS_ULTRA_LCD) - #define ULTRA_LCD +#if EITHER(IS_ULTIPANEL, ULTRA_LCD) + #define IS_ULTRA_LCD 1 #endif -#if ENABLED(IS_RRW_KEYPAD) - #define REPRAPWORLD_KEYPAD +#if EITHER(IS_ULTIPANEL, REPRAPWORLD_KEYPAD) + #define IS_NEWPANEL 1 #endif -// Keypad needs a move step -#if ENABLED(REPRAPWORLD_KEYPAD) - #define NEWPANEL +#if EITHER(ZONESTAR_LCD, REPRAPWORLD_KEYPAD) + #define IS_RRW_KEYPAD 1 #ifndef REPRAPWORLD_KEYPAD_MOVE_STEP #define REPRAPWORLD_KEYPAD_MOVE_STEP 1.0 #endif @@ -479,16 +462,16 @@ // Extensible UI serial touch screens. (See src/lcd/extui) #if ANY(HAS_DGUS_LCD, MALYAN_LCD, TOUCH_UI_FTDI_EVE, ANYCUBIC_LCD_I3MEGA, ANYCUBIC_LCD_CHIRON) - #define IS_EXTUI + #define IS_EXTUI 1 #define EXTENSIBLE_UI #endif // Aliases for LCD features -#if EITHER(ULTRA_LCD, EXTENSIBLE_UI) +#if EITHER(IS_ULTRA_LCD, EXTENSIBLE_UI) #define HAS_DISPLAY 1 #endif -#if ENABLED(ULTRA_LCD) +#if IS_ULTRA_LCD #define HAS_WIRED_LCD 1 #if ENABLED(DOGLCD) #define HAS_MARLINUI_U8GLIB 1 @@ -499,12 +482,9 @@ #endif #endif -#if ENABLED(ULTIPANEL) && DISABLED(NO_LCD_MENUS) +#if IS_ULTIPANEL && DISABLED(NO_LCD_MENUS) #define HAS_LCD_MENU 1 #endif -#if ENABLED(ADC_KEYPAD) - #define HAS_ADC_BUTTONS 1 -#endif #if HAS_MARLINUI_U8GLIB #ifndef LCD_PIXEL_WIDTH @@ -837,83 +817,85 @@ #if ENABLED(MKS_TS35_V2_0) // Most common: ST7796 #define TFT_DEFAULT_ORIENTATION (TFT_EXCHANGE_XY) - #define TFT_WIDTH 480 - #define TFT_HEIGHT 320 + #define TFT_RES_480x320 #define TFT_INTERFACE_SPI - #define GRAPHICAL_TFT_UPSCALE 3 #elif ENABLED(MKS_ROBIN_TFT24) // Most common: ST7789 #define TFT_DEFAULT_ORIENTATION (TFT_EXCHANGE_XY | TFT_INVERT_Y) - #define TFT_WIDTH 320 - #define TFT_HEIGHT 240 + #define TFT_RES_320x240 #define TFT_INTERFACE_FSMC - #define GRAPHICAL_TFT_UPSCALE 2 #elif ENABLED(MKS_ROBIN_TFT28) // Most common: ST7789 #define TFT_DEFAULT_ORIENTATION (TFT_EXCHANGE_XY | TFT_INVERT_Y) - #define TFT_WIDTH 320 - #define TFT_HEIGHT 240 + #define TFT_RES_320x240 #define TFT_INTERFACE_FSMC - #define GRAPHICAL_TFT_UPSCALE 2 #elif ENABLED(MKS_ROBIN_TFT32) // Most common: ST7789 #define TFT_DEFAULT_ORIENTATION (TFT_EXCHANGE_XY | TFT_INVERT_Y) - #define TFT_WIDTH 320 - #define TFT_HEIGHT 240 + #define TFT_RES_320x240 #define TFT_INTERFACE_FSMC - #define GRAPHICAL_TFT_UPSCALE 2 #elif ENABLED(MKS_ROBIN_TFT35) // Most common: ILI9488 #define TFT_DEFAULT_ORIENTATION (TFT_EXCHANGE_XY | TFT_INVERT_X | TFT_INVERT_Y) - #define TFT_WIDTH 480 - #define TFT_HEIGHT 320 + #define TFT_RES_480x320 #define TFT_INTERFACE_FSMC - #define GRAPHICAL_TFT_UPSCALE 3 #elif ENABLED(MKS_ROBIN_TFT43) #define TFT_DEFAULT_ORIENTATION 0 #define TFT_DRIVER SSD1963 - #define TFT_WIDTH 480 - #define TFT_HEIGHT 272 + #define TFT_RES_480x272 #define TFT_INTERFACE_FSMC - #define GRAPHICAL_TFT_UPSCALE 2 #elif ENABLED(MKS_ROBIN_TFT_V1_1R) // ILI9328 or R61505 - #define TFT_DEFAULT_ORIENTATION (TFT_INVERT_X | TFT_INVERT_Y | TFT_EXCHANGE_XY) - #define TFT_WIDTH 320 - #define TFT_HEIGHT 240 + #define TFT_DEFAULT_ORIENTATION (TFT_EXCHANGE_XY | TFT_INVERT_X | TFT_INVERT_Y) + #define TFT_RES_320x240 #define TFT_INTERFACE_FSMC - #define GRAPHICAL_TFT_UPSCALE 2 #elif EITHER(TFT_TRONXY_X5SA, ANYCUBIC_TFT35) #define TFT_DEFAULT_ORIENTATION (TFT_EXCHANGE_XY | TFT_INVERT_X | TFT_INVERT_Y) #define TFT_DRIVER ILI9488 - #define TFT_WIDTH 480 - #define TFT_HEIGHT 320 + #define TFT_RES_480x320 #define TFT_INTERFACE_FSMC - #define GRAPHICAL_TFT_UPSCALE 3 #elif ENABLED(LONGER_LK_TFT28) #define TFT_DEFAULT_ORIENTATION (TFT_EXCHANGE_XY | TFT_INVERT_X | TFT_INVERT_Y) - #define TFT_WIDTH 320 - #define TFT_HEIGHT 240 + #define TFT_RES_320x240 #define TFT_INTERFACE_FSMC - #define GRAPHICAL_TFT_UPSCALE 2 #elif ENABLED(TFT_GENERIC) #define TFT_DEFAULT_ORIENTATION (TFT_EXCHANGE_XY | TFT_INVERT_X | TFT_INVERT_Y) + #if NONE(TFT_RES_320x240, TFT_RES_480x272, TFT_RES_480x320) + #define TFT_RES_320x240 + #endif + #if NONE(TFT_INTERFACE_FSMC, TFT_INTERFACE_SPI) + #define TFT_INTERFACE_SPI + #endif +#endif + +#if ENABLED(TFT_RES_320x240) + #define TFT_WIDTH 320 + #define TFT_HEIGHT 240 + #define GRAPHICAL_TFT_UPSCALE 2 +#elif ENABLED(TFT_RES_480x272) + #define TFT_WIDTH 480 + #define TFT_HEIGHT 272 + #define GRAPHICAL_TFT_UPSCALE 2 +#elif ENABLED(TFT_RES_480x320) + #define TFT_WIDTH 480 + #define TFT_HEIGHT 320 + #define GRAPHICAL_TFT_UPSCALE 3 #endif // FSMC/SPI TFT Panels using standard HAL/tft/tft_(fsmc|spi).h #if ENABLED(TFT_INTERFACE_FSMC) #define HAS_FSMC_TFT 1 #if ENABLED(TFT_CLASSIC_UI) - #define FSMC_GRAPHICAL_TFT + #define HAS_FSMC_GRAPHICAL_TFT 1 #elif ENABLED(TFT_LVGL_UI) - #define TFT_LVGL_UI_FSMC + #define HAS_TFT_LVGL_UI_FSMC 1 #endif #elif ENABLED(TFT_INTERFACE_SPI) #define HAS_SPI_TFT 1 #if ENABLED(TFT_CLASSIC_UI) - #define SPI_GRAPHICAL_TFT + #define HAS_SPI_GRAPHICAL_TFT 1 #elif ENABLED(TFT_LVGL_UI) - #define TFT_LVGL_UI_SPI + #define HAS_TFT_LVGL_UI_SPI 1 #endif #endif diff --git a/Marlin/src/inc/Conditionals_adv.h b/Marlin/src/inc/Conditionals_adv.h index 255470bca6..78c014865c 100644 --- a/Marlin/src/inc/Conditionals_adv.h +++ b/Marlin/src/inc/Conditionals_adv.h @@ -148,7 +148,7 @@ #if ANY(MARLIN_BRICKOUT, MARLIN_INVADERS, MARLIN_SNAKE, MARLIN_MAZE) #define HAS_GAMES 1 - #if (1 < ENABLED(MARLIN_BRICKOUT) + ENABLED(MARLIN_INVADERS) + ENABLED(MARLIN_SNAKE) + ENABLED(MARLIN_MAZE)) + #if MANY(MARLIN_BRICKOUT, MARLIN_INVADERS, MARLIN_SNAKE, MARLIN_MAZE) #define HAS_GAME_MENU 1 #endif #endif @@ -163,7 +163,7 @@ #if EITHER(MIN_SOFTWARE_ENDSTOPS, MAX_SOFTWARE_ENDSTOPS) #define HAS_SOFTWARE_ENDSTOPS 1 #endif -#if ANY(EXTENSIBLE_UI, NEWPANEL, EMERGENCY_PARSER, HAS_ADC_BUTTONS, DWIN_CREALITY_LCD) +#if ANY(EXTENSIBLE_UI, IS_NEWPANEL, EMERGENCY_PARSER, HAS_ADC_BUTTONS, DWIN_CREALITY_LCD) #define HAS_RESUME_CONTINUE 1 #endif diff --git a/Marlin/src/inc/Conditionals_post.h b/Marlin/src/inc/Conditionals_post.h index 798bf009c6..581b36932a 100644 --- a/Marlin/src/inc/Conditionals_post.h +++ b/Marlin/src/inc/Conditionals_post.h @@ -383,7 +383,7 @@ #endif -#if ANY(HAS_GRAPHICAL_TFT, LCD_USE_DMA_FSMC, FSMC_GRAPHICAL_TFT, SPI_GRAPHICAL_TFT) || !PIN_EXISTS(SD_DETECT) +#if ANY(HAS_GRAPHICAL_TFT, LCD_USE_DMA_FSMC, HAS_FSMC_GRAPHICAL_TFT, HAS_SPI_GRAPHICAL_TFT) || !PIN_EXISTS(SD_DETECT) #define NO_LCD_REINIT 1 // Suppress LCD re-initialization #endif @@ -2578,7 +2578,7 @@ // Force SDCARD_SORT_ALPHA to be enabled for Graphical LCD on LPC1768 // on boards where SD card and LCD display share the same SPI bus // because of a bug in the shared SPI implementation. (See #8122) -#if defined(TARGET_LPC1768) && ENABLED(REPRAP_DISCOUNT_FULL_GRAPHIC_SMART_CONTROLLER) && (SCK_PIN == LCD_PINS_D4) +#if defined(TARGET_LPC1768) && IS_RRD_FG_SC && (SCK_PIN == LCD_PINS_D4) #define SDCARD_SORT_ALPHA // Keep one directory level in RAM. Changing directory levels // may still glitch the screen, but LCD updates clean it up. #undef SDSORT_LIMIT diff --git a/Marlin/src/inc/SanityCheck.h b/Marlin/src/inc/SanityCheck.h index e4f278b22b..9aea18c2d7 100644 --- a/Marlin/src/inc/SanityCheck.h +++ b/Marlin/src/inc/SanityCheck.h @@ -702,8 +702,10 @@ static_assert(Y_MAX_LENGTH >= Y_BED_SIZE, "Movement bounds (Y_MIN_POS, Y_MAX_POS #elif PROGRESS_MSG_EXPIRE < 0 #error "PROGRESS_MSG_EXPIRE must be greater than or equal to 0." #endif -#elif ENABLED(LCD_SET_PROGRESS_MANUALLY) && NONE(HAS_MARLINUI_U8GLIB, HAS_GRAPHICAL_TFT, HAS_MARLINUI_HD44780, EXTENSIBLE_UI) - #error "LCD_SET_PROGRESS_MANUALLY requires LCD_PROGRESS_BAR, Character LCD, Graphical LCD, TFT, or EXTENSIBLE_UI." +#elif ENABLED(LCD_SET_PROGRESS_MANUALLY) + #if NONE(HAS_MARLINUI_U8GLIB, HAS_GRAPHICAL_TFT, HAS_MARLINUI_HD44780, EXTENSIBLE_UI) + #error "LCD_SET_PROGRESS_MANUALLY requires LCD_PROGRESS_BAR, Character LCD, Graphical LCD, TFT, or EXTENSIBLE_UI." + #endif #endif #if !HAS_LCD_MENU && ENABLED(SD_REPRINT_LAST_SELECTED_FILE) @@ -843,7 +845,7 @@ static_assert(Y_MAX_LENGTH >= Y_BED_SIZE, "Movement bounds (Y_MIN_POS, Y_MAX_POS #error "ADVANCED_PAUSE_FEATURE requires FILAMENT_UNLOAD_PURGE_FEEDRATE. Please add it to Configuration_adv.h." #elif ENABLED(EXTRUDER_RUNOUT_PREVENT) #error "EXTRUDER_RUNOUT_PREVENT is incompatible with ADVANCED_PAUSE_FEATURE." - #elif ENABLED(PARK_HEAD_ON_PAUSE) && NONE(SDSUPPORT, NEWPANEL, EMERGENCY_PARSER) + #elif ENABLED(PARK_HEAD_ON_PAUSE) && NONE(SDSUPPORT, IS_NEWPANEL, EMERGENCY_PARSER) #error "PARK_HEAD_ON_PAUSE requires SDSUPPORT, EMERGENCY_PARSER, or an LCD controller." #elif ENABLED(HOME_BEFORE_FILAMENT_CHANGE) && DISABLED(PAUSE_PARK_NO_STEPPER_TIMEOUT) #error "HOME_BEFORE_FILAMENT_CHANGE requires PAUSE_PARK_NO_STEPPER_TIMEOUT." @@ -1026,15 +1028,8 @@ static_assert(Y_MAX_LENGTH >= Y_BED_SIZE, "Movement bounds (Y_MIN_POS, Y_MAX_POS /** * Special tool-changing options */ -#if 1 < 0 \ - + ENABLED(SINGLENOZZLE) \ - + ENABLED(DUAL_X_CARRIAGE) \ - + ENABLED(PARKING_EXTRUDER) \ - + ENABLED(MAGNETIC_PARKING_EXTRUDER) \ - + ENABLED(SWITCHING_TOOLHEAD) \ - + ENABLED(MAGNETIC_SWITCHING_TOOLHEAD) \ - + ENABLED(ELECTROMAGNETIC_SWITCHING_TOOLHEAD) - #error "Please select only one of SINGLENOZZLE, DUAL_X_CARRIAGE, PARKING_EXTRUDER, SWITCHING_TOOLHEAD, MAGNETIC_SWITCHING_TOOLHEAD, or ELECTROMAGNETIC_SWITCHING_TOOLHEAD." +#if MANY(SINGLENOZZLE, DUAL_X_CARRIAGE, PARKING_EXTRUDER, MAGNETIC_PARKING_EXTRUDER, SWITCHING_TOOLHEAD, MAGNETIC_SWITCHING_TOOLHEAD, ELECTROMAGNETIC_SWITCHING_TOOLHEAD) + #error "Please select only one of SINGLENOZZLE, DUAL_X_CARRIAGE, PARKING_EXTRUDER, MAGNETIC_PARKING_EXTRUDER, SWITCHING_TOOLHEAD, MAGNETIC_SWITCHING_TOOLHEAD, or ELECTROMAGNETIC_SWITCHING_TOOLHEAD." #endif /** @@ -1161,16 +1156,7 @@ static_assert(Y_MAX_LENGTH >= Y_BED_SIZE, "Movement bounds (Y_MIN_POS, Y_MAX_POS /** * Allow only one kinematic type to be defined */ -#if 1 < 0 \ - + ENABLED(DELTA) \ - + ENABLED(MORGAN_SCARA) \ - + ENABLED(COREXY) \ - + ENABLED(COREXZ) \ - + ENABLED(COREYZ) \ - + ENABLED(COREYX) \ - + ENABLED(COREZX) \ - + ENABLED(COREZY) \ - + ENABLED(MARKFORGED_XY) +#if MANY(DELTA, MORGAN_SCARA, COREXY, COREXZ, COREYZ, COREYX, COREZX, COREZY, MARKFORGED_XY) #error "Please enable only one of DELTA, MORGAN_SCARA, COREXY, COREYX, COREXZ, COREZX, COREYZ, COREZY, or MARKFORGED_XY." #endif @@ -1210,18 +1196,9 @@ static_assert(Y_MAX_LENGTH >= Y_BED_SIZE, "Movement bounds (Y_MIN_POS, Y_MAX_POS * Allow only one probe option to be defined */ #if 1 < 0 \ - + ENABLED(PROBE_MANUALLY) \ - + ENABLED(FIX_MOUNTED_PROBE) \ - + ENABLED(NOZZLE_AS_PROBE) \ - + (HAS_Z_SERVO_PROBE && DISABLED(BLTOUCH)) \ - + ENABLED(BLTOUCH) && DISABLED(CREALITY_TOUCH) \ - + ENABLED(CREALITY_TOUCH) \ - + ENABLED(TOUCH_MI_PROBE) \ - + ENABLED(SOLENOID_PROBE) \ - + ENABLED(Z_PROBE_ALLEN_KEY) \ - + ENABLED(Z_PROBE_SLED) \ - + ENABLED(RACK_AND_PINION_PROBE) \ - + ENABLED(SENSORLESS_PROBING) + + (DISABLED(BLTOUCH) && HAS_Z_SERVO_PROBE) \ + + (ENABLED(BLTOUCH) && DISABLED(CREALITY_TOUCH)) \ + + COUNT_ENABLED(PROBE_MANUALLY, FIX_MOUNTED_PROBE, NOZZLE_AS_PROBE, CREALITY_TOUCH, TOUCH_MI_PROBE, SOLENOID_PROBE, Z_PROBE_ALLEN_KEY, Z_PROBE_SLED, RACK_AND_PINION_PROBE, SENSORLESS_PROBING) #error "Please enable only one probe option: PROBE_MANUALLY, SENSORLESS_PROBING, BLTOUCH, FIX_MOUNTED_PROBE, NOZZLE_AS_PROBE, TOUCH_MI_PROBE, SOLENOID_PROBE, Z_PROBE_ALLEN_KEY, Z_PROBE_SLED, or Z Servo." #endif @@ -1391,12 +1368,7 @@ static_assert(Y_MAX_LENGTH >= Y_BED_SIZE, "Movement bounds (Y_MIN_POS, Y_MAX_POS /** * Allow only one bed leveling option to be defined */ -#if 1 < 0 \ - + ENABLED(AUTO_BED_LEVELING_LINEAR) \ - + ENABLED(AUTO_BED_LEVELING_3POINT) \ - + ENABLED(AUTO_BED_LEVELING_BILINEAR) \ - + ENABLED(AUTO_BED_LEVELING_UBL) \ - + ENABLED(MESH_BED_LEVELING) +#if MANY(AUTO_BED_LEVELING_LINEAR, AUTO_BED_LEVELING_3POINT, AUTO_BED_LEVELING_BILINEAR, AUTO_BED_LEVELING_UBL, MESH_BED_LEVELING) #error "Select only one of: MESH_BED_LEVELING, AUTO_BED_LEVELING_LINEAR, AUTO_BED_LEVELING_3POINT, AUTO_BED_LEVELING_BILINEAR or AUTO_BED_LEVELING_UBL." #endif @@ -1558,8 +1530,8 @@ static_assert(hbm[Z_AXIS] >= 0, "HOMING_BUMP_MM.Z must be greater than or equal /** * ULTIPANEL encoder */ -#if ENABLED(ULTIPANEL) && NONE(NEWPANEL, SR_LCD_2W_NL) && !defined(SHIFT_CLK) - #error "ULTIPANEL requires some kind of encoder." +#if IS_ULTIPANEL && NONE(IS_NEWPANEL, SR_LCD_2W_NL) && !defined(SHIFT_CLK) + #error "ULTIPANEL controllers require some kind of encoder." #endif #if ENCODER_PULSES_PER_STEP < 0 @@ -2237,89 +2209,100 @@ static_assert(hbm[Z_AXIS] >= 0, "HOMING_BUMP_MM.Z must be greater than or equal * Make sure only one display is enabled */ #if 1 < 0 \ - + (ENABLED(REPRAP_DISCOUNT_SMART_CONTROLLER) && DISABLED(IS_RRD_SC)) \ - + (ENABLED(REPRAP_DISCOUNT_FULL_GRAPHIC_SMART_CONTROLLER) && DISABLED(IS_RRD_FG_SC)) \ - + (ENABLED(ULTRA_LCD) && DISABLED(IS_ULTRA_LCD)) \ + + ENABLED(REPRAP_DISCOUNT_SMART_CONTROLLER) \ + + ENABLED(REPRAP_DISCOUNT_FULL_GRAPHIC_SMART_CONTROLLER) \ + + ENABLED(ULTIPANEL) \ + + ENABLED(ULTRA_LCD) \ + (ENABLED(U8GLIB_SSD1306) && DISABLED(IS_U8GLIB_SSD1306)) \ + (ENABLED(MINIPANEL) && NONE(MKS_MINI_12864, ENDER2_STOCKDISPLAY)) \ + (ENABLED(MKS_MINI_12864) && DISABLED(MKS_LCD12864)) \ + (ENABLED(EXTENSIBLE_UI) && DISABLED(IS_EXTUI)) \ - + (ENABLED(ULTIPANEL) && DISABLED(IS_ULTIPANEL)) \ - + ENABLED(RADDS_DISPLAY) \ - + ENABLED(ULTIMAKERCONTROLLER) \ - + ENABLED(PANEL_ONE) \ - + ENABLED(G3D_PANEL) \ - + ENABLED(RIGIDBOT_PANEL) \ - + ENABLED(MAKEBOARD_MINI_2_LINE_DISPLAY_1602) \ - + ENABLED(ZONESTAR_LCD) \ - + ENABLED(RA_CONTROL_PANEL) \ - + ENABLED(LCD_SAINSMART_I2C_1602) \ - + ENABLED(LCD_SAINSMART_I2C_2004) \ - + ENABLED(LCM1602) \ - + ENABLED(LCD_I2C_PANELOLU2) \ - + ENABLED(LCD_I2C_VIKI) \ - + ENABLED(SAV_3DLCD) \ - + ENABLED(FF_INTERFACEBOARD) \ - + ENABLED(REPRAPWORLD_GRAPHICAL_LCD) \ - + ENABLED(VIKI2) \ - + ENABLED(miniVIKI) \ - + ENABLED(MAKRPANEL) \ - + ENABLED(ELB_FULL_GRAPHIC_CONTROLLER) \ - + ENABLED(BQ_LCD_SMART_CONTROLLER) \ - + ENABLED(CARTESIO_UI) \ - + ENABLED(LCD_FOR_MELZI) \ - + ENABLED(ULTI_CONTROLLER) \ - + ENABLED(MKS_LCD12864) \ - + ENABLED(ENDER2_STOCKDISPLAY) \ - + ENABLED(FYSETC_MINI_12864_X_X) \ - + ENABLED(FYSETC_MINI_12864_1_2) \ - + ENABLED(FYSETC_MINI_12864_2_0) \ - + ENABLED(FYSETC_MINI_12864_2_1) \ - + ENABLED(FYSETC_GENERIC_12864_1_1) \ - + ENABLED(CR10_STOCKDISPLAY) \ - + ENABLED(DWIN_CREALITY_LCD) \ + + (DISABLED(IS_LEGACY_TFT) && ENABLED(TFT_GENERIC)) \ + + (ENABLED(IS_LEGACY_TFT) && COUNT_ENABLED(TFT_320x240, TFT_320x240_SPI, TFT_480x320, TFT_480x320_SPI)) \ + + COUNT_ENABLED(ANYCUBIC_LCD_I3MEGA, ANYCUBIC_LCD_CHIRON, ANYCUBIC_TFT35) \ + + COUNT_ENABLED(DGUS_LCD_UI_ORIGIN, DGUS_LCD_UI_FYSETC, DGUS_LCD_UI_HIPRECY) \ + + COUNT_ENABLED(ENDER2_STOCKDISPLAY, CR10_STOCKDISPLAY, DWIN_CREALITY_LCD) \ + + COUNT_ENABLED(FYSETC_MINI_12864_X_X, FYSETC_MINI_12864_1_2, FYSETC_MINI_12864_2_0, FYSETC_MINI_12864_2_1, FYSETC_GENERIC_12864_1_1) \ + + COUNT_ENABLED(LCD_SAINSMART_I2C_1602, LCD_SAINSMART_I2C_2004) \ + + COUNT_ENABLED(MKS_12864OLED, MKS_12864OLED_SSD1306) \ + + COUNT_ENABLED(MKS_TS35_V2_0, MKS_ROBIN_TFT24, MKS_ROBIN_TFT28, MKS_ROBIN_TFT32, MKS_ROBIN_TFT35, MKS_ROBIN_TFT43, MKS_ROBIN_TFT_V1_1R) \ + + COUNT_ENABLED(TFTGLCD_PANEL_SPI, TFTGLCD_PANEL_I2C) \ + + COUNT_ENABLED(VIKI2, miniVIKI) \ + + COUNT_ENABLED(ZONESTAR_12864LCD, ZONESTAR_12864OLED, ZONESTAR_12864OLED_SSD1306) \ + ENABLED(ANET_FULL_GRAPHICS_LCD) \ + ENABLED(AZSMZ_12864) \ - + ENABLED(SILVER_GATE_GLCD_CONTROLLER) \ - + ENABLED(SAV_3DGLCD) \ - + ENABLED(OLED_PANEL_TINYBOY2) \ - + ENABLED(MKS_12864OLED) \ - + ENABLED(MKS_12864OLED_SSD1306) \ - + ENABLED(ZONESTAR_12864LCD) \ - + ENABLED(ZONESTAR_12864OLED) \ - + ENABLED(ZONESTAR_12864OLED_SSD1306) \ - + ENABLED(U8GLIB_SH1106_EINSTART) \ - + ENABLED(OVERLORD_OLED) \ + + ENABLED(BQ_LCD_SMART_CONTROLLER) \ + + ENABLED(CARTESIO_UI) \ + + ENABLED(ELB_FULL_GRAPHIC_CONTROLLER) \ + + ENABLED(FF_INTERFACEBOARD) \ + ENABLED(FYSETC_242_OLED_12864) \ - + ENABLED(DGUS_LCD_UI_ORIGIN) \ - + ENABLED(DGUS_LCD_UI_FYSETC) \ - + ENABLED(DGUS_LCD_UI_HIPRECY) \ + + ENABLED(G3D_PANEL) \ + + ENABLED(LCD_FOR_MELZI) \ + + ENABLED(LCD_I2C_PANELOLU2) \ + + ENABLED(LCD_I2C_VIKI) \ + + ENABLED(LCM1602) \ + + ENABLED(LONGER_LK_TFT28) \ + + ENABLED(MAKEBOARD_MINI_2_LINE_DISPLAY_1602) \ + + ENABLED(MAKRPANEL) \ + ENABLED(MALYAN_LCD) \ + + ENABLED(MKS_LCD12864) \ + + ENABLED(OLED_PANEL_TINYBOY2) \ + + ENABLED(OVERLORD_OLED) \ + + ENABLED(PANEL_ONE) \ + + ENABLED(RA_CONTROL_PANEL) \ + + ENABLED(RADDS_DISPLAY) \ + + ENABLED(REPRAPWORLD_GRAPHICAL_LCD) \ + + ENABLED(RIGIDBOT_PANEL) \ + + ENABLED(SAV_3DGLCD) \ + + ENABLED(SAV_3DLCD) \ + + ENABLED(SILVER_GATE_GLCD_CONTROLLER) \ + + ENABLED(TFT_TRONXY_X5SA) \ + ENABLED(TOUCH_UI_FTDI_EVE) \ - + ENABLED(TFT_320x240) \ - + ENABLED(TFT_320x240_SPI) \ - + ENABLED(FSMC_GRAPHICAL_TFT) \ - + ENABLED(TFT_LVGL_UI_FSMC) \ - + ENABLED(TFT_LVGL_UI_SPI) \ - + ENABLED(ANYCUBIC_LCD_I3MEGA) \ - + ENABLED(ANYCUBIC_LCD_CHIRON) \ - + ENABLED(TFTGLCD_PANEL_SPI) \ - + ENABLED(TFTGLCD_PANEL_I2C) + + ENABLED(U8GLIB_SH1106_EINSTART) \ + + ENABLED(ULTI_CONTROLLER) \ + + ENABLED(ULTIMAKERCONTROLLER) \ + + ENABLED(ZONESTAR_LCD) #error "Please select only one LCD controller option." #endif -#undef IS_RRD_SC -#undef IS_RRD_FG_SC -#undef IS_ULTRA_LCD #undef IS_U8GLIB_SSD1306 -#undef IS_RRW_KEYPAD #undef IS_EXTUI -#undef IS_ULTIPANEL +#undef IS_LEGACY_TFT -#if 1 < ENABLED(LCD_SCREEN_ROT_0) + ENABLED(LCD_SCREEN_ROT_90) + ENABLED(LCD_SCREEN_ROT_180) + ENABLED(LCD_SCREEN_ROT_270) +#if ANY(TFT_GENERIC, MKS_TS35_V2_0, MKS_ROBIN_TFT24, MKS_ROBIN_TFT28, MKS_ROBIN_TFT32, MKS_ROBIN_TFT35, MKS_ROBIN_TFT43, MKS_ROBIN_TFT_V1_1R, TFT_TRONXY_X5SA, ANYCUBIC_TFT35, ANYCUBIC_TFT35, LONGER_LK_TFT28) + #if NONE(TFT_COLOR_UI, TFT_CLASSIC_UI, TFT_LVGL_UI) + #error "TFT_COLOR_UI, TFT_CLASSIC_UI, TFT_LVGL_UI is required for your TFT. Please enable one." + #elif 1 < ENABLED(TFT_COLOR_UI) + ENABLED(TFT_CLASSIC_UI) + ENABLED(TFT_LVGL_UI) + #error "Please select only one of TFT_COLOR_UI, TFT_CLASSIC_UI, or TFT_LVGL_UI." + #endif +#elif ANY(TFT_COLOR_UI, TFT_CLASSIC_UI, TFT_LVGL_UI) + #error "TFT_(COLOR|CLASSIC|LVGL)_UI requires a TFT display to be enabled." +#endif + +#if ENABLED(TFT_GENERIC) && NONE(TFT_INTERFACE_FSMC, TFT_INTERFACE_SPI) + #error "TFT_GENERIC requires either TFT_INTERFACE_FSMC or TFT_INTERFACE_SPI interface." +#endif + +#if BOTH(TFT_INTERFACE_FSMC, TFT_INTERFACE_SPI) + #error "Please enable only one of TFT_INTERFACE_SPI or TFT_INTERFACE_SPI." +#endif + +#if MANY(LCD_SCREEN_ROT_0, LCD_SCREEN_ROT_90, LCD_SCREEN_ROT_180, LCD_SCREEN_ROT_270) #error "Please enable only one LCD_SCREEN_ROT_* option: 0, 90, 180, or 270." #endif +#if MANY(TFT_RES_320x240, TFT_RES_480x272, TFT_RES_480x320) + #error "Please select only one of TFT_RES_480x320, TFT_RES_480x320, or TFT_RES_480x272." +#endif + +#if HAS_TFT_LVGL_UI && DISABLED(TFT_RES_480x320) + #error "(FMSC|SPI)TFT_LVGL_UI requires TFT_RES_480x320." +#endif + +#if defined(GRAPHICAL_TFT_UPSCALE) && !WITHIN(GRAPHICAL_TFT_UPSCALE, 2, 3) + #error "GRAPHICAL_TFT_UPSCALE must be set to 2 or 3." +#endif + /** * Serial displays require a dedicated serial port */ @@ -2756,7 +2739,7 @@ static_assert( _ARR_TEST(3,0) && _ARR_TEST(3,1) && _ARR_TEST(3,2) #error "BLOCK_BUFFER_SIZE must be a power of 2." #endif -#if ENABLED(LED_CONTROL_MENU) && DISABLED(ULTIPANEL) +#if ENABLED(LED_CONTROL_MENU) && !IS_ULTIPANEL #error "LED_CONTROL_MENU requires an LCD controller." #endif diff --git a/Marlin/src/inc/Version.h b/Marlin/src/inc/Version.h index 9133752844..e254cb0108 100644 --- a/Marlin/src/inc/Version.h +++ b/Marlin/src/inc/Version.h @@ -52,7 +52,7 @@ * to alert users to major changes. */ -#define MARLIN_HEX_VERSION 020007 +#define MARLIN_HEX_VERSION 020008 #ifndef REQUIRED_CONFIGURATION_H_VERSION #define REQUIRED_CONFIGURATION_H_VERSION MARLIN_HEX_VERSION #endif diff --git a/Marlin/src/lcd/TFTGLCD/ultralcd_TFTGLCD.cpp b/Marlin/src/lcd/TFTGLCD/ultralcd_TFTGLCD.cpp index b5789091dc..4aa6bcd485 100644 --- a/Marlin/src/lcd/TFTGLCD/ultralcd_TFTGLCD.cpp +++ b/Marlin/src/lcd/TFTGLCD/ultralcd_TFTGLCD.cpp @@ -28,7 +28,7 @@ * ultralcd_TFTGLCD.cpp * * Implementation of the LCD display routines for a TFT GLCD displays with external controller. - * This display looks as a REPRAP_DISCOUNT_FULL_GRAPHIC_SMART_CONTROLLER but has good text font + * This display looks like a REPRAP_DISCOUNT_FULL_GRAPHIC_SMART_CONTROLLER but has good text font * and supports color output. */ diff --git a/Marlin/src/lcd/dogm/HAL_LCD_com_defines.h b/Marlin/src/lcd/dogm/HAL_LCD_com_defines.h index da7d4f6f1e..535502f2e1 100644 --- a/Marlin/src/lcd/dogm/HAL_LCD_com_defines.h +++ b/Marlin/src/lcd/dogm/HAL_LCD_com_defines.h @@ -112,7 +112,7 @@ #ifndef U8G_COM_SSD_I2C_HAL #define U8G_COM_SSD_I2C_HAL u8g_com_null_fn #endif -#if EITHER(FSMC_GRAPHICAL_TFT, SPI_GRAPHICAL_TFT) +#if HAS_FSMC_GRAPHICAL_TFT || HAS_SPI_GRAPHICAL_TFT uint8_t u8g_com_hal_tft_fn(u8g_t *u8g, uint8_t msg, uint8_t arg_val, void *arg_ptr); #define U8G_COM_HAL_TFT_FN u8g_com_hal_tft_fn #else diff --git a/Marlin/src/lcd/dogm/u8g_dev_tft_upscale_from_128x64.cpp b/Marlin/src/lcd/dogm/u8g_dev_tft_upscale_from_128x64.cpp index d18b617987..fa9e006744 100644 --- a/Marlin/src/lcd/dogm/u8g_dev_tft_upscale_from_128x64.cpp +++ b/Marlin/src/lcd/dogm/u8g_dev_tft_upscale_from_128x64.cpp @@ -55,7 +55,7 @@ #include "../../inc/MarlinConfig.h" -#if HAS_MARLINUI_U8GLIB && (PIN_EXISTS(FSMC_CS) || ENABLED(SPI_GRAPHICAL_TFT)) +#if HAS_MARLINUI_U8GLIB && (PIN_EXISTS(FSMC_CS) || HAS_SPI_GRAPHICAL_TFT) #include "HAL_LCD_com_defines.h" #include "ultralcd_DOGM.h" @@ -477,4 +477,4 @@ uint8_t u8g_com_hal_tft_fn(u8g_t *u8g, uint8_t msg, uint8_t arg_val, void *arg_p U8G_PB_DEV(u8g_dev_tft_320x240_upscale_from_128x64, WIDTH, HEIGHT, PAGE_HEIGHT, u8g_dev_tft_320x240_upscale_from_128x64_fn, U8G_COM_HAL_TFT_FN); -#endif // HAS_MARLINUI_U8GLIB && FSMC_CS +#endif // HAS_MARLINUI_U8GLIB && (FSMC_CS_PIN || HAS_SPI_GRAPHICAL_TFT) diff --git a/Marlin/src/lcd/dogm/ultralcd_DOGM.h b/Marlin/src/lcd/dogm/ultralcd_DOGM.h index 228cee6848..b0db727f09 100644 --- a/Marlin/src/lcd/dogm/ultralcd_DOGM.h +++ b/Marlin/src/lcd/dogm/ultralcd_DOGM.h @@ -189,7 +189,7 @@ // Unspecified 320x240 TFT pre-initialized by built-in bootloader #define U8G_CLASS U8GLIB_TFT_320X240_UPSCALE_FROM_128X64 - #if ENABLED(FSMC_GRAPHICAL_TFT) + #if HAS_FSMC_GRAPHICAL_TFT #define U8G_PARAM FSMC_CS_PIN, FSMC_RS_PIN #else #define U8G_PARAM -1, -1 diff --git a/Marlin/src/lcd/extui/lib/mks_ui/draw_print_file.cpp b/Marlin/src/lcd/extui/lib/mks_ui/draw_print_file.cpp index 6d7b68af42..e84bb395e0 100644 --- a/Marlin/src/lcd/extui/lib/mks_ui/draw_print_file.cpp +++ b/Marlin/src/lcd/extui/lib/mks_ui/draw_print_file.cpp @@ -520,7 +520,7 @@ void lv_gcode_file_read(uint8_t *data_buf) { j = 0; ignore_start = false; } - #if ENABLED(TFT_LVGL_UI_SPI) + #if HAS_TFT_LVGL_UI_SPI for (i = 0; i < 200;) { p_index = (uint16_t *)(&public_buf[i]); @@ -529,7 +529,7 @@ void lv_gcode_file_read(uint8_t *data_buf) { i += 2; if (*p_index == 0x0000) *p_index = LV_COLOR_BACKGROUND.full; } - #else + #else // !HAS_TFT_LVGL_UI_SPI for (i = 0; i < 200;) { p_index = (uint16_t *)(&public_buf[i]); //Color = (*p_index >> 8); @@ -537,7 +537,7 @@ void lv_gcode_file_read(uint8_t *data_buf) { i += 2; if (*p_index == 0x0000) *p_index = LV_COLOR_BACKGROUND.full; // 0x18C3; } - #endif // TFT_LVGL_UI_SPI + #endif // !HAS_TFT_LVGL_UI_SPI memcpy(data_buf, public_buf, 200); #endif // SDSUPPORT } diff --git a/Marlin/src/lcd/extui/lib/mks_ui/draw_ui.cpp b/Marlin/src/lcd/extui/lib/mks_ui/draw_ui.cpp index d600b09a5f..519fae2f39 100644 --- a/Marlin/src/lcd/extui/lib/mks_ui/draw_ui.cpp +++ b/Marlin/src/lcd/extui/lib/mks_ui/draw_ui.cpp @@ -751,7 +751,7 @@ char *creat_title_text() { card.openFileRead(cur_name); card.setIndex((PREVIEW_LITTLE_PIC_SIZE + To_pre_view) + size * row + 8); - #if ENABLED(TFT_LVGL_UI_SPI) + #if HAS_TFT_LVGL_UI_SPI SPI_TFT.setWindow(xpos_pixel, ypos_pixel + row, 200, 1); #else LCD_setWindowArea(xpos_pixel, ypos_pixel + row, 200, 1); @@ -782,7 +782,7 @@ char *creat_title_text() { //#endif } - #if ENABLED(TFT_LVGL_UI_SPI) + #if HAS_TFT_LVGL_UI_SPI for (i = 0; i < 400;) { p_index = (uint16_t *)(&bmp_public_buf[i]); diff --git a/Marlin/src/lcd/scaled_tft.h b/Marlin/src/lcd/scaled_tft.h index 2c05e5f26d..54bf6f8d13 100644 --- a/Marlin/src/lcd/scaled_tft.h +++ b/Marlin/src/lcd/scaled_tft.h @@ -49,7 +49,7 @@ #define TFT_PIXEL_OFFSET_X 48 #endif #endif + #ifndef TFT_PIXEL_OFFSET_Y - // 32 is better for both 320x240 and 480x320 - #define TFT_PIXEL_OFFSET_Y 32 + #define TFT_PIXEL_OFFSET_Y 32 // 32 is best for both 320x240 and 480x320 #endif diff --git a/Marlin/src/lcd/ultralcd.cpp b/Marlin/src/lcd/ultralcd.cpp index 7003d13fdd..da9c3e2456 100644 --- a/Marlin/src/lcd/ultralcd.cpp +++ b/Marlin/src/lcd/ultralcd.cpp @@ -400,7 +400,7 @@ bool MarlinUI::get_blink() { ///////////// Keypad Handling ////////////// //////////////////////////////////////////// -#if BOTH(REPRAPWORLD_KEYPAD, HAS_ENCODER_ACTION) +#if IS_RRW_KEYPAD && HAS_ENCODER_ACTION volatile uint8_t MarlinUI::keypad_buttons; @@ -432,7 +432,7 @@ bool MarlinUI::get_blink() { #if HAS_ENCODER_ACTION refresh(LCDVIEW_REDRAW_NOW); #if HAS_LCD_MENU - if (encoderDirection == -(ENCODERBASE)) { // ADC_KEYPAD forces REVERSE_MENU_DIRECTION, so this indicates menu navigation + if (encoderDirection == -(ENCODERBASE)) { // HAS_ADC_BUTTONS forces REVERSE_MENU_DIRECTION, so this indicates menu navigation if (RRK(EN_KEYPAD_UP)) encoderPosition += ENCODER_STEPS_PER_MENU_ITEM; else if (RRK(EN_KEYPAD_DOWN)) encoderPosition -= ENCODER_STEPS_PER_MENU_ITEM; else if (RRK(EN_KEYPAD_LEFT)) { MenuItem_back::action(); quick_feedback(); } @@ -497,12 +497,12 @@ bool MarlinUI::get_blink() { return true; } - #endif // !ADC_KEYPAD + #endif // !HAS_ADC_BUTTONS return false; } -#endif // REPRAPWORLD_KEYPAD +#endif // IS_RRW_KEYPAD && HAS_ENCODER_ACTION /** * Status Screen diff --git a/Marlin/src/lcd/ultralcd.h b/Marlin/src/lcd/ultralcd.h index c7ef41596d..bf9e47e0c8 100644 --- a/Marlin/src/lcd/ultralcd.h +++ b/Marlin/src/lcd/ultralcd.h @@ -34,13 +34,13 @@ #if EITHER(HAS_LCD_MENU, ULTIPANEL_FEEDMULTIPLY) #define HAS_ENCODER_ACTION 1 #endif -#if ((!HAS_ADC_BUTTONS && ENABLED(NEWPANEL)) || BUTTONS_EXIST(EN1, EN2)) && !IS_TFTGLCD_PANEL +#if ((!HAS_ADC_BUTTONS && IS_NEWPANEL) || BUTTONS_EXIST(EN1, EN2)) && !IS_TFTGLCD_PANEL #define HAS_ENCODER_WHEEL 1 #endif #if HAS_ENCODER_WHEEL || ANY_BUTTON(ENC, BACK, UP, DWN, LFT, RT) #define HAS_DIGITAL_BUTTONS 1 #endif -#if !HAS_ADC_BUTTONS && (ENABLED(REPRAPWORLD_KEYPAD) || (HAS_WIRED_LCD && DISABLED(NEWPANEL))) +#if !HAS_ADC_BUTTONS && (IS_RRW_KEYPAD || (HAS_WIRED_LCD && !IS_NEWPANEL)) #define HAS_SHIFT_ENCODER 1 #endif @@ -106,8 +106,7 @@ #endif // HAS_WIRED_LCD -// REPRAPWORLD_KEYPAD (and ADC_KEYPAD) -#if ENABLED(REPRAPWORLD_KEYPAD) +#if IS_RRW_KEYPAD #define BTN_OFFSET 0 // Bit offset into buttons for shift register values #define BLEN_KEYPAD_F3 0 @@ -136,7 +135,7 @@ #define BUTTON_CLICK() RRK(EN_KEYPAD_MIDDLE) #endif -#endif +#endif // IS_RRW_KEYPAD #if HAS_DIGITAL_BUTTONS @@ -633,7 +632,7 @@ public: #if HAS_ENCODER_ACTION static volatile uint8_t buttons; - #if ENABLED(REPRAPWORLD_KEYPAD) + #if IS_RRW_KEYPAD static volatile uint8_t keypad_buttons; static bool handle_keypad(); #endif diff --git a/Marlin/src/pins/esp32/pins_MRR_ESPE.h b/Marlin/src/pins/esp32/pins_MRR_ESPE.h index 95f761f26a..d22a82d7a4 100644 --- a/Marlin/src/pins/esp32/pins_MRR_ESPE.h +++ b/Marlin/src/pins/esp32/pins_MRR_ESPE.h @@ -134,7 +134,7 @@ #define BEEPER_PIN 151 - #elif ENABLED(REPRAP_DISCOUNT_FULL_GRAPHIC_SMART_CONTROLLER) + #elif IS_RRD_FG_SC #define BEEPER_PIN 151 diff --git a/Marlin/src/pins/linux/pins_RAMPS_LINUX.h b/Marlin/src/pins/linux/pins_RAMPS_LINUX.h index 002d2ebd9c..ce2ee2579a 100644 --- a/Marlin/src/pins/linux/pins_RAMPS_LINUX.h +++ b/Marlin/src/pins/linux/pins_RAMPS_LINUX.h @@ -400,7 +400,7 @@ #define LCD_PINS_ENABLE 51 // SID (MOSI) #define LCD_PINS_D4 52 // SCK (CLK) clock - #elif BOTH(NEWPANEL, PANEL_ONE) + #elif BOTH(IS_NEWPANEL, PANEL_ONE) #define LCD_PINS_RS 40 #define LCD_PINS_ENABLE 42 @@ -417,7 +417,7 @@ #define LCD_PINS_ENABLE 29 #define LCD_PINS_D4 25 - #if DISABLED(NEWPANEL) + #if !IS_NEWPANEL #define BEEPER_PIN 37 #endif @@ -450,13 +450,13 @@ #define LCD_PINS_D7 29 - #if DISABLED(NEWPANEL) + #if !IS_NEWPANEL #define BEEPER_PIN 33 #endif #endif - #if DISABLED(NEWPANEL) + #if !IS_NEWPANEL // Buttons attached to a shift register // Not wired yet //#define SHIFT_CLK 38 @@ -470,7 +470,7 @@ // // LCD Display input pins // - #if ENABLED(NEWPANEL) + #if IS_NEWPANEL #if ENABLED(REPRAP_DISCOUNT_SMART_CONTROLLER) @@ -607,7 +607,7 @@ #define BEEPER_PIN 33 // Buttons are directly attached to AUX-2 - #if ENABLED(REPRAPWORLD_KEYPAD) + #if IS_RRW_KEYPAD #define SHIFT_OUT 40 #define SHIFT_CLK 44 #define SHIFT_LD 42 @@ -630,6 +630,6 @@ #endif #endif - #endif // NEWPANEL + #endif // IS_NEWPANEL #endif // HAS_WIRED_LCD diff --git a/Marlin/src/pins/lpc1768/pins_BIQU_B300_V1.0.h b/Marlin/src/pins/lpc1768/pins_BIQU_B300_V1.0.h index df182049f9..8c1c124d90 100644 --- a/Marlin/src/pins/lpc1768/pins_BIQU_B300_V1.0.h +++ b/Marlin/src/pins/lpc1768/pins_BIQU_B300_V1.0.h @@ -138,8 +138,8 @@ #define LCD_PINS_ENABLE P0_18 // (MOSI) EXP1-3 #define LCD_PINS_D4 P0_15 // (SCK) EXP1-5 - #if BOTH(HAS_MARLINUI_HD44780, REPRAP_DISCOUNT_SMART_CONTROLLER) - #error "REPRAP_DISCOUNT_SMART_CONTROLLER is not supported by the BIQU B300 v1.0" + #if BOTH(HAS_MARLINUI_HD44780, IS_RRD_SC) + #error "REPRAP_DISCOUNT_SMART_CONTROLLER displays aren't supported by the BIQU B300 v1.0" #endif #if ENABLED(SDSUPPORT) diff --git a/Marlin/src/pins/lpc1768/pins_BIQU_BQ111_A4.h b/Marlin/src/pins/lpc1768/pins_BIQU_BQ111_A4.h index bcff04eb85..d92d5e578f 100644 --- a/Marlin/src/pins/lpc1768/pins_BIQU_BQ111_A4.h +++ b/Marlin/src/pins/lpc1768/pins_BIQU_BQ111_A4.h @@ -109,8 +109,8 @@ #define LCD_PINS_ENABLE P0_18 // (MOSI) EXP1-3 #define LCD_PINS_D4 P0_15 // (SCK) EXP1-5 - #if BOTH(HAS_MARLINUI_HD44780, REPRAP_DISCOUNT_SMART_CONTROLLER) - #error "REPRAP_DISCOUNT_SMART_CONTROLLER is not supported by the BIQU BQ111-A4" + #if BOTH(HAS_MARLINUI_HD44780, IS_RRD_SC) + #error "REPRAP_DISCOUNT_SMART_CONTROLLER displays aren't supported by the BIQU BQ111-A4" #endif #if ENABLED(SDSUPPORT) diff --git a/Marlin/src/pins/lpc1768/pins_BTT_SKR_V1_3.h b/Marlin/src/pins/lpc1768/pins_BTT_SKR_V1_3.h index 31373fedff..51e48fc8e9 100644 --- a/Marlin/src/pins/lpc1768/pins_BTT_SKR_V1_3.h +++ b/Marlin/src/pins/lpc1768/pins_BTT_SKR_V1_3.h @@ -348,7 +348,7 @@ #define LCD_BACKLIGHT_PIN -1 #endif - #if ENABLED(ULTIPANEL) + #if IS_ULTIPANEL #define LCD_PINS_D5 EXPA1_05_PIN #define LCD_PINS_D6 EXPA1_04_PIN #define LCD_PINS_D7 EXPA1_03_PIN diff --git a/Marlin/src/pins/lpc1768/pins_BTT_SKR_V1_4.h b/Marlin/src/pins/lpc1768/pins_BTT_SKR_V1_4.h index 4686e984b0..f2afc23bc2 100644 --- a/Marlin/src/pins/lpc1768/pins_BTT_SKR_V1_4.h +++ b/Marlin/src/pins/lpc1768/pins_BTT_SKR_V1_4.h @@ -293,9 +293,6 @@ #define TOUCH_BUTTONS_HW_SPI #define TOUCH_BUTTONS_HW_SPI_DEVICE 1 - #ifndef GRAPHICAL_TFT_UPSCALE - #define GRAPHICAL_TFT_UPSCALE 3 - #endif // SPI 1 #define SCK_PIN P0_15 #define MISO_PIN P0_17 @@ -398,7 +395,7 @@ #define FORCE_SOFT_SPI #endif - #if ENABLED(ULTIPANEL) + #if IS_ULTIPANEL #define LCD_PINS_D5 P1_21 #define LCD_PINS_D6 P1_22 #define LCD_PINS_D7 P1_23 diff --git a/Marlin/src/pins/lpc1768/pins_GMARSH_X6_REV1.h b/Marlin/src/pins/lpc1768/pins_GMARSH_X6_REV1.h index 5132081a55..3562619f5c 100644 --- a/Marlin/src/pins/lpc1768/pins_GMARSH_X6_REV1.h +++ b/Marlin/src/pins/lpc1768/pins_GMARSH_X6_REV1.h @@ -125,7 +125,7 @@ // // LCD // -#if ENABLED(REPRAP_DISCOUNT_SMART_CONTROLLER) +#if IS_RRD_SC #define BEEPER_PIN P0_19 #define BTN_EN1 P1_23 #define BTN_EN2 P1_24 diff --git a/Marlin/src/pins/lpc1768/pins_MKS_SBASE.h b/Marlin/src/pins/lpc1768/pins_MKS_SBASE.h index 6c6a9ea306..2430958895 100644 --- a/Marlin/src/pins/lpc1768/pins_MKS_SBASE.h +++ b/Marlin/src/pins/lpc1768/pins_MKS_SBASE.h @@ -147,7 +147,7 @@ // // Ethernet pins // -#ifndef ULTIPANEL +#if !IS_ULTIPANEL #define ENET_MDIO P1_17 // J12-4 #define ENET_RX_ER P1_14 // J12-6 #define ENET_RXD1 P1_10 // J12-8 diff --git a/Marlin/src/pins/lpc1768/pins_MKS_SGEN_L.h b/Marlin/src/pins/lpc1768/pins_MKS_SGEN_L.h index d269ecbdc9..0a8f3a6da8 100644 --- a/Marlin/src/pins/lpc1768/pins_MKS_SGEN_L.h +++ b/Marlin/src/pins/lpc1768/pins_MKS_SGEN_L.h @@ -319,7 +319,7 @@ #define DOGLCD_A0 P1_00 #endif - #if ENABLED(ULTIPANEL) + #if IS_ULTIPANEL #define LCD_PINS_D5 P0_17 #define LCD_PINS_D6 P1_00 #define LCD_PINS_D7 P1_22 diff --git a/Marlin/src/pins/lpc1768/pins_RAMPS_RE_ARM.h b/Marlin/src/pins/lpc1768/pins_RAMPS_RE_ARM.h index 294e7527a8..674bd6b0ff 100644 --- a/Marlin/src/pins/lpc1768/pins_RAMPS_RE_ARM.h +++ b/Marlin/src/pins/lpc1768/pins_RAMPS_RE_ARM.h @@ -357,8 +357,8 @@ #define LCD_PINS_RS P0_16 // (16) J3-7 & AUX-4 #define LCD_SDSS P1_23 // (53) J3-5 & AUX-3 - #if ENABLED(NEWPANEL) - #if ENABLED(REPRAPWORLD_KEYPAD) + #if IS_NEWPANEL + #if IS_RRW_KEYPAD #define SHIFT_OUT P0_18 // (51) (MOSI) J3-10 & AUX-3 #define SHIFT_CLK P0_15 // (52) (SCK) J3-9 & AUX-3 #define SHIFT_LD P1_31 // (49) J3-1 & AUX-3 (NOT 5V tolerant) @@ -416,7 +416,7 @@ #define LCD_BACKLIGHT_PIN P0_16 //(16) J3-7 & AUX-4 - only used on DOGLCD controllers #define LCD_PINS_ENABLE P0_18 // (51) (MOSI) J3-10 & AUX-3 #define LCD_PINS_D4 P0_15 // (52) (SCK) J3-9 & AUX-3 - #if ENABLED(ULTIPANEL) + #if IS_ULTIPANEL #define LCD_PINS_D5 P1_17 // (71) ENET_MDIO #define LCD_PINS_D6 P1_14 // (73) ENET_RX_ER #define LCD_PINS_D7 P1_10 // (75) ENET_RXD1 @@ -436,7 +436,7 @@ // // Ethernet pins // -#if DISABLED(ULTIPANEL) +#if !IS_ULTIPANEL #define ENET_MDIO P1_17 // (71) J12-4 #define ENET_RX_ER P1_14 // (73) J12-6 #define ENET_RXD1 P1_10 // (75) J12-8 diff --git a/Marlin/src/pins/lpc1768/pins_SELENA_COMPACT.h b/Marlin/src/pins/lpc1768/pins_SELENA_COMPACT.h index f9b9db918d..4e3b2ef425 100644 --- a/Marlin/src/pins/lpc1768/pins_SELENA_COMPACT.h +++ b/Marlin/src/pins/lpc1768/pins_SELENA_COMPACT.h @@ -96,7 +96,7 @@ // Display // -#if ENABLED(REPRAP_DISCOUNT_FULL_GRAPHIC_SMART_CONTROLLER) +#if IS_RRD_FG_SC #define LCD_PINS_RS P0_16 #define LCD_PINS_ENABLE P0_18 #define LCD_PINS_D4 P0_15 @@ -110,4 +110,4 @@ #define BTN_ENC P1_30 #define SD_DETECT_PIN -1 -#endif // REPRAP_DISCOUNT_FULL_GRAPHIC_SMART_CONTROLLER +#endif // IS_RRD_FG_SC diff --git a/Marlin/src/pins/lpc1769/pins_AZTEEG_X5_MINI.h b/Marlin/src/pins/lpc1769/pins_AZTEEG_X5_MINI.h index 6331d6aa7c..ad792447ea 100644 --- a/Marlin/src/pins/lpc1769/pins_AZTEEG_X5_MINI.h +++ b/Marlin/src/pins/lpc1769/pins_AZTEEG_X5_MINI.h @@ -144,11 +144,11 @@ #define DOGLCD_A0 P2_06 // (59) J3-8 & AUX-2 - #if ENABLED(REPRAPWORLD_KEYPAD) + #if IS_RRW_KEYPAD #define SHIFT_OUT P0_18 // (51) (MOSI) J3-10 & AUX-3 #define SHIFT_CLK P0_15 // (52) (SCK) J3-9 & AUX-3 #define SHIFT_LD P1_31 // (49) not 5V tolerant J3-1 & AUX-3 - #elif DISABLED(NEWPANEL) + #elif !IS_NEWPANEL //#define SHIFT_OUT P2_11 // (35) J3-3 & AUX-4 //#define SHIFT_CLK P3_26 // (31) J3-2 & AUX-4 //#define SHIFT_LD P3_25 // (33) J3-4 & AUX-4 @@ -166,7 +166,7 @@ #define STAT_LED_BLUE_PIN P0_26 // (63) may change if cable changes #define STAT_LED_RED_PIN P1_21 // ( 6) may change if cable changes #else - #if ENABLED(ULTIPANEL) + #if IS_ULTIPANEL #define LCD_PINS_D5 P1_17 // (71) ENET_MDIO #define LCD_PINS_D6 P1_14 // (73) ENET_RX_ER #define LCD_PINS_D7 P1_10 // (75) ENET_RXD1 diff --git a/Marlin/src/pins/lpc1769/pins_MKS_SGEN_L_V2.h b/Marlin/src/pins/lpc1769/pins_MKS_SGEN_L_V2.h index 62660935f5..e18f938dc4 100644 --- a/Marlin/src/pins/lpc1769/pins_MKS_SGEN_L_V2.h +++ b/Marlin/src/pins/lpc1769/pins_MKS_SGEN_L_V2.h @@ -325,7 +325,7 @@ #define DOGLCD_A0 P1_00 #endif - #if ENABLED(ULTIPANEL) + #if IS_ULTIPANEL #define LCD_PINS_D5 P0_17 #define LCD_PINS_D6 P1_00 #define LCD_PINS_D7 P1_22 diff --git a/Marlin/src/pins/lpc1769/pins_SMOOTHIEBOARD.h b/Marlin/src/pins/lpc1769/pins_SMOOTHIEBOARD.h index f2811b14ab..3c47a70101 100644 --- a/Marlin/src/pins/lpc1769/pins_SMOOTHIEBOARD.h +++ b/Marlin/src/pins/lpc1769/pins_SMOOTHIEBOARD.h @@ -138,7 +138,7 @@ * http://chibidibidiwah.wdfiles.com/local--files/panel/smoothieboard2sd.jpg * http://smoothieware.org/panel */ - #if ENABLED(REPRAP_DISCOUNT_FULL_GRAPHIC_SMART_CONTROLLER) + #if IS_RRD_FG_SC // EXP1 Pins #define BEEPER_PIN P1_31 // EXP1 Pin 1 #define BTN_ENC P1_30 // EXP1 Pin 2 diff --git a/Marlin/src/pins/mega/pins_CHEAPTRONICv2.h b/Marlin/src/pins/mega/pins_CHEAPTRONICv2.h index 3a84f4395f..af9f683c7d 100644 --- a/Marlin/src/pins/mega/pins_CHEAPTRONICv2.h +++ b/Marlin/src/pins/mega/pins_CHEAPTRONICv2.h @@ -129,7 +129,7 @@ #define SD_DETECT_PIN 49 #endif -#if ENABLED(NEWPANEL) +#if IS_NEWPANEL #define BTN_EN1 11 #define BTN_EN2 12 #define BTN_ENC 43 diff --git a/Marlin/src/pins/mega/pins_GT2560_REV_A.h b/Marlin/src/pins/mega/pins_GT2560_REV_A.h index 2fe9a43ba1..f481db2b96 100644 --- a/Marlin/src/pins/mega/pins_GT2560_REV_A.h +++ b/Marlin/src/pins/mega/pins_GT2560_REV_A.h @@ -109,7 +109,7 @@ #define BEEPER_PIN 18 - #if ENABLED(NEWPANEL) + #if IS_NEWPANEL #if ENABLED(MKS_MINI_12864) #define DOGLCD_A0 5 @@ -130,7 +130,7 @@ #define BTN_ENC 19 #define SD_DETECT_PIN 38 - #else // !NEWPANEL + #else // !IS_NEWPANEL #define SHIFT_CLK 38 #define SHIFT_LD 42 @@ -146,6 +146,6 @@ #define SD_DETECT_PIN -1 - #endif // !NEWPANEL + #endif // !IS_NEWPANEL #endif // HAS_WIRED_LCD diff --git a/Marlin/src/pins/mega/pins_GT2560_V3.h b/Marlin/src/pins/mega/pins_GT2560_V3.h index d71a195419..606debd1b0 100644 --- a/Marlin/src/pins/mega/pins_GT2560_V3.h +++ b/Marlin/src/pins/mega/pins_GT2560_V3.h @@ -172,7 +172,7 @@ #define LCD_PINS_D7 36 #endif -#if ENABLED(NEWPANEL) +#if IS_NEWPANEL #ifndef BTN_EN1 #define BTN_EN1 42 #endif diff --git a/Marlin/src/pins/mega/pins_GT2560_V3_A20.h b/Marlin/src/pins/mega/pins_GT2560_V3_A20.h index e1956488c6..20cccf148f 100644 --- a/Marlin/src/pins/mega/pins_GT2560_V3_A20.h +++ b/Marlin/src/pins/mega/pins_GT2560_V3_A20.h @@ -32,7 +32,7 @@ #define SPEAKER // The speaker can produce tones -#if ENABLED(NEWPANEL) +#if IS_NEWPANEL #define BTN_EN1 16 #define BTN_EN2 17 #define BTN_ENC 19 diff --git a/Marlin/src/pins/mega/pins_HJC2560C_REV2.h b/Marlin/src/pins/mega/pins_HJC2560C_REV2.h index e30a65b90e..fa2027fb78 100644 --- a/Marlin/src/pins/mega/pins_HJC2560C_REV2.h +++ b/Marlin/src/pins/mega/pins_HJC2560C_REV2.h @@ -127,7 +127,7 @@ #define BEEPER_PIN 18 - #if ENABLED(NEWPANEL) + #if IS_NEWPANEL #define LCD_PINS_RS 20 // LCD_CS #define LCD_PINS_ENABLE 15 // LCD_SDA @@ -168,6 +168,6 @@ #define LCD_PINS_D6 20 #define LCD_PINS_D7 19 - #endif // !NEWPANEL + #endif // !IS_NEWPANEL #endif // HAS_WIRED_LCD diff --git a/Marlin/src/pins/mega/pins_MEGATRONICS.h b/Marlin/src/pins/mega/pins_MEGATRONICS.h index 1c37b21ab7..f813366a14 100644 --- a/Marlin/src/pins/mega/pins_MEGATRONICS.h +++ b/Marlin/src/pins/mega/pins_MEGATRONICS.h @@ -108,7 +108,7 @@ // #define BEEPER_PIN 33 -#if BOTH(ULTRA_LCD, NEWPANEL) +#if IS_ULTRA_LCD && IS_NEWPANEL #define LCD_PINS_RS 16 #define LCD_PINS_ENABLE 17 @@ -124,7 +124,7 @@ #define SD_DETECT_PIN -1 // RAMPS doesn't use this -#endif // ULTRA_LCD && NEWPANEL +#endif // IS_ULTRA_LCD && IS_NEWPANEL // // M3/M4/M5 - Spindle/Laser Control diff --git a/Marlin/src/pins/mega/pins_MEGATRONICS_2.h b/Marlin/src/pins/mega/pins_MEGATRONICS_2.h index ff7cf15714..67ec24ed6f 100644 --- a/Marlin/src/pins/mega/pins_MEGATRONICS_2.h +++ b/Marlin/src/pins/mega/pins_MEGATRONICS_2.h @@ -139,7 +139,7 @@ #define LCD_PINS_D6 32 #define LCD_PINS_D7 33 - #if ENABLED(NEWPANEL) + #if IS_NEWPANEL // Buttons are directly attached using keypad #define BTN_EN1 61 #define BTN_EN2 59 diff --git a/Marlin/src/pins/mega/pins_MIGHTYBOARD_REVE.h b/Marlin/src/pins/mega/pins_MIGHTYBOARD_REVE.h index 963911ec5d..d074db8b25 100644 --- a/Marlin/src/pins/mega/pins_MIGHTYBOARD_REVE.h +++ b/Marlin/src/pins/mega/pins_MIGHTYBOARD_REVE.h @@ -214,7 +214,7 @@ // #if HAS_WIRED_LCD - #if ENABLED(REPRAP_DISCOUNT_FULL_GRAPHIC_SMART_CONTROLLER) + #if IS_RRD_FG_SC #define LCD_PINS_RS 33 // C4: LCD-STROBE #define LCD_PINS_ENABLE 72 // J2: LEFT diff --git a/Marlin/src/pins/mega/pins_OVERLORD.h b/Marlin/src/pins/mega/pins_OVERLORD.h index 045c1bc0fa..18bb1f27bf 100644 --- a/Marlin/src/pins/mega/pins_OVERLORD.h +++ b/Marlin/src/pins/mega/pins_OVERLORD.h @@ -132,7 +132,7 @@ #endif #endif -#if ENABLED(NEWPANEL) +#if IS_NEWPANEL #define BTN_ENC 16 // Enter Pin #define BTN_UP 19 // Button UP Pin #define BTN_DWN 17 // Button DOWN Pin diff --git a/Marlin/src/pins/pins.h b/Marlin/src/pins/pins.h index c5dbd20876..bd85c44899 100644 --- a/Marlin/src/pins/pins.h +++ b/Marlin/src/pins/pins.h @@ -49,7 +49,9 @@ #define IS_RAMPS_SF #endif -#define HAS_FREE_AUX2_PINS !(BOTH(ULTRA_LCD, NEWPANEL) && ANY(PANEL_ONE, VIKI2, miniVIKI, MINIPANEL, REPRAPWORLD_KEYPAD)) +#if !(BOTH(IS_ULTRA_LCD, IS_NEWPANEL) && ANY(PANEL_ONE, VIKI2, miniVIKI, MINIPANEL, REPRAPWORLD_KEYPAD)) + #define HAS_FREE_AUX2_PINS 1 +#endif // Test the target within the included pins file #ifdef __MARLIN_DEPS__ diff --git a/Marlin/src/pins/rambo/pins_EINSY_RAMBO.h b/Marlin/src/pins/rambo/pins_EINSY_RAMBO.h index 2ea15c97d3..c2cc24943a 100644 --- a/Marlin/src/pins/rambo/pins_EINSY_RAMBO.h +++ b/Marlin/src/pins/rambo/pins_EINSY_RAMBO.h @@ -164,7 +164,7 @@ #define KILL_PIN 32 - #if ENABLED(ULTIPANEL) || TOUCH_UI_ULTIPANEL + #if IS_ULTIPANEL || TOUCH_UI_ULTIPANEL #if ENABLED(CR10_STOCKDISPLAY) #define LCD_PINS_RS 85 @@ -187,5 +187,5 @@ #define BEEPER_PIN 84 // AUX-4 #define SD_DETECT_PIN 15 - #endif // ULTIPANEL || TOUCH_UI_ULTIPANEL + #endif // IS_ULTIPANEL || TOUCH_UI_ULTIPANEL #endif // HAS_WIRED_LCD diff --git a/Marlin/src/pins/rambo/pins_EINSY_RETRO.h b/Marlin/src/pins/rambo/pins_EINSY_RETRO.h index 4a1bf70b6e..7e53246181 100644 --- a/Marlin/src/pins/rambo/pins_EINSY_RETRO.h +++ b/Marlin/src/pins/rambo/pins_EINSY_RETRO.h @@ -170,7 +170,7 @@ #define KILL_PIN 32 - #if ANY(ULTIPANEL, TOUCH_UI_ULTIPANEL, TOUCH_UI_FTDI_EVE) + #if ANY(IS_ULTIPANEL, TOUCH_UI_ULTIPANEL, TOUCH_UI_FTDI_EVE) #if ENABLED(CR10_STOCKDISPLAY) #define LCD_PINS_RS 85 @@ -194,6 +194,6 @@ #define SD_DETECT_PIN 15 - #endif // ULTIPANEL || TOUCH_UI_ULTIPANEL || TOUCH_UI_FTDI_EVE + #endif // IS_ULTIPANEL || TOUCH_UI_ULTIPANEL || TOUCH_UI_FTDI_EVE #endif // HAS_WIRED_LCD || TOUCH_UI_ULTIPANEL || TOUCH_UI_FTDI_EVE diff --git a/Marlin/src/pins/rambo/pins_MINIRAMBO.h b/Marlin/src/pins/rambo/pins_MINIRAMBO.h index 6314bc07b8..8b034820cf 100644 --- a/Marlin/src/pins/rambo/pins_MINIRAMBO.h +++ b/Marlin/src/pins/rambo/pins_MINIRAMBO.h @@ -147,7 +147,7 @@ #define KILL_PIN 32 #endif - #if ENABLED(ULTIPANEL) || TOUCH_UI_ULTIPANEL + #if IS_ULTIPANEL || TOUCH_UI_ULTIPANEL #if MB(MINIRAMBO_10A) @@ -187,6 +187,6 @@ #endif // !MINIRAMBO_10A - #endif // ULTIPANEL || TOUCH_UI_ULTIPANEL + #endif // IS_ULTIPANEL || TOUCH_UI_ULTIPANEL #endif // HAS_WIRED_LCD || TOUCH_UI_ULTIPANEL diff --git a/Marlin/src/pins/rambo/pins_RAMBO.h b/Marlin/src/pins/rambo/pins_RAMBO.h index 735852b2ff..0254edea26 100644 --- a/Marlin/src/pins/rambo/pins_RAMBO.h +++ b/Marlin/src/pins/rambo/pins_RAMBO.h @@ -187,7 +187,7 @@ #define KILL_PIN 80 - #if ENABLED(ULTIPANEL) || TOUCH_UI_ULTIPANEL + #if IS_ULTIPANEL || TOUCH_UI_ULTIPANEL #define LCD_PINS_RS 70 #define LCD_PINS_ENABLE 71 @@ -228,7 +228,7 @@ #endif // !VIKI2 && !miniVIKI - #else // !NEWPANEL - old style panel with shift register + #else // !IS_NEWPANEL - old style panel with shift register // No Beeper added #define BEEPER_PIN 33 @@ -247,6 +247,6 @@ #define LCD_PINS_D6 27 #define LCD_PINS_D7 29 - #endif // !NEWPANEL + #endif // !IS_NEWPANEL #endif // HAS_WIRED_LCD diff --git a/Marlin/src/pins/ramps/pins_3DRAG.h b/Marlin/src/pins/ramps/pins_3DRAG.h index f0057e1fc9..b7f0517aac 100644 --- a/Marlin/src/pins/ramps/pins_3DRAG.h +++ b/Marlin/src/pins/ramps/pins_3DRAG.h @@ -78,7 +78,7 @@ // // LCD / Controller // -#if BOTH(ULTRA_LCD, NEWPANEL) +#if IS_ULTRA_LCD && IS_NEWPANEL #undef BEEPER_PIN #undef LCD_PINS_RS @@ -106,7 +106,7 @@ #define BEEPER_PIN 33 -#endif // ULTRA_LCD && NEWPANEL +#endif // IS_ULTRA_LCD && IS_NEWPANEL /** * M3/M4/M5 - Spindle/Laser Control @@ -157,7 +157,7 @@ #define SPINDLE_LASER_PWM_PIN 46 // Hardware PWM #define SPINDLE_LASER_ENA_PIN 62 // Pullup! #define SPINDLE_DIR_PIN 48 - #elif !BOTH(ULTRA_LCD, NEWPANEL) // use expansion header if no LCD in use + #elif !BOTH(IS_ULTRA_LCD, IS_NEWPANEL) // use expansion header if no LCD in use #define SPINDLE_LASER_ENA_PIN 16 // Pullup or pulldown! #define SPINDLE_DIR_PIN 17 #endif diff --git a/Marlin/src/pins/ramps/pins_FELIX2.h b/Marlin/src/pins/ramps/pins_FELIX2.h index 6cc6997adc..e572d3f286 100644 --- a/Marlin/src/pins/ramps/pins_FELIX2.h +++ b/Marlin/src/pins/ramps/pins_FELIX2.h @@ -49,11 +49,11 @@ // // LCD / Controller // -#if BOTH(ULTRA_LCD, NEWPANEL) +#if IS_ULTRA_LCD && IS_NEWPANEL #define SD_DETECT_PIN 6 -#endif // NEWPANEL && ULTRA_LCD +#endif // // M3/M4/M5 - Spindle/Laser Control diff --git a/Marlin/src/pins/ramps/pins_FORMBOT_RAPTOR.h b/Marlin/src/pins/ramps/pins_FORMBOT_RAPTOR.h index 0877d168d6..5b724787e9 100644 --- a/Marlin/src/pins/ramps/pins_FORMBOT_RAPTOR.h +++ b/Marlin/src/pins/ramps/pins_FORMBOT_RAPTOR.h @@ -181,7 +181,7 @@ // // Formbot only supports REPRAP_DISCOUNT_SMART_CONTROLLER // -#if ENABLED(REPRAP_DISCOUNT_SMART_CONTROLLER) +#if IS_RRD_SC #define BEEPER_PIN 37 #define BTN_EN1 31 #define BTN_EN2 33 diff --git a/Marlin/src/pins/ramps/pins_FORMBOT_TREX2PLUS.h b/Marlin/src/pins/ramps/pins_FORMBOT_TREX2PLUS.h index 75a219c177..81b6ea16d7 100644 --- a/Marlin/src/pins/ramps/pins_FORMBOT_TREX2PLUS.h +++ b/Marlin/src/pins/ramps/pins_FORMBOT_TREX2PLUS.h @@ -175,7 +175,7 @@ // // Formbot only supports REPRAP_DISCOUNT_SMART_CONTROLLER // -#if ENABLED(REPRAP_DISCOUNT_SMART_CONTROLLER) +#if IS_RRD_SC #ifndef BEEPER_PIN #define BEEPER_PIN 37 #endif diff --git a/Marlin/src/pins/ramps/pins_FORMBOT_TREX3.h b/Marlin/src/pins/ramps/pins_FORMBOT_TREX3.h index 0470fc47e9..a97b0d2d12 100644 --- a/Marlin/src/pins/ramps/pins_FORMBOT_TREX3.h +++ b/Marlin/src/pins/ramps/pins_FORMBOT_TREX3.h @@ -155,7 +155,7 @@ // // Formbot only supports REPRAP_DISCOUNT_SMART_CONTROLLER // -#if ENABLED(REPRAP_DISCOUNT_SMART_CONTROLLER) +#if IS_RRD_SC #define LCD_PINS_RS 16 #define LCD_PINS_ENABLE 17 #define LCD_PINS_D4 23 diff --git a/Marlin/src/pins/ramps/pins_FYSETC_F6_13.h b/Marlin/src/pins/ramps/pins_FYSETC_F6_13.h index 3fa3cc9e8c..9e4ee10096 100644 --- a/Marlin/src/pins/ramps/pins_FYSETC_F6_13.h +++ b/Marlin/src/pins/ramps/pins_FYSETC_F6_13.h @@ -277,7 +277,7 @@ #endif - #if ENABLED(NEWPANEL) + #if IS_NEWPANEL #define BTN_EN1 31 #define BTN_EN2 33 #define BTN_ENC 35 diff --git a/Marlin/src/pins/ramps/pins_K8600.h b/Marlin/src/pins/ramps/pins_K8600.h index 0de0192752..60bb18204a 100644 --- a/Marlin/src/pins/ramps/pins_K8600.h +++ b/Marlin/src/pins/ramps/pins_K8600.h @@ -96,7 +96,7 @@ // // LCD / Controller // -#if BOTH(ULTRA_LCD, NEWPANEL) +#if IS_ULTRA_LCD && IS_NEWPANEL #undef BEEPER_PIN #undef LCD_PINS_RS diff --git a/Marlin/src/pins/ramps/pins_K8800.h b/Marlin/src/pins/ramps/pins_K8800.h index 7e8c245a41..5388c9621d 100644 --- a/Marlin/src/pins/ramps/pins_K8800.h +++ b/Marlin/src/pins/ramps/pins_K8800.h @@ -113,7 +113,7 @@ #define LCD_CONTRAST_MAX 100 #define DEFAULT_LCD_CONTRAST 30 - #if ENABLED(NEWPANEL) + #if IS_NEWPANEL #define BTN_EN1 17 #define BTN_EN2 16 #define BTN_ENC 23 diff --git a/Marlin/src/pins/ramps/pins_ORTUR_4.h b/Marlin/src/pins/ramps/pins_ORTUR_4.h index cef01bf62a..e79973e06f 100644 --- a/Marlin/src/pins/ramps/pins_ORTUR_4.h +++ b/Marlin/src/pins/ramps/pins_ORTUR_4.h @@ -91,7 +91,7 @@ // // LCD / Controller // -#if ENABLED(REPRAP_DISCOUNT_FULL_GRAPHIC_SMART_CONTROLLER) +#if IS_RRD_FG_SC #undef BEEPER_PIN #define BEEPER_PIN 35 diff --git a/Marlin/src/pins/ramps/pins_RAMPS.h b/Marlin/src/pins/ramps/pins_RAMPS.h index de56d2b59d..c8578f2fa1 100644 --- a/Marlin/src/pins/ramps/pins_RAMPS.h +++ b/Marlin/src/pins/ramps/pins_RAMPS.h @@ -441,7 +441,7 @@ #define LCD_PINS_ENABLE 51 // SID (MOSI) #define LCD_PINS_D4 52 // SCK (CLK) clock - #elif BOTH(NEWPANEL, PANEL_ONE) + #elif BOTH(IS_NEWPANEL, PANEL_ONE) #define LCD_PINS_RS 40 #define LCD_PINS_ENABLE 42 @@ -462,7 +462,7 @@ #define LCD_PINS_ENABLE 29 #define LCD_PINS_D4 25 - #if DISABLED(NEWPANEL) + #if !IS_NEWPANEL #define BEEPER_PIN 37 #endif @@ -481,10 +481,10 @@ #define LCD_PINS_DC 25 // Set as output on init #define LCD_PINS_RS 27 // Pull low for 1s to init // DOGM SPI LCD Support + #define DOGLCD_A0 LCD_PINS_DC #define DOGLCD_CS 16 #define DOGLCD_MOSI 17 #define DOGLCD_SCK 23 - #define DOGLCD_A0 LCD_PINS_DC #else #define LCD_PINS_RS 16 #define LCD_PINS_ENABLE 17 @@ -495,13 +495,13 @@ #define LCD_PINS_D7 29 - #if DISABLED(NEWPANEL) + #if !IS_NEWPANEL #define BEEPER_PIN 33 #endif #endif - #if DISABLED(NEWPANEL) + #if !IS_NEWPANEL // Buttons attached to a shift register // Not wired yet //#define SHIFT_CLK 38 @@ -515,9 +515,9 @@ // // LCD Display input pins // - #if ENABLED(NEWPANEL) + #if IS_NEWPANEL - #if ENABLED(REPRAP_DISCOUNT_SMART_CONTROLLER) + #if IS_RRD_SC #define BEEPER_PIN 37 @@ -685,6 +685,7 @@ #elif ENABLED(AZSMZ_12864) // Pins only defined for RAMPS_SMART currently + #error "No pins defined for RAMPS with AZSMZ_12864." #elif IS_TFTGLCD_PANEL @@ -712,11 +713,11 @@ #endif #endif - #endif // NEWPANEL + #endif // IS_NEWPANEL #endif // HAS_WIRED_LCD -#if ENABLED(REPRAPWORLD_KEYPAD) && DISABLED(ADC_KEYPAD) +#if IS_RRW_KEYPAD && !HAS_ADC_BUTTONS #define SHIFT_OUT 40 #define SHIFT_CLK 44 #define SHIFT_LD 42 diff --git a/Marlin/src/pins/ramps/pins_RAMPS_PLUS.h b/Marlin/src/pins/ramps/pins_RAMPS_PLUS.h index 9908d9494f..23b1dfa346 100644 --- a/Marlin/src/pins/ramps/pins_RAMPS_PLUS.h +++ b/Marlin/src/pins/ramps/pins_RAMPS_PLUS.h @@ -73,7 +73,7 @@ #undef E0_CS_PIN #undef E1_CS_PIN -#if ENABLED(ULTRA_LCD) && NONE(REPRAPWORLD_GRAPHICAL_LCD, CR10_STOCKDISPLAY) && !BOTH(NEWPANEL, PANEL_ONE) +#if IS_ULTRA_LCD && NONE(REPRAPWORLD_GRAPHICAL_LCD, CR10_STOCKDISPLAY) && !BOTH(IS_NEWPANEL, PANEL_ONE) #if DISABLED(MKS_12864OLED) || ENABLED(MKS_12864OLED_SSD1306) #undef LCD_PINS_RS #define LCD_PINS_RS 42 // 3DYMY boards pin 16 -> 42 diff --git a/Marlin/src/pins/ramps/pins_RIGIDBOARD.h b/Marlin/src/pins/ramps/pins_RIGIDBOARD.h index c43d786aa2..345c51d5de 100644 --- a/Marlin/src/pins/ramps/pins_RIGIDBOARD.h +++ b/Marlin/src/pins/ramps/pins_RIGIDBOARD.h @@ -124,7 +124,7 @@ #undef SD_DETECT_PIN #define SD_DETECT_PIN 22 -#elif ENABLED(REPRAP_DISCOUNT_SMART_CONTROLLER) +#elif IS_RRD_SC #undef SD_DETECT_PIN #define SD_DETECT_PIN 22 diff --git a/Marlin/src/pins/ramps/pins_RUMBA.h b/Marlin/src/pins/ramps/pins_RUMBA.h index 5be2896e18..4af49d9164 100644 --- a/Marlin/src/pins/ramps/pins_RUMBA.h +++ b/Marlin/src/pins/ramps/pins_RUMBA.h @@ -227,7 +227,7 @@ #define SD_DETECT_PIN 49 #endif -#if ENABLED(NEWPANEL) +#if IS_NEWPANEL #define BTN_EN1 11 #define BTN_EN2 12 #define BTN_ENC 43 diff --git a/Marlin/src/pins/ramps/pins_TENLOG_D3_HERO.h b/Marlin/src/pins/ramps/pins_TENLOG_D3_HERO.h index e7a59a69df..84e7e31126 100644 --- a/Marlin/src/pins/ramps/pins_TENLOG_D3_HERO.h +++ b/Marlin/src/pins/ramps/pins_TENLOG_D3_HERO.h @@ -163,7 +163,7 @@ // LCD / Controller // -//#if ENABLED(REPRAP_DISCOUNT_SMART_CONTROLLER) +//#if IS_RRD_SC #define LCD_PINS_RS -1 #define LCD_PINS_ENABLE -1 @@ -182,4 +182,4 @@ #define BEEPER_PIN -1 //#endif -//#endif // REPRAP_DISCOUNT_SMART_CONTROLLER +//#endif // IS_RRD_SC diff --git a/Marlin/src/pins/ramps/pins_TRIGORILLA_14.h b/Marlin/src/pins/ramps/pins_TRIGORILLA_14.h index 1c2cb60957..54d91cee6a 100644 --- a/Marlin/src/pins/ramps/pins_TRIGORILLA_14.h +++ b/Marlin/src/pins/ramps/pins_TRIGORILLA_14.h @@ -131,13 +131,13 @@ #if 0 && HAS_WIRED_LCD // LCD Display output pins - #if BOTH(NEWPANEL, PANEL_ONE) + #if BOTH(IS_NEWPANEL, PANEL_ONE) #undef LCD_PINS_D6 #define LCD_PINS_D6 57 #endif // LCD Display input pins - #if ENABLED(NEWPANEL) + #if IS_NEWPANEL #if ANY(VIKI2, miniVIKI) #undef DOGLCD_A0 #define DOGLCD_A0 23 diff --git a/Marlin/src/pins/ramps/pins_TT_OSCAR.h b/Marlin/src/pins/ramps/pins_TT_OSCAR.h index 1568288e69..725d36466c 100644 --- a/Marlin/src/pins/ramps/pins_TT_OSCAR.h +++ b/Marlin/src/pins/ramps/pins_TT_OSCAR.h @@ -282,7 +282,7 @@ #define LCD_PINS_ENABLE 51 // SID (MOSI) #define LCD_PINS_D4 52 // SCK (CLK) clock - #elif BOTH(NEWPANEL, PANEL_ONE) + #elif BOTH(IS_NEWPANEL, PANEL_ONE) #define LCD_PINS_RS 40 #define LCD_PINS_ENABLE 42 @@ -309,7 +309,7 @@ #define LCD_PINS_ENABLE 29 #define LCD_PINS_D4 25 - #if DISABLED(NEWPANEL) + #if !IS_NEWPANEL #define BEEPER_PIN 37 #endif @@ -333,13 +333,13 @@ #define LCD_PINS_D7 29 - #if DISABLED(NEWPANEL) + #if !IS_NEWPANEL #define BEEPER_PIN 33 #endif #endif - #if DISABLED(NEWPANEL) + #if !IS_NEWPANEL // Buttons attached to a shift register // Not wired yet //#define SHIFT_CLK 38 @@ -353,9 +353,9 @@ // // LCD Display input pins // - #if ENABLED(NEWPANEL) + #if IS_NEWPANEL - #if ENABLED(REPRAP_DISCOUNT_SMART_CONTROLLER) + #if IS_RRD_SC #define BEEPER_PIN 37 @@ -486,7 +486,7 @@ #define BEEPER_PIN 33 // Buttons are directly attached to AUX-2 - #if ENABLED(REPRAPWORLD_KEYPAD) + #if IS_RRW_KEYPAD #define SHIFT_OUT 40 #define SHIFT_CLK 44 #define SHIFT_LD 42 @@ -510,6 +510,6 @@ #endif - #endif // NEWPANEL + #endif // IS_NEWPANEL #endif diff --git a/Marlin/src/pins/ramps/pins_ULTIMAKER.h b/Marlin/src/pins/ramps/pins_ULTIMAKER.h index 597a37bdbc..116301f4d4 100644 --- a/Marlin/src/pins/ramps/pins_ULTIMAKER.h +++ b/Marlin/src/pins/ramps/pins_ULTIMAKER.h @@ -123,7 +123,7 @@ #define BEEPER_PIN 18 - #if ENABLED(NEWPANEL) + #if IS_NEWPANEL #define LCD_PINS_RS 20 #define LCD_PINS_ENABLE 17 @@ -139,7 +139,7 @@ #define SD_DETECT_PIN 38 - #else // !NEWPANEL - Old style panel with shift register + #else // !IS_NEWPANEL - Old style panel with shift register // Buttons attached to a shift register #define SHIFT_CLK 38 @@ -156,7 +156,7 @@ #define SD_DETECT_PIN -1 - #endif // !NEWPANEL + #endif // !IS_NEWPANEL #endif // HAS_WIRED_LCD diff --git a/Marlin/src/pins/ramps/pins_ULTIMAKER_OLD.h b/Marlin/src/pins/ramps/pins_ULTIMAKER_OLD.h index c5bbd02bf5..9b17384aaf 100644 --- a/Marlin/src/pins/ramps/pins_ULTIMAKER_OLD.h +++ b/Marlin/src/pins/ramps/pins_ULTIMAKER_OLD.h @@ -174,11 +174,11 @@ #define LCD_PINS_D6 32 #define LCD_PINS_D7 30 -#elif BOTH(BOARD_REV_1_5, ULTRA_LCD) +#elif BOTH(BOARD_REV_1_5, IS_ULTRA_LCD) #define BEEPER_PIN 18 - #if ENABLED(NEWPANEL) + #if IS_NEWPANEL #define LCD_PINS_RS 20 #define LCD_PINS_ENABLE 17 @@ -194,7 +194,7 @@ #define SD_DETECT_PIN 38 - #else // !NEWPANEL - Old style panel with shift register + #else // !IS_NEWPANEL - Old style panel with shift register // Buttons attached to a shift register #define SHIFT_CLK 38 @@ -209,7 +209,7 @@ #define LCD_PINS_D6 20 #define LCD_PINS_D7 19 - #endif // !NEWPANEL + #endif // !IS_NEWPANEL #endif diff --git a/Marlin/src/pins/sam/pins_ALLIGATOR_R2.h b/Marlin/src/pins/sam/pins_ALLIGATOR_R2.h index 8d6906117d..b01d1aafdf 100644 --- a/Marlin/src/pins/sam/pins_ALLIGATOR_R2.h +++ b/Marlin/src/pins/sam/pins_ALLIGATOR_R2.h @@ -143,7 +143,7 @@ // // LCD / Controller // -#if ENABLED(REPRAP_DISCOUNT_FULL_GRAPHIC_SMART_CONTROLLER) +#if IS_RRD_FG_SC #define LCD_PINS_RS 18 #define LCD_PINS_ENABLE 15 #define LCD_PINS_D4 19 @@ -152,7 +152,7 @@ #define UI_VOLTAGE_LEVEL 1 #endif -#if ENABLED(NEWPANEL) +#if IS_NEWPANEL #define BTN_EN1 14 #define BTN_EN2 16 #define BTN_ENC 17 diff --git a/Marlin/src/pins/sam/pins_ARCHIM1.h b/Marlin/src/pins/sam/pins_ARCHIM1.h index 6e3768c663..347afe9ebd 100644 --- a/Marlin/src/pins/sam/pins_ARCHIM1.h +++ b/Marlin/src/pins/sam/pins_ARCHIM1.h @@ -192,10 +192,10 @@ #define SD_DETECT_PIN 2 // D2 PB25_TIOA0 - #if ENABLED(NEWPANEL) + #if IS_NEWPANEL // Buttons on AUX-2 #define BTN_EN1 60 // D60 PA3_TIOB1 #define BTN_EN2 13 // D13 PB27_TIOB0 #define BTN_ENC 16 // D16 PA13_TXD1 - #endif // NEWPANEL + #endif // IS_NEWPANEL #endif // HAS_WIRED_LCD diff --git a/Marlin/src/pins/sam/pins_ARCHIM2.h b/Marlin/src/pins/sam/pins_ARCHIM2.h index 5a3fe0e4d5..5923ea0f8f 100644 --- a/Marlin/src/pins/sam/pins_ARCHIM2.h +++ b/Marlin/src/pins/sam/pins_ARCHIM2.h @@ -247,11 +247,11 @@ #define LCD_PINS_D7 34 // D34 PC2_PWML0 #define SD_DETECT_PIN 2 // D2 PB25_TIOA0 - - #if ANY(ULTIPANEL, TOUCH_UI_ULTIPANEL, TOUCH_UI_FTDI_EVE) - // Buttons on AUX-2 - #define BTN_EN1 60 // D60 PA3_TIOB1 - #define BTN_EN2 13 // D13 PB27_TIOB0 - #define BTN_ENC 16 // D16 PA13_TXD1 // the click - #endif +#endif + +#if ANY(IS_ULTIPANEL, TOUCH_UI_ULTIPANEL, TOUCH_UI_FTDI_EVE) + // Buttons on AUX-2 + #define BTN_EN1 60 // D60 PA3_TIOB1 + #define BTN_EN2 13 // D13 PB27_TIOB0 + #define BTN_ENC 16 // D16 PA13_TXD1 // the click #endif diff --git a/Marlin/src/pins/sam/pins_DUE3DOM.h b/Marlin/src/pins/sam/pins_DUE3DOM.h index cd4033aa6f..a5c22ff3f2 100644 --- a/Marlin/src/pins/sam/pins_DUE3DOM.h +++ b/Marlin/src/pins/sam/pins_DUE3DOM.h @@ -122,7 +122,7 @@ #define LCD_PINS_D6 46 #define LCD_PINS_D7 47 - #if ENABLED(REPRAP_DISCOUNT_SMART_CONTROLLER) + #if IS_RRD_SC #define BEEPER_PIN 41 diff --git a/Marlin/src/pins/sam/pins_DUE3DOM_MINI.h b/Marlin/src/pins/sam/pins_DUE3DOM_MINI.h index 5f9ad48a08..b3e76199dc 100644 --- a/Marlin/src/pins/sam/pins_DUE3DOM_MINI.h +++ b/Marlin/src/pins/sam/pins_DUE3DOM_MINI.h @@ -114,7 +114,7 @@ #define LCD_PINS_D6 46 #define LCD_PINS_D7 47 - #if ENABLED(REPRAP_DISCOUNT_SMART_CONTROLLER) + #if IS_RRD_SC #define BEEPER_PIN 41 diff --git a/Marlin/src/pins/sam/pins_RADDS.h b/Marlin/src/pins/sam/pins_RADDS.h index 60fe351237..cd895365d0 100644 --- a/Marlin/src/pins/sam/pins_RADDS.h +++ b/Marlin/src/pins/sam/pins_RADDS.h @@ -248,7 +248,7 @@ #define SDSS 10 #define SD_DETECT_PIN 14 - #elif ENABLED(REPRAP_DISCOUNT_FULL_GRAPHIC_SMART_CONTROLLER) + #elif IS_RRD_FG_SC // The REPRAP_DISCOUNT_FULL_GRAPHIC_SMART_CONTROLLER requires // an adapter such as https://www.thingiverse.com/thing:1740725 diff --git a/Marlin/src/pins/sam/pins_RAMPS_DUO.h b/Marlin/src/pins/sam/pins_RAMPS_DUO.h index bfc3968ffa..44e2695a53 100644 --- a/Marlin/src/pins/sam/pins_RAMPS_DUO.h +++ b/Marlin/src/pins/sam/pins_RAMPS_DUO.h @@ -78,7 +78,7 @@ // #if HAS_WIRED_LCD - #if BOTH(NEWPANEL, PANEL_ONE) + #if BOTH(IS_NEWPANEL, PANEL_ONE) #undef LCD_PINS_D4 #define LCD_PINS_D4 68 @@ -89,7 +89,7 @@ #define LCD_PINS_D7 67 #endif - #if ENABLED(NEWPANEL) + #if IS_NEWPANEL #if ENABLED(REPRAPWORLD_GRAPHICAL_LCD) @@ -115,7 +115,7 @@ #else - #if ENABLED(REPRAPWORLD_KEYPAD) + #if IS_RRW_KEYPAD #undef BTN_EN1 #define BTN_EN1 67 // encoder @@ -127,6 +127,6 @@ #endif #endif - #endif // NEWPANEL + #endif // IS_NEWPANEL #endif // HAS_WIRED_LCD diff --git a/Marlin/src/pins/sam/pins_RAMPS_FD_V1.h b/Marlin/src/pins/sam/pins_RAMPS_FD_V1.h index ee525eefaa..a0dbddf567 100644 --- a/Marlin/src/pins/sam/pins_RAMPS_FD_V1.h +++ b/Marlin/src/pins/sam/pins_RAMPS_FD_V1.h @@ -148,7 +148,7 @@ #define BTN_ENC 35 #define SD_DETECT_PIN 49 - #if ENABLED(NEWPANEL) + #if IS_NEWPANEL #define LCD_PINS_RS 16 #define LCD_PINS_ENABLE 17 #endif @@ -178,7 +178,7 @@ #define NEOPIXEL_PIN 25 #endif - #elif ENABLED(NEWPANEL) + #elif IS_NEWPANEL #define LCD_PINS_D4 23 #define LCD_PINS_D5 25 diff --git a/Marlin/src/pins/sam/pins_RURAMPS4D_11.h b/Marlin/src/pins/sam/pins_RURAMPS4D_11.h index b9e61fb27c..49378541a9 100644 --- a/Marlin/src/pins/sam/pins_RURAMPS4D_11.h +++ b/Marlin/src/pins/sam/pins_RURAMPS4D_11.h @@ -202,7 +202,7 @@ // #if HAS_WIRED_LCD - #if ANY(RADDS_DISPLAY, REPRAP_DISCOUNT_SMART_CONTROLLER, REPRAP_DISCOUNT_FULL_GRAPHIC_SMART_CONTROLLER) + #if ANY(RADDS_DISPLAY, IS_RRD_SC, IS_RRD_FG_SC) #define BEEPER_PIN 62 #define LCD_PINS_D4 48 #define LCD_PINS_D5 50 @@ -211,12 +211,12 @@ #define SD_DETECT_PIN 51 #endif - #if EITHER(RADDS_DISPLAY, REPRAP_DISCOUNT_SMART_CONTROLLER) + #if EITHER(RADDS_DISPLAY, IS_RRD_SC) #define LCD_PINS_RS 63 #define LCD_PINS_ENABLE 64 - #elif ENABLED(REPRAP_DISCOUNT_FULL_GRAPHIC_SMART_CONTROLLER) + #elif IS_RRD_FG_SC #define LCD_PINS_RS 52 #define LCD_PINS_ENABLE 53 @@ -265,7 +265,7 @@ #endif // SPARK_FULL_GRAPHICS - #if ENABLED(NEWPANEL) + #if IS_NEWPANEL #define BTN_EN1 44 #define BTN_EN2 42 #define BTN_ENC 40 diff --git a/Marlin/src/pins/sam/pins_RURAMPS4D_13.h b/Marlin/src/pins/sam/pins_RURAMPS4D_13.h index dc0c127995..1cc2eee6b0 100644 --- a/Marlin/src/pins/sam/pins_RURAMPS4D_13.h +++ b/Marlin/src/pins/sam/pins_RURAMPS4D_13.h @@ -188,7 +188,7 @@ // #if HAS_WIRED_LCD - #if ANY(RADDS_DISPLAY, REPRAP_DISCOUNT_SMART_CONTROLLER, REPRAP_DISCOUNT_FULL_GRAPHIC_SMART_CONTROLLER) + #if ANY(RADDS_DISPLAY, IS_RRD_SC, IS_RRD_FG_SC) #define BEEPER_PIN 62 #define LCD_PINS_D4 48 #define LCD_PINS_D5 50 @@ -197,12 +197,12 @@ #define SD_DETECT_PIN 51 #endif - #if EITHER(RADDS_DISPLAY, REPRAP_DISCOUNT_SMART_CONTROLLER) + #if EITHER(RADDS_DISPLAY, IS_RRD_SC) #define LCD_PINS_RS 63 #define LCD_PINS_ENABLE 64 - #elif ENABLED(REPRAP_DISCOUNT_FULL_GRAPHIC_SMART_CONTROLLER) + #elif IS_RRD_FG_SC #define LCD_PINS_RS 52 #define LCD_PINS_ENABLE 53 @@ -247,7 +247,7 @@ #endif - #if ENABLED(NEWPANEL) + #if IS_NEWPANEL #define BTN_EN1 44 #define BTN_EN2 42 #define BTN_ENC 40 diff --git a/Marlin/src/pins/samd/pins_RAMPS_144.h b/Marlin/src/pins/samd/pins_RAMPS_144.h index 6076be07e9..1948acf897 100644 --- a/Marlin/src/pins/samd/pins_RAMPS_144.h +++ b/Marlin/src/pins/samd/pins_RAMPS_144.h @@ -299,7 +299,7 @@ //#define LCD_PINS_ENABLE 51 // SID (MOSI) //#define LCD_PINS_D4 52 // SCK (CLK) clock - #elif BOTH(NEWPANEL, PANEL_ONE) + #elif BOTH(IS_NEWPANEL, PANEL_ONE) // TO TEST //#define LCD_PINS_RS 40 @@ -318,7 +318,7 @@ //#define LCD_PINS_ENABLE 29 //#define LCD_PINS_D4 25 - #if DISABLED(NEWPANEL) + #if !IS_NEWPANEL // TO TEST //#define BEEPER_PIN 37 #endif @@ -354,13 +354,13 @@ #define LCD_PINS_D7 29 - #if DISABLED(NEWPANEL) + #if !IS_NEWPANEL #define BEEPER_PIN 33 #endif #endif - #if DISABLED(NEWPANEL) + #if !IS_NEWPANEL // Buttons attached to a shift register // Not wired yet //#define SHIFT_CLK 38 @@ -374,9 +374,9 @@ // // LCD Display input pins // - #if ENABLED(NEWPANEL) + #if IS_NEWPANEL - #if ENABLED(REPRAP_DISCOUNT_SMART_CONTROLLER) + #if IS_RRD_SC #define BEEPER_PIN 37 @@ -565,7 +565,7 @@ //#define BEEPER_PIN 33 // Buttons are directly attached to AUX-2 - #if ENABLED(REPRAPWORLD_KEYPAD) + #if IS_RRW_KEYPAD // TO TEST //#define SHIFT_OUT 40 //#define SHIFT_CLK 44 @@ -592,7 +592,7 @@ #endif #endif - #endif // NEWPANEL + #endif // IS_NEWPANEL #endif // HAS_WIRED_LCD diff --git a/Marlin/src/pins/sanguino/pins_ANET_10.h b/Marlin/src/pins/sanguino/pins_ANET_10.h index 74692a21a3..d48db36287 100644 --- a/Marlin/src/pins/sanguino/pins_ANET_10.h +++ b/Marlin/src/pins/sanguino/pins_ANET_10.h @@ -151,7 +151,7 @@ #if HAS_WIRED_LCD #define LCD_SDSS 28 - #if ENABLED(ADC_KEYPAD) + #if HAS_ADC_BUTTONS #define SERVO0_PIN 27 // free for BLTouch/3D-Touch #define LCD_PINS_RS 28 #define LCD_PINS_ENABLE 29 @@ -160,7 +160,7 @@ #define LCD_PINS_D6 16 #define LCD_PINS_D7 17 #define ADC_KEYPAD_PIN 1 - #elif ENABLED(REPRAP_DISCOUNT_FULL_GRAPHIC_SMART_CONTROLLER) + #elif IS_RRD_FG_SC // Pin definitions for the Anet A6 Full Graphics display and the RepRapDiscount Full Graphics // display using an adapter board // https://go.aisler.net/benlye/anet-lcd-adapter/pcb // See below for alternative pin definitions for use with https://www.thingiverse.com/thing:2103748 diff --git a/Marlin/src/pins/sanguino/pins_SANGUINOLOLU_11.h b/Marlin/src/pins/sanguino/pins_SANGUINOLOLU_11.h index 438d49d615..69b351e3fc 100644 --- a/Marlin/src/pins/sanguino/pins_SANGUINOLOLU_11.h +++ b/Marlin/src/pins/sanguino/pins_SANGUINOLOLU_11.h @@ -136,7 +136,7 @@ #define LCD_BACKLIGHT_PIN 17 // LCD backlight LED #endif -#if NONE(SPINDLE_FEATURE, LASER_FEATURE) && ENABLED(SANGUINOLOLU_V_1_2) && !BOTH(ULTRA_LCD, NEWPANEL)// try to use IO Header +#if NONE(SPINDLE_FEATURE, LASER_FEATURE) && ENABLED(SANGUINOLOLU_V_1_2) && !BOTH(IS_ULTRA_LCD, IS_NEWPANEL) // try to use IO Header #define CASE_LIGHT_PIN 4 // Hardware PWM - see if IO Header is available #endif @@ -185,7 +185,7 @@ // with M42 instead of BEEPER_PIN. #define BEEPER_PIN 27 - #if ENABLED(REPRAP_DISCOUNT_FULL_GRAPHIC_SMART_CONTROLLER) + #if IS_RRD_FG_SC #ifndef BOARD_ST7920_DELAY_1 #define BOARD_ST7920_DELAY_1 DELAY_NS(0) #endif @@ -283,7 +283,7 @@ #endif - #if ENABLED(NEWPANEL) && !defined(BTN_EN1) + #if IS_NEWPANEL && !defined(BTN_EN1) #define BTN_EN1 11 #define BTN_EN2 10 #endif @@ -294,7 +294,7 @@ // M3/M4/M5 - Spindle/Laser Control // #if HAS_CUTTER - #if !MB(AZTEEG_X1) && ENABLED(SANGUINOLOLU_V_1_2) && !BOTH(ULTRA_LCD, NEWPANEL)// try to use IO Header + #if !MB(AZTEEG_X1) && ENABLED(SANGUINOLOLU_V_1_2) && !BOTH(IS_ULTRA_LCD, IS_NEWPANEL) // try to use IO Header #define SPINDLE_LASER_ENA_PIN 10 // Pullup or pulldown! #define SPINDLE_LASER_PWM_PIN 4 // Hardware PWM diff --git a/Marlin/src/pins/sanguino/pins_ZMIB_V2.h b/Marlin/src/pins/sanguino/pins_ZMIB_V2.h index 838ffe38aa..4257b2c40e 100644 --- a/Marlin/src/pins/sanguino/pins_ZMIB_V2.h +++ b/Marlin/src/pins/sanguino/pins_ZMIB_V2.h @@ -225,7 +225,7 @@ // // All the above are also RRDSC with rotary encoder // -#if ENABLED(REPRAP_DISCOUNT_SMART_CONTROLLER) +#if IS_RRD_SC #define BTN_EN1 2 #define BTN_EN2 12 #define BTN_ENC 29 diff --git a/Marlin/src/pins/stm32f1/pins_BTT_SKR_MINI_V1_1.h b/Marlin/src/pins/stm32f1/pins_BTT_SKR_MINI_V1_1.h index 47fff4467c..ce43e677e2 100644 --- a/Marlin/src/pins/stm32f1/pins_BTT_SKR_MINI_V1_1.h +++ b/Marlin/src/pins/stm32f1/pins_BTT_SKR_MINI_V1_1.h @@ -175,7 +175,7 @@ #else // !FYSETC_MINI_12864 #define LCD_PINS_D4 PC13 - #if ENABLED(ULTIPANEL) + #if IS_ULTIPANEL #define LCD_PINS_D5 PB7 #define LCD_PINS_D6 PC15 #define LCD_PINS_D7 PC14 diff --git a/Marlin/src/pins/stm32f1/pins_CHITU3D.h b/Marlin/src/pins/stm32f1/pins_CHITU3D.h index 3a872db025..1d8f4f684b 100644 --- a/Marlin/src/pins/stm32f1/pins_CHITU3D.h +++ b/Marlin/src/pins/stm32f1/pins_CHITU3D.h @@ -126,7 +126,7 @@ #define LCD_PINS_RS PD1 // 49 // CS chip select /SS chip slave select #define LCD_PINS_ENABLE PD3 // 51 // SID (MOSI) #define LCD_PINS_D4 PD4 // 52 // SCK (CLK) clock - #elif BOTH(NEWPANEL, PANEL_ONE) + #elif BOTH(IS_NEWPANEL, PANEL_ONE) #define LCD_PINS_RS PB8 #define LCD_PINS_ENABLE PD2 #define LCD_PINS_D4 PB12 @@ -140,7 +140,7 @@ #define LCD_PINS_D5 PB13 #define LCD_PINS_D6 PB14 #define LCD_PINS_D7 PB15 - #if DISABLED(NEWPANEL) + #if !IS_NEWPANEL #define BEEPER_PIN PC1 // 33 // Buttons attached to a shift register // Not wired yet @@ -151,9 +151,9 @@ #endif #endif - #if ENABLED(NEWPANEL) + #if IS_NEWPANEL - #if ENABLED(REPRAP_DISCOUNT_SMART_CONTROLLER) + #if IS_RRD_SC #define BEEPER_PIN PC5 @@ -254,7 +254,7 @@ #define BEEPER_PIN PC1 // 33 // Buttons directly attached to AUX-2 - #if ENABLED(REPRAPWORLD_KEYPAD) + #if IS_RRW_KEYPAD #define BTN_EN1 PE0 // 64 #define BTN_EN2 PD11 // 59 #define BTN_ENC PD15 // 63 @@ -279,6 +279,6 @@ #endif #endif - #endif // NEWPANEL + #endif // IS_NEWPANEL #endif // HAS_WIRED_LCD diff --git a/Marlin/src/pins/stm32f1/pins_CHITU3D_V5.h b/Marlin/src/pins/stm32f1/pins_CHITU3D_V5.h index b02d414089..33ec27ddba 100644 --- a/Marlin/src/pins/stm32f1/pins_CHITU3D_V5.h +++ b/Marlin/src/pins/stm32f1/pins_CHITU3D_V5.h @@ -152,9 +152,6 @@ // Color UI #define TFT_DRIVER ILI9488 #define TFT_BUFFER_SIZE 14400 -#elif ENABLED(TFT_CLASSIC_UI) - // Emulated DOGM - #define GRAPHICAL_TFT_UPSCALE 3 #endif // XPT2046 Touch Screen calibration diff --git a/Marlin/src/pins/stm32f1/pins_CHITU3D_V6.h b/Marlin/src/pins/stm32f1/pins_CHITU3D_V6.h index cafd50dcf2..990d33b759 100644 --- a/Marlin/src/pins/stm32f1/pins_CHITU3D_V6.h +++ b/Marlin/src/pins/stm32f1/pins_CHITU3D_V6.h @@ -167,9 +167,6 @@ // Color UI #define TFT_DRIVER ILI9488 #define TFT_BUFFER_SIZE 14400 -#elif ENABLED(TFT_CLASSIC_UI) - // Emulated DOGM - #define GRAPHICAL_TFT_UPSCALE 3 #endif // XPT2046 Touch Screen calibration diff --git a/Marlin/src/pins/stm32f1/pins_FYSETC_AIO_II.h b/Marlin/src/pins/stm32f1/pins_FYSETC_AIO_II.h index ebe5964d05..d2c587beb8 100644 --- a/Marlin/src/pins/stm32f1/pins_FYSETC_AIO_II.h +++ b/Marlin/src/pins/stm32f1/pins_FYSETC_AIO_II.h @@ -162,7 +162,7 @@ // not connected to a pin #define SD_DETECT_PIN PC3 - #if ENABLED(NEWPANEL) + #if IS_NEWPANEL // The encoder and click button #define BTN_EN1 PC10 #define BTN_EN2 PC11 diff --git a/Marlin/src/pins/stm32f1/pins_FYSETC_CHEETAH.h b/Marlin/src/pins/stm32f1/pins_FYSETC_CHEETAH.h index de5ea45d44..deca1a0546 100644 --- a/Marlin/src/pins/stm32f1/pins_FYSETC_CHEETAH.h +++ b/Marlin/src/pins/stm32f1/pins_FYSETC_CHEETAH.h @@ -153,7 +153,7 @@ //#define LCD_CONTRAST_INIT 190 - #if ENABLED(NEWPANEL) + #if IS_NEWPANEL #define BTN_EN1 PC10 #define BTN_EN2 PC11 #define BTN_ENC PC12 diff --git a/Marlin/src/pins/stm32f1/pins_GTM32_MINI.h b/Marlin/src/pins/stm32f1/pins_GTM32_MINI.h index ca25c45a7b..00c5721384 100644 --- a/Marlin/src/pins/stm32f1/pins_GTM32_MINI.h +++ b/Marlin/src/pins/stm32f1/pins_GTM32_MINI.h @@ -137,7 +137,7 @@ // #if HAS_WIRED_LCD - #if ENABLED(REPRAP_DISCOUNT_SMART_CONTROLLER) + #if IS_RRD_SC // // LCD display on J2 FFC40 // Geeetech's LCD2004A Control Panel is very much like @@ -172,7 +172,7 @@ #endif // HAS_WIRED_LCD -#if ENABLED(REPRAP_DISCOUNT_SMART_CONTROLLER) +#if IS_RRD_SC // // Geeetech's LCD2004A Control Panel is very much like // RepRapDiscount Smart Controller, but adds an FFC40 connector diff --git a/Marlin/src/pins/stm32f1/pins_GTM32_MINI_A30.h b/Marlin/src/pins/stm32f1/pins_GTM32_MINI_A30.h index 02fd3bcae7..b10748e57f 100644 --- a/Marlin/src/pins/stm32f1/pins_GTM32_MINI_A30.h +++ b/Marlin/src/pins/stm32f1/pins_GTM32_MINI_A30.h @@ -137,7 +137,7 @@ // #if HAS_WIRED_LCD - #if ENABLED(REPRAP_DISCOUNT_SMART_CONTROLLER) + #if IS_RRD_SC // // LCD display on J2 FFC40 // Geeetech's LCD2004A Control Panel is very much like diff --git a/Marlin/src/pins/stm32f1/pins_GTM32_PRO_VB.h b/Marlin/src/pins/stm32f1/pins_GTM32_PRO_VB.h index ca25c45a7b..00c5721384 100644 --- a/Marlin/src/pins/stm32f1/pins_GTM32_PRO_VB.h +++ b/Marlin/src/pins/stm32f1/pins_GTM32_PRO_VB.h @@ -137,7 +137,7 @@ // #if HAS_WIRED_LCD - #if ENABLED(REPRAP_DISCOUNT_SMART_CONTROLLER) + #if IS_RRD_SC // // LCD display on J2 FFC40 // Geeetech's LCD2004A Control Panel is very much like @@ -172,7 +172,7 @@ #endif // HAS_WIRED_LCD -#if ENABLED(REPRAP_DISCOUNT_SMART_CONTROLLER) +#if IS_RRD_SC // // Geeetech's LCD2004A Control Panel is very much like // RepRapDiscount Smart Controller, but adds an FFC40 connector diff --git a/Marlin/src/pins/stm32f1/pins_GTM32_REV_B.h b/Marlin/src/pins/stm32f1/pins_GTM32_REV_B.h index fc18263fdd..b913530f67 100644 --- a/Marlin/src/pins/stm32f1/pins_GTM32_REV_B.h +++ b/Marlin/src/pins/stm32f1/pins_GTM32_REV_B.h @@ -137,7 +137,7 @@ // #if HAS_WIRED_LCD - #if ENABLED(REPRAP_DISCOUNT_SMART_CONTROLLER) + #if IS_RRD_SC // // LCD display on J2 FFC40 diff --git a/Marlin/src/pins/stm32f1/pins_MKS_ROBIN.h b/Marlin/src/pins/stm32f1/pins_MKS_ROBIN.h index 8831d6804b..63c0da476d 100644 --- a/Marlin/src/pins/stm32f1/pins_MKS_ROBIN.h +++ b/Marlin/src/pins/stm32f1/pins_MKS_ROBIN.h @@ -126,6 +126,11 @@ #endif #define LED_PIN PB2 +#if HAS_FSMC_TFT || HAS_GRAPHICAL_TFT + #define TFT_CS_PIN PG12 // NE4 + #define TFT_RS_PIN PF0 // A0 +#endif + #if HAS_FSMC_TFT /** * Note: MKS Robin TFT screens use various TFT controllers @@ -141,10 +146,8 @@ */ //#define LCD_RESET_PIN PF6 #define LCD_BACKLIGHT_PIN PG11 - #define FSMC_CS_PIN PG12 // NE4 - #define FSMC_RS_PIN PF0 // A0 - #define TFT_CS_PIN FSMC_CS_PIN - #define TFT_RS_PIN FSMC_RS_PIN + #define FSMC_CS_PIN TFT_CS_PIN + #define FSMC_RS_PIN TFT_RS_PIN #define LCD_USE_DMA_FSMC // Use DMA transfers to send data to the TFT #define FSMC_DMA_DEV DMA2 @@ -152,8 +155,6 @@ #elif HAS_GRAPHICAL_TFT #define TFT_RESET_PIN PF6 #define TFT_BACKLIGHT_PIN PG11 - #define TFT_CS_PIN PG12 // NE4 - #define TFT_RS_PIN PF0 // A0 #endif #if NEED_TOUCH_PINS diff --git a/Marlin/src/pins/stm32f1/pins_MKS_ROBIN_E3P.h b/Marlin/src/pins/stm32f1/pins_MKS_ROBIN_E3P.h index 94a28953cc..4998c92dc5 100644 --- a/Marlin/src/pins/stm32f1/pins_MKS_ROBIN_E3P.h +++ b/Marlin/src/pins/stm32f1/pins_MKS_ROBIN_E3P.h @@ -269,22 +269,13 @@ #endif -#if ENABLED(SPI_GRAPHICAL_TFT) +#if HAS_SPI_GRAPHICAL_TFT // Emulated DOGM SPI - #ifndef GRAPHICAL_TFT_UPSCALE - #define GRAPHICAL_TFT_UPSCALE 3 - #endif - #ifndef TFT_PIXEL_OFFSET_Y - #define TFT_PIXEL_OFFSET_Y 32 - #endif - + #define LCD_PINS_ENABLE PD13 + #define LCD_PINS_RS PC6 #define BTN_ENC PE13 #define BTN_EN1 PE8 #define BTN_EN2 PE11 - - #define LCD_PINS_ENABLE PD13 - #define LCD_PINS_RS PC6 - #elif ENABLED(TFT_480x320_SPI) #define TFT_DRIVER ST7796 #define TFT_BUFFER_SIZE 14400 @@ -304,7 +295,7 @@ #ifndef XPT2046_Y_OFFSET #define XPT2046_Y_OFFSET -24 #endif -#elif ENABLED(SPI_GRAPHICAL_TFT) +#elif HAS_SPI_GRAPHICAL_TFT #ifndef XPT2046_X_CALIBRATION #define XPT2046_X_CALIBRATION -11386 #endif @@ -342,7 +333,7 @@ #else // !MKS_MINI_12864 #define LCD_PINS_D4 PE14 - #if ENABLED(ULTIPANEL) + #if IS_ULTIPANEL #define LCD_PINS_D5 PE15 #define LCD_PINS_D6 PD11 #define LCD_PINS_D7 PD10 diff --git a/Marlin/src/pins/stm32f1/pins_MKS_ROBIN_E3_common.h b/Marlin/src/pins/stm32f1/pins_MKS_ROBIN_E3_common.h index 015e29bdbe..af2908545b 100644 --- a/Marlin/src/pins/stm32f1/pins_MKS_ROBIN_E3_common.h +++ b/Marlin/src/pins/stm32f1/pins_MKS_ROBIN_E3_common.h @@ -154,7 +154,7 @@ #else #define LCD_PINS_D4 PA6 - #if ENABLED(ULTIPANEL) + #if IS_ULTIPANEL #define LCD_PINS_D5 PA7 #define LCD_PINS_D6 PC4 #define LCD_PINS_D7 PC5 diff --git a/Marlin/src/pins/stm32f1/pins_MKS_ROBIN_LITE.h b/Marlin/src/pins/stm32f1/pins_MKS_ROBIN_LITE.h index aa1ccedb35..ffd21917dd 100644 --- a/Marlin/src/pins/stm32f1/pins_MKS_ROBIN_LITE.h +++ b/Marlin/src/pins/stm32f1/pins_MKS_ROBIN_LITE.h @@ -103,7 +103,7 @@ #else // !MKS_MINI_12864 #define LCD_PINS_D4 PC1 - #if ENABLED(ULTIPANEL) + #if IS_ULTIPANEL #define LCD_PINS_D5 -1 #define LCD_PINS_D6 -1 #define LCD_PINS_D7 -1 diff --git a/Marlin/src/pins/stm32f1/pins_MKS_ROBIN_LITE3.h b/Marlin/src/pins/stm32f1/pins_MKS_ROBIN_LITE3.h index d5318b8e87..493efc5c7b 100644 --- a/Marlin/src/pins/stm32f1/pins_MKS_ROBIN_LITE3.h +++ b/Marlin/src/pins/stm32f1/pins_MKS_ROBIN_LITE3.h @@ -124,7 +124,7 @@ #else // !MKS_MINI_12864 #define LCD_PINS_D4 PA6 - #if ENABLED(ULTIPANEL) + #if IS_ULTIPANEL #define LCD_PINS_D5 PA7 #define LCD_PINS_D6 PC4 #define LCD_PINS_D7 PC5 diff --git a/Marlin/src/pins/stm32f1/pins_MKS_ROBIN_MINI.h b/Marlin/src/pins/stm32f1/pins_MKS_ROBIN_MINI.h index 2b099b3e93..14f9c3b626 100644 --- a/Marlin/src/pins/stm32f1/pins_MKS_ROBIN_MINI.h +++ b/Marlin/src/pins/stm32f1/pins_MKS_ROBIN_MINI.h @@ -139,6 +139,35 @@ * If the screen stays white, disable 'LCD_RESET_PIN' * to let the bootloader init the screen. */ +#if EITHER(HAS_FSMC_GRAPHICAL_TFT, TFT_320x240) + #define FSMC_CS_PIN PD7 // NE4 + #define FSMC_RS_PIN PD11 // A0 + + #define LCD_USE_DMA_FSMC // Use DMA transfers to send data to the TFT + #define FSMC_DMA_DEV DMA2 + #define FSMC_DMA_CHANNEL DMA_CH5 + + #define LCD_RESET_PIN PC6 // FSMC_RST + #define LCD_BACKLIGHT_PIN PD13 +#endif + +#if BOTH(NEED_TOUCH_PINS, HAS_FSMC_GRAPHICAL_TFT) || ENABLED(TFT_320x240) + #define TOUCH_CS_PIN PC2 // SPI2_NSS + #define TOUCH_SCK_PIN PB13 // SPI2_SCK + #define TOUCH_MISO_PIN PB14 // SPI2_MISO + #define TOUCH_MOSI_PIN PB15 // SPI2_MOSI +#endif + +#if ENABLED(TFT_320x240) // TFT32/28 + #define TFT_DRIVER ILI9341 + #define TFT_BUFFER_SIZE 14400 + #define ILI9341_COLOR_RGB + // YV for normal screen mounting + #define ILI9341_ORIENTATION ILI9341_MADCTL_MY | ILI9341_MADCTL_MV + // XV for 180° rotated screen mounting + //#define ILI9341_ORIENTATION ILI9341_MADCTL_MX | ILI9341_MADCTL_MV +#endif + #if ENABLED(TOUCH_SCREEN) #ifndef XPT2046_X_CALIBRATION #define XPT2046_X_CALIBRATION 12033 @@ -154,52 +183,6 @@ #endif #endif -#if ENABLED(FSMC_GRAPHICAL_TFT) - - #define FSMC_CS_PIN PD7 // NE4 - #define FSMC_RS_PIN PD11 // A0 - - #define LCD_USE_DMA_FSMC // Use DMA transfers to send data to the TFT - #define FSMC_DMA_DEV DMA2 - #define FSMC_DMA_CHANNEL DMA_CH5 - - #define LCD_RESET_PIN PC6 // FSMC_RST - #define LCD_BACKLIGHT_PIN PD13 - - #if NEED_TOUCH_PINS - #define TOUCH_CS_PIN PC2 // SPI2_NSS - #define TOUCH_SCK_PIN PB13 // SPI2_SCK - #define TOUCH_MISO_PIN PB14 // SPI2_MISO - #define TOUCH_MOSI_PIN PB15 // SPI2_MOSI - #endif - -#elif ENABLED(TFT_320x240) //TFT32/28 - - #define TFT_RESET_PIN PC6 - #define TFT_BACKLIGHT_PIN PD13 - - #define LCD_USE_DMA_FSMC // Use DMA transfers to send data to the TFT - #define FSMC_CS_PIN PD7 - #define FSMC_RS_PIN PD11 - #define FSMC_DMA_DEV DMA2 - #define FSMC_DMA_CHANNEL DMA_CH5 - - #define TOUCH_CS_PIN PC2 // SPI2_NSS - #define TOUCH_SCK_PIN PB13 // SPI2_SCK - #define TOUCH_MISO_PIN PB14 // SPI2_MISO - #define TOUCH_MOSI_PIN PB15 // SPI2_MOSI - - #define TFT_DRIVER ILI9341 - #define TFT_BUFFER_SIZE 14400 - - // YV for normal screen mounting - #define ILI9341_ORIENTATION ILI9341_MADCTL_MY | ILI9341_MADCTL_MV - // XV for 180° rotated screen mounting - //#define ILI9341_ORIENTATION ILI9341_MADCTL_MX | ILI9341_MADCTL_MV - - #define ILI9341_COLOR_RGB -#endif - #define HAS_SPI_FLASH 1 #if HAS_SPI_FLASH #define SPI_FLASH_SIZE 0x1000000 // 16MB diff --git a/Marlin/src/pins/stm32f1/pins_MKS_ROBIN_NANO.h b/Marlin/src/pins/stm32f1/pins_MKS_ROBIN_NANO.h index 16d6d2ffc4..86dab41121 100644 --- a/Marlin/src/pins/stm32f1/pins_MKS_ROBIN_NANO.h +++ b/Marlin/src/pins/stm32f1/pins_MKS_ROBIN_NANO.h @@ -198,7 +198,7 @@ #endif // XPT2046 Touch Screen calibration -#if EITHER(TFT_LVGL_UI_FSMC, TFT_480x320) +#if EITHER(HAS_TFT_LVGL_UI_FSMC, TFT_480x320) #ifndef XPT2046_X_CALIBRATION #define XPT2046_X_CALIBRATION 17880 #endif diff --git a/Marlin/src/pins/stm32f1/pins_MKS_ROBIN_NANO_V2.h b/Marlin/src/pins/stm32f1/pins_MKS_ROBIN_NANO_V2.h index 846fe80a08..b1e49f4d9f 100644 --- a/Marlin/src/pins/stm32f1/pins_MKS_ROBIN_NANO_V2.h +++ b/Marlin/src/pins/stm32f1/pins_MKS_ROBIN_NANO_V2.h @@ -275,20 +275,11 @@ #if ENABLED(TFT_CLASSIC_UI) // Emulated DOGM SPI - #ifndef GRAPHICAL_TFT_UPSCALE - #define GRAPHICAL_TFT_UPSCALE 3 - #endif - #ifndef TFT_PIXEL_OFFSET_Y - #define TFT_PIXEL_OFFSET_Y 32 - #endif - + #define LCD_PINS_ENABLE PD13 + #define LCD_PINS_RS PC6 #define BTN_ENC PE13 #define BTN_EN1 PE8 #define BTN_EN2 PE11 - - #define LCD_PINS_ENABLE PD13 - #define LCD_PINS_RS PC6 - #elif ENABLED(TFT_COLOR_UI) #define TFT_BUFFER_SIZE 14400 #endif @@ -354,7 +345,7 @@ #else // !MKS_MINI_12864 #define LCD_PINS_D4 PE14 - #if ENABLED(ULTIPANEL) + #if IS_ULTIPANEL #define LCD_PINS_D5 PE15 #define LCD_PINS_D6 PD11 #define LCD_PINS_D7 PD10 diff --git a/Marlin/src/pins/stm32f1/pins_MKS_ROBIN_PRO.h b/Marlin/src/pins/stm32f1/pins_MKS_ROBIN_PRO.h index 32203f52ea..db6bc93205 100644 --- a/Marlin/src/pins/stm32f1/pins_MKS_ROBIN_PRO.h +++ b/Marlin/src/pins/stm32f1/pins_MKS_ROBIN_PRO.h @@ -210,7 +210,7 @@ * If the screen stays white, disable 'LCD_RESET_PIN' * to let the bootloader init the screen. */ -#if ENABLED(FSMC_GRAPHICAL_TFT) +#if HAS_FSMC_GRAPHICAL_TFT #define FSMC_CS_PIN PD7 // NE4 #define FSMC_RS_PIN PD11 // A0 @@ -254,7 +254,7 @@ #else // !MKS_MINI_12864 && !ENDER2_STOCKDISPLAY #define LCD_PINS_D4 PF14 - #if ENABLED(ULTIPANEL) + #if IS_ULTIPANEL #define LCD_PINS_D5 PF15 #define LCD_PINS_D6 PF12 #define LCD_PINS_D7 PF13 diff --git a/Marlin/src/pins/stm32f1/pins_STM32F1R.h b/Marlin/src/pins/stm32f1/pins_STM32F1R.h index cf2ba2c5fa..1b9a62fe9e 100644 --- a/Marlin/src/pins/stm32f1/pins_STM32F1R.h +++ b/Marlin/src/pins/stm32f1/pins_STM32F1R.h @@ -103,7 +103,7 @@ #define LCD_PINS_RS 49 // CS chip select /SS chip slave select #define LCD_PINS_ENABLE 51 // SID (MOSI) #define LCD_PINS_D4 52 // SCK (CLK) clock - #elif BOTH(NEWPANEL, PANEL_ONE) + #elif BOTH(IS_NEWPANEL, PANEL_ONE) #define LCD_PINS_RS PB8 #define LCD_PINS_ENABLE PD2 #define LCD_PINS_D4 PB12 @@ -117,7 +117,7 @@ #define LCD_PINS_D5 PB13 #define LCD_PINS_D6 PB14 #define LCD_PINS_D7 PB15 - #if DISABLED(NEWPANEL) + #if !IS_NEWPANEL #define BEEPER_PIN 33 // Buttons attached to a shift register // Not wired yet @@ -128,9 +128,9 @@ #endif #endif - #if ENABLED(NEWPANEL) + #if IS_NEWPANEL - #if ENABLED(REPRAP_DISCOUNT_SMART_CONTROLLER) + #if IS_RRD_SC #define BEEPER_PIN 37 @@ -231,7 +231,7 @@ #define BEEPER_PIN 33 // Buttons directly attached to AUX-2 - #if ENABLED(REPRAPWORLD_KEYPAD) + #if IS_RRW_KEYPAD #define BTN_EN1 64 #define BTN_EN2 59 #define BTN_ENC 63 @@ -256,6 +256,6 @@ #endif #endif - #endif // NEWPANEL + #endif // IS_NEWPANEL #endif // HAS_WIRED_LCD diff --git a/Marlin/src/pins/stm32f1/pins_STM3R_MINI.h b/Marlin/src/pins/stm32f1/pins_STM3R_MINI.h index e74698f89e..3ebc4bca57 100644 --- a/Marlin/src/pins/stm32f1/pins_STM3R_MINI.h +++ b/Marlin/src/pins/stm32f1/pins_STM3R_MINI.h @@ -118,7 +118,7 @@ #define LCD_PINS_RS 49 // CS chip select /SS chip slave select #define LCD_PINS_ENABLE 51 // SID (MOSI) #define LCD_PINS_D4 52 // SCK (CLK) clock - #elif BOTH(NEWPANEL, PANEL_ONE) + #elif BOTH(IS_NEWPANEL, PANEL_ONE) #define LCD_PINS_RS PB8 #define LCD_PINS_ENABLE PD2 #define LCD_PINS_D4 PB12 @@ -132,7 +132,7 @@ #define LCD_PINS_D5 PB13 #define LCD_PINS_D6 PB14 #define LCD_PINS_D7 PB15 - #if DISABLED(NEWPANEL) + #if !IS_NEWPANEL #define BEEPER_PIN 33 // Buttons attached to a shift register // Not wired yet @@ -151,9 +151,9 @@ #define TOUCH_MISO_PIN PB15 #define TOUCH_INT_PIN PC6 // (PenIRQ coming from ADS7843) - #elif ENABLED(NEWPANEL) + #elif IS_NEWPANEL - #if ENABLED(REPRAP_DISCOUNT_SMART_CONTROLLER) + #if IS_RRD_SC #define BEEPER_PIN 37 @@ -255,7 +255,7 @@ #define BEEPER_PIN 33 // Buttons directly attached to AUX-2 - #if ENABLED(REPRAPWORLD_KEYPAD) + #if IS_RRW_KEYPAD #define BTN_EN1 64 #define BTN_EN2 59 #define BTN_ENC 63 @@ -280,6 +280,6 @@ #endif #endif - #endif // NEWPANEL + #endif // IS_NEWPANEL #endif // HAS_WIRED_LCD diff --git a/Marlin/src/pins/stm32f4/pins_BEAST.h b/Marlin/src/pins/stm32f4/pins_BEAST.h index 268b7b59cd..279d0b9ec7 100644 --- a/Marlin/src/pins/stm32f4/pins_BEAST.h +++ b/Marlin/src/pins/stm32f4/pins_BEAST.h @@ -126,7 +126,7 @@ #define LCD_PINS_RS 49 // CS chip select /SS chip slave select #define LCD_PINS_ENABLE 51 // SID (MOSI) #define LCD_PINS_D4 52 // SCK (CLK) clock - #elif BOTH(NEWPANEL, PANEL_ONE) + #elif BOTH(IS_NEWPANEL, PANEL_ONE) #define LCD_PINS_RS PB8 #define LCD_PINS_ENABLE PD2 #define LCD_PINS_D4 PB12 @@ -140,7 +140,7 @@ #define LCD_PINS_D5 PB13 #define LCD_PINS_D6 PB14 #define LCD_PINS_D7 PB15 - #if DISABLED(NEWPANEL) + #if !IS_NEWPANEL #define BEEPER_PIN 33 // Buttons attached to a shift register // Not wired yet @@ -151,9 +151,9 @@ #endif #endif - #if ENABLED(NEWPANEL) + #if IS_NEWPANEL - #if ENABLED(REPRAP_DISCOUNT_SMART_CONTROLLER) + #if IS_RRD_SC #define BEEPER_PIN 37 @@ -255,7 +255,7 @@ #define BEEPER_PIN 33 // Buttons directly attached to AUX-2 - #if ENABLED(REPRAPWORLD_KEYPAD) + #if IS_RRW_KEYPAD #define BTN_EN1 64 #define BTN_EN2 59 #define BTN_ENC 63 @@ -280,6 +280,6 @@ #endif #endif - #endif // NEWPANEL + #endif // IS_NEWPANEL #endif // HAS_WIRED_LCD diff --git a/Marlin/src/pins/stm32f4/pins_BTT_BTT002_V1_0.h b/Marlin/src/pins/stm32f4/pins_BTT_BTT002_V1_0.h index c37f6cce04..6f9c3d3095 100644 --- a/Marlin/src/pins/stm32f4/pins_BTT_BTT002_V1_0.h +++ b/Marlin/src/pins/stm32f4/pins_BTT_BTT002_V1_0.h @@ -228,7 +228,7 @@ #define LCD_PINS_ENABLE PE9 #define LCD_PINS_D4 PE10 - #if ENABLED(ULTIPANEL) + #if IS_ULTIPANEL #define LCD_PINS_D5 PE11 #define LCD_PINS_D6 PE12 #define LCD_PINS_D7 PE13 diff --git a/Marlin/src/pins/stm32f4/pins_BTT_GTR_V1_0.h b/Marlin/src/pins/stm32f4/pins_BTT_GTR_V1_0.h index dc8ce9f2d1..eaf90da1ae 100644 --- a/Marlin/src/pins/stm32f4/pins_BTT_GTR_V1_0.h +++ b/Marlin/src/pins/stm32f4/pins_BTT_GTR_V1_0.h @@ -385,7 +385,7 @@ #endif #endif // !FYSETC_MINI_12864 - #if ENABLED(ULTIPANEL) + #if IS_ULTIPANEL #define LCD_PINS_D5 PG7 #define LCD_PINS_D6 PG6 #define LCD_PINS_D7 PG5 diff --git a/Marlin/src/pins/stm32f4/pins_BTT_SKR_PRO_common.h b/Marlin/src/pins/stm32f4/pins_BTT_SKR_PRO_common.h index 83fd987d9d..995fcb9585 100644 --- a/Marlin/src/pins/stm32f4/pins_BTT_SKR_PRO_common.h +++ b/Marlin/src/pins/stm32f4/pins_BTT_SKR_PRO_common.h @@ -350,7 +350,7 @@ #endif #endif // !FYSETC_MINI_12864 - #if ENABLED(ULTIPANEL) + #if IS_ULTIPANEL #define LCD_PINS_D5 PG3 #define LCD_PINS_D6 PG6 #define LCD_PINS_D7 PG7 diff --git a/Marlin/src/pins/stm32f4/pins_FYSETC_S6.h b/Marlin/src/pins/stm32f4/pins_FYSETC_S6.h index 151f6c3bc0..8638e9a4cf 100644 --- a/Marlin/src/pins/stm32f4/pins_FYSETC_S6.h +++ b/Marlin/src/pins/stm32f4/pins_FYSETC_S6.h @@ -252,7 +252,7 @@ #endif #endif // !FYSETC_MINI_12864 - #if ENABLED(ULTIPANEL) + #if IS_ULTIPANEL #define LCD_PINS_D5 PC12 #define LCD_PINS_D6 PD0 #define LCD_PINS_D7 PD1 diff --git a/Marlin/src/pins/stm32f4/pins_RUMBA32_common.h b/Marlin/src/pins/stm32f4/pins_RUMBA32_common.h index d52bb11d12..9a6a16516c 100644 --- a/Marlin/src/pins/stm32f4/pins_RUMBA32_common.h +++ b/Marlin/src/pins/stm32f4/pins_RUMBA32_common.h @@ -161,7 +161,7 @@ #define DOGLCD_A0 PE14 #endif - #if ENABLED(ULTIPANEL) + #if IS_ULTIPANEL #define LCD_PINS_D5 PE13 #define LCD_PINS_D6 PE14 #define LCD_PINS_D7 PE15 diff --git a/Marlin/src/pins/stm32f7/pins_NUCLEO_F767ZI.h b/Marlin/src/pins/stm32f7/pins_NUCLEO_F767ZI.h index 5e3d5f4ab5..7d95521eb6 100644 --- a/Marlin/src/pins/stm32f7/pins_NUCLEO_F767ZI.h +++ b/Marlin/src/pins/stm32f7/pins_NUCLEO_F767ZI.h @@ -41,7 +41,7 @@ /** * Timer assignments - * + * * TIM1 - * TIM2 - Hardware PWM (Fan/Heater Pins) * TIM3 - Hardware PWM (Servo Pins) @@ -55,7 +55,7 @@ * TIM12 - * TIM13 - * TIM14 - TEMP_TIMER (Marlin) - * + * */ #define STEP_TIMER 4 #define TEMP_TIMER 14 @@ -66,7 +66,7 @@ * Assignments may not be ideal, and not every assignment has been tested. * Proceed at your own risk. * _CN7_ - * (X_STEP) PC6 | · · | PB8 (X_EN) + * (X_STEP) PC6 | · · | PB8 (X_EN) * (X_DIR) PB15 | · · | PB9 (X_CS) * (LCD_D4) PB13 | · · | AVDD * _CN8_ PB12 | · · | GND @@ -77,7 +77,7 @@ * +5V | · · | PC12 (SDSS) PA4 | · · | PD15 (LCD_ENABLE) * GND | · · | PD2 (SERVO0_PIN) PB4 | · · | PF12 (LCD_RS) * GND | · · | PG2  ̄ ̄ ̄ - * VIN | · · | PG3 + * VIN | · · | PG3 _*  ̄ ̄ ̄ _CN10 * AVDD | · · | PF13 (BTN_EN1) * _CN9_ AGND | · · | PE9 (BTN_EN2) @@ -140,7 +140,7 @@ _*  ̄ ̄ ̄ _CN10 #define Z_SERIAL_RX_PIN PE12 #define E_SERIAL_TX_PIN PG9 - #define E_SERIAL_RX_PIN PG9 + #define E_SERIAL_RX_PIN PG9 #endif // @@ -182,7 +182,7 @@ _*  ̄ ̄ ̄ _CN10 // // LCD / Controller // -#if ENABLED(REPRAP_DISCOUNT_FULL_GRAPHIC_SMART_CONTROLLER) +#if IS_RRD_FG_SC #define BEEPER_PIN PC7 // LCD_BEEPER #define BTN_ENC PE11 // BTN_ENC #define SD_DETECT_PIN PD14 diff --git a/Marlin/src/pins/teensy2/pins_PRINTRBOARD.h b/Marlin/src/pins/teensy2/pins_PRINTRBOARD.h index ffecc03b4a..2401c976f1 100644 --- a/Marlin/src/pins/teensy2/pins_PRINTRBOARD.h +++ b/Marlin/src/pins/teensy2/pins_PRINTRBOARD.h @@ -124,7 +124,7 @@ // // LCD / Controller // -#if BOTH(ULTRA_LCD, NEWPANEL) +#if IS_ULTRA_LCD && IS_NEWPANEL #define LCD_PINS_RS 9 // E1 JP11-11 #define LCD_PINS_ENABLE 8 // E0 JP11-10 @@ -166,4 +166,4 @@ #endif -#endif // ULTRA_LCD && NEWPANEL +#endif // IS_ULTRA_LCD && IS_NEWPANEL diff --git a/Marlin/src/pins/teensy2/pins_TEENSY2.h b/Marlin/src/pins/teensy2/pins_TEENSY2.h index 4efd83d9bc..d43e39b09a 100644 --- a/Marlin/src/pins/teensy2/pins_TEENSY2.h +++ b/Marlin/src/pins/teensy2/pins_TEENSY2.h @@ -168,7 +168,7 @@ // // LCD / Controller // -#if ENABLED(ULTIPANEL) +#if IS_ULTIPANEL #define LCD_PINS_RS 8 // E0 #define LCD_PINS_ENABLE 9 // E1 #define LCD_PINS_D4 10 // C0 diff --git a/Marlin/src/pins/teensy2/pins_TEENSYLU.h b/Marlin/src/pins/teensy2/pins_TEENSYLU.h index 9de119b62b..54cee137ad 100644 --- a/Marlin/src/pins/teensy2/pins_TEENSYLU.h +++ b/Marlin/src/pins/teensy2/pins_TEENSYLU.h @@ -141,7 +141,7 @@ // // LCD / Controller // -#if BOTH(ULTRA_LCD, NEWPANEL) +#if IS_ULTRA_LCD && IS_NEWPANEL #define BEEPER_PIN -1 @@ -154,7 +154,7 @@ #define SD_DETECT_PIN -1 -#endif // ULTRA_LCD && NEWPANEL +#endif // IS_ULTRA_LCD && IS_NEWPANEL // // M3/M4/M5 - Spindle/Laser Control diff --git a/Marlin/src/pins/teensy3/pins_TEENSY35_36.h b/Marlin/src/pins/teensy3/pins_TEENSY35_36.h index 2e09c8a425..b8a0ffe2c8 100644 --- a/Marlin/src/pins/teensy3/pins_TEENSY35_36.h +++ b/Marlin/src/pins/teensy3/pins_TEENSY35_36.h @@ -139,13 +139,13 @@ #define LCD_PINS_D7 45 #endif -#if ENABLED(NEWPANEL) +#if IS_NEWPANEL #define BTN_EN1 46 #define BTN_EN2 47 #define BTN_ENC 48 #endif -#if ENABLED(REPRAPWORLD_KEYPAD) +#if IS_RRW_KEYPAD #define SHIFT_OUT 40 #define SHIFT_CLK 44 #define SHIFT_LD 42 diff --git a/buildroot/tests/STM32F103VE_longer-tests b/buildroot/tests/STM32F103VE_longer-tests index 85b22c1284..8eb9e4cd1b 100755 --- a/buildroot/tests/STM32F103VE_longer-tests +++ b/buildroot/tests/STM32F103VE_longer-tests @@ -7,8 +7,6 @@ set -e use_example_configs Alfawise/U20 -opt_set MOTHERBOARD BOARD_LONGER3D_LK -opt_set SERIAL_PORT 1 opt_enable BAUD_RATE_GCODE exec_test $1 $2 "Full-featured U20 config" diff --git a/buildroot/tests/mks_robin-tests b/buildroot/tests/mks_robin-tests index d635062205..4246231070 100644 --- a/buildroot/tests/mks_robin-tests +++ b/buildroot/tests/mks_robin-tests @@ -8,9 +8,7 @@ set -e use_example_configs Mks/Robin -opt_disable TFT_320x240 -opt_enable FSMC_GRAPHICAL_TFT -exec_test $1 $2 "MKS Robin base configuration" +exec_test $1 $2 "MKS Robin config (FSMC Color UI)" # cleanup restore_configs diff --git a/buildroot/tests/mks_robin_nano35-tests b/buildroot/tests/mks_robin_nano35-tests index 92c97be756..ce98f563b9 100644 --- a/buildroot/tests/mks_robin_nano35-tests +++ b/buildroot/tests/mks_robin_nano35-tests @@ -7,39 +7,50 @@ # exit on first failure set -e +# +# MKS Robin nano v1.2 Emulated DOGM FSMC +# use_example_configs Mks/Robin opt_set MOTHERBOARD BOARD_MKS_ROBIN_NANO -opt_disable TFT_320x240 -opt_enable TOUCH_SCREEN -opt_enable FSMC_GRAPHICAL_TFT exec_test $1 $2 "MKS Robin nano v1.2 Emulated DOGM FSMC" +# +# MKS Robin v2 nano LVGL SPI +# (Robin v2 nano has no FSMC interface) +# use_example_configs Mks/Robin opt_set MOTHERBOARD BOARD_MKS_ROBIN_NANO_V2 -opt_disable TFT_320x240 -opt_enable TOUCH_SCREEN -opt_enable SPI_GRAPHICAL_TFT +opt_disable TFT_INTERFACE_FSMC +opt_enable TFT_INTERFACE_SPI exec_test $1 $2 "MKS Robin v2 nano Emulated DOGM SPI" +# +# MKS Robin nano v1.2 LVGL FSMC +# use_example_configs Mks/Robin opt_set MOTHERBOARD BOARD_MKS_ROBIN_NANO -opt_disable TFT_320x240 -opt_disable TOUCH_SCREEN -opt_enable TFT_LVGL_UI_FSMC +opt_disable TFT_CLASSIC_UI TFT_COLOR_UI TOUCH_SCREEN TFT_RES_320x240 +opt_enable TFT_LVGL_UI TFT_RES_480x320 exec_test $1 $2 "MKS Robin nano v1.2 LVGL FSMC" +# +# MKS Robin v2 nano LVGL SPI +# (Robin v2 nano has no FSMC interface) +# use_example_configs Mks/Robin opt_set MOTHERBOARD BOARD_MKS_ROBIN_NANO_V2 -opt_disable TFT_320x240 -opt_disable TOUCH_SCREEN -opt_enable TFT_LVGL_UI_SPI +opt_disable TFT_INTERFACE_FSMC TFT_COLOR_UI TOUCH_SCREEN TFT_RES_320x240 +opt_enable TFT_INTERFACE_SPI TFT_LVGL_UI TFT_RES_480x320 exec_test $1 $2 "MKS Robin v2 nano LVGL SPI" +# +# MKS Robin v2 nano New Color UI 480x320 SPI +# (Robin v2 nano has no FSMC interface) +# use_example_configs Mks/Robin opt_set MOTHERBOARD BOARD_MKS_ROBIN_NANO_V2 -opt_disable TFT_320x240 -opt_enable TOUCH_SCREEN -opt_enable TFT_480x320_SPI +opt_disable TFT_INTERFACE_FSMC TFT_RES_320x240 +opt_enable TFT_INTERFACE_SPI TFT_RES_480x320 exec_test $1 $2 "MKS Robin v2 nano New Color UI 480x320 SPI" # cleanup diff --git a/buildroot/tests/mks_robin_pro-tests b/buildroot/tests/mks_robin_pro-tests index 7ae4670fed..50ec7b0dd1 100644 --- a/buildroot/tests/mks_robin_pro-tests +++ b/buildroot/tests/mks_robin_pro-tests @@ -13,7 +13,7 @@ opt_set X_DRIVER_TYPE TMC2209 opt_set Y_DRIVER_TYPE TMC2130 opt_set TEMP_SENSOR_BED 1 opt_disable THERMAL_PROTECTION_HOTENDS -exec_test $1 $2 "MKS Robin Pro with TMC Drivers, hotend thermal protection disabled" +exec_test $1 $2 "MKS Robin Pro, TMC Drivers, no thermal protection" # cleanup -#restore_configs +restore_configs From f86c6851fcb310c5533958b4d99ab121d757b068 Mon Sep 17 00:00:00 2001 From: Peter Hall <33176108+IamPete1@users.noreply.github.com> Date: Thu, 15 Oct 2020 19:18:43 +0100 Subject: [PATCH 033/226] Default LASER_POWER_INLINE to OFF (#19727) --- Marlin/Configuration_adv.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Marlin/Configuration_adv.h b/Marlin/Configuration_adv.h index 714bcb288f..c3ba3f7e22 100644 --- a/Marlin/Configuration_adv.h +++ b/Marlin/Configuration_adv.h @@ -2958,7 +2958,7 @@ * This allows the laser to keep in perfect sync with the planner and removes * the powerup/down delay since lasers require negligible time. */ - #define LASER_POWER_INLINE + //#define LASER_POWER_INLINE #if ENABLED(LASER_POWER_INLINE) /** From 72e3238c3f4fc2a9bf0c69d13a839924581a9490 Mon Sep 17 00:00:00 2001 From: rlojek Date: Thu, 15 Oct 2020 20:44:57 +0200 Subject: [PATCH 034/226] Fix ADVANCED_PAUSE && !PREVENT_COLD_EXTRUSION (#19740) --- Marlin/src/feature/pause.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/Marlin/src/feature/pause.cpp b/Marlin/src/feature/pause.cpp index 0ab6594021..ffc04af91f 100644 --- a/Marlin/src/feature/pause.cpp +++ b/Marlin/src/feature/pause.cpp @@ -132,8 +132,10 @@ static bool ensure_safe_temperature(const bool wait=true, const PauseMode mode=P DEBUG_SECTION(est, "ensure_safe_temperature", true); DEBUG_ECHOLNPAIR("... wait:", int(wait), " mode:", int(mode)); - if (!DEBUGGING(DRYRUN) && thermalManager.targetTooColdToExtrude(active_extruder)) - thermalManager.setTargetHotend(thermalManager.extrude_min_temp, active_extruder); + #if ENABLED(PREVENT_COLD_EXTRUSION) + if (!DEBUGGING(DRYRUN) && thermalManager.targetTooColdToExtrude(active_extruder)) + thermalManager.setTargetHotend(thermalManager.extrude_min_temp, active_extruder); + #endif #if HAS_LCD_MENU lcd_pause_show_message(PAUSE_MESSAGE_HEATING, mode); From f74b5a6b9bb1e11b6b3a411bcd990e23598730a4 Mon Sep 17 00:00:00 2001 From: Victor Oliveira Date: Thu, 15 Oct 2020 16:15:11 -0300 Subject: [PATCH 035/226] Update Probe Offset Wizard for Color UI (#19742) --- Marlin/src/lcd/menu/menu_probe_offset.cpp | 22 +++++++++++++--------- 1 file changed, 13 insertions(+), 9 deletions(-) diff --git a/Marlin/src/lcd/menu/menu_probe_offset.cpp b/Marlin/src/lcd/menu/menu_probe_offset.cpp index 6b7830b853..4623b8f492 100644 --- a/Marlin/src/lcd/menu/menu_probe_offset.cpp +++ b/Marlin/src/lcd/menu/menu_probe_offset.cpp @@ -88,16 +88,20 @@ void probe_offset_wizard_menu() { SUBMENU(MSG_MOVE_01MM, []{ _goto_manual_move_z( 0.1f); }); if ((SHORT_MANUAL_Z_MOVE) > 0.0f && (SHORT_MANUAL_Z_MOVE) < 0.1f) { - extern const char NUL_STR[]; - SUBMENU_P(NUL_STR, []{ _goto_manual_move_z(float(SHORT_MANUAL_Z_MOVE)); }); - MENU_ITEM_ADDON_START(0 + ENABLED(HAS_MARLINUI_HD44780)); - char tmp[20], numstr[10]; - // Determine digits needed right of decimal - const uint8_t digs = !UNEAR_ZERO((SHORT_MANUAL_Z_MOVE) * 1000 - int((SHORT_MANUAL_Z_MOVE) * 1000)) ? 4 : - !UNEAR_ZERO((SHORT_MANUAL_Z_MOVE) * 100 - int((SHORT_MANUAL_Z_MOVE) * 100)) ? 3 : 2; - sprintf_P(tmp, GET_TEXT(MSG_MOVE_Z_DIST), dtostrf(SHORT_MANUAL_Z_MOVE, 1, digs, numstr)); + char tmp[20], numstr[10]; + // Determine digits needed right of decimal + const uint8_t digs = !UNEAR_ZERO((SHORT_MANUAL_Z_MOVE) * 1000 - int((SHORT_MANUAL_Z_MOVE) * 1000)) ? 4 : + !UNEAR_ZERO((SHORT_MANUAL_Z_MOVE) * 100 - int((SHORT_MANUAL_Z_MOVE) * 100)) ? 3 : 2; + sprintf_P(tmp, GET_TEXT(MSG_MOVE_Z_DIST), dtostrf(SHORT_MANUAL_Z_MOVE, 1, digs, numstr)); + #if DISABLED(HAS_GRAPHICAL_TFT) + extern const char NUL_STR[]; + SUBMENU_P(NUL_STR, []{ _goto_manual_move_z(float(SHORT_MANUAL_Z_MOVE)); }); + MENU_ITEM_ADDON_START(0 + ENABLED(HAS_MARLINUI_HD44780)); lcd_put_u8str(tmp); - MENU_ITEM_ADDON_END(); + MENU_ITEM_ADDON_END(); + #else + SUBMENU_P(tmp, []{ _goto_manual_move_z(float(SHORT_MANUAL_Z_MOVE)); }); + #endif } ACTION_ITEM(MSG_BUTTON_DONE, []{ From 8a885dc61b8ded0a02f003915e8883eda3b22f7a Mon Sep 17 00:00:00 2001 From: Victor Oliveira Date: Thu, 15 Oct 2020 20:38:27 -0300 Subject: [PATCH 036/226] Fix TOUCH_SCREEN + TFT_LVGL_UI compile (#19754) --- Marlin/src/inc/Conditionals_LCD.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Marlin/src/inc/Conditionals_LCD.h b/Marlin/src/inc/Conditionals_LCD.h index 4eeb0e8a44..cbc75cfb6d 100644 --- a/Marlin/src/inc/Conditionals_LCD.h +++ b/Marlin/src/inc/Conditionals_LCD.h @@ -926,5 +926,7 @@ #if ENABLED(TOUCH_SCREEN) && !HAS_GRAPHICAL_TFT #undef TOUCH_SCREEN #undef TOUCH_SCREEN_CALIBRATION - #define HAS_TOUCH_XPT2046 1 + #if !HAS_TFT_LVGL_UI + #define HAS_TOUCH_XPT2046 1 + #endif #endif From 763544585a57b5692c7c37840efcdddfcaec584f Mon Sep 17 00:00:00 2001 From: thinkyhead Date: Fri, 16 Oct 2020 00:15:39 +0000 Subject: [PATCH 037/226] [cron] Bump distribution date (2020-10-16) --- Marlin/src/inc/Version.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Marlin/src/inc/Version.h b/Marlin/src/inc/Version.h index e254cb0108..a2901a4628 100644 --- a/Marlin/src/inc/Version.h +++ b/Marlin/src/inc/Version.h @@ -42,7 +42,7 @@ * version was tagged. */ #ifndef STRING_DISTRIBUTION_DATE - #define STRING_DISTRIBUTION_DATE "2020-10-15" + #define STRING_DISTRIBUTION_DATE "2020-10-16" #endif /** From 5247bb11f7cc455cad780fbed8eaddd4a6dd007a Mon Sep 17 00:00:00 2001 From: Victor Oliveira Date: Fri, 16 Oct 2020 04:03:45 -0300 Subject: [PATCH 038/226] Sanity check unsupported EP (#19745) --- Marlin/src/HAL/STM32F1/inc/SanityCheck.h | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/Marlin/src/HAL/STM32F1/inc/SanityCheck.h b/Marlin/src/HAL/STM32F1/inc/SanityCheck.h index 9d5026fbab..a0381ea8c8 100644 --- a/Marlin/src/HAL/STM32F1/inc/SanityCheck.h +++ b/Marlin/src/HAL/STM32F1/inc/SanityCheck.h @@ -51,3 +51,10 @@ #if ENABLED(NEOPIXEL_LED) #error "NEOPIXEL_LED (Adafruit NeoPixel) is not supported for HAL/STM32F1. Comment out this line to proceed at your own risk!" #endif + +// Emergency Parser needs at least one serial with HardwareSerial or USBComposite. +// The USBSerial maple don't allow any hook to implement EMERGENCY_PARSER. +// And copy all USBSerial code to marlin space to support EMERGENCY_PARSER, when we have another options, don't worth it. +#if ENABLED(EMERGENCY_PARSER) && !defined(USE_USB_COMPOSITE) && ((SERIAL_PORT == -1 && !defined(SERIAL_PORT_2)) || (SERIAL_PORT_2 == -1 && !defined(SERIAL_PORT))) + #error "EMERGENCY_PARSER is only supported by HardwareSerial or USBComposite in HAL/STM32F1." +#endif From 7f83231385779af657b28fa6b2aa58962a946def Mon Sep 17 00:00:00 2001 From: Jason Smith Date: Fri, 16 Oct 2020 00:04:55 -0700 Subject: [PATCH 039/226] Fix NUCLEO_F767ZI build, add tests (#19746) --- .github/workflows/test-builds.yml | 1 + Marlin/src/pins/stm32f7/pins_NUCLEO_F767ZI.h | 2 +- buildroot/tests/NUCLEO_F767ZI-tests | 21 ++++++++++++++++++++ 3 files changed, 23 insertions(+), 1 deletion(-) create mode 100644 buildroot/tests/NUCLEO_F767ZI-tests diff --git a/.github/workflows/test-builds.yml b/.github/workflows/test-builds.yml index b228783799..f7ba348cc0 100644 --- a/.github/workflows/test-builds.yml +++ b/.github/workflows/test-builds.yml @@ -81,6 +81,7 @@ jobs: - STM32F103RET6_creality - LERDGEX - mks_robin_nano35 + - NUCLEO_F767ZI # Put lengthy tests last diff --git a/Marlin/src/pins/stm32f7/pins_NUCLEO_F767ZI.h b/Marlin/src/pins/stm32f7/pins_NUCLEO_F767ZI.h index 7d95521eb6..0a00e03612 100644 --- a/Marlin/src/pins/stm32f7/pins_NUCLEO_F767ZI.h +++ b/Marlin/src/pins/stm32f7/pins_NUCLEO_F767ZI.h @@ -21,7 +21,7 @@ */ #pragma once -#ifndef STM32F767xx +#if NOT_TARGET(STM32F767xx) #error "Oops! Select an STM32F767 environment" #endif diff --git a/buildroot/tests/NUCLEO_F767ZI-tests b/buildroot/tests/NUCLEO_F767ZI-tests new file mode 100644 index 0000000000..05125a4539 --- /dev/null +++ b/buildroot/tests/NUCLEO_F767ZI-tests @@ -0,0 +1,21 @@ +#!/usr/bin/env bash +# +# Build tests for NUCLEO_F767ZI +# + +# exit on first failure +set -e + +# +# Build with the default configurations +# +restore_configs +opt_set MOTHERBOARD BOARD_NUCLEO_F767ZI +opt_set SERIAL_PORT -1 +opt_enable BLTOUCH Z_SAFE_HOMING SPEAKER +opt_set X_DRIVER_TYPE TMC2209 +opt_set Y_DRIVER_TYPE TMC2208 +exec_test $1 $2 "Mixed timer usage" + +# clean up +restore_configs From 814db9d7c919c08bc0e21edcf51e31f2188e763c Mon Sep 17 00:00:00 2001 From: Andreas Setterlind Date: Fri, 16 Oct 2020 09:06:05 +0200 Subject: [PATCH 040/226] Add ESP32 160MHz to README (#19748) --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 27becb9db6..f3c2afa874 100644 --- a/README.md +++ b/README.md @@ -46,7 +46,7 @@ Marlin 2.0 introduces a layer of abstraction so that all the existing high-level board|processor|speed|flash|sram|logic|fpu ----|---------|-----|-----|----|-----|--- - [ESP32](https://www.espressif.com/en/products/hardware/esp32/overview)|Tensilica Xtensa LX6|240MHz|---|---|3.3V|--- + [ESP32](https://www.espressif.com/en/products/hardware/esp32/overview)|Tensilica Xtensa LX6|160-240MHz variants|---|---|3.3V|--- #### LPC1768 / LPC1769 From a4b89e67c6c0a063efd98c91f45baa11e1372277 Mon Sep 17 00:00:00 2001 From: mks-viva <1224833100@qq.com> Date: Fri, 16 Oct 2020 15:16:09 +0800 Subject: [PATCH 041/226] Update MKS SGen-L V2 RGB LED pins (#19762) --- Marlin/src/pins/lpc1769/pins_MKS_SGEN_L_V2.h | 22 +++++++++++++++++--- 1 file changed, 19 insertions(+), 3 deletions(-) diff --git a/Marlin/src/pins/lpc1769/pins_MKS_SGEN_L_V2.h b/Marlin/src/pins/lpc1769/pins_MKS_SGEN_L_V2.h index e18f938dc4..1a558075b6 100644 --- a/Marlin/src/pins/lpc1769/pins_MKS_SGEN_L_V2.h +++ b/Marlin/src/pins/lpc1769/pins_MKS_SGEN_L_V2.h @@ -227,9 +227,25 @@ // Misc. Functions // #define LED_PIN P1_18 // Used as a status indicator -#define LED2_PIN P1_19 -#define LED3_PIN P1_20 -#define LED4_PIN P1_21 + +// +// RGB LED +// +#if ENABLED(RGB_LED) + #ifndef RGB_LED_R_PIN + #define RGB_LED_R_PIN P1_19 + #endif + #ifndef RGB_LED_G_PIN + #define RGB_LED_G_PIN P1_20 + #endif + #ifndef RGB_LED_B_PIN + #define RGB_LED_B_PIN P1_21 + #endif +#else + #define LED2_PIN P1_19 // Initialized by HAL/LPC1768/main.cpp + #define LED3_PIN P1_20 + #define LED4_PIN P1_21 +#endif /** * _____ _____ From 9b9cd698a5b30036fcb6d643bec114babc8cc7c9 Mon Sep 17 00:00:00 2001 From: Jason Smith Date: Fri, 16 Oct 2020 14:04:51 -0700 Subject: [PATCH 042/226] Fix SAMD Serial name macro (#19765) --- Marlin/src/HAL/SAMD51/HAL.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Marlin/src/HAL/SAMD51/HAL.h b/Marlin/src/HAL/SAMD51/HAL.h index abc6c04a69..7cb3635bd7 100644 --- a/Marlin/src/HAL/SAMD51/HAL.h +++ b/Marlin/src/HAL/SAMD51/HAL.h @@ -35,7 +35,8 @@ // MYSERIAL0 required before MarlinSerial includes! - #define _MSERIAL(X) Serial##X + #define __MSERIAL(X) Serial##X + #define _MSERIAL(X) __MSERIAL(X) #define MSERIAL(X) _MSERIAL(INCREMENT(X)) #if SERIAL_PORT == -1 From e370834c35bfc529c4b11441e77e5ce7cdafac67 Mon Sep 17 00:00:00 2001 From: Victor Oliveira Date: Fri, 16 Oct 2020 18:11:00 -0300 Subject: [PATCH 043/226] Handle M410 in the main task (#19752) --- Marlin/src/feature/e_parser.cpp | 1 + Marlin/src/feature/e_parser.h | 3 ++- Marlin/src/module/temperature.cpp | 10 ++++++++-- 3 files changed, 11 insertions(+), 3 deletions(-) diff --git a/Marlin/src/feature/e_parser.cpp b/Marlin/src/feature/e_parser.cpp index a4c2d0dac9..d98afcfee7 100644 --- a/Marlin/src/feature/e_parser.cpp +++ b/Marlin/src/feature/e_parser.cpp @@ -32,6 +32,7 @@ // Static data members bool EmergencyParser::killed_by_M112, // = false + EmergencyParser::quickstop_by_M410, EmergencyParser::enabled; #if ENABLED(HOST_PROMPT_SUPPORT) diff --git a/Marlin/src/feature/e_parser.h b/Marlin/src/feature/e_parser.h index 085cbd4eab..0bb0253149 100644 --- a/Marlin/src/feature/e_parser.h +++ b/Marlin/src/feature/e_parser.h @@ -63,6 +63,7 @@ public: }; static bool killed_by_M112; + static bool quickstop_by_M410; #if ENABLED(HOST_PROMPT_SUPPORT) static uint8_t M876_reason; @@ -168,7 +169,7 @@ public: if (enabled) switch (state) { case EP_M108: wait_for_user = wait_for_heatup = false; break; case EP_M112: killed_by_M112 = true; break; - case EP_M410: quickstop_stepper(); break; + case EP_M410: quickstop_by_M410 = true; break; #if ENABLED(HOST_PROMPT_SUPPORT) case EP_M876SN: host_response_handler(M876_reason); break; #endif diff --git a/Marlin/src/module/temperature.cpp b/Marlin/src/module/temperature.cpp index 9ecbb7c766..4b352e738e 100644 --- a/Marlin/src/module/temperature.cpp +++ b/Marlin/src/module/temperature.cpp @@ -1032,8 +1032,14 @@ void Temperature::manage_heater() { if (!inited) return watchdog_refresh(); #endif - if (TERN0(EMERGENCY_PARSER, emergency_parser.killed_by_M112)) - kill(M112_KILL_STR, nullptr, true); + #if ENABLED(EMERGENCY_PARSER) + if (emergency_parser.killed_by_M112) kill(M112_KILL_STR, nullptr, true); + + if (emergency_parser.quickstop_by_M410) { + emergency_parser.quickstop_by_M410 = false; // quickstop_stepper may call idle so clear this now! + quickstop_stepper(); + } + #endif if (!raw_temps_ready) return; From 0b80841c38dcd8259821f72dc40c194e67042c5d Mon Sep 17 00:00:00 2001 From: Victor Oliveira Date: Fri, 16 Oct 2020 18:19:48 -0300 Subject: [PATCH 044/226] Fix Color UI external_control, wait_for_release (#19771) Co-authored-by: Scott Lahteine --- Marlin/src/lcd/tft/touch.cpp | 21 ++++++++++++--------- Marlin/src/lcd/tft/touch.h | 8 +++++++- Marlin/src/lcd/ultralcd.cpp | 4 ---- Marlin/src/module/probe.cpp | 2 +- 4 files changed, 20 insertions(+), 15 deletions(-) diff --git a/Marlin/src/lcd/tft/touch.cpp b/Marlin/src/lcd/tft/touch.cpp index 80c65f074a..3ecf481ed1 100644 --- a/Marlin/src/lcd/tft/touch.cpp +++ b/Marlin/src/lcd/tft/touch.cpp @@ -40,7 +40,7 @@ int16_t Touch::x, Touch::y; touch_control_t Touch::controls[]; touch_control_t *Touch::current_control; uint16_t Touch::controls_count; -millis_t Touch::now = 0; +millis_t Touch::last_touch_ms = 0; millis_t Touch::time_to_hold; millis_t Touch::repeat_delay; millis_t Touch::touch_time; @@ -79,8 +79,10 @@ void Touch::idle() { if (!enabled) return; - if (now == millis()) return; - now = millis(); + // Return if Touch::idle is called within the same millisecond + const millis_t now = millis(); + if (last_touch_ms == now) return; + last_touch_ms = now; if (get_point(&_x, &_y)) { #if HAS_RESUME_CONTINUE @@ -88,24 +90,25 @@ void Touch::idle() { if (wait_for_user) { touch_control_type = CLICK; ui.lcd_clicked = true; + if (ui.external_control) wait_for_user = false; return; } #endif #if LCD_TIMEOUT_TO_STATUS - ui.return_to_status_ms = now + LCD_TIMEOUT_TO_STATUS; + ui.return_to_status_ms = last_touch_ms + LCD_TIMEOUT_TO_STATUS; #endif if (touch_time) { #if ENABLED(TOUCH_SCREEN_CALIBRATION) - if (touch_control_type == NONE && ELAPSED(now, touch_time + TOUCH_SCREEN_HOLD_TO_CALIBRATE_MS) && ui.on_status_screen()) + if (touch_control_type == NONE && ELAPSED(last_touch_ms, touch_time + TOUCH_SCREEN_HOLD_TO_CALIBRATE_MS) && ui.on_status_screen()) ui.goto_screen(touch_screen_calibration); #endif return; } - if (time_to_hold == 0) time_to_hold = now + MINIMUM_HOLD_TIME; - if (PENDING(now, time_to_hold)) return; + if (time_to_hold == 0) time_to_hold = last_touch_ms + MINIMUM_HOLD_TIME; + if (PENDING(last_touch_ms, time_to_hold)) return; if (x != 0 && y != 0) { if (current_control) { @@ -131,7 +134,7 @@ void Touch::idle() { } if (current_control == NULL) - touch_time = now; + touch_time = last_touch_ms; } x = _x; y = _y; @@ -284,7 +287,7 @@ void Touch::hold(touch_control_t *control, millis_t delay) { current_control = control; if (delay) { repeat_delay = delay > MIN_REPEAT_DELAY ? delay : MIN_REPEAT_DELAY; - time_to_hold = now + repeat_delay; + time_to_hold = last_touch_ms + repeat_delay; } ui.refresh(); } diff --git a/Marlin/src/lcd/tft/touch.h b/Marlin/src/lcd/tft/touch.h index 7d8f222918..b2c7a21ba1 100644 --- a/Marlin/src/lcd/tft/touch.h +++ b/Marlin/src/lcd/tft/touch.h @@ -164,7 +164,13 @@ class Touch { static void reset() { controls_count = 0; touch_time = -1; current_control = NULL; } static void clear() { controls_count = 0; } static void idle(); - static bool is_clicked() { return touch_control_type == CLICK; } + static bool is_clicked() { + if (touch_control_type == CLICK) { + touch_control_type = NONE; + return true; + } + return false; + } static void disable() { enabled = false; } static void enable() { enabled = true; } diff --git a/Marlin/src/lcd/ultralcd.cpp b/Marlin/src/lcd/ultralcd.cpp index da9c3e2456..25f5afc71d 100644 --- a/Marlin/src/lcd/ultralcd.cpp +++ b/Marlin/src/lcd/ultralcd.cpp @@ -1478,10 +1478,6 @@ void MarlinUI::update() { set_status_P(msg, -1); } - #if ENABLED(SDSUPPORT) - extern bool wait_for_user, wait_for_heatup; - #endif - void MarlinUI::abort_print() { #if ENABLED(SDSUPPORT) wait_for_heatup = wait_for_user = false; diff --git a/Marlin/src/module/probe.cpp b/Marlin/src/module/probe.cpp index defc22b1fe..27ceb989c0 100644 --- a/Marlin/src/module/probe.cpp +++ b/Marlin/src/module/probe.cpp @@ -38,7 +38,7 @@ #include "../gcode/gcode.h" #include "../lcd/ultralcd.h" -#include "../MarlinCore.h" // for stop(), disable_e_steppers, wait_for_user +#include "../MarlinCore.h" // for stop(), disable_e_steppers #if HAS_LEVELING #include "../feature/bedlevel/bedlevel.h" From aa901ac4a2b87079777280aa678b82294b9d9bee Mon Sep 17 00:00:00 2001 From: Serhiy-K <52166448+Serhiy-K@users.noreply.github.com> Date: Sat, 17 Oct 2020 00:21:21 +0300 Subject: [PATCH 045/226] Fix HAL/STM32 FastIO for analog pins (#19735) --- Marlin/src/HAL/STM32/fastio.h | 10 +++++----- Marlin/src/HAL/STM32/pinsDebug_STM32duino.h | 10 ++++------ 2 files changed, 9 insertions(+), 11 deletions(-) diff --git a/Marlin/src/HAL/STM32/fastio.h b/Marlin/src/HAL/STM32/fastio.h index f000d68cf0..ea28b8f3bf 100644 --- a/Marlin/src/HAL/STM32/fastio.h +++ b/Marlin/src/HAL/STM32/fastio.h @@ -51,15 +51,15 @@ void FastIO_init(); // Must be called before using fast io macros #if defined(STM32F0xx) || defined(STM32F1xx) || defined(STM32F3xx) || defined(STM32L0xx) || defined(STM32L4xx) #define _WRITE(IO, V) do { \ - if (V) FastIOPortMap[STM_PORT(digitalPin[IO])]->BSRR = _BV32(STM_PIN(digitalPin[IO])) ; \ - else FastIOPortMap[STM_PORT(digitalPin[IO])]->BRR = _BV32(STM_PIN(digitalPin[IO])) ; \ + if (V) FastIOPortMap[STM_PORT(digitalPinToPinName(IO))]->BSRR = _BV32(STM_PIN(digitalPinToPinName(IO))) ; \ + else FastIOPortMap[STM_PORT(digitalPinToPinName(IO))]->BRR = _BV32(STM_PIN(digitalPinToPinName(IO))) ; \ }while(0) #else - #define _WRITE(IO, V) (FastIOPortMap[STM_PORT(digitalPin[IO])]->BSRR = _BV32(STM_PIN(digitalPin[IO]) + ((V) ? 0 : 16))) + #define _WRITE(IO, V) (FastIOPortMap[STM_PORT(digitalPinToPinName(IO))]->BSRR = _BV32(STM_PIN(digitalPinToPinName(IO)) + ((V) ? 0 : 16))) #endif -#define _READ(IO) bool(READ_BIT(FastIOPortMap[STM_PORT(digitalPin[IO])]->IDR, _BV32(STM_PIN(digitalPin[IO])))) -#define _TOGGLE(IO) (FastIOPortMap[STM_PORT(digitalPin[IO])]->ODR ^= _BV32(STM_PIN(digitalPin[IO]))) +#define _READ(IO) bool(READ_BIT(FastIOPortMap[STM_PORT(digitalPinToPinName(IO))]->IDR, _BV32(STM_PIN(digitalPinToPinName(IO))))) +#define _TOGGLE(IO) (FastIOPortMap[STM_PORT(digitalPinToPinName(IO))]->ODR ^= _BV32(STM_PIN(digitalPinToPinName(IO)))) #define _GET_MODE(IO) #define _SET_MODE(IO,M) pinMode(IO, M) diff --git a/Marlin/src/HAL/STM32/pinsDebug_STM32duino.h b/Marlin/src/HAL/STM32/pinsDebug_STM32duino.h index 09f2bb54e6..71480153a7 100644 --- a/Marlin/src/HAL/STM32/pinsDebug_STM32duino.h +++ b/Marlin/src/HAL/STM32/pinsDebug_STM32duino.h @@ -51,8 +51,8 @@ * It contains: * - name of the signal * - the Ard_num assigned by the pins_YOUR_BOARD.h file using the platform defines. - * EXAMPLE: "#define KILL_PIN PB1" results in Ard_num of 57. 57 is then used as an - * index into digitalPin[] to get the Port_pin number + * EXAMPLE: "#define KILL_PIN PB1" results in Ard_num of 57. 57 is then used as the + * argument to digitalPinToPinName(IO) to get the Port_pin number * - if it is a digital or analog signal. PWMs are considered digital here. * * pin_xref is a structure generated by this header file. It is generated by the @@ -68,8 +68,6 @@ * signal. The Arduino pin number is listed by the M43 I command. */ -extern const PinName digitalPin[]; // provided by the platform - //////////////////////////////////////////////////////// // // make a list of the Arduino pin numbers in the Port/Pin order @@ -137,7 +135,7 @@ const XrefInfo pin_xref[] PROGMEM = { uint8_t get_pin_mode(const pin_t Ard_num) { uint32_t mode_all = 0; - const PinName dp = digitalPin[Ard_num]; + const PinName dp = digitalPinToPinName(Ard_num); switch (PORT_ALPHA(dp)) { case 'A' : mode_all = GPIOA->MODER; break; case 'B' : mode_all = GPIOB->MODER; break; @@ -218,7 +216,7 @@ bool pwm_status(const pin_t Ard_num) { void pwm_details(const pin_t Ard_num) { if (pwm_status(Ard_num)) { uint32_t alt_all = 0; - const PinName dp = digitalPin[Ard_num]; + const PinName dp = digitalPinToPinName(Ard_num); pin_t pin_number = uint8_t(PIN_NUM(dp)); const bool over_7 = pin_number >= 8; const uint8_t ind = over_7 ? 1 : 0; From 418b3e5ee26c0284561f07cf462af27971715d12 Mon Sep 17 00:00:00 2001 From: nb-rapidia <43864438+nb-rapidia@users.noreply.github.com> Date: Fri, 16 Oct 2020 14:59:55 -0700 Subject: [PATCH 046/226] Fix IDEX layer shift and DIR states (#19756) Co-authored-by: Scott Lahteine --- Marlin/src/feature/pause.cpp | 21 ++---- Marlin/src/feature/pause.h | 7 +- Marlin/src/feature/runout.h | 2 +- Marlin/src/gcode/bedlevel/G35.cpp | 5 +- Marlin/src/gcode/calibrate/G28.cpp | 28 ++++---- Marlin/src/gcode/calibrate/G34_M422.cpp | 2 +- Marlin/src/gcode/control/M605.cpp | 15 ++-- Marlin/src/gcode/feature/pause/M600.cpp | 4 +- Marlin/src/gcode/temp/M104_M109.cpp | 4 +- Marlin/src/libs/L64XX/L64XX_Marlin.cpp | 4 +- Marlin/src/module/motion.cpp | 93 +++++++++++++++---------- Marlin/src/module/motion.h | 13 ++-- Marlin/src/module/stepper.cpp | 37 ++++------ Marlin/src/module/stepper.h | 8 ++- Marlin/src/module/tool_change.cpp | 41 +++++++---- 15 files changed, 152 insertions(+), 132 deletions(-) diff --git a/Marlin/src/feature/pause.cpp b/Marlin/src/feature/pause.cpp index ffc04af91f..dbf27ad8b8 100644 --- a/Marlin/src/feature/pause.cpp +++ b/Marlin/src/feature/pause.cpp @@ -223,8 +223,7 @@ bool load_filament(const float &slow_load_length/*=0*/, const float &fast_load_l #if ENABLED(DUAL_X_CARRIAGE) const int8_t saved_ext = active_extruder; const bool saved_ext_dup_mode = extruder_duplication_enabled; - active_extruder = DXC_ext; - extruder_duplication_enabled = false; + set_duplication_enabled(false, DXC_ext); #endif // Slow Load filament @@ -245,9 +244,7 @@ bool load_filament(const float &slow_load_length/*=0*/, const float &fast_load_l } #if ENABLED(DUAL_X_CARRIAGE) // Tie the two extruders movement back together. - active_extruder = saved_ext; - extruder_duplication_enabled = saved_ext_dup_mode; - stepper.set_directions(); + set_duplication_enabled(saved_ext_dup_mode, saved_ext); #endif #if ENABLED(ADVANCED_PAUSE_CONTINUOUS_PURGE) @@ -439,17 +436,14 @@ bool pause_print(const float &retract, const xyz_pos_t &park_point, const float #if ENABLED(DUAL_X_CARRIAGE) const int8_t saved_ext = active_extruder; const bool saved_ext_dup_mode = extruder_duplication_enabled; - active_extruder = DXC_ext; - extruder_duplication_enabled = false; + set_duplication_enabled(false, DXC_ext); #endif if (unload_length) // Unload the filament unload_filament(unload_length, show_lcd, PAUSE_MODE_CHANGE_FILAMENT); #if ENABLED(DUAL_X_CARRIAGE) - active_extruder = saved_ext; - extruder_duplication_enabled = saved_ext_dup_mode; - stepper.set_directions(); + set_duplication_enabled(saved_ext_dup_mode, saved_ext); #endif return true; @@ -495,8 +489,7 @@ void wait_for_confirmation(const bool is_reload/*=false*/, const int8_t max_beep #if ENABLED(DUAL_X_CARRIAGE) const int8_t saved_ext = active_extruder; const bool saved_ext_dup_mode = extruder_duplication_enabled; - active_extruder = DXC_ext; - extruder_duplication_enabled = false; + set_duplication_enabled(false, DXC_ext); #endif // Wait for filament insert by user and press button @@ -550,9 +543,7 @@ void wait_for_confirmation(const bool is_reload/*=false*/, const int8_t max_beep idle_no_sleep(); } #if ENABLED(DUAL_X_CARRIAGE) - active_extruder = saved_ext; - extruder_duplication_enabled = saved_ext_dup_mode; - stepper.set_directions(); + set_duplication_enabled(saved_ext_dup_mode, saved_ext); #endif } diff --git a/Marlin/src/feature/pause.h b/Marlin/src/feature/pause.h index 016b0ce3f7..c69ed73546 100644 --- a/Marlin/src/feature/pause.h +++ b/Marlin/src/feature/pause.h @@ -89,10 +89,11 @@ bool pause_print(const float &retract, const xyz_pos_t &park_point, const float void wait_for_confirmation(const bool is_reload=false, const int8_t max_beep_count=0 DXC_PARAMS); -void resume_print(const float &slow_load_length=0, const float &fast_load_length=0, const float &extrude_length=ADVANCED_PAUSE_PURGE_LENGTH, const int8_t max_beep_count=0, int16_t targetTemp=0 DXC_PARAMS); +void resume_print(const float &slow_load_length=0, const float &fast_load_length=0, const float &extrude_length=ADVANCED_PAUSE_PURGE_LENGTH, + const int8_t max_beep_count=0, int16_t targetTemp=0 DXC_PARAMS); -bool load_filament(const float &slow_load_length=0, const float &fast_load_length=0, const float &extrude_length=0, const int8_t max_beep_count=0, const bool show_lcd=false, - const bool pause_for_user=false, const PauseMode mode=PAUSE_MODE_PAUSE_PRINT DXC_PARAMS); +bool load_filament(const float &slow_load_length=0, const float &fast_load_length=0, const float &extrude_length=0, const int8_t max_beep_count=0, + const bool show_lcd=false, const bool pause_for_user=false, const PauseMode mode=PAUSE_MODE_PAUSE_PRINT DXC_PARAMS); bool unload_filament(const float &unload_length, const bool show_lcd=false, const PauseMode mode=PAUSE_MODE_PAUSE_PRINT #if BOTH(FILAMENT_UNLOAD_ALL_EXTRUDERS, MIXING_EXTRUDER) diff --git a/Marlin/src/feature/runout.h b/Marlin/src/feature/runout.h index a7f8366849..a5abf057d1 100644 --- a/Marlin/src/feature/runout.h +++ b/Marlin/src/feature/runout.h @@ -237,7 +237,7 @@ class FilamentSensorBase { #if NUM_RUNOUT_SENSORS == 1 UNUSED(extruder); #else - if ( !TERN0(DUAL_X_CARRIAGE, dxc_is_duplicating()) + if ( !TERN0(DUAL_X_CARRIAGE, idex_is_duplicating()) && !TERN0(MULTI_NOZZLE_DUPLICATION, extruder_duplication_enabled) ) return TEST(runout_states, extruder); // A specific extruder ran out #endif diff --git a/Marlin/src/gcode/bedlevel/G35.cpp b/Marlin/src/gcode/bedlevel/G35.cpp index 0ede4e79c6..f6ae2db2c7 100755 --- a/Marlin/src/gcode/bedlevel/G35.cpp +++ b/Marlin/src/gcode/bedlevel/G35.cpp @@ -110,9 +110,8 @@ void GcodeSuite::G35() { tool_change(0, true); #endif - #if HAS_DUPLICATION_MODE - extruder_duplication_enabled = false; - #endif + // Disable duplication mode on homing + TERN_(HAS_DUPLICATION_MODE, set_duplication_enabled(false)); // Home all before this procedure home_all_axes(); diff --git a/Marlin/src/gcode/calibrate/G28.cpp b/Marlin/src/gcode/calibrate/G28.cpp index 3420956803..bccbb9bd16 100644 --- a/Marlin/src/gcode/calibrate/G28.cpp +++ b/Marlin/src/gcode/calibrate/G28.cpp @@ -134,8 +134,8 @@ if (DEBUGGING(LEVELING)) DEBUG_POS("home_z_safely", destination); - // This causes the carriage on Dual X to unpark - TERN_(DUAL_X_CARRIAGE, active_extruder_parked = false); + // Free the active extruder for movement + TERN_(DUAL_X_CARRIAGE, idex_set_parked(false)); TERN_(SENSORLESS_HOMING, safe_delay(500)); // Short delay needed to settle @@ -282,7 +282,7 @@ void GcodeSuite::G28() { tool_change(0, true); #endif - TERN_(HAS_DUPLICATION_MODE, extruder_duplication_enabled = false); + TERN_(HAS_DUPLICATION_MODE, set_duplication_enabled(false)); remember_feedrate_scaling_off(); @@ -342,16 +342,14 @@ void GcodeSuite::G28() { homeaxis(X_AXIS); // Remember this extruder's position for later tool change - inactive_extruder_x_pos = current_position.x; + inactive_extruder_x = current_position.x; // Home the 1st (left) extruder active_extruder = 0; homeaxis(X_AXIS); - // Consider the active extruder to be parked - raised_parked_position = current_position; - delayed_move_time = 0; - active_extruder_parked = true; + // Consider the active extruder to be in its "parked" position + idex_set_parked(); #else @@ -392,7 +390,7 @@ void GcodeSuite::G28() { */ #if ENABLED(DUAL_X_CARRIAGE) - if (dxc_is_duplicating()) { + if (idex_is_duplicating()) { TERN_(IMPROVE_HOMING_RELIABILITY, slow_homing = begin_slow_homing()); @@ -401,19 +399,17 @@ void GcodeSuite::G28() { homeaxis(X_AXIS); // Remember this extruder's position for later tool change - inactive_extruder_x_pos = current_position.x; + inactive_extruder_x = current_position.x; // Home the 1st (left) extruder active_extruder = 0; homeaxis(X_AXIS); // Consider the active extruder to be parked - raised_parked_position = current_position; - delayed_move_time = 0; - active_extruder_parked = true; - extruder_duplication_enabled = IDEX_saved_duplication_state; - dual_x_carriage_mode = IDEX_saved_mode; - stepper.set_directions(); + idex_set_parked(); + + dual_x_carriage_mode = IDEX_saved_mode; + set_duplication_enabled(IDEX_saved_duplication_state); TERN_(IMPROVE_HOMING_RELIABILITY, end_slow_homing(slow_homing)); } diff --git a/Marlin/src/gcode/calibrate/G34_M422.cpp b/Marlin/src/gcode/calibrate/G34_M422.cpp index 24292477f9..3dc63b0655 100644 --- a/Marlin/src/gcode/calibrate/G34_M422.cpp +++ b/Marlin/src/gcode/calibrate/G34_M422.cpp @@ -113,7 +113,7 @@ void GcodeSuite::G34() { tool_change(0, true); #endif - TERN_(HAS_DUPLICATION_MODE, extruder_duplication_enabled = false); + TERN_(HAS_DUPLICATION_MODE, set_duplication_enabled(false)); // In BLTOUCH HS mode, the probe travels in a deployed state. // Users of G34 might have a badly misaligned bed, so raise Z by the diff --git a/Marlin/src/gcode/control/M605.cpp b/Marlin/src/gcode/control/M605.cpp index 5dc36428b5..b1e54b25e7 100644 --- a/Marlin/src/gcode/control/M605.cpp +++ b/Marlin/src/gcode/control/M605.cpp @@ -68,7 +68,7 @@ const DualXMode previous_mode = dual_x_carriage_mode; dual_x_carriage_mode = (DualXMode)parser.value_byte(); - mirrored_duplication_mode = false; + idex_set_mirrored_mode(false); if (dual_x_carriage_mode == DXC_MIRRORED_MODE) { if (previous_mode != DXC_DUPLICATION_MODE) { @@ -77,8 +77,7 @@ dual_x_carriage_mode = DEFAULT_DUAL_X_CARRIAGE_MODE; return; } - mirrored_duplication_mode = true; - stepper.set_directions(); + idex_set_mirrored_mode(true); float x_jog = current_position.x - .1; for (uint8_t i = 2; --i;) { planner.buffer_line(x_jog, current_position.y, current_position.z, current_position.e, feedrate_mm_s, 0); @@ -102,10 +101,8 @@ dual_x_carriage_mode = DEFAULT_DUAL_X_CARRIAGE_MODE; break; } - active_extruder_parked = false; - extruder_duplication_enabled = false; - stepper.set_directions(); - delayed_move_time = 0; + idex_set_parked(false); + set_duplication_enabled(false); } else if (!parser.seen('W')) // if no S or W parameter, the DXC mode gets reset to the user's default dual_x_carriage_mode = DEFAULT_DUAL_X_CARRIAGE_MODE; @@ -125,7 +122,7 @@ if (!active_extruder_parked) DEBUG_ECHOPGM(" NOT "); DEBUG_ECHOPGM(" parked."); DEBUG_ECHOPAIR("\nactive_extruder_x_pos: ", current_position.x); - DEBUG_ECHOPAIR("\ninactive_extruder_x_pos: ", inactive_extruder_x_pos); + DEBUG_ECHOPAIR("\ninactive_extruder_x: ", inactive_extruder_x); DEBUG_ECHOPAIR("\nextruder_duplication_enabled: ", int(extruder_duplication_enabled)); DEBUG_ECHOPAIR("\nduplicate_extruder_x_offset: ", duplicate_extruder_x_offset); DEBUG_ECHOPAIR("\nduplicate_extruder_temp_offset: ", duplicate_extruder_temp_offset); @@ -166,7 +163,7 @@ if (parser.seenval('P')) duplication_e_mask = parser.value_int(); // Set the mask directly else if (parser.seenval('E')) duplication_e_mask = pow(2, parser.value_int() + 1) - 1; // Set the mask by E index ena = (2 == parser.intval('S', extruder_duplication_enabled ? 2 : 0)); - extruder_duplication_enabled = ena && (duplication_e_mask >= 3); + set_duplication_enabled(ena && (duplication_e_mask >= 3)); } SERIAL_ECHO_START(); SERIAL_ECHOPGM(STR_DUPLICATION_MODE); diff --git a/Marlin/src/gcode/feature/pause/M600.cpp b/Marlin/src/gcode/feature/pause/M600.cpp index 7c9be54b29..5f3573ef83 100644 --- a/Marlin/src/gcode/feature/pause/M600.cpp +++ b/Marlin/src/gcode/feature/pause/M600.cpp @@ -87,7 +87,7 @@ void GcodeSuite::M600() { if (!parser.seen('T')) { // If no tool index is specified, M600 was (probably) sent in response to filament runout. // In this case, for duplicating modes set DXC_ext to the extruder that ran out. #if HAS_FILAMENT_SENSOR && NUM_RUNOUT_SENSORS > 1 - if (dxc_is_duplicating()) + if (idex_is_duplicating()) DXC_ext = (READ(FIL_RUNOUT2_PIN) == FIL_RUNOUT_STATE) ? 1 : 0; #else DXC_ext = active_extruder; @@ -108,7 +108,7 @@ void GcodeSuite::M600() { #if HAS_MULTI_EXTRUDER // Change toolhead if specified const uint8_t active_extruder_before_filament_change = active_extruder; - if (active_extruder != target_extruder && TERN1(DUAL_X_CARRIAGE, !dxc_is_duplicating())) + if (active_extruder != target_extruder && TERN1(DUAL_X_CARRIAGE, !idex_is_duplicating())) tool_change(target_extruder, false); #endif diff --git a/Marlin/src/gcode/temp/M104_M109.cpp b/Marlin/src/gcode/temp/M104_M109.cpp index a289983b92..4402728de3 100644 --- a/Marlin/src/gcode/temp/M104_M109.cpp +++ b/Marlin/src/gcode/temp/M104_M109.cpp @@ -94,7 +94,7 @@ void GcodeSuite::M104() { thermalManager.setTargetHotend(temp, target_extruder); #if ENABLED(DUAL_X_CARRIAGE) - if (dxc_is_duplicating() && target_extruder == 0) + if (idex_is_duplicating() && target_extruder == 0) thermalManager.setTargetHotend(temp ? temp + duplicate_extruder_temp_offset : 0, 1); #endif @@ -172,7 +172,7 @@ void GcodeSuite::M109() { thermalManager.setTargetHotend(temp, target_extruder); #if ENABLED(DUAL_X_CARRIAGE) - if (dxc_is_duplicating() && target_extruder == 0) + if (idex_is_duplicating() && target_extruder == 0) thermalManager.setTargetHotend(temp ? temp + duplicate_extruder_temp_offset : 0, 1); #endif diff --git a/Marlin/src/libs/L64XX/L64XX_Marlin.cpp b/Marlin/src/libs/L64XX/L64XX_Marlin.cpp index dd85473e98..8914bc560e 100644 --- a/Marlin/src/libs/L64XX/L64XX_Marlin.cpp +++ b/Marlin/src/libs/L64XX/L64XX_Marlin.cpp @@ -62,11 +62,11 @@ const uint8_t L64XX_Marlin::index_to_dir[MAX_L64XX] = { INVERT_X_DIR, INVERT_Y_DIR, INVERT_Z_DIR , (INVERT_X_DIR) // X2 #if ENABLED(X_DUAL_STEPPER_DRIVERS) - ^ (INVERT_X2_VS_X_DIR) + ^ ENABLED(INVERT_X2_VS_X_DIR) #endif , (INVERT_Y_DIR) // Y2 #if ENABLED(Y_DUAL_STEPPER_DRIVERS) - ^ (INVERT_Y2_VS_Y_DIR) + ^ ENABLED(INVERT_Y2_VS_Y_DIR) #endif , INVERT_Z_DIR, INVERT_Z_DIR, INVERT_Z_DIR // Z2,Z3,Z4 diff --git a/Marlin/src/module/motion.cpp b/Marlin/src/module/motion.cpp index 5b3fab10b1..75a7944c3f 100644 --- a/Marlin/src/module/motion.cpp +++ b/Marlin/src/module/motion.cpp @@ -569,7 +569,7 @@ void restore_feedrate_and_scaling() { soft_endstop.min.x = X2_MIN_POS; soft_endstop.max.x = dual_max_x; } - else if (dxc_is_duplicating()) { + else if (idex_is_duplicating()) { // In Duplication Mode, T0 can move as far left as X1_MIN_POS // but not so far to the right that T1 would move past the end soft_endstop.min.x = X1_MIN_POS; @@ -932,8 +932,7 @@ FORCE_INLINE void segment_idle(millis_t &next_idle_ms) { #endif // !UBL_SEGMENTED #if HAS_DUPLICATION_MODE - bool extruder_duplication_enabled, - mirrored_duplication_mode; + bool extruder_duplication_enabled; #if ENABLED(MULTI_NOZZLE_DUPLICATION) uint8_t duplication_e_mask; // = 0 #endif @@ -942,12 +941,13 @@ FORCE_INLINE void segment_idle(millis_t &next_idle_ms) { #if ENABLED(DUAL_X_CARRIAGE) DualXMode dual_x_carriage_mode = DEFAULT_DUAL_X_CARRIAGE_MODE; - float inactive_extruder_x_pos = X2_MAX_POS, // used in mode 0 & 1 - duplicate_extruder_x_offset = DEFAULT_DUPLICATION_X_OFFSET; // used in mode 2 - xyz_pos_t raised_parked_position; // used in mode 1 - bool active_extruder_parked = false; // used in mode 1 & 2 - millis_t delayed_move_time = 0; // used in mode 1 - int16_t duplicate_extruder_temp_offset = 0; // used in mode 2 + float inactive_extruder_x = X2_MAX_POS, // Used in mode 0 & 1 + duplicate_extruder_x_offset = DEFAULT_DUPLICATION_X_OFFSET; // Used in mode 2 + xyz_pos_t raised_parked_position; // Used in mode 1 + bool active_extruder_parked = false; // Used in mode 1 & 2 + millis_t delayed_move_time = 0; // Used in mode 1 + int16_t duplicate_extruder_temp_offset = 0; // Used in mode 2 + bool idex_mirrored_mode = false; // Used in mode 3 float x_home_pos(const uint8_t extruder) { if (extruder == 0) @@ -962,6 +962,23 @@ FORCE_INLINE void segment_idle(millis_t &next_idle_ms) { return hotend_offset[1].x > 0 ? hotend_offset[1].x : X2_HOME_POS; } + void idex_set_mirrored_mode(const bool mirr) { + idex_mirrored_mode = mirr; + stepper.set_directions(); + } + + void set_duplication_enabled(const bool dupe, const int8_t tool_index/*=-1*/) { + extruder_duplication_enabled = dupe; + if (tool_index >= 0) active_extruder = tool_index; + stepper.set_directions(); + } + + void idex_set_parked(const bool park/*=true*/) { + delayed_move_time = 0; + active_extruder_parked = park; + if (park) raised_parked_position = current_position; // Remember current raised toolhead position for use by unpark + } + /** * Prepare a linear move in a dual X axis setup * @@ -970,9 +987,10 @@ FORCE_INLINE void segment_idle(millis_t &next_idle_ms) { inline bool dual_x_carriage_unpark() { if (active_extruder_parked) { switch (dual_x_carriage_mode) { - case DXC_FULL_CONTROL_MODE: - break; - case DXC_AUTO_PARK_MODE: + + case DXC_FULL_CONTROL_MODE: break; + + case DXC_AUTO_PARK_MODE: { if (current_position.e == destination.e) { // This is a travel move (with no extrusion) // Skip it, but keep track of the current position @@ -984,23 +1002,27 @@ FORCE_INLINE void segment_idle(millis_t &next_idle_ms) { return true; } } - // unpark extruder: 1) raise, 2) move into starting XY position, 3) lower + // + // Un-park the active extruder + // + const feedRate_t fr_zfast = planner.settings.max_feedrate_mm_s[Z_AXIS]; + #define CURPOS current_position + #define RAISED raised_parked_position + // 1. Move to the raised parked XYZ. Presumably the tool is already at XY. + if (planner.buffer_line(RAISED.x, RAISED.y, RAISED.z, CURPOS.e, fr_zfast, active_extruder)) { + // 2. Move to the current native XY and raised Z. Presumably this is a null move. + if (planner.buffer_line(CURPOS.x, CURPOS.y, RAISED.z, CURPOS.e, PLANNER_XY_FEEDRATE(), active_extruder)) { + // 3. Lower Z back down + line_to_current_position(fr_zfast); + } + } + planner.synchronize(); // paranoia + stepper.set_directions(); - #define CUR_X current_position.x - #define CUR_Y current_position.y - #define CUR_Z current_position.z - #define CUR_E current_position.e - #define RAISED_X raised_parked_position.x - #define RAISED_Y raised_parked_position.y - #define RAISED_Z raised_parked_position.z + idex_set_parked(false); + if (DEBUGGING(LEVELING)) DEBUG_ECHOLNPGM("idex_set_parked(false)"); + } break; - if ( planner.buffer_line(RAISED_X, RAISED_Y, RAISED_Z, CUR_E, planner.settings.max_feedrate_mm_s[Z_AXIS], active_extruder)) - if (planner.buffer_line( CUR_X, CUR_Y, RAISED_Z, CUR_E, PLANNER_XY_FEEDRATE(), active_extruder)) - line_to_current_position(planner.settings.max_feedrate_mm_s[Z_AXIS]); - delayed_move_time = 0; - active_extruder_parked = false; - if (DEBUGGING(LEVELING)) DEBUG_ECHOLNPGM("Clear active_extruder_parked"); - break; case DXC_MIRRORED_MODE: case DXC_DUPLICATION_MODE: if (active_extruder == 0) { @@ -1008,22 +1030,23 @@ FORCE_INLINE void segment_idle(millis_t &next_idle_ms) { if (dual_x_carriage_mode == DXC_DUPLICATION_MODE) new_pos.x += duplicate_extruder_x_offset; else - new_pos.x = inactive_extruder_x_pos; - // move duplicate extruder into correct duplication position. - if (DEBUGGING(LEVELING)) DEBUG_ECHOLNPAIR("Set planner X", inactive_extruder_x_pos, " ... Line to X", new_pos.x); - planner.set_position_mm(inactive_extruder_x_pos, current_position.y, current_position.z, current_position.e); + new_pos.x = inactive_extruder_x; + // Move duplicate extruder into correct duplication position. + if (DEBUGGING(LEVELING)) DEBUG_ECHOLNPAIR("Set planner X", inactive_extruder_x, " ... Line to X", new_pos.x); + planner.set_position_mm(inactive_extruder_x, current_position.y, current_position.z, current_position.e); if (!planner.buffer_line(new_pos, planner.settings.max_feedrate_mm_s[X_AXIS], 1)) break; + planner.synchronize(); sync_plan_position(); - extruder_duplication_enabled = true; - active_extruder_parked = false; - if (DEBUGGING(LEVELING)) DEBUG_ECHOLNPGM("Set extruder_duplication_enabled\nClear active_extruder_parked"); + + set_duplication_enabled(true); + idex_set_parked(false); + if (DEBUGGING(LEVELING)) DEBUG_ECHOLNPGM("set_duplication_enabled(true)\nidex_set_parked(false)"); } else if (DEBUGGING(LEVELING)) DEBUG_ECHOLNPGM("Active extruder not 0"); break; } } - stepper.set_directions(); return false; } diff --git a/Marlin/src/module/motion.h b/Marlin/src/module/motion.h index 85b70c057a..5a8a8e0045 100644 --- a/Marlin/src/module/motion.h +++ b/Marlin/src/module/motion.h @@ -384,8 +384,7 @@ bool homing_needed_error(uint8_t axis_bits=0x07); * Duplication mode */ #if HAS_DUPLICATION_MODE - extern bool extruder_duplication_enabled, // Used in Dual X mode 2 - mirrored_duplication_mode; // Used in Dual X mode 3 + extern bool extruder_duplication_enabled; // Used in Dual X mode 2 #if ENABLED(MULTI_NOZZLE_DUPLICATION) extern uint8_t duplication_e_mask; #endif @@ -404,23 +403,29 @@ bool homing_needed_error(uint8_t axis_bits=0x07); }; extern DualXMode dual_x_carriage_mode; - extern float inactive_extruder_x_pos, // Used in mode 0 & 1 + extern float inactive_extruder_x, // Used in mode 0 & 1 duplicate_extruder_x_offset; // Used in mode 2 & 3 extern xyz_pos_t raised_parked_position; // Used in mode 1 extern bool active_extruder_parked; // Used in mode 1, 2 & 3 extern millis_t delayed_move_time; // Used in mode 1 extern int16_t duplicate_extruder_temp_offset; // Used in mode 2 & 3 + extern bool idex_mirrored_mode; // Used in mode 3 - FORCE_INLINE bool dxc_is_duplicating() { return dual_x_carriage_mode >= DXC_DUPLICATION_MODE; } + FORCE_INLINE bool idex_is_duplicating() { return dual_x_carriage_mode >= DXC_DUPLICATION_MODE; } float x_home_pos(const uint8_t extruder); FORCE_INLINE int x_home_dir(const uint8_t extruder) { return extruder ? X2_HOME_DIR : X_HOME_DIR; } + void set_duplication_enabled(const bool dupe, const int8_t tool_index=-1); + void idex_set_mirrored_mode(const bool mirr); + void idex_set_parked(const bool park=true); + #else #if ENABLED(MULTI_NOZZLE_DUPLICATION) enum DualXMode : char { DXC_DUPLICATION_MODE = 2 }; + FORCE_INLINE void set_duplication_enabled(const bool dupe) { extruder_duplication_enabled = dupe; } #endif FORCE_INLINE int x_home_dir(const uint8_t) { return home_dir(X_AXIS); } diff --git a/Marlin/src/module/stepper.cpp b/Marlin/src/module/stepper.cpp index 8a5de4b608..2201577717 100644 --- a/Marlin/src/module/stepper.cpp +++ b/Marlin/src/module/stepper.cpp @@ -348,7 +348,7 @@ xyze_int8_t Stepper::count_direction{0}; } #if ENABLED(X_DUAL_STEPPER_DRIVERS) - #define X_APPLY_DIR(v,Q) do{ X_DIR_WRITE(v); X2_DIR_WRITE((v) != INVERT_X2_VS_X_DIR); }while(0) + #define X_APPLY_DIR(v,Q) do{ X_DIR_WRITE(v); X2_DIR_WRITE((v) ^ ENABLED(INVERT_X2_VS_X_DIR)); }while(0) #if ENABLED(X_DUAL_ENDSTOPS) #define X_APPLY_STEP(v,Q) DUAL_ENDSTOP_APPLY_STEP(X,v) #else @@ -356,7 +356,7 @@ xyze_int8_t Stepper::count_direction{0}; #endif #elif ENABLED(DUAL_X_CARRIAGE) #define X_APPLY_DIR(v,ALWAYS) do{ \ - if (extruder_duplication_enabled || ALWAYS) { X_DIR_WRITE(v); X2_DIR_WRITE(mirrored_duplication_mode ? !(v) : v); } \ + if (extruder_duplication_enabled || ALWAYS) { X_DIR_WRITE(v); X2_DIR_WRITE((v) ^ idex_mirrored_mode); } \ else if (last_moved_extruder) X2_DIR_WRITE(v); else X_DIR_WRITE(v); \ }while(0) #define X_APPLY_STEP(v,ALWAYS) do{ \ @@ -369,7 +369,7 @@ xyze_int8_t Stepper::count_direction{0}; #endif #if ENABLED(Y_DUAL_STEPPER_DRIVERS) - #define Y_APPLY_DIR(v,Q) do{ Y_DIR_WRITE(v); Y2_DIR_WRITE((v) != INVERT_Y2_VS_Y_DIR); }while(0) + #define Y_APPLY_DIR(v,Q) do{ Y_DIR_WRITE(v); Y2_DIR_WRITE((v) ^ ENABLED(INVERT_Y2_VS_Y_DIR)); }while(0) #if ENABLED(Y_DUAL_ENDSTOPS) #define Y_APPLY_STEP(v,Q) DUAL_ENDSTOP_APPLY_STEP(Y,v) #else @@ -1605,10 +1605,9 @@ void Stepper::pulse_phase_isr() { PAGE_SEGMENT_UPDATE(Z, high >> 4); PAGE_SEGMENT_UPDATE(E, high & 0xF); - if (dm != last_direction_bits) { - last_direction_bits = dm; - set_directions(); - } + if (dm != last_direction_bits) + set_directions(dm); + } break; default: break; @@ -2131,9 +2130,7 @@ uint32_t Stepper::block_phase_isr() { MIXER_STEPPER_SETUP(); #endif - #if HAS_MULTI_EXTRUDER - stepper_extruder = current_block->extruder; - #endif + TERN_(HAS_MULTI_EXTRUDER, stepper_extruder = current_block->extruder); // Initialize the trapezoid generator from the current block. #if ENABLED(LIN_ADVANCE) @@ -2151,17 +2148,14 @@ uint32_t Stepper::block_phase_isr() { else LA_isr_rate = LA_ADV_NEVER; #endif - if ( ENABLED(HAS_L64XX) // Always set direction for L64xx (Also enables the chips) + if ( ENABLED(HAS_L64XX) // Always set direction for L64xx (Also enables the chips) + || ENABLED(DUAL_X_CARRIAGE) // TODO: Find out why this fixes "jittery" small circles || current_block->direction_bits != last_direction_bits || TERN(MIXING_EXTRUDER, false, stepper_extruder != last_moved_extruder) ) { - last_direction_bits = current_block->direction_bits; - #if HAS_MULTI_EXTRUDER - last_moved_extruder = stepper_extruder; - #endif - + TERN_(HAS_MULTI_EXTRUDER, last_moved_extruder = stepper_extruder); TERN_(HAS_L64XX, L64XX_OK_to_power_up = true); - set_directions(); + set_directions(current_block->direction_bits); } #if ENABLED(LASER_POWER_INLINE) @@ -2583,12 +2577,9 @@ void Stepper::init() { #endif // Init direction bits for first moves - last_direction_bits = 0 - | (INVERT_X_DIR ? _BV(X_AXIS) : 0) - | (INVERT_Y_DIR ? _BV(Y_AXIS) : 0) - | (INVERT_Z_DIR ? _BV(Z_AXIS) : 0); - - set_directions(); + set_directions((INVERT_X_DIR ? _BV(X_AXIS) : 0) + | (INVERT_Y_DIR ? _BV(Y_AXIS) : 0) + | (INVERT_Z_DIR ? _BV(Z_AXIS) : 0)); #if HAS_MOTOR_CURRENT_SPI || HAS_MOTOR_CURRENT_PWM initialized = true; diff --git a/Marlin/src/module/stepper.h b/Marlin/src/module/stepper.h index 572c3f3f9b..639a1b2650 100644 --- a/Marlin/src/module/stepper.h +++ b/Marlin/src/module/stepper.h @@ -514,9 +514,15 @@ class Stepper { static void refresh_motor_power(); #endif - // Set direction bits for all steppers + // Update direction states for all steppers static void set_directions(); + // Set direction bits and update all stepper DIR states + static void set_directions(const uint8_t bits) { + last_direction_bits = bits; + set_directions(); + } + private: // Set the current position in steps diff --git a/Marlin/src/module/tool_change.cpp b/Marlin/src/module/tool_change.cpp index 4ab818f41d..968e654aa3 100644 --- a/Marlin/src/module/tool_change.cpp +++ b/Marlin/src/module/tool_change.cpp @@ -61,6 +61,10 @@ #include "../gcode/gcode.h" #endif +#if ENABLED(DUAL_X_CARRIAGE) + #include "stepper.h" +#endif + #if ANY(SWITCHING_EXTRUDER, SWITCHING_NOZZLE, SWITCHING_TOOLHEAD) #include "servo.h" #endif @@ -701,6 +705,13 @@ inline void fast_line_to_current(const AxisEnum fr_axis) { _line_to_current(fr_a #if ENABLED(DUAL_X_CARRIAGE) + /** + * @brief Dual X Tool Change + * @details Change tools, with extra behavior based on current mode + * + * @param new_tool Tool index to activate + * @param no_move Flag indicating no moves should take place + */ inline void dualx_tool_change(const uint8_t new_tool, bool &no_move) { DEBUG_ECHOPGM("Dual X Carriage Mode "); @@ -711,17 +722,16 @@ inline void fast_line_to_current(const AxisEnum fr_axis) { _line_to_current(fr_a case DXC_MIRRORED_MODE: DEBUG_ECHOLNPGM("MIRRORED"); break; } + // Get the home position of the currently-active tool const float xhome = x_home_pos(active_extruder); - if (dual_x_carriage_mode == DXC_AUTO_PARK_MODE - && IsRunning() && !no_move - && (delayed_move_time || current_position.x != xhome) + + if (dual_x_carriage_mode == DXC_AUTO_PARK_MODE // If Auto-Park mode is enabled + && IsRunning() && !no_move // ...and movement is permitted + && (delayed_move_time || current_position.x != xhome) // ...and delayed_move_time is set OR not "already parked"... ) { - DEBUG_ECHOLNPAIR("MoveX to ", xhome); - - // Park old head current_position.x = xhome; - line_to_current_position(planner.settings.max_feedrate_mm_s[X_AXIS]); + line_to_current_position(planner.settings.max_feedrate_mm_s[X_AXIS]); // Park the current head planner.synchronize(); } @@ -736,20 +746,21 @@ inline void fast_line_to_current(const AxisEnum fr_axis) { _line_to_current(fr_a switch (dual_x_carriage_mode) { case DXC_FULL_CONTROL_MODE: // New current position is the position of the activated extruder - current_position.x = inactive_extruder_x_pos; + current_position.x = inactive_extruder_x; // Save the inactive extruder's position (from the old current_position) - inactive_extruder_x_pos = destination.x; + inactive_extruder_x = destination.x; + DEBUG_ECHOLNPAIR("DXC Full Control curr.x=", current_position.x, " dest.x=", destination.x); break; case DXC_AUTO_PARK_MODE: - // record current raised toolhead position for use by unpark - raised_parked_position = current_position; - active_extruder_parked = true; - delayed_move_time = 0; + idex_set_parked(); break; default: break; } + // Ensure X axis DIR pertains to the correct carriage + stepper.set_directions(); + DEBUG_ECHOLNPAIR("Active extruder parked: ", active_extruder_parked ? "yes" : "no"); DEBUG_POS("New extruder (parked)", current_position); } @@ -875,7 +886,7 @@ void tool_change(const uint8_t new_tool, bool no_move/*=false*/) { planner.synchronize(); #if ENABLED(DUAL_X_CARRIAGE) // Only T0 allowed if the Printer is in DXC_DUPLICATION_MODE or DXC_MIRRORED_MODE - if (new_tool != 0 && dxc_is_duplicating()) + if (new_tool != 0 && idex_is_duplicating()) return invalid_extruder_error(new_tool); #endif @@ -1151,7 +1162,7 @@ void tool_change(const uint8_t new_tool, bool no_move/*=false*/) { } #endif - TERN_(DUAL_X_CARRIAGE, active_extruder_parked = false); + TERN_(DUAL_X_CARRIAGE, idex_set_parked(false)); } #if ENABLED(SWITCHING_NOZZLE) From 050ba0e0a09312f9ce46de1b92ee09f9f792228d Mon Sep 17 00:00:00 2001 From: Jason Smith Date: Fri, 16 Oct 2020 15:04:10 -0700 Subject: [PATCH 047/226] LCD conditionals followup (#19766) --- Marlin/src/inc/Conditionals_post.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Marlin/src/inc/Conditionals_post.h b/Marlin/src/inc/Conditionals_post.h index 581b36932a..3587d82cda 100644 --- a/Marlin/src/inc/Conditionals_post.h +++ b/Marlin/src/inc/Conditionals_post.h @@ -2614,14 +2614,14 @@ #if HAS_MARLINUI_U8GLIB #define LCD_WIDTH 21 #else - #define LCD_WIDTH TERN(ULTIPANEL, 20, 16) + #define LCD_WIDTH TERN(IS_ULTIPANEL, 20, 16) #endif #endif #ifndef LCD_HEIGHT #if HAS_MARLINUI_U8GLIB #define LCD_HEIGHT 5 #else - #define LCD_HEIGHT TERN(ULTIPANEL, 4, 2) + #define LCD_HEIGHT TERN(IS_ULTIPANEL, 4, 2) #endif #endif #endif From 3ed0b24831adf6b89234f7684b5907561fd13f89 Mon Sep 17 00:00:00 2001 From: arminth Date: Sat, 17 Oct 2020 00:07:34 +0200 Subject: [PATCH 048/226] Provide FYSETC F6 13 LCD pins for HD44780 (#19769) --- Marlin/src/pins/ramps/pins_FYSETC_F6_13.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Marlin/src/pins/ramps/pins_FYSETC_F6_13.h b/Marlin/src/pins/ramps/pins_FYSETC_F6_13.h index 9e4ee10096..80eb3f1534 100644 --- a/Marlin/src/pins/ramps/pins_FYSETC_F6_13.h +++ b/Marlin/src/pins/ramps/pins_FYSETC_F6_13.h @@ -261,7 +261,7 @@ #define NEOPIXEL_PIN 25 #endif - #elif HAS_MARLINUI_U8GLIB + #elif HAS_MARLINUI_U8GLIB || HAS_MARLINUI_HD44780 #define LCD_PINS_RS 16 #define LCD_PINS_ENABLE 17 From 1e13a7161acf25106c3753cb7554e947d0e66497 Mon Sep 17 00:00:00 2001 From: thinkyhead Date: Sat, 17 Oct 2020 00:15:41 +0000 Subject: [PATCH 049/226] [cron] Bump distribution date (2020-10-17) --- Marlin/src/inc/Version.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Marlin/src/inc/Version.h b/Marlin/src/inc/Version.h index a2901a4628..7aadf66a22 100644 --- a/Marlin/src/inc/Version.h +++ b/Marlin/src/inc/Version.h @@ -42,7 +42,7 @@ * version was tagged. */ #ifndef STRING_DISTRIBUTION_DATE - #define STRING_DISTRIBUTION_DATE "2020-10-16" + #define STRING_DISTRIBUTION_DATE "2020-10-17" #endif /** From 0f6fc48f8536081265a19950a0df7ed3f3de7571 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Fri, 16 Oct 2020 19:54:59 -0500 Subject: [PATCH 050/226] touch_ms followup --- Marlin/src/lcd/tft/touch.cpp | 8 ++++---- Marlin/src/lcd/tft/touch.h | 5 +---- 2 files changed, 5 insertions(+), 8 deletions(-) diff --git a/Marlin/src/lcd/tft/touch.cpp b/Marlin/src/lcd/tft/touch.cpp index 3ecf481ed1..e3cd26a392 100644 --- a/Marlin/src/lcd/tft/touch.cpp +++ b/Marlin/src/lcd/tft/touch.cpp @@ -40,10 +40,10 @@ int16_t Touch::x, Touch::y; touch_control_t Touch::controls[]; touch_control_t *Touch::current_control; uint16_t Touch::controls_count; -millis_t Touch::last_touch_ms = 0; -millis_t Touch::time_to_hold; -millis_t Touch::repeat_delay; -millis_t Touch::touch_time; +millis_t Touch::last_touch_ms = 0, + Touch::time_to_hold, + Touch::repeat_delay, + Touch::touch_time; TouchControlType Touch::touch_control_type = NONE; touch_calibration_t Touch::calibration; #if ENABLED(TOUCH_SCREEN_CALIBRATION) diff --git a/Marlin/src/lcd/tft/touch.h b/Marlin/src/lcd/tft/touch.h index b2c7a21ba1..17aa5bdd97 100644 --- a/Marlin/src/lcd/tft/touch.h +++ b/Marlin/src/lcd/tft/touch.h @@ -140,10 +140,7 @@ class Touch { static touch_control_t *current_control; static uint16_t controls_count; - static millis_t now; - static millis_t time_to_hold; - static millis_t repeat_delay; - static millis_t touch_time; + static millis_t last_touch_ms, time_to_hold, repeat_delay, touch_time; static TouchControlType touch_control_type; static inline bool get_point(int16_t *x, int16_t *y); From eaf6777a6643a6fab23ceaaa4699cb2466ea6b83 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Fri, 16 Oct 2020 19:36:25 -0500 Subject: [PATCH 051/226] Rename ultralcd => marlinui --- Marlin/src/HAL/DUE/dogm/u8g_com_HAL_DUE_st7920_sw_spi.cpp | 2 +- Marlin/src/MarlinCore.cpp | 2 +- Marlin/src/feature/bedlevel/bedlevel.cpp | 2 +- Marlin/src/feature/bedlevel/ubl/ubl_G29.cpp | 2 +- Marlin/src/feature/cancel_object.cpp | 2 +- Marlin/src/feature/hotend_idle.cpp | 2 +- Marlin/src/feature/mmu2/mmu2.cpp | 2 +- Marlin/src/feature/password/password.h | 2 +- Marlin/src/feature/pause.cpp | 2 +- Marlin/src/feature/power_monitor.cpp | 2 +- Marlin/src/feature/powerloss.cpp | 2 +- Marlin/src/feature/tmc_util.h | 2 +- Marlin/src/gcode/bedlevel/G26.cpp | 2 +- Marlin/src/gcode/bedlevel/abl/G29.cpp | 2 +- Marlin/src/gcode/bedlevel/mbl/G29.cpp | 2 +- Marlin/src/gcode/calibrate/G28.cpp | 2 +- Marlin/src/gcode/calibrate/G33.cpp | 2 +- Marlin/src/gcode/calibrate/G425.cpp | 2 +- Marlin/src/gcode/calibrate/G76_M192_M871.cpp | 2 +- Marlin/src/gcode/calibrate/M48.cpp | 2 +- Marlin/src/gcode/config/M43.cpp | 2 +- Marlin/src/gcode/control/M17_M18_M84.cpp | 2 +- Marlin/src/gcode/control/M80_M81.cpp | 2 +- Marlin/src/gcode/control/M999.cpp | 2 +- Marlin/src/gcode/feature/pause/M125.cpp | 2 +- Marlin/src/gcode/feature/pause/M600.cpp | 2 +- Marlin/src/gcode/feature/pause/M701_M702.cpp | 2 +- Marlin/src/gcode/feature/powerloss/M1000.cpp | 2 +- Marlin/src/gcode/feature/powerloss/M413.cpp | 2 +- Marlin/src/gcode/geometry/M206_M428.cpp | 2 +- Marlin/src/gcode/lcd/M0_M1.cpp | 2 +- Marlin/src/gcode/lcd/M117.cpp | 2 +- Marlin/src/gcode/lcd/M145.cpp | 2 +- Marlin/src/gcode/lcd/M250.cpp | 2 +- Marlin/src/gcode/lcd/M300.cpp | 2 +- Marlin/src/gcode/lcd/M73.cpp | 2 +- Marlin/src/gcode/motion/G4.cpp | 2 +- Marlin/src/gcode/queue.cpp | 2 +- Marlin/src/gcode/sd/M1001.cpp | 2 +- Marlin/src/gcode/sd/M23.cpp | 2 +- Marlin/src/gcode/sd/M24_M25.cpp | 2 +- Marlin/src/gcode/stats/M31.cpp | 2 +- Marlin/src/gcode/stats/M75-M78.cpp | 2 +- Marlin/src/gcode/temp/M104_M109.cpp | 2 +- Marlin/src/gcode/temp/M106_M107.cpp | 2 +- Marlin/src/gcode/temp/M140_M190.cpp | 2 +- Marlin/src/gcode/temp/M141_M191.cpp | 2 +- Marlin/src/gcode/temp/M303.cpp | 2 +- Marlin/src/lcd/HD44780/lcdprint_hd44780.cpp | 4 ++-- .../{ultralcd_HD44780.cpp => marlinui_HD44780.cpp} | 6 +++--- .../HD44780/{ultralcd_HD44780.h => marlinui_HD44780.h} | 0 Marlin/src/lcd/TFTGLCD/lcdprint_TFTGLCD.cpp | 4 ++-- .../{ultralcd_TFTGLCD.cpp => marlinui_TFTGLCD.cpp} | 6 +++--- .../TFTGLCD/{ultralcd_TFTGLCD.h => marlinui_TFTGLCD.h} | 0 Marlin/src/lcd/dogm/dogm_Statusscreen.h | 2 +- Marlin/src/lcd/dogm/lcdprint_u8g.cpp | 4 ++-- .../src/lcd/dogm/{ultralcd_DOGM.cpp => marlinui_DOGM.cpp} | 6 +++--- Marlin/src/lcd/dogm/{ultralcd_DOGM.h => marlinui_DOGM.h} | 2 +- Marlin/src/lcd/dogm/status_screen_DOGM.cpp | 4 ++-- Marlin/src/lcd/dogm/status_screen_lite_ST7920.cpp | 2 +- Marlin/src/lcd/dogm/u8g_dev_tft_upscale_from_128x64.cpp | 2 +- Marlin/src/lcd/dwin/e3v2/dwin.cpp | 2 +- Marlin/src/lcd/extui/lib/dgus/fysetc/DGUSDisplayDef.cpp | 2 +- Marlin/src/lcd/extui/lib/dgus/hiprecy/DGUSDisplayDef.cpp | 2 +- Marlin/src/lcd/extui/lib/dgus/origin/DGUSDisplayDef.cpp | 2 +- Marlin/src/lcd/extui/lib/mks_ui/draw_printing.cpp | 2 +- .../src/lcd/extui/lib/mks_ui/tft_lvgl_configuration.cpp | 2 +- Marlin/src/lcd/extui/lib/mks_ui/wifi_module.cpp | 2 +- Marlin/src/lcd/extui/malyan_lcd.cpp | 2 +- Marlin/src/lcd/extui/ui_api.cpp | 8 +++----- Marlin/src/lcd/fontutils.cpp | 2 +- Marlin/src/lcd/{ultralcd.cpp => marlinui.cpp} | 4 ++-- Marlin/src/lcd/{ultralcd.h => marlinui.h} | 0 Marlin/src/lcd/menu/game/game.h | 4 ++-- Marlin/src/lcd/menu/menu.h | 2 +- Marlin/src/lcd/menu/menu_item.h | 2 +- Marlin/src/lcd/menu/menu_touch_screen.cpp | 2 +- Marlin/src/lcd/menu/menu_tune.cpp | 2 +- Marlin/src/lcd/tft/touch.cpp | 2 +- Marlin/src/lcd/tft/ui_320x240.cpp | 2 +- Marlin/src/lcd/tft/ui_480x320.cpp | 2 +- Marlin/src/lcd/touch/touch_buttons.cpp | 2 +- Marlin/src/module/delta.cpp | 2 +- Marlin/src/module/endstops.cpp | 2 +- Marlin/src/module/motion.cpp | 4 ++-- Marlin/src/module/planner.cpp | 2 +- Marlin/src/module/probe.cpp | 2 +- Marlin/src/module/settings.cpp | 2 +- Marlin/src/module/stepper.cpp | 2 +- Marlin/src/module/temperature.cpp | 2 +- Marlin/src/module/tool_change.cpp | 2 +- Marlin/src/sd/cardreader.cpp | 2 +- Marlin/src/sd/usb_flashdrive/Sd2Card_FlashDrive.cpp | 2 +- 93 files changed, 105 insertions(+), 107 deletions(-) rename Marlin/src/lcd/HD44780/{ultralcd_HD44780.cpp => marlinui_HD44780.cpp} (99%) rename Marlin/src/lcd/HD44780/{ultralcd_HD44780.h => marlinui_HD44780.h} (100%) rename Marlin/src/lcd/TFTGLCD/{ultralcd_TFTGLCD.cpp => marlinui_TFTGLCD.cpp} (99%) rename Marlin/src/lcd/TFTGLCD/{ultralcd_TFTGLCD.h => marlinui_TFTGLCD.h} (100%) rename Marlin/src/lcd/dogm/{ultralcd_DOGM.cpp => marlinui_DOGM.cpp} (99%) rename Marlin/src/lcd/dogm/{ultralcd_DOGM.h => marlinui_DOGM.h} (99%) rename Marlin/src/lcd/{ultralcd.cpp => marlinui.cpp} (99%) rename Marlin/src/lcd/{ultralcd.h => marlinui.h} (100%) diff --git a/Marlin/src/HAL/DUE/dogm/u8g_com_HAL_DUE_st7920_sw_spi.cpp b/Marlin/src/HAL/DUE/dogm/u8g_com_HAL_DUE_st7920_sw_spi.cpp index 47060d6a5b..7df180cbaa 100644 --- a/Marlin/src/HAL/DUE/dogm/u8g_com_HAL_DUE_st7920_sw_spi.cpp +++ b/Marlin/src/HAL/DUE/dogm/u8g_com_HAL_DUE_st7920_sw_spi.cpp @@ -145,7 +145,7 @@ uint8_t u8g_com_HAL_DUE_ST7920_sw_spi_fn(u8g_t *u8g, uint8_t msg, uint8_t arg_va } #if ENABLED(LIGHTWEIGHT_UI) - #include "../../../lcd/ultralcd.h" + #include "../../../lcd/marlinui.h" #include "../../shared/HAL_ST7920.h" #define ST7920_CS_PIN LCD_PINS_RS diff --git a/Marlin/src/MarlinCore.cpp b/Marlin/src/MarlinCore.cpp index 3a20cf3ee3..786a847fa6 100644 --- a/Marlin/src/MarlinCore.cpp +++ b/Marlin/src/MarlinCore.cpp @@ -59,7 +59,7 @@ #include "sd/cardreader.h" -#include "lcd/ultralcd.h" +#include "lcd/marlinui.h" #if HAS_TOUCH_XPT2046 #include "lcd/touch/touch_buttons.h" #endif diff --git a/Marlin/src/feature/bedlevel/bedlevel.cpp b/Marlin/src/feature/bedlevel/bedlevel.cpp index 3e9225b7f9..0e0b87e890 100644 --- a/Marlin/src/feature/bedlevel/bedlevel.cpp +++ b/Marlin/src/feature/bedlevel/bedlevel.cpp @@ -36,7 +36,7 @@ #endif #if ENABLED(LCD_BED_LEVELING) - #include "../../lcd/ultralcd.h" + #include "../../lcd/marlinui.h" #endif #define DEBUG_OUT ENABLED(DEBUG_LEVELING_FEATURE) diff --git a/Marlin/src/feature/bedlevel/ubl/ubl_G29.cpp b/Marlin/src/feature/bedlevel/ubl/ubl_G29.cpp index e41af9f3cd..ea2e62dd51 100644 --- a/Marlin/src/feature/bedlevel/ubl/ubl_G29.cpp +++ b/Marlin/src/feature/bedlevel/ubl/ubl_G29.cpp @@ -30,7 +30,7 @@ #include "../../../HAL/shared/eeprom_api.h" #include "../../../libs/hex_print.h" #include "../../../module/settings.h" - #include "../../../lcd/ultralcd.h" + #include "../../../lcd/marlinui.h" #include "../../../module/stepper.h" #include "../../../module/planner.h" #include "../../../module/motion.h" diff --git a/Marlin/src/feature/cancel_object.cpp b/Marlin/src/feature/cancel_object.cpp index 16f876f136..853e765b66 100644 --- a/Marlin/src/feature/cancel_object.cpp +++ b/Marlin/src/feature/cancel_object.cpp @@ -25,7 +25,7 @@ #include "cancel_object.h" #include "../gcode/gcode.h" -#include "../lcd/ultralcd.h" +#include "../lcd/marlinui.h" CancelObject cancelable; diff --git a/Marlin/src/feature/hotend_idle.cpp b/Marlin/src/feature/hotend_idle.cpp index 9d5594c2f1..7f8f20a047 100644 --- a/Marlin/src/feature/hotend_idle.cpp +++ b/Marlin/src/feature/hotend_idle.cpp @@ -34,7 +34,7 @@ #include "../module/temperature.h" #include "../module/motion.h" -#include "../lcd/ultralcd.h" +#include "../lcd/marlinui.h" extern HotendIdleProtection hotend_idle; diff --git a/Marlin/src/feature/mmu2/mmu2.cpp b/Marlin/src/feature/mmu2/mmu2.cpp index 3d635369e4..c5cf485850 100644 --- a/Marlin/src/feature/mmu2/mmu2.cpp +++ b/Marlin/src/feature/mmu2/mmu2.cpp @@ -30,7 +30,7 @@ MMU2 mmu2; #include "../../gcode/gcode.h" -#include "../../lcd/ultralcd.h" +#include "../../lcd/marlinui.h" #include "../../libs/buzzer.h" #include "../../libs/nozzle.h" #include "../../module/temperature.h" diff --git a/Marlin/src/feature/password/password.h b/Marlin/src/feature/password/password.h index 3ed584b29d..3c223b6a82 100644 --- a/Marlin/src/feature/password/password.h +++ b/Marlin/src/feature/password/password.h @@ -21,7 +21,7 @@ */ #pragma once -#include "../../lcd/ultralcd.h" +#include "../../lcd/marlinui.h" class Password { public: diff --git a/Marlin/src/feature/pause.cpp b/Marlin/src/feature/pause.cpp index dbf27ad8b8..6f970d1a4c 100644 --- a/Marlin/src/feature/pause.cpp +++ b/Marlin/src/feature/pause.cpp @@ -55,7 +55,7 @@ #include "../lcd/extui/ui_api.h" #endif -#include "../lcd/ultralcd.h" +#include "../lcd/marlinui.h" #if HAS_BUZZER #include "../libs/buzzer.h" diff --git a/Marlin/src/feature/power_monitor.cpp b/Marlin/src/feature/power_monitor.cpp index af31d156fc..e1e7324fb6 100644 --- a/Marlin/src/feature/power_monitor.cpp +++ b/Marlin/src/feature/power_monitor.cpp @@ -26,7 +26,7 @@ #include "power_monitor.h" -#include "../lcd/ultralcd.h" +#include "../lcd/marlinui.h" #include "../lcd/lcdprint.h" #include "../libs/numtostr.h" diff --git a/Marlin/src/feature/powerloss.cpp b/Marlin/src/feature/powerloss.cpp index e4bc605bb5..874bcff46d 100644 --- a/Marlin/src/feature/powerloss.cpp +++ b/Marlin/src/feature/powerloss.cpp @@ -45,7 +45,7 @@ uint32_t PrintJobRecovery::cmd_sdpos, // = 0 #endif #include "../sd/cardreader.h" -#include "../lcd/ultralcd.h" +#include "../lcd/marlinui.h" #include "../gcode/queue.h" #include "../gcode/gcode.h" #include "../module/motion.h" diff --git a/Marlin/src/feature/tmc_util.h b/Marlin/src/feature/tmc_util.h index b65a1254c6..187cfda483 100644 --- a/Marlin/src/feature/tmc_util.h +++ b/Marlin/src/feature/tmc_util.h @@ -22,7 +22,7 @@ #pragma once #include "../inc/MarlinConfig.h" -#include "../lcd/ultralcd.h" +#include "../lcd/marlinui.h" #if HAS_TRINAMIC_CONFIG diff --git a/Marlin/src/gcode/bedlevel/G26.cpp b/Marlin/src/gcode/bedlevel/G26.cpp index 661128b04e..6123fbf6c8 100644 --- a/Marlin/src/gcode/bedlevel/G26.cpp +++ b/Marlin/src/gcode/bedlevel/G26.cpp @@ -111,7 +111,7 @@ #include "../../module/motion.h" #include "../../module/tool_change.h" #include "../../module/temperature.h" -#include "../../lcd/ultralcd.h" +#include "../../lcd/marlinui.h" #define EXTRUSION_MULTIPLIER 1.0 #define PRIME_LENGTH 10.0 diff --git a/Marlin/src/gcode/bedlevel/abl/G29.cpp b/Marlin/src/gcode/bedlevel/abl/G29.cpp index f7de6c8cee..fcdab742cf 100644 --- a/Marlin/src/gcode/bedlevel/abl/G29.cpp +++ b/Marlin/src/gcode/bedlevel/abl/G29.cpp @@ -42,7 +42,7 @@ #endif #if HAS_DISPLAY - #include "../../../lcd/ultralcd.h" + #include "../../../lcd/marlinui.h" #endif #if ENABLED(AUTO_BED_LEVELING_LINEAR) diff --git a/Marlin/src/gcode/bedlevel/mbl/G29.cpp b/Marlin/src/gcode/bedlevel/mbl/G29.cpp index d94c16052b..d5cc8a4fcb 100644 --- a/Marlin/src/gcode/bedlevel/mbl/G29.cpp +++ b/Marlin/src/gcode/bedlevel/mbl/G29.cpp @@ -34,7 +34,7 @@ #include "../../queue.h" #include "../../../libs/buzzer.h" -#include "../../../lcd/ultralcd.h" +#include "../../../lcd/marlinui.h" #include "../../../module/motion.h" #include "../../../module/stepper.h" diff --git a/Marlin/src/gcode/calibrate/G28.cpp b/Marlin/src/gcode/calibrate/G28.cpp index bccbb9bd16..06b9fee257 100644 --- a/Marlin/src/gcode/calibrate/G28.cpp +++ b/Marlin/src/gcode/calibrate/G28.cpp @@ -45,7 +45,7 @@ #include "../../feature/bltouch.h" #endif -#include "../../lcd/ultralcd.h" +#include "../../lcd/marlinui.h" #if ENABLED(DWIN_CREALITY_LCD) #include "../../lcd/dwin/e3v2/dwin.h" #endif diff --git a/Marlin/src/gcode/calibrate/G33.cpp b/Marlin/src/gcode/calibrate/G33.cpp index 53af04d528..77cc45771c 100644 --- a/Marlin/src/gcode/calibrate/G33.cpp +++ b/Marlin/src/gcode/calibrate/G33.cpp @@ -29,7 +29,7 @@ #include "../../module/motion.h" #include "../../module/stepper.h" #include "../../module/endstops.h" -#include "../../lcd/ultralcd.h" +#include "../../lcd/marlinui.h" #if HAS_BED_PROBE #include "../../module/probe.h" diff --git a/Marlin/src/gcode/calibrate/G425.cpp b/Marlin/src/gcode/calibrate/G425.cpp index 8968f78999..6517e6b4bd 100644 --- a/Marlin/src/gcode/calibrate/G425.cpp +++ b/Marlin/src/gcode/calibrate/G425.cpp @@ -30,7 +30,7 @@ #include "../../feature/backlash.h" #endif -#include "../../lcd/ultralcd.h" +#include "../../lcd/marlinui.h" #include "../../module/motion.h" #include "../../module/planner.h" #include "../../module/tool_change.h" diff --git a/Marlin/src/gcode/calibrate/G76_M192_M871.cpp b/Marlin/src/gcode/calibrate/G76_M192_M871.cpp index 89393b4582..38f17869fb 100644 --- a/Marlin/src/gcode/calibrate/G76_M192_M871.cpp +++ b/Marlin/src/gcode/calibrate/G76_M192_M871.cpp @@ -37,7 +37,7 @@ #include "../../module/probe.h" #include "../../feature/probe_temp_comp.h" -#include "../../lcd/ultralcd.h" +#include "../../lcd/marlinui.h" #include "../../MarlinCore.h" // for wait_for_heatup and idle() #if ENABLED(PRINTJOB_TIMER_AUTOSTART) diff --git a/Marlin/src/gcode/calibrate/M48.cpp b/Marlin/src/gcode/calibrate/M48.cpp index 8640dfa391..e70815ad54 100644 --- a/Marlin/src/gcode/calibrate/M48.cpp +++ b/Marlin/src/gcode/calibrate/M48.cpp @@ -27,7 +27,7 @@ #include "../gcode.h" #include "../../module/motion.h" #include "../../module/probe.h" -#include "../../lcd/ultralcd.h" +#include "../../lcd/marlinui.h" #include "../../feature/bedlevel/bedlevel.h" diff --git a/Marlin/src/gcode/config/M43.cpp b/Marlin/src/gcode/config/M43.cpp index 1e780ca05a..005fdf0f31 100644 --- a/Marlin/src/gcode/config/M43.cpp +++ b/Marlin/src/gcode/config/M43.cpp @@ -47,7 +47,7 @@ #endif #if HAS_RESUME_CONTINUE - #include "../../lcd/ultralcd.h" + #include "../../lcd/marlinui.h" #endif #ifndef GET_PIN_MAP_PIN_M43 diff --git a/Marlin/src/gcode/control/M17_M18_M84.cpp b/Marlin/src/gcode/control/M17_M18_M84.cpp index 499feef715..b35b465331 100644 --- a/Marlin/src/gcode/control/M17_M18_M84.cpp +++ b/Marlin/src/gcode/control/M17_M18_M84.cpp @@ -22,7 +22,7 @@ #include "../gcode.h" #include "../../MarlinCore.h" // for stepper_inactive_time, disable_e_steppers -#include "../../lcd/ultralcd.h" +#include "../../lcd/marlinui.h" #include "../../module/stepper.h" #if ENABLED(AUTO_BED_LEVELING_UBL) diff --git a/Marlin/src/gcode/control/M80_M81.cpp b/Marlin/src/gcode/control/M80_M81.cpp index 6302bb5c67..a8f7f7c10b 100644 --- a/Marlin/src/gcode/control/M80_M81.cpp +++ b/Marlin/src/gcode/control/M80_M81.cpp @@ -25,7 +25,7 @@ #include "../../module/temperature.h" #include "../../module/planner.h" // for planner.finish_and_disable #include "../../module/printcounter.h" // for print_job_timer.stop -#include "../../lcd/ultralcd.h" // for LCD_MESSAGEPGM_P +#include "../../lcd/marlinui.h" // for LCD_MESSAGEPGM_P #include "../../inc/MarlinConfig.h" diff --git a/Marlin/src/gcode/control/M999.cpp b/Marlin/src/gcode/control/M999.cpp index 3bd908cad6..7487b4cf6e 100644 --- a/Marlin/src/gcode/control/M999.cpp +++ b/Marlin/src/gcode/control/M999.cpp @@ -22,7 +22,7 @@ #include "../gcode.h" -#include "../../lcd/ultralcd.h" // for lcd_reset_alert_level +#include "../../lcd/marlinui.h" // for lcd_reset_alert_level #include "../../MarlinCore.h" // for marlin_state #include "../queue.h" // for flush_and_request_resend diff --git a/Marlin/src/gcode/feature/pause/M125.cpp b/Marlin/src/gcode/feature/pause/M125.cpp index db78e870d7..ed9a393310 100644 --- a/Marlin/src/gcode/feature/pause/M125.cpp +++ b/Marlin/src/gcode/feature/pause/M125.cpp @@ -32,7 +32,7 @@ #include "../../../module/printcounter.h" #if HAS_LCD_MENU - #include "../../../lcd/ultralcd.h" + #include "../../../lcd/marlinui.h" #endif #if ENABLED(POWER_LOSS_RECOVERY) diff --git a/Marlin/src/gcode/feature/pause/M600.cpp b/Marlin/src/gcode/feature/pause/M600.cpp index 5f3573ef83..0af68333ca 100644 --- a/Marlin/src/gcode/feature/pause/M600.cpp +++ b/Marlin/src/gcode/feature/pause/M600.cpp @@ -34,7 +34,7 @@ #endif #if HAS_LCD_MENU - #include "../../../lcd/ultralcd.h" + #include "../../../lcd/marlinui.h" #endif #if ENABLED(MMU2_MENUS) diff --git a/Marlin/src/gcode/feature/pause/M701_M702.cpp b/Marlin/src/gcode/feature/pause/M701_M702.cpp index c1f7223142..a193d83d40 100644 --- a/Marlin/src/gcode/feature/pause/M701_M702.cpp +++ b/Marlin/src/gcode/feature/pause/M701_M702.cpp @@ -35,7 +35,7 @@ #endif #if HAS_LCD_MENU - #include "../../../lcd/ultralcd.h" + #include "../../../lcd/marlinui.h" #endif #if ENABLED(PRUSA_MMU2) diff --git a/Marlin/src/gcode/feature/powerloss/M1000.cpp b/Marlin/src/gcode/feature/powerloss/M1000.cpp index e9477dd2fb..14c92531fa 100644 --- a/Marlin/src/gcode/feature/powerloss/M1000.cpp +++ b/Marlin/src/gcode/feature/powerloss/M1000.cpp @@ -27,7 +27,7 @@ #include "../../gcode.h" #include "../../../feature/powerloss.h" #include "../../../module/motion.h" -#include "../../../lcd/ultralcd.h" +#include "../../../lcd/marlinui.h" #if ENABLED(EXTENSIBLE_UI) #include "../../../lcd/extui/ui_api.h" #endif diff --git a/Marlin/src/gcode/feature/powerloss/M413.cpp b/Marlin/src/gcode/feature/powerloss/M413.cpp index 3538ccaa6e..64573e5dff 100644 --- a/Marlin/src/gcode/feature/powerloss/M413.cpp +++ b/Marlin/src/gcode/feature/powerloss/M413.cpp @@ -27,7 +27,7 @@ #include "../../gcode.h" #include "../../../feature/powerloss.h" #include "../../../module/motion.h" -#include "../../../lcd/ultralcd.h" +#include "../../../lcd/marlinui.h" /** * M413: Enable / Disable power-loss recovery diff --git a/Marlin/src/gcode/geometry/M206_M428.cpp b/Marlin/src/gcode/geometry/M206_M428.cpp index a477a1a526..70cb1e19e5 100644 --- a/Marlin/src/gcode/geometry/M206_M428.cpp +++ b/Marlin/src/gcode/geometry/M206_M428.cpp @@ -26,7 +26,7 @@ #include "../gcode.h" #include "../../module/motion.h" -#include "../../lcd/ultralcd.h" +#include "../../lcd/marlinui.h" #include "../../libs/buzzer.h" /** diff --git a/Marlin/src/gcode/lcd/M0_M1.cpp b/Marlin/src/gcode/lcd/M0_M1.cpp index 1d18b70602..414c4ce023 100644 --- a/Marlin/src/gcode/lcd/M0_M1.cpp +++ b/Marlin/src/gcode/lcd/M0_M1.cpp @@ -32,7 +32,7 @@ #include "../../MarlinCore.h" // for wait_for_user_response() #if HAS_LCD_MENU - #include "../../lcd/ultralcd.h" + #include "../../lcd/marlinui.h" #elif ENABLED(EXTENSIBLE_UI) #include "../../lcd/extui/ui_api.h" #endif diff --git a/Marlin/src/gcode/lcd/M117.cpp b/Marlin/src/gcode/lcd/M117.cpp index 8459135f30..59305d94c5 100644 --- a/Marlin/src/gcode/lcd/M117.cpp +++ b/Marlin/src/gcode/lcd/M117.cpp @@ -21,7 +21,7 @@ */ #include "../gcode.h" -#include "../../lcd/ultralcd.h" +#include "../../lcd/marlinui.h" /** * M117: Set LCD Status Message diff --git a/Marlin/src/gcode/lcd/M145.cpp b/Marlin/src/gcode/lcd/M145.cpp index abd4dcc743..84a7e75aa4 100644 --- a/Marlin/src/gcode/lcd/M145.cpp +++ b/Marlin/src/gcode/lcd/M145.cpp @@ -25,7 +25,7 @@ #if PREHEAT_COUNT #include "../gcode.h" -#include "../../lcd/ultralcd.h" +#include "../../lcd/marlinui.h" /** * M145: Set the heatup state for a material in the LCD menu diff --git a/Marlin/src/gcode/lcd/M250.cpp b/Marlin/src/gcode/lcd/M250.cpp index f42daaeac4..f553044d31 100644 --- a/Marlin/src/gcode/lcd/M250.cpp +++ b/Marlin/src/gcode/lcd/M250.cpp @@ -25,7 +25,7 @@ #if HAS_LCD_CONTRAST #include "../gcode.h" -#include "../../lcd/ultralcd.h" +#include "../../lcd/marlinui.h" /** * M250: Read and optionally set the LCD contrast diff --git a/Marlin/src/gcode/lcd/M300.cpp b/Marlin/src/gcode/lcd/M300.cpp index 56d9ee5d73..5250774955 100644 --- a/Marlin/src/gcode/lcd/M300.cpp +++ b/Marlin/src/gcode/lcd/M300.cpp @@ -26,7 +26,7 @@ #include "../gcode.h" -#include "../../lcd/ultralcd.h" // i2c-based BUZZ +#include "../../lcd/marlinui.h" // i2c-based BUZZ #include "../../libs/buzzer.h" // Buzzer, if possible /** diff --git a/Marlin/src/gcode/lcd/M73.cpp b/Marlin/src/gcode/lcd/M73.cpp index 7a5454419d..5b135bdff8 100644 --- a/Marlin/src/gcode/lcd/M73.cpp +++ b/Marlin/src/gcode/lcd/M73.cpp @@ -25,7 +25,7 @@ #if ENABLED(LCD_SET_PROGRESS_MANUALLY) #include "../gcode.h" -#include "../../lcd/ultralcd.h" +#include "../../lcd/marlinui.h" #include "../../sd/cardreader.h" /** diff --git a/Marlin/src/gcode/motion/G4.cpp b/Marlin/src/gcode/motion/G4.cpp index 3a37fe5b2c..724ed7f1ca 100644 --- a/Marlin/src/gcode/motion/G4.cpp +++ b/Marlin/src/gcode/motion/G4.cpp @@ -22,7 +22,7 @@ #include "../gcode.h" #include "../../module/stepper.h" -#include "../../lcd/ultralcd.h" +#include "../../lcd/marlinui.h" /** * G4: Dwell S or P diff --git a/Marlin/src/gcode/queue.cpp b/Marlin/src/gcode/queue.cpp index b9169d90e1..4de5056fb2 100644 --- a/Marlin/src/gcode/queue.cpp +++ b/Marlin/src/gcode/queue.cpp @@ -29,7 +29,7 @@ GCodeQueue queue; #include "gcode.h" -#include "../lcd/ultralcd.h" +#include "../lcd/marlinui.h" #include "../sd/cardreader.h" #include "../module/planner.h" #include "../module/temperature.h" diff --git a/Marlin/src/gcode/sd/M1001.cpp b/Marlin/src/gcode/sd/M1001.cpp index b28429f631..4a461170bc 100644 --- a/Marlin/src/gcode/sd/M1001.cpp +++ b/Marlin/src/gcode/sd/M1001.cpp @@ -32,7 +32,7 @@ #endif #if EITHER(LCD_SET_PROGRESS_MANUALLY, SD_REPRINT_LAST_SELECTED_FILE) - #include "../../lcd/ultralcd.h" + #include "../../lcd/marlinui.h" #endif #if ENABLED(POWER_LOSS_RECOVERY) diff --git a/Marlin/src/gcode/sd/M23.cpp b/Marlin/src/gcode/sd/M23.cpp index b88f66b591..51bc824130 100644 --- a/Marlin/src/gcode/sd/M23.cpp +++ b/Marlin/src/gcode/sd/M23.cpp @@ -26,7 +26,7 @@ #include "../gcode.h" #include "../../sd/cardreader.h" -#include "../../lcd/ultralcd.h" +#include "../../lcd/marlinui.h" /** * M23: Open a file diff --git a/Marlin/src/gcode/sd/M24_M25.cpp b/Marlin/src/gcode/sd/M24_M25.cpp index bdb37f605c..611ba17c55 100644 --- a/Marlin/src/gcode/sd/M24_M25.cpp +++ b/Marlin/src/gcode/sd/M24_M25.cpp @@ -27,7 +27,7 @@ #include "../gcode.h" #include "../../sd/cardreader.h" #include "../../module/printcounter.h" -#include "../../lcd/ultralcd.h" +#include "../../lcd/marlinui.h" #if ENABLED(PARK_HEAD_ON_PAUSE) #include "../../feature/pause.h" diff --git a/Marlin/src/gcode/stats/M31.cpp b/Marlin/src/gcode/stats/M31.cpp index b39108bb90..c0e7d2a7ae 100644 --- a/Marlin/src/gcode/stats/M31.cpp +++ b/Marlin/src/gcode/stats/M31.cpp @@ -24,7 +24,7 @@ #include "../../core/serial.h" #include "../../module/printcounter.h" #include "../../libs/duration_t.h" -#include "../../lcd/ultralcd.h" +#include "../../lcd/marlinui.h" /** * M31: Get the time since the start of SD Print (or last M109) diff --git a/Marlin/src/gcode/stats/M75-M78.cpp b/Marlin/src/gcode/stats/M75-M78.cpp index 908e6e5a31..568d9b0e27 100644 --- a/Marlin/src/gcode/stats/M75-M78.cpp +++ b/Marlin/src/gcode/stats/M75-M78.cpp @@ -22,7 +22,7 @@ #include "../gcode.h" #include "../../module/printcounter.h" -#include "../../lcd/ultralcd.h" +#include "../../lcd/marlinui.h" #include "../../MarlinCore.h" // for startOrResumeJob diff --git a/Marlin/src/gcode/temp/M104_M109.cpp b/Marlin/src/gcode/temp/M104_M109.cpp index 4402728de3..d2b466e2fb 100644 --- a/Marlin/src/gcode/temp/M104_M109.cpp +++ b/Marlin/src/gcode/temp/M104_M109.cpp @@ -34,7 +34,7 @@ #include "../../module/temperature.h" #include "../../module/motion.h" #include "../../module/planner.h" -#include "../../lcd/ultralcd.h" +#include "../../lcd/marlinui.h" #include "../../MarlinCore.h" // for startOrResumeJob, etc. diff --git a/Marlin/src/gcode/temp/M106_M107.cpp b/Marlin/src/gcode/temp/M106_M107.cpp index 17ff8c3c8f..9c70f1ebc7 100644 --- a/Marlin/src/gcode/temp/M106_M107.cpp +++ b/Marlin/src/gcode/temp/M106_M107.cpp @@ -29,7 +29,7 @@ #include "../../module/temperature.h" #if PREHEAT_COUNT - #include "../../lcd/ultralcd.h" + #include "../../lcd/marlinui.h" #endif #if ENABLED(SINGLENOZZLE) diff --git a/Marlin/src/gcode/temp/M140_M190.cpp b/Marlin/src/gcode/temp/M140_M190.cpp index 9438b9e0c2..ac8228085e 100644 --- a/Marlin/src/gcode/temp/M140_M190.cpp +++ b/Marlin/src/gcode/temp/M140_M190.cpp @@ -33,7 +33,7 @@ #include "../gcode.h" #include "../../module/temperature.h" #include "../../module/motion.h" -#include "../../lcd/ultralcd.h" +#include "../../lcd/marlinui.h" #if ENABLED(PRINTJOB_TIMER_AUTOSTART) #include "../../module/printcounter.h" diff --git a/Marlin/src/gcode/temp/M141_M191.cpp b/Marlin/src/gcode/temp/M141_M191.cpp index 41a79825aa..fc80c5f4cb 100644 --- a/Marlin/src/gcode/temp/M141_M191.cpp +++ b/Marlin/src/gcode/temp/M141_M191.cpp @@ -34,7 +34,7 @@ #include "../../module/temperature.h" #include "../../module/motion.h" -#include "../../lcd/ultralcd.h" +#include "../../lcd/marlinui.h" #if ENABLED(PRINTJOB_TIMER_AUTOSTART) #include "../../module/printcounter.h" diff --git a/Marlin/src/gcode/temp/M303.cpp b/Marlin/src/gcode/temp/M303.cpp index ccce09b4f1..c1bf9efd7f 100644 --- a/Marlin/src/gcode/temp/M303.cpp +++ b/Marlin/src/gcode/temp/M303.cpp @@ -25,7 +25,7 @@ #if HAS_PID_HEATING #include "../gcode.h" -#include "../../lcd/ultralcd.h" +#include "../../lcd/marlinui.h" #include "../../module/temperature.h" #if ENABLED(EXTENSIBLE_UI) diff --git a/Marlin/src/lcd/HD44780/lcdprint_hd44780.cpp b/Marlin/src/lcd/HD44780/lcdprint_hd44780.cpp index aa3c3c04a1..8aca19b0cd 100644 --- a/Marlin/src/lcd/HD44780/lcdprint_hd44780.cpp +++ b/Marlin/src/lcd/HD44780/lcdprint_hd44780.cpp @@ -16,10 +16,10 @@ #if HAS_MARLINUI_HD44780 -#include "../ultralcd.h" +#include "../marlinui.h" #include "../../MarlinCore.h" -#include "ultralcd_HD44780.h" +#include "marlinui_HD44780.h" #include diff --git a/Marlin/src/lcd/HD44780/ultralcd_HD44780.cpp b/Marlin/src/lcd/HD44780/marlinui_HD44780.cpp similarity index 99% rename from Marlin/src/lcd/HD44780/ultralcd_HD44780.cpp rename to Marlin/src/lcd/HD44780/marlinui_HD44780.cpp index e6cc227465..3c7993e375 100644 --- a/Marlin/src/lcd/HD44780/ultralcd_HD44780.cpp +++ b/Marlin/src/lcd/HD44780/marlinui_HD44780.cpp @@ -25,14 +25,14 @@ #if HAS_MARLINUI_HD44780 /** - * ultralcd_HD44780.cpp + * marlinui_HD44780.cpp * * LCD display implementations for Hitachi HD44780. * These are the most common LCD character displays. */ -#include "ultralcd_HD44780.h" -#include "../ultralcd.h" +#include "marlinui_HD44780.h" +#include "../marlinui.h" #include "../../libs/numtostr.h" #include "../../sd/cardreader.h" diff --git a/Marlin/src/lcd/HD44780/ultralcd_HD44780.h b/Marlin/src/lcd/HD44780/marlinui_HD44780.h similarity index 100% rename from Marlin/src/lcd/HD44780/ultralcd_HD44780.h rename to Marlin/src/lcd/HD44780/marlinui_HD44780.h diff --git a/Marlin/src/lcd/TFTGLCD/lcdprint_TFTGLCD.cpp b/Marlin/src/lcd/TFTGLCD/lcdprint_TFTGLCD.cpp index 51681a8009..dddab1f259 100644 --- a/Marlin/src/lcd/TFTGLCD/lcdprint_TFTGLCD.cpp +++ b/Marlin/src/lcd/TFTGLCD/lcdprint_TFTGLCD.cpp @@ -37,11 +37,11 @@ #if IS_TFTGLCD_PANEL -#include "../ultralcd.h" +#include "../marlinui.h" #include "../../MarlinCore.h" #include "../../libs/numtostr.h" -#include "ultralcd_TFTGLCD.h" +#include "marlinui_TFTGLCD.h" #include diff --git a/Marlin/src/lcd/TFTGLCD/ultralcd_TFTGLCD.cpp b/Marlin/src/lcd/TFTGLCD/marlinui_TFTGLCD.cpp similarity index 99% rename from Marlin/src/lcd/TFTGLCD/ultralcd_TFTGLCD.cpp rename to Marlin/src/lcd/TFTGLCD/marlinui_TFTGLCD.cpp index 4aa6bcd485..83ebe111ae 100644 --- a/Marlin/src/lcd/TFTGLCD/ultralcd_TFTGLCD.cpp +++ b/Marlin/src/lcd/TFTGLCD/marlinui_TFTGLCD.cpp @@ -25,7 +25,7 @@ #if IS_TFTGLCD_PANEL /** - * ultralcd_TFTGLCD.cpp + * marlinui_TFTGLCD.cpp * * Implementation of the LCD display routines for a TFT GLCD displays with external controller. * This display looks like a REPRAP_DISCOUNT_FULL_GRAPHIC_SMART_CONTROLLER but has good text font @@ -42,8 +42,8 @@ #include #endif -#include "ultralcd_TFTGLCD.h" -#include "../ultralcd.h" +#include "marlinui_TFTGLCD.h" +#include "../marlinui.h" #include "../../libs/numtostr.h" #include "../../sd/cardreader.h" diff --git a/Marlin/src/lcd/TFTGLCD/ultralcd_TFTGLCD.h b/Marlin/src/lcd/TFTGLCD/marlinui_TFTGLCD.h similarity index 100% rename from Marlin/src/lcd/TFTGLCD/ultralcd_TFTGLCD.h rename to Marlin/src/lcd/TFTGLCD/marlinui_TFTGLCD.h diff --git a/Marlin/src/lcd/dogm/dogm_Statusscreen.h b/Marlin/src/lcd/dogm/dogm_Statusscreen.h index c6ad566cff..e76b7da598 100644 --- a/Marlin/src/lcd/dogm/dogm_Statusscreen.h +++ b/Marlin/src/lcd/dogm/dogm_Statusscreen.h @@ -29,7 +29,7 @@ */ #include "../../inc/MarlinConfig.h" -#include "ultralcd_DOGM.h" +#include "marlinui_DOGM.h" #define BW(N) ((N + 7) / 8) diff --git a/Marlin/src/lcd/dogm/lcdprint_u8g.cpp b/Marlin/src/lcd/dogm/lcdprint_u8g.cpp index a6bdb373dd..a85dc9f979 100644 --- a/Marlin/src/lcd/dogm/lcdprint_u8g.cpp +++ b/Marlin/src/lcd/dogm/lcdprint_u8g.cpp @@ -11,9 +11,9 @@ #if HAS_MARLINUI_U8GLIB -#include "ultralcd_DOGM.h" +#include "marlinui_DOGM.h" -#include "../ultralcd.h" +#include "../marlinui.h" #include "../../MarlinCore.h" #include "../fontutils.h" diff --git a/Marlin/src/lcd/dogm/ultralcd_DOGM.cpp b/Marlin/src/lcd/dogm/marlinui_DOGM.cpp similarity index 99% rename from Marlin/src/lcd/dogm/ultralcd_DOGM.cpp rename to Marlin/src/lcd/dogm/marlinui_DOGM.cpp index c48abac810..53a20476e9 100644 --- a/Marlin/src/lcd/dogm/ultralcd_DOGM.cpp +++ b/Marlin/src/lcd/dogm/marlinui_DOGM.cpp @@ -21,7 +21,7 @@ */ /** - * lcd/dogm/ultralcd_DOGM.h + * lcd/dogm/marlinui_DOGM.h * * Implementation of the LCD display routines for a DOGM128 graphic display. * by STB for ErikZalm/Marlin. Common LCD 128x64 pixel graphic displays. @@ -39,7 +39,7 @@ #if HAS_MARLINUI_U8GLIB -#include "ultralcd_DOGM.h" +#include "marlinui_DOGM.h" #include "u8g_fontutf8.h" #if ENABLED(SHOW_BOOTSCREEN) @@ -49,7 +49,7 @@ #include "../lcdprint.h" #include "../fontutils.h" #include "../../libs/numtostr.h" -#include "../ultralcd.h" +#include "../marlinui.h" #include "../../sd/cardreader.h" #include "../../module/temperature.h" diff --git a/Marlin/src/lcd/dogm/ultralcd_DOGM.h b/Marlin/src/lcd/dogm/marlinui_DOGM.h similarity index 99% rename from Marlin/src/lcd/dogm/ultralcd_DOGM.h rename to Marlin/src/lcd/dogm/marlinui_DOGM.h index b0db727f09..29a1b7d3cf 100644 --- a/Marlin/src/lcd/dogm/ultralcd_DOGM.h +++ b/Marlin/src/lcd/dogm/marlinui_DOGM.h @@ -22,7 +22,7 @@ #pragma once /** - * lcd/dogm/ultralcd_DOGM.h + * lcd/dogm/marlinui_DOGM.h */ #include "../../inc/MarlinConfigPre.h" diff --git a/Marlin/src/lcd/dogm/status_screen_DOGM.cpp b/Marlin/src/lcd/dogm/status_screen_DOGM.cpp index 987924201a..d07474d810 100644 --- a/Marlin/src/lcd/dogm/status_screen_DOGM.cpp +++ b/Marlin/src/lcd/dogm/status_screen_DOGM.cpp @@ -30,8 +30,8 @@ #if HAS_MARLINUI_U8GLIB && DISABLED(LIGHTWEIGHT_UI) #include "dogm_Statusscreen.h" -#include "ultralcd_DOGM.h" -#include "../ultralcd.h" +#include "marlinui_DOGM.h" +#include "../marlinui.h" #include "../lcdprint.h" #include "../../libs/numtostr.h" diff --git a/Marlin/src/lcd/dogm/status_screen_lite_ST7920.cpp b/Marlin/src/lcd/dogm/status_screen_lite_ST7920.cpp index 806f370db3..c06080f601 100644 --- a/Marlin/src/lcd/dogm/status_screen_lite_ST7920.cpp +++ b/Marlin/src/lcd/dogm/status_screen_lite_ST7920.cpp @@ -46,7 +46,7 @@ #include "status_screen_lite_ST7920.h" -#include "../ultralcd.h" +#include "../marlinui.h" #include "../fontutils.h" #include "../lcdprint.h" #include "../../libs/duration_t.h" diff --git a/Marlin/src/lcd/dogm/u8g_dev_tft_upscale_from_128x64.cpp b/Marlin/src/lcd/dogm/u8g_dev_tft_upscale_from_128x64.cpp index fa9e006744..2599b1ad22 100644 --- a/Marlin/src/lcd/dogm/u8g_dev_tft_upscale_from_128x64.cpp +++ b/Marlin/src/lcd/dogm/u8g_dev_tft_upscale_from_128x64.cpp @@ -58,7 +58,7 @@ #if HAS_MARLINUI_U8GLIB && (PIN_EXISTS(FSMC_CS) || HAS_SPI_GRAPHICAL_TFT) #include "HAL_LCD_com_defines.h" -#include "ultralcd_DOGM.h" +#include "marlinui_DOGM.h" #include diff --git a/Marlin/src/lcd/dwin/e3v2/dwin.cpp b/Marlin/src/lcd/dwin/e3v2/dwin.cpp index 2808749737..45704d5724 100644 --- a/Marlin/src/lcd/dwin/e3v2/dwin.cpp +++ b/Marlin/src/lcd/dwin/e3v2/dwin.cpp @@ -47,7 +47,7 @@ #include #include "../../fontutils.h" -#include "../../ultralcd.h" +#include "../../marlinui.h" #include "../../../sd/cardreader.h" diff --git a/Marlin/src/lcd/extui/lib/dgus/fysetc/DGUSDisplayDef.cpp b/Marlin/src/lcd/extui/lib/dgus/fysetc/DGUSDisplayDef.cpp index 3beed892e3..e2f2fd9346 100644 --- a/Marlin/src/lcd/extui/lib/dgus/fysetc/DGUSDisplayDef.cpp +++ b/Marlin/src/lcd/extui/lib/dgus/fysetc/DGUSDisplayDef.cpp @@ -35,7 +35,7 @@ #include "../../../../../module/planner.h" #include "../../../ui_api.h" -#include "../../../../ultralcd.h" +#include "../../../../marlinui.h" #if ENABLED(DGUS_UI_MOVE_DIS_OPTION) uint16_t distanceToMove = 10; diff --git a/Marlin/src/lcd/extui/lib/dgus/hiprecy/DGUSDisplayDef.cpp b/Marlin/src/lcd/extui/lib/dgus/hiprecy/DGUSDisplayDef.cpp index 82c06d7a4a..ed26cac3c5 100644 --- a/Marlin/src/lcd/extui/lib/dgus/hiprecy/DGUSDisplayDef.cpp +++ b/Marlin/src/lcd/extui/lib/dgus/hiprecy/DGUSDisplayDef.cpp @@ -35,7 +35,7 @@ #include "../../../../../module/planner.h" #include "../../../ui_api.h" -#include "../../../../ultralcd.h" +#include "../../../../marlinui.h" #if ENABLED(DGUS_UI_MOVE_DIS_OPTION) uint16_t distanceToMove = 10; diff --git a/Marlin/src/lcd/extui/lib/dgus/origin/DGUSDisplayDef.cpp b/Marlin/src/lcd/extui/lib/dgus/origin/DGUSDisplayDef.cpp index f9d4351e02..46e542a959 100644 --- a/Marlin/src/lcd/extui/lib/dgus/origin/DGUSDisplayDef.cpp +++ b/Marlin/src/lcd/extui/lib/dgus/origin/DGUSDisplayDef.cpp @@ -34,7 +34,7 @@ #include "../../../../../module/motion.h" #include "../../../../../module/planner.h" -#include "../../../../ultralcd.h" +#include "../../../../marlinui.h" #include "../../../ui_api.h" #if ENABLED(DGUS_UI_MOVE_DIS_OPTION) diff --git a/Marlin/src/lcd/extui/lib/mks_ui/draw_printing.cpp b/Marlin/src/lcd/extui/lib/mks_ui/draw_printing.cpp index c6369db413..0b49bf4ab7 100644 --- a/Marlin/src/lcd/extui/lib/mks_ui/draw_printing.cpp +++ b/Marlin/src/lcd/extui/lib/mks_ui/draw_printing.cpp @@ -41,7 +41,7 @@ #include "../../../../feature/powerloss.h" #endif #if BOTH(LCD_SET_PROGRESS_MANUALLY, USE_M73_REMAINING_TIME) - #include "../../../ultralcd.h" + #include "../../../marlinui.h" #endif extern lv_group_t * g; diff --git a/Marlin/src/lcd/extui/lib/mks_ui/tft_lvgl_configuration.cpp b/Marlin/src/lcd/extui/lib/mks_ui/tft_lvgl_configuration.cpp index c0cd14d70d..f74ed3c798 100644 --- a/Marlin/src/lcd/extui/lib/mks_ui/tft_lvgl_configuration.cpp +++ b/Marlin/src/lcd/extui/lib/mks_ui/tft_lvgl_configuration.cpp @@ -44,7 +44,7 @@ #include "../../../../inc/MarlinConfig.h" #include HAL_PATH(../../HAL, tft/xpt2046.h) -#include "../../../ultralcd.h" +#include "../../../marlinui.h" XPT2046 touch; #if ENABLED(POWER_LOSS_RECOVERY) diff --git a/Marlin/src/lcd/extui/lib/mks_ui/wifi_module.cpp b/Marlin/src/lcd/extui/lib/mks_ui/wifi_module.cpp index f5d954792e..e4fb4ece03 100644 --- a/Marlin/src/lcd/extui/lib/mks_ui/wifi_module.cpp +++ b/Marlin/src/lcd/extui/lib/mks_ui/wifi_module.cpp @@ -33,7 +33,7 @@ #include "../../../../module/temperature.h" #include "../../../../gcode/queue.h" #include "../../../../gcode/gcode.h" -#include "../../../../lcd/ultralcd.h" +#include "../../../../lcd/marlinui.h" #include "../../../../sd/cardreader.h" #include "../../../../module/planner.h" #if ENABLED(POWER_LOSS_RECOVERY) diff --git a/Marlin/src/lcd/extui/malyan_lcd.cpp b/Marlin/src/lcd/extui/malyan_lcd.cpp index 79a5fb961a..5505a0dff7 100644 --- a/Marlin/src/lcd/extui/malyan_lcd.cpp +++ b/Marlin/src/lcd/extui/malyan_lcd.cpp @@ -49,7 +49,7 @@ #include "ui_api.h" -#include "../ultralcd.h" +#include "../marlinui.h" #include "../../sd/cardreader.h" #include "../../module/temperature.h" #include "../../module/stepper.h" diff --git a/Marlin/src/lcd/extui/ui_api.cpp b/Marlin/src/lcd/extui/ui_api.cpp index 30cf696f3e..8151828a08 100644 --- a/Marlin/src/lcd/extui/ui_api.cpp +++ b/Marlin/src/lcd/extui/ui_api.cpp @@ -45,7 +45,7 @@ #if ENABLED(EXTENSIBLE_UI) -#include "../ultralcd.h" +#include "../marlinui.h" #include "../../gcode/queue.h" #include "../../module/motion.h" #include "../../module/planner.h" @@ -1053,11 +1053,9 @@ namespace ExtUI { } // namespace ExtUI -// At the moment, we piggy-back off the ultralcd calls, but this could be cleaned up in the future +// At the moment we hook into MarlinUI methods, but this could be cleaned up in the future -void MarlinUI::init() { - ExtUI::onStartup(); -} +void MarlinUI::init() { ExtUI::onStartup(); } void MarlinUI::update() { ExtUI::onIdle(); } diff --git a/Marlin/src/lcd/fontutils.cpp b/Marlin/src/lcd/fontutils.cpp index 5bf07e1bd4..22b54c72de 100644 --- a/Marlin/src/lcd/fontutils.cpp +++ b/Marlin/src/lcd/fontutils.cpp @@ -10,7 +10,7 @@ #include "../inc/MarlinConfig.h" #if HAS_WIRED_LCD - #include "ultralcd.h" + #include "marlinui.h" #include "../MarlinCore.h" #endif diff --git a/Marlin/src/lcd/ultralcd.cpp b/Marlin/src/lcd/marlinui.cpp similarity index 99% rename from Marlin/src/lcd/ultralcd.cpp rename to Marlin/src/lcd/marlinui.cpp index 25f5afc71d..487678eccf 100644 --- a/Marlin/src/lcd/ultralcd.cpp +++ b/Marlin/src/lcd/marlinui.cpp @@ -31,7 +31,7 @@ #endif // All displays share the MarlinUI class -#include "ultralcd.h" +#include "marlinui.h" MarlinUI ui; #if HAS_DISPLAY @@ -117,7 +117,7 @@ constexpr uint8_t epps = ENCODER_PULSES_PER_STEP; #if HAS_WIRED_LCD #if HAS_MARLINUI_U8GLIB - #include "dogm/ultralcd_DOGM.h" + #include "dogm/marlinui_DOGM.h" #endif #include "lcdprint.h" diff --git a/Marlin/src/lcd/ultralcd.h b/Marlin/src/lcd/marlinui.h similarity index 100% rename from Marlin/src/lcd/ultralcd.h rename to Marlin/src/lcd/marlinui.h diff --git a/Marlin/src/lcd/menu/game/game.h b/Marlin/src/lcd/menu/game/game.h index e788f29805..cba79e4f28 100644 --- a/Marlin/src/lcd/menu/game/game.h +++ b/Marlin/src/lcd/menu/game/game.h @@ -22,9 +22,9 @@ #pragma once #include "../../../inc/MarlinConfigPre.h" -#include "../../dogm/ultralcd_DOGM.h" +#include "../../dogm/marlinui_DOGM.h" #include "../../lcdprint.h" -#include "../../ultralcd.h" +#include "../../marlinui.h" //#define MUTE_GAMES diff --git a/Marlin/src/lcd/menu/menu.h b/Marlin/src/lcd/menu/menu.h index 89970225ad..4dd66637f1 100644 --- a/Marlin/src/lcd/menu/menu.h +++ b/Marlin/src/lcd/menu/menu.h @@ -21,7 +21,7 @@ */ #pragma once -#include "../ultralcd.h" +#include "../marlinui.h" #include "../../libs/numtostr.h" #include "../../inc/MarlinConfig.h" diff --git a/Marlin/src/lcd/menu/menu_item.h b/Marlin/src/lcd/menu/menu_item.h index bd3af0cec6..3ebe38235d 100644 --- a/Marlin/src/lcd/menu/menu_item.h +++ b/Marlin/src/lcd/menu/menu_item.h @@ -22,7 +22,7 @@ #pragma once #include "menu.h" -#include "../ultralcd.h" +#include "../marlinui.h" #include "../../gcode/queue.h" // for inject_P #include "../../inc/MarlinConfigPre.h" diff --git a/Marlin/src/lcd/menu/menu_touch_screen.cpp b/Marlin/src/lcd/menu/menu_touch_screen.cpp index 96eae2298e..ea610e0886 100644 --- a/Marlin/src/lcd/menu/menu_touch_screen.cpp +++ b/Marlin/src/lcd/menu/menu_touch_screen.cpp @@ -25,7 +25,7 @@ #if BOTH(HAS_LCD_MENU, TOUCH_SCREEN_CALIBRATION) #include "menu_item.h" -#include "../ultralcd.h" +#include "../marlinui.h" void touch_screen_calibration() { diff --git a/Marlin/src/lcd/menu/menu_tune.cpp b/Marlin/src/lcd/menu/menu_tune.cpp index 6bf5c3a15d..041786794e 100644 --- a/Marlin/src/lcd/menu/menu_tune.cpp +++ b/Marlin/src/lcd/menu/menu_tune.cpp @@ -47,7 +47,7 @@ #include "../../feature/babystep.h" #include "../lcdprint.h" #if HAS_MARLINUI_U8GLIB - #include "../dogm/ultralcd_DOGM.h" + #include "../dogm/marlinui_DOGM.h" #endif void _lcd_babystep(const AxisEnum axis, PGM_P const msg) { diff --git a/Marlin/src/lcd/tft/touch.cpp b/Marlin/src/lcd/tft/touch.cpp index e3cd26a392..6dcddc5d56 100644 --- a/Marlin/src/lcd/tft/touch.cpp +++ b/Marlin/src/lcd/tft/touch.cpp @@ -23,7 +23,7 @@ #include "touch.h" -#include "../ultralcd.h" // for ui methods +#include "../marlinui.h" // for ui methods #include "../menu/menu_item.h" // for touch_screen_calibration #include "../../module/temperature.h" diff --git a/Marlin/src/lcd/tft/ui_320x240.cpp b/Marlin/src/lcd/tft/ui_320x240.cpp index de8498c5ff..339c26cca2 100644 --- a/Marlin/src/lcd/tft/ui_320x240.cpp +++ b/Marlin/src/lcd/tft/ui_320x240.cpp @@ -26,7 +26,7 @@ #include "ui_320x240.h" -#include "../ultralcd.h" +#include "../marlinui.h" #include "../menu/menu.h" #include "../../libs/numtostr.h" diff --git a/Marlin/src/lcd/tft/ui_480x320.cpp b/Marlin/src/lcd/tft/ui_480x320.cpp index 3dab9418f5..b67e041349 100644 --- a/Marlin/src/lcd/tft/ui_480x320.cpp +++ b/Marlin/src/lcd/tft/ui_480x320.cpp @@ -26,7 +26,7 @@ #include "ui_480x320.h" -#include "../ultralcd.h" +#include "../marlinui.h" #include "../menu/menu.h" #include "../../libs/numtostr.h" diff --git a/Marlin/src/lcd/touch/touch_buttons.cpp b/Marlin/src/lcd/touch/touch_buttons.cpp index 7d25c0df7e..eeb22aae6e 100644 --- a/Marlin/src/lcd/touch/touch_buttons.cpp +++ b/Marlin/src/lcd/touch/touch_buttons.cpp @@ -27,7 +27,7 @@ #include HAL_PATH(../../HAL, tft/xpt2046.h) XPT2046 touchIO; -#include "../../lcd/ultralcd.h" // For EN_C bit mask +#include "../../lcd/marlinui.h" // For EN_C bit mask /** * Draw and Touch processing diff --git a/Marlin/src/module/delta.cpp b/Marlin/src/module/delta.cpp index df6cae6e0a..93238a69e3 100644 --- a/Marlin/src/module/delta.cpp +++ b/Marlin/src/module/delta.cpp @@ -34,7 +34,7 @@ // For homing: #include "planner.h" #include "endstops.h" -#include "../lcd/ultralcd.h" +#include "../lcd/marlinui.h" #include "../MarlinCore.h" #if HAS_BED_PROBE diff --git a/Marlin/src/module/endstops.cpp b/Marlin/src/module/endstops.cpp index 712182a0ea..928c9ad8b9 100644 --- a/Marlin/src/module/endstops.cpp +++ b/Marlin/src/module/endstops.cpp @@ -30,7 +30,7 @@ #include "../MarlinCore.h" #include "../sd/cardreader.h" #include "temperature.h" -#include "../lcd/ultralcd.h" +#include "../lcd/marlinui.h" #if ENABLED(ENDSTOP_INTERRUPTS_FEATURE) #include HAL_PATH(../HAL, endstop_interrupts.h) diff --git a/Marlin/src/module/motion.cpp b/Marlin/src/module/motion.cpp index 75a7944c3f..03c8ddc462 100644 --- a/Marlin/src/module/motion.cpp +++ b/Marlin/src/module/motion.cpp @@ -36,7 +36,7 @@ #if IS_SCARA #include "../libs/buzzer.h" - #include "../lcd/ultralcd.h" + #include "../lcd/marlinui.h" #endif #if HAS_BED_PROBE @@ -52,7 +52,7 @@ #endif #if HAS_DISPLAY - #include "../lcd/ultralcd.h" + #include "../lcd/marlinui.h" #endif #if HAS_FILAMENT_SENSOR diff --git a/Marlin/src/module/planner.cpp b/Marlin/src/module/planner.cpp index 4ad7c4ccf0..74535df1f9 100644 --- a/Marlin/src/module/planner.cpp +++ b/Marlin/src/module/planner.cpp @@ -66,7 +66,7 @@ #include "stepper.h" #include "motion.h" #include "temperature.h" -#include "../lcd/ultralcd.h" +#include "../lcd/marlinui.h" #include "../gcode/parser.h" #include "../MarlinCore.h" diff --git a/Marlin/src/module/probe.cpp b/Marlin/src/module/probe.cpp index 27ceb989c0..d008720389 100644 --- a/Marlin/src/module/probe.cpp +++ b/Marlin/src/module/probe.cpp @@ -36,7 +36,7 @@ #include "endstops.h" #include "../gcode/gcode.h" -#include "../lcd/ultralcd.h" +#include "../lcd/marlinui.h" #include "../MarlinCore.h" // for stop(), disable_e_steppers diff --git a/Marlin/src/module/settings.cpp b/Marlin/src/module/settings.cpp index 33e5c351ab..eac2af38c3 100644 --- a/Marlin/src/module/settings.cpp +++ b/Marlin/src/module/settings.cpp @@ -54,7 +54,7 @@ #include "../lcd/dwin/e3v2/dwin.h" #endif -#include "../lcd/ultralcd.h" +#include "../lcd/marlinui.h" #include "../libs/vector_3.h" // for matrix_3x3 #include "../gcode/gcode.h" #include "../MarlinCore.h" diff --git a/Marlin/src/module/stepper.cpp b/Marlin/src/module/stepper.cpp index 2201577717..7b3e13eff4 100644 --- a/Marlin/src/module/stepper.cpp +++ b/Marlin/src/module/stepper.cpp @@ -92,7 +92,7 @@ Stepper stepper; // Singleton #include "motion.h" #include "temperature.h" -#include "../lcd/ultralcd.h" +#include "../lcd/marlinui.h" #include "../gcode/queue.h" #include "../sd/cardreader.h" #include "../MarlinCore.h" diff --git a/Marlin/src/module/temperature.cpp b/Marlin/src/module/temperature.cpp index 4b352e738e..3468a4c1c5 100644 --- a/Marlin/src/module/temperature.cpp +++ b/Marlin/src/module/temperature.cpp @@ -34,7 +34,7 @@ #include "planner.h" #include "../HAL/shared/Delay.h" -#include "../lcd/ultralcd.h" +#include "../lcd/marlinui.h" #if ENABLED(DWIN_CREALITY_LCD) #include "../lcd/dwin/e3v2/dwin.h" diff --git a/Marlin/src/module/tool_change.cpp b/Marlin/src/module/tool_change.cpp index 968e654aa3..2c1a1a6017 100644 --- a/Marlin/src/module/tool_change.cpp +++ b/Marlin/src/module/tool_change.cpp @@ -94,7 +94,7 @@ #endif #if HAS_LCD_MENU - #include "../lcd/ultralcd.h" + #include "../lcd/marlinui.h" #endif #if ENABLED(ADVANCED_PAUSE_FEATURE) diff --git a/Marlin/src/sd/cardreader.cpp b/Marlin/src/sd/cardreader.cpp index e154ea9f31..b809b2c10f 100644 --- a/Marlin/src/sd/cardreader.cpp +++ b/Marlin/src/sd/cardreader.cpp @@ -29,7 +29,7 @@ #include "cardreader.h" #include "../MarlinCore.h" -#include "../lcd/ultralcd.h" +#include "../lcd/marlinui.h" #if ENABLED(DWIN_CREALITY_LCD) #include "../lcd/dwin/e3v2/dwin.h" diff --git a/Marlin/src/sd/usb_flashdrive/Sd2Card_FlashDrive.cpp b/Marlin/src/sd/usb_flashdrive/Sd2Card_FlashDrive.cpp index a097df5105..539d316542 100644 --- a/Marlin/src/sd/usb_flashdrive/Sd2Card_FlashDrive.cpp +++ b/Marlin/src/sd/usb_flashdrive/Sd2Card_FlashDrive.cpp @@ -94,7 +94,7 @@ static_assert(USB_INTR_PIN != -1, "USB_INTR_PIN must be defined"); #include "Sd2Card_FlashDrive.h" -#include "../../lcd/ultralcd.h" +#include "../../lcd/marlinui.h" static enum { UNINITIALIZED, From 313efa33ae05d05d8109b65065833722147a8068 Mon Sep 17 00:00:00 2001 From: Victor Oliveira Date: Fri, 16 Oct 2020 22:05:45 -0300 Subject: [PATCH 052/226] Fix starting fan with bad material preset index (#19773) --- Marlin/src/lcd/menu/menu_temperature.cpp | 17 ++++++----------- 1 file changed, 6 insertions(+), 11 deletions(-) diff --git a/Marlin/src/lcd/menu/menu_temperature.cpp b/Marlin/src/lcd/menu/menu_temperature.cpp index 0c70cd7e18..edf6685d7c 100644 --- a/Marlin/src/lcd/menu/menu_temperature.cpp +++ b/Marlin/src/lcd/menu/menu_temperature.cpp @@ -44,24 +44,17 @@ // void Temperature::lcd_preheat(const int16_t e, const int8_t indh, const int8_t indb) { + UNUSED(e); UNUSED(indh); UNUSED(indb); #if HAS_HOTEND if (indh >= 0 && ui.material_preset[indh].hotend_temp > 0) setTargetHotend(_MIN(thermalManager.heater_maxtemp[e] - HOTEND_OVERSHOOT, ui.material_preset[indh].hotend_temp), e); - #else - UNUSED(e); UNUSED(indh); #endif #if HAS_HEATED_BED if (indb >= 0 && ui.material_preset[indb].bed_temp > 0) setTargetBed(ui.material_preset[indb].bed_temp); - #else - UNUSED(indb); #endif #if HAS_FAN - set_fan_speed(( - #if FAN_COUNT > 1 - active_extruder < FAN_COUNT ? active_extruder : - #endif - 0), ui.material_preset[indh].fan_speed - ); + if (indh >= 0) + set_fan_speed(active_extruder < (FAN_COUNT) ? active_extruder : 0, ui.material_preset[indh].fan_speed); #endif ui.return_to_status(); } @@ -93,7 +86,9 @@ void Temperature::lcd_preheat(const int16_t e, const int8_t indh, const int8_t i #endif - void do_preheat_end_m() { _preheat_end(editable.int8, 0); } + void do_preheat_end_m() { + _preheat_end(editable.int8, 0); + } #if HAS_MULTI_HOTEND || HAS_HEATED_BED From e99f9673723167cdba878d8d13626d940e431b6d Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Fri, 16 Oct 2020 20:38:23 -0500 Subject: [PATCH 053/226] Starting fan followup --- Marlin/src/lcd/menu/menu_temperature.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Marlin/src/lcd/menu/menu_temperature.cpp b/Marlin/src/lcd/menu/menu_temperature.cpp index edf6685d7c..28ea54efba 100644 --- a/Marlin/src/lcd/menu/menu_temperature.cpp +++ b/Marlin/src/lcd/menu/menu_temperature.cpp @@ -31,7 +31,7 @@ #include "menu_item.h" #include "../../module/temperature.h" -#if FAN_COUNT > 1 || ENABLED(SINGLENOZZLE) +#if HAS_FAN || ENABLED(SINGLENOZZLE) #include "../../module/motion.h" #endif From 263f29a96a6ce5e76aa94782f5dc9c26e3f4a4fc Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Fri, 16 Oct 2020 20:48:52 -0500 Subject: [PATCH 054/226] MarlinUI followup --- Marlin/src/gcode/calibrate/G34_M422.cpp | 2 +- Marlin/src/lcd/dogm/u8g_dev_st7920_128x64_HAL.cpp | 2 +- Marlin/src/lcd/language/language_de.h | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Marlin/src/gcode/calibrate/G34_M422.cpp b/Marlin/src/gcode/calibrate/G34_M422.cpp index 3dc63b0655..5e1ec5b961 100644 --- a/Marlin/src/gcode/calibrate/G34_M422.cpp +++ b/Marlin/src/gcode/calibrate/G34_M422.cpp @@ -31,7 +31,7 @@ #include "../../module/stepper.h" #include "../../module/planner.h" #include "../../module/probe.h" -#include "../../lcd/ultralcd.h" // for LCD_MESSAGEPGM +#include "../../lcd/marlinui.h" // for LCD_MESSAGEPGM #if HAS_LEVELING #include "../../feature/bedlevel/bedlevel.h" diff --git a/Marlin/src/lcd/dogm/u8g_dev_st7920_128x64_HAL.cpp b/Marlin/src/lcd/dogm/u8g_dev_st7920_128x64_HAL.cpp index 740436d93c..c745f971dc 100644 --- a/Marlin/src/lcd/dogm/u8g_dev_st7920_128x64_HAL.cpp +++ b/Marlin/src/lcd/dogm/u8g_dev_st7920_128x64_HAL.cpp @@ -201,7 +201,7 @@ u8g_dev_t u8g_dev_st7920_128x64_HAL_4x_hw_spi = { u8g_dev_st7920_128x64_HAL_4x_f #if NONE(__AVR__, ARDUINO_ARCH_STM32, ARDUINO_ARCH_ESP32) || defined(U8G_HAL_LINKS) // Also use this device for HAL version of rrd class. This results in the same device being used - // for the ST7920 for HAL systems no matter what is selected in ultralcd_impl_DOGM.h. + // for the ST7920 for HAL systems no matter what is selected in marlinui_DOGM.h. u8g_dev_t u8g_dev_st7920_128x64_rrd_sw_spi = { u8g_dev_st7920_128x64_HAL_4x_fn, &u8g_dev_st7920_128x64_HAL_4x_pb, U8G_COM_ST7920_HAL_SW_SPI }; #endif diff --git a/Marlin/src/lcd/language/language_de.h b/Marlin/src/lcd/language/language_de.h index 74e185680c..f8d891576e 100644 --- a/Marlin/src/lcd/language/language_de.h +++ b/Marlin/src/lcd/language/language_de.h @@ -70,7 +70,7 @@ namespace Language_de { PROGMEM Language_Str MSG_Z_FADE_HEIGHT = _UxGT("Ausblendhöhe"); PROGMEM Language_Str MSG_SET_HOME_OFFSETS = _UxGT("Setze Homeversatz"); PROGMEM Language_Str MSG_HOME_OFFSETS_APPLIED = _UxGT("Homeversatz aktiv"); - PROGMEM Language_Str MSG_SET_ORIGIN = _UxGT("Setze Nullpunkte"); //"G92 X0 Y0 Z0" commented out in ultralcd.cpp + PROGMEM Language_Str MSG_SET_ORIGIN = _UxGT("Setze Nullpunkte"); //"G92 X0 Y0 Z0" commented out in marlinui.cpp #if PREHEAT_COUNT PROGMEM Language_Str MSG_PREHEAT_1 = PREHEAT_1_LABEL _UxGT(" Vorwärmen"); PROGMEM Language_Str MSG_PREHEAT_1_H = PREHEAT_1_LABEL _UxGT(" Vorwärmen ~"); From 178721a329aa59b7917ffe89e76e7f68f921bd79 Mon Sep 17 00:00:00 2001 From: Curtis Jenkins Date: Sat, 17 Oct 2020 16:05:50 -0400 Subject: [PATCH 055/226] Fix Smoothieboard digipots i2c pin (#19784) --- Marlin/src/pins/lpc1769/pins_SMOOTHIEBOARD.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Marlin/src/pins/lpc1769/pins_SMOOTHIEBOARD.h b/Marlin/src/pins/lpc1769/pins_SMOOTHIEBOARD.h index 3c47a70101..4e10d8d1da 100644 --- a/Marlin/src/pins/lpc1769/pins_SMOOTHIEBOARD.h +++ b/Marlin/src/pins/lpc1769/pins_SMOOTHIEBOARD.h @@ -169,7 +169,7 @@ * Set from 0 - 127 with stop bit. * (Ex. 3F << 1 | 1) */ -#define DIGIPOTS_I2C_SCL P0_0 +#define DIGIPOTS_I2C_SCL P0_00 #define DIGIPOTS_I2C_SDA_X P0_04 #define DIGIPOTS_I2C_SDA_Y P0_10 #define DIGIPOTS_I2C_SDA_Z P0_19 From 6fed11896ba7c51ba5f5ade4346c94ff048b1718 Mon Sep 17 00:00:00 2001 From: Sten Uusvali <31988255+nuevocampo@users.noreply.github.com> Date: Sat, 17 Oct 2020 14:11:22 -0700 Subject: [PATCH 056/226] Fix M503 output for M907 motor current (#19777) Co-authored-by: Scott Lahteine --- Marlin/src/module/settings.cpp | 22 +++++++++++++-------- Marlin/src/module/stepper.cpp | 2 +- Marlin/src/pins/rambo/pins_RAMBO.h | 2 +- Marlin/src/pins/rambo/pins_SCOOVO_X9H.h | 2 +- Marlin/src/pins/ramps/pins_BQ_ZUM_MEGA_3D.h | 2 +- 5 files changed, 18 insertions(+), 12 deletions(-) diff --git a/Marlin/src/module/settings.cpp b/Marlin/src/module/settings.cpp index eac2af38c3..f5a954f5de 100644 --- a/Marlin/src/module/settings.cpp +++ b/Marlin/src/module/settings.cpp @@ -3719,19 +3719,25 @@ void MarlinSettings::reset() { CONFIG_ECHO_HEADING("Stepper motor currents:"); CONFIG_ECHO_START(); #if HAS_MOTOR_CURRENT_PWM - SERIAL_ECHOLNPAIR_P( - PSTR(" M907 X"), stepper.motor_current_setting[0] - , SP_Z_STR, stepper.motor_current_setting[1] - , SP_E_STR, stepper.motor_current_setting[2] + SERIAL_ECHOLNPAIR_P( // PWM-based has 3 values: + PSTR(" M907 X"), stepper.motor_current_setting[0] // X and Y + , SP_Z_STR, stepper.motor_current_setting[1] // Z + , SP_E_STR, stepper.motor_current_setting[2] // E ); #elif HAS_MOTOR_CURRENT_SPI - SERIAL_ECHOPGM(" M907"); - LOOP_L_N(q, MOTOR_CURRENT_COUNT) { - SERIAL_CHAR(' '); - SERIAL_CHAR(axis_codes[q]); + SERIAL_ECHOPGM(" M907"); // SPI-based has 5 values: + LOOP_XYZE(q) { // X Y Z E (map to X Y Z E0 by default) + SERIAL_CHAR(' ', axis_codes[q]); SERIAL_ECHO(stepper.motor_current_setting[q]); } + SERIAL_CHAR(' ', 'B'); // B (maps to E1 by default) + SERIAL_ECHOLN(stepper.motor_current_setting[4]); #endif + #elif HAS_MOTOR_CURRENT_I2C // i2c-based has any number of values + // Values sent over i2c are not stored. + // Indexes map directly to drivers, not axes. + #elif HAS_MOTOR_CURRENT_DAC // DAC-based has 4 values, for X Y Z E + // Values sent over i2c are not stored. Uses indirect mapping. #endif /** diff --git a/Marlin/src/module/stepper.cpp b/Marlin/src/module/stepper.cpp index 7b3e13eff4..0a83a90ba2 100644 --- a/Marlin/src/module/stepper.cpp +++ b/Marlin/src/module/stepper.cpp @@ -2962,7 +2962,7 @@ void Stepper::report_positions() { #if HAS_MOTOR_CURRENT_SPI || HAS_MOTOR_CURRENT_PWM void Stepper::set_digipot_current(const uint8_t driver, const int16_t current) { - if (WITHIN(driver, 0, COUNT(motor_current_setting) - 1)) + if (WITHIN(driver, 0, MOTOR_CURRENT_COUNT - 1)) motor_current_setting[driver] = current; // update motor_current_setting if (!initialized) return; diff --git a/Marlin/src/pins/rambo/pins_RAMBO.h b/Marlin/src/pins/rambo/pins_RAMBO.h index 0254edea26..62e7565c14 100644 --- a/Marlin/src/pins/rambo/pins_RAMBO.h +++ b/Marlin/src/pins/rambo/pins_RAMBO.h @@ -112,7 +112,7 @@ #define E1_MS2_PIN 64 #define DIGIPOTSS_PIN 38 -#define DIGIPOT_CHANNELS { 4,5,3,0,1 } // X Y Z E0 E1 digipot channels to stepper driver mapping +#define DIGIPOT_CHANNELS { 4, 5, 3, 0, 1 } // X Y Z E0 E1 digipot channels to stepper driver mapping #ifndef DIGIPOT_MOTOR_CURRENT #define DIGIPOT_MOTOR_CURRENT { 135,135,135,135,135 } // Values 0-255 (RAMBO 135 = ~0.75A, 185 = ~1A) #endif diff --git a/Marlin/src/pins/rambo/pins_SCOOVO_X9H.h b/Marlin/src/pins/rambo/pins_SCOOVO_X9H.h index 4af38e1de3..5680b00df6 100644 --- a/Marlin/src/pins/rambo/pins_SCOOVO_X9H.h +++ b/Marlin/src/pins/rambo/pins_SCOOVO_X9H.h @@ -92,7 +92,7 @@ #define E1_MS2_PIN 64 #define DIGIPOTSS_PIN 38 -#define DIGIPOT_CHANNELS {4,5,3,0,1} // X Y Z E0 E1 digipot channels to stepper driver mapping +#define DIGIPOT_CHANNELS { 4, 5, 3, 0, 1 } // X Y Z E0 E1 digipot channels to stepper driver mapping // // Temperature Sensors diff --git a/Marlin/src/pins/ramps/pins_BQ_ZUM_MEGA_3D.h b/Marlin/src/pins/ramps/pins_BQ_ZUM_MEGA_3D.h index 967fec7b47..f120e9c44f 100644 --- a/Marlin/src/pins/ramps/pins_BQ_ZUM_MEGA_3D.h +++ b/Marlin/src/pins/ramps/pins_BQ_ZUM_MEGA_3D.h @@ -85,7 +85,7 @@ // Steppers // #define DIGIPOTSS_PIN 22 -#define DIGIPOT_CHANNELS { 4, 5, 3, 0, 1 } +#define DIGIPOT_CHANNELS { 4, 5, 3, 0, 1 } // // Temperature Sensors From 2693d0eb271a748e52417bb31be2a938df42844c Mon Sep 17 00:00:00 2001 From: thinkyhead Date: Sun, 18 Oct 2020 00:16:03 +0000 Subject: [PATCH 057/226] [cron] Bump distribution date (2020-10-18) --- Marlin/src/inc/Version.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Marlin/src/inc/Version.h b/Marlin/src/inc/Version.h index 7aadf66a22..cf21b49bd8 100644 --- a/Marlin/src/inc/Version.h +++ b/Marlin/src/inc/Version.h @@ -42,7 +42,7 @@ * version was tagged. */ #ifndef STRING_DISTRIBUTION_DATE - #define STRING_DISTRIBUTION_DATE "2020-10-17" + #define STRING_DISTRIBUTION_DATE "2020-10-18" #endif /** From c2802d35bb1bcfc20785b0ccf255697b9c08c775 Mon Sep 17 00:00:00 2001 From: Jago Strong-Wright Date: Sun, 18 Oct 2020 04:35:19 +0100 Subject: [PATCH 058/226] Distinct Chopper Timing settings (#19781) Co-authored-by: Scott Lahteine --- Marlin/Configuration_adv.h | 20 ++++- Marlin/src/module/stepper/trinamic.cpp | 68 ++++++++--------- Marlin/src/module/stepper/trinamic.h | 100 ++++++++++++++++++++----- 3 files changed, 135 insertions(+), 53 deletions(-) diff --git a/Marlin/Configuration_adv.h b/Marlin/Configuration_adv.h index c3ba3f7e22..d6f31658cd 100644 --- a/Marlin/Configuration_adv.h +++ b/Marlin/Configuration_adv.h @@ -2471,10 +2471,26 @@ * CHOPPER_PRUSAMK3_24V // Imported parameters from the official Průša firmware for MK3 (24V) * CHOPPER_MARLIN_119 // Old defaults from Marlin v1.1.9 * - * Define you own with + * Define your own with: * { , , hysteresis_start[1..8] } */ - #define CHOPPER_TIMING CHOPPER_DEFAULT_12V + #define CHOPPER_TIMING CHOPPER_DEFAULT_12V // All axes (override below) + //#define CHOPPER_TIMING_X CHOPPER_DEFAULT_12V // For X Axes (override below) + //#define CHOPPER_TIMING_X2 CHOPPER_DEFAULT_12V + //#define CHOPPER_TIMING_Y CHOPPER_DEFAULT_12V // For Y Axes (override below) + //#define CHOPPER_TIMING_Y2 CHOPPER_DEFAULT_12V + //#define CHOPPER_TIMING_Z CHOPPER_DEFAULT_12V // For Z Axes (override below) + //#define CHOPPER_TIMING_Z2 CHOPPER_DEFAULT_12V + //#define CHOPPER_TIMING_Z3 CHOPPER_DEFAULT_12V + //#define CHOPPER_TIMING_Z4 CHOPPER_DEFAULT_12V + //#define CHOPPER_TIMING_E CHOPPER_DEFAULT_12V // For Extruders (override below) + //#define CHOPPER_TIMING_E1 CHOPPER_DEFAULT_12V + //#define CHOPPER_TIMING_E2 CHOPPER_DEFAULT_12V + //#define CHOPPER_TIMING_E3 CHOPPER_DEFAULT_12V + //#define CHOPPER_TIMING_E4 CHOPPER_DEFAULT_12V + //#define CHOPPER_TIMING_E5 CHOPPER_DEFAULT_12V + //#define CHOPPER_TIMING_E6 CHOPPER_DEFAULT_12V + //#define CHOPPER_TIMING_E7 CHOPPER_DEFAULT_12V /** * Monitor Trinamic drivers diff --git a/Marlin/src/module/stepper/trinamic.cpp b/Marlin/src/module/stepper/trinamic.cpp index d5a861d71b..ad11046f62 100644 --- a/Marlin/src/module/stepper/trinamic.cpp +++ b/Marlin/src/module/stepper/trinamic.cpp @@ -36,7 +36,7 @@ #include enum StealthIndex : uint8_t { STEALTH_AXIS_XY, STEALTH_AXIS_Z, STEALTH_AXIS_E }; -#define TMC_INIT(ST, STEALTH_INDEX) tmc_init(stepper##ST, ST##_CURRENT, ST##_MICROSTEPS, ST##_HYBRID_THRESHOLD, stealthchop_by_axis[STEALTH_INDEX]) +#define TMC_INIT(ST, STEALTH_INDEX) tmc_init(stepper##ST, ST##_CURRENT, ST##_MICROSTEPS, ST##_HYBRID_THRESHOLD, stealthchop_by_axis[STEALTH_INDEX], chopper_timing_##ST) // IC = TMC model number // ST = Stepper object letter @@ -131,15 +131,15 @@ enum StealthIndex : uint8_t { STEALTH_AXIS_XY, STEALTH_AXIS_Z, STEALTH_AXIS_E }; #if HAS_DRIVER(TMC2130) template - void tmc_init(TMCMarlin &st, const uint16_t mA, const uint16_t microsteps, const uint32_t hyb_thrs, const bool stealth) { + void tmc_init(TMCMarlin &st, const uint16_t mA, const uint16_t microsteps, const uint32_t hyb_thrs, const bool stealth, const chopper_timing_t &chop_init) { st.begin(); CHOPCONF_t chopconf{0}; - chopconf.tbl = 1; - chopconf.toff = chopper_timing.toff; + chopconf.tbl = 0b01; + chopconf.toff = chop_init.toff; chopconf.intpol = INTERPOLATE; - chopconf.hend = chopper_timing.hend + 3; - chopconf.hstrt = chopper_timing.hstrt - 1; + chopconf.hend = chop_init.hend + 3; + chopconf.hstrt = chop_init.hstrt - 1; TERN_(SQUARE_WAVE_STEPPING, chopconf.dedge = true); st.CHOPCONF(chopconf.sr); @@ -166,15 +166,15 @@ enum StealthIndex : uint8_t { STEALTH_AXIS_XY, STEALTH_AXIS_Z, STEALTH_AXIS_E }; #if HAS_DRIVER(TMC2160) template - void tmc_init(TMCMarlin &st, const uint16_t mA, const uint16_t microsteps, const uint32_t hyb_thrs, const bool stealth) { + void tmc_init(TMCMarlin &st, const uint16_t mA, const uint16_t microsteps, const uint32_t hyb_thrs, const bool stealth, const chopper_timing_t &chop_init) { st.begin(); CHOPCONF_t chopconf{0}; - chopconf.tbl = 1; - chopconf.toff = chopper_timing.toff; + chopconf.tbl = 0b01; + chopconf.toff = chop_init.toff; chopconf.intpol = INTERPOLATE; - chopconf.hend = chopper_timing.hend + 3; - chopconf.hstrt = chopper_timing.hstrt - 1; + chopconf.hend = chop_init.hend + 3; + chopconf.hstrt = chop_init.hstrt - 1; TERN_(SQUARE_WAVE_STEPPING, chopconf.dedge = true); st.CHOPCONF(chopconf.sr); @@ -484,7 +484,7 @@ enum StealthIndex : uint8_t { STEALTH_AXIS_XY, STEALTH_AXIS_Z, STEALTH_AXIS_E }; #if HAS_DRIVER(TMC2208) template - void tmc_init(TMCMarlin &st, const uint16_t mA, const uint16_t microsteps, const uint32_t hyb_thrs, const bool stealth) { + void tmc_init(TMCMarlin &st, const uint16_t mA, const uint16_t microsteps, const uint32_t hyb_thrs, const bool stealth, const chopper_timing_t &chop_init) { TMC2208_n::GCONF_t gconf{0}; gconf.pdn_disable = true; // Use UART gconf.mstep_reg_select = true; // Select microsteps with UART @@ -495,10 +495,10 @@ enum StealthIndex : uint8_t { STEALTH_AXIS_XY, STEALTH_AXIS_Z, STEALTH_AXIS_E }; TMC2208_n::CHOPCONF_t chopconf{0}; chopconf.tbl = 0b01; // blank_time = 24 - chopconf.toff = chopper_timing.toff; + chopconf.toff = chop_init.toff; chopconf.intpol = INTERPOLATE; - chopconf.hend = chopper_timing.hend + 3; - chopconf.hstrt = chopper_timing.hstrt - 1; + chopconf.hend = chop_init.hend + 3; + chopconf.hstrt = chop_init.hstrt - 1; TERN_(SQUARE_WAVE_STEPPING, chopconf.dedge = true); st.CHOPCONF(chopconf.sr); @@ -526,7 +526,7 @@ enum StealthIndex : uint8_t { STEALTH_AXIS_XY, STEALTH_AXIS_Z, STEALTH_AXIS_E }; #if HAS_DRIVER(TMC2209) template - void tmc_init(TMCMarlin &st, const uint16_t mA, const uint16_t microsteps, const uint32_t hyb_thrs, const bool stealth) { + void tmc_init(TMCMarlin &st, const uint16_t mA, const uint16_t microsteps, const uint32_t hyb_thrs, const bool stealth, const chopper_timing_t &chop_init) { TMC2208_n::GCONF_t gconf{0}; gconf.pdn_disable = true; // Use UART gconf.mstep_reg_select = true; // Select microsteps with UART @@ -537,10 +537,10 @@ enum StealthIndex : uint8_t { STEALTH_AXIS_XY, STEALTH_AXIS_Z, STEALTH_AXIS_E }; TMC2208_n::CHOPCONF_t chopconf{0}; chopconf.tbl = 0b01; // blank_time = 24 - chopconf.toff = chopper_timing.toff; + chopconf.toff = chop_init.toff; chopconf.intpol = INTERPOLATE; - chopconf.hend = chopper_timing.hend + 3; - chopconf.hstrt = chopper_timing.hstrt - 1; + chopconf.hend = chop_init.hend + 3; + chopconf.hstrt = chop_init.hstrt - 1; TERN_(SQUARE_WAVE_STEPPING, chopconf.dedge = true); st.CHOPCONF(chopconf.sr); @@ -568,14 +568,14 @@ enum StealthIndex : uint8_t { STEALTH_AXIS_XY, STEALTH_AXIS_Z, STEALTH_AXIS_E }; #if HAS_DRIVER(TMC2660) template - void tmc_init(TMCMarlin &st, const uint16_t mA, const uint16_t microsteps, const uint32_t, const bool) { + void tmc_init(TMCMarlin &st, const uint16_t mA, const uint16_t microsteps, const uint32_t, const bool, const chopper_timing_t &chop_init) { st.begin(); TMC2660_n::CHOPCONF_t chopconf{0}; - chopconf.tbl = 1; - chopconf.toff = chopper_timing.toff; - chopconf.hend = chopper_timing.hend + 3; - chopconf.hstrt = chopper_timing.hstrt - 1; + chopconf.tbl = 0b01; + chopconf.toff = chop_init.toff; + chopconf.hend = chop_init.hend + 3; + chopconf.hstrt = chop_init.hstrt - 1; st.CHOPCONF(chopconf.sr); st.sdoff(0); @@ -590,15 +590,15 @@ enum StealthIndex : uint8_t { STEALTH_AXIS_XY, STEALTH_AXIS_Z, STEALTH_AXIS_E }; #if HAS_DRIVER(TMC5130) template - void tmc_init(TMCMarlin &st, const uint16_t mA, const uint16_t microsteps, const uint32_t hyb_thrs, const bool stealth) { + void tmc_init(TMCMarlin &st, const uint16_t mA, const uint16_t microsteps, const uint32_t hyb_thrs, const bool stealth, const chopper_timing_t &chop_init) { st.begin(); CHOPCONF_t chopconf{0}; - chopconf.tbl = 1; - chopconf.toff = chopper_timing.toff; + chopconf.tbl = 0b01; + chopconf.toff = chop_init.toff; chopconf.intpol = INTERPOLATE; - chopconf.hend = chopper_timing.hend + 3; - chopconf.hstrt = chopper_timing.hstrt - 1; + chopconf.hend = chop_init.hend + 3; + chopconf.hstrt = chop_init.hstrt - 1; TERN_(SQUARE_WAVE_STEPPING, chopconf.dedge = true); st.CHOPCONF(chopconf.sr); @@ -625,15 +625,15 @@ enum StealthIndex : uint8_t { STEALTH_AXIS_XY, STEALTH_AXIS_Z, STEALTH_AXIS_E }; #if HAS_DRIVER(TMC5160) template - void tmc_init(TMCMarlin &st, const uint16_t mA, const uint16_t microsteps, const uint32_t hyb_thrs, const bool stealth) { + void tmc_init(TMCMarlin &st, const uint16_t mA, const uint16_t microsteps, const uint32_t hyb_thrs, const bool stealth, const chopper_timing_t &chop_init) { st.begin(); CHOPCONF_t chopconf{0}; - chopconf.tbl = 1; - chopconf.toff = chopper_timing.toff; + chopconf.tbl = 0b01; + chopconf.toff = chop_init.toff; chopconf.intpol = INTERPOLATE; - chopconf.hend = chopper_timing.hend + 3; - chopconf.hstrt = chopper_timing.hstrt - 1; + chopconf.hend = chop_init.hend + 3; + chopconf.hstrt = chop_init.hstrt - 1; TERN_(SQUARE_WAVE_STEPPING, chopconf.dedge = true); st.CHOPCONF(chopconf.sr); diff --git a/Marlin/src/module/stepper/trinamic.h b/Marlin/src/module/stepper/trinamic.h index 9cc3404cd2..7ae2a276db 100644 --- a/Marlin/src/module/stepper/trinamic.h +++ b/Marlin/src/module/stepper/trinamic.h @@ -76,7 +76,18 @@ typedef struct { uint8_t hstrt; } chopper_timing_t; -static constexpr chopper_timing_t chopper_timing = CHOPPER_TIMING; +#ifndef CHOPPER_TIMING_X + #define CHOPPER_TIMING_X CHOPPER_TIMING +#endif +#ifndef CHOPPER_TIMING_Y + #define CHOPPER_TIMING_Y CHOPPER_TIMING +#endif +#ifndef CHOPPER_TIMING_Z + #define CHOPPER_TIMING_Z CHOPPER_TIMING +#endif +#ifndef CHOPPER_TIMING_E + #define CHOPPER_TIMING_E CHOPPER_TIMING +#endif #if HAS_TMC220x void tmc_serial_begin(); @@ -90,9 +101,10 @@ void reset_trinamic_drivers(); // X Stepper #if AXIS_IS_TMC(X) extern TMC_CLASS(X, X) stepperX; + static constexpr chopper_timing_t chopper_timing_X = CHOPPER_TIMING_X; #if ENABLED(SOFTWARE_DRIVER_ENABLE) #define X_ENABLE_INIT() NOOP - #define X_ENABLE_WRITE(STATE) stepperX.toff((STATE)==X_ENABLE_ON ? chopper_timing.toff : 0) + #define X_ENABLE_WRITE(STATE) stepperX.toff((STATE)==X_ENABLE_ON ? chopper_timing_X.toff : 0) #define X_ENABLE_READ() stepperX.isEnabled() #endif #if AXIS_HAS_SQUARE_WAVE(X) @@ -103,9 +115,10 @@ void reset_trinamic_drivers(); // Y Stepper #if AXIS_IS_TMC(Y) extern TMC_CLASS(Y, Y) stepperY; + static constexpr chopper_timing_t chopper_timing_Y = CHOPPER_TIMING_Y; #if ENABLED(SOFTWARE_DRIVER_ENABLE) #define Y_ENABLE_INIT() NOOP - #define Y_ENABLE_WRITE(STATE) stepperY.toff((STATE)==Y_ENABLE_ON ? chopper_timing.toff : 0) + #define Y_ENABLE_WRITE(STATE) stepperY.toff((STATE)==Y_ENABLE_ON ? chopper_timing_Y.toff : 0) #define Y_ENABLE_READ() stepperY.isEnabled() #endif #if AXIS_HAS_SQUARE_WAVE(Y) @@ -116,9 +129,10 @@ void reset_trinamic_drivers(); // Z Stepper #if AXIS_IS_TMC(Z) extern TMC_CLASS(Z, Z) stepperZ; + static constexpr chopper_timing_t chopper_timing_Z = CHOPPER_TIMING_Z; #if ENABLED(SOFTWARE_DRIVER_ENABLE) #define Z_ENABLE_INIT() NOOP - #define Z_ENABLE_WRITE(STATE) stepperZ.toff((STATE)==Z_ENABLE_ON ? chopper_timing.toff : 0) + #define Z_ENABLE_WRITE(STATE) stepperZ.toff((STATE)==Z_ENABLE_ON ? chopper_timing_Z.toff : 0) #define Z_ENABLE_READ() stepperZ.isEnabled() #endif #if AXIS_HAS_SQUARE_WAVE(Z) @@ -129,9 +143,13 @@ void reset_trinamic_drivers(); // X2 Stepper #if HAS_X2_ENABLE && AXIS_IS_TMC(X2) extern TMC_CLASS(X2, X) stepperX2; + #ifndef CHOPPER_TIMING_X2 + #define CHOPPER_TIMING_X2 CHOPPER_TIMING_E + #endif + static constexpr chopper_timing_t chopper_timing_X2 = CHOPPER_TIMING_X2; #if ENABLED(SOFTWARE_DRIVER_ENABLE) #define X2_ENABLE_INIT() NOOP - #define X2_ENABLE_WRITE(STATE) stepperX2.toff((STATE)==X_ENABLE_ON ? chopper_timing.toff : 0) + #define X2_ENABLE_WRITE(STATE) stepperX2.toff((STATE)==X_ENABLE_ON ? chopper_timing_X2.toff : 0) #define X2_ENABLE_READ() stepperX2.isEnabled() #endif #if AXIS_HAS_SQUARE_WAVE(X2) @@ -142,9 +160,13 @@ void reset_trinamic_drivers(); // Y2 Stepper #if HAS_Y2_ENABLE && AXIS_IS_TMC(Y2) extern TMC_CLASS(Y2, Y) stepperY2; + #ifndef CHOPPER_TIMING_Y2 + #define CHOPPER_TIMING_Y2 CHOPPER_TIMING_E + #endif + static constexpr chopper_timing_t chopper_timing_Y2 = CHOPPER_TIMING_Y2; #if ENABLED(SOFTWARE_DRIVER_ENABLE) #define Y2_ENABLE_INIT() NOOP - #define Y2_ENABLE_WRITE(STATE) stepperY2.toff((STATE)==Y_ENABLE_ON ? chopper_timing.toff : 0) + #define Y2_ENABLE_WRITE(STATE) stepperY2.toff((STATE)==Y_ENABLE_ON ? chopper_timing_Y2.toff : 0) #define Y2_ENABLE_READ() stepperY2.isEnabled() #endif #if AXIS_HAS_SQUARE_WAVE(Y2) @@ -155,9 +177,13 @@ void reset_trinamic_drivers(); // Z2 Stepper #if HAS_Z2_ENABLE && AXIS_IS_TMC(Z2) extern TMC_CLASS(Z2, Z) stepperZ2; + #ifndef CHOPPER_TIMING_Z2 + #define CHOPPER_TIMING_Z2 CHOPPER_TIMING_E + #endif + static constexpr chopper_timing_t chopper_timing_Z2 = CHOPPER_TIMING_Z2; #if ENABLED(SOFTWARE_DRIVER_ENABLE) && AXIS_IS_TMC(Z2) #define Z2_ENABLE_INIT() NOOP - #define Z2_ENABLE_WRITE(STATE) stepperZ2.toff((STATE)==Z_ENABLE_ON ? chopper_timing.toff : 0) + #define Z2_ENABLE_WRITE(STATE) stepperZ2.toff((STATE)==Z_ENABLE_ON ? chopper_timing_Z2.toff : 0) #define Z2_ENABLE_READ() stepperZ2.isEnabled() #endif #if AXIS_HAS_SQUARE_WAVE(Z2) @@ -168,9 +194,13 @@ void reset_trinamic_drivers(); // Z3 Stepper #if HAS_Z3_ENABLE && AXIS_IS_TMC(Z3) extern TMC_CLASS(Z3, Z) stepperZ3; + #ifndef CHOPPER_TIMING_Z3 + #define CHOPPER_TIMING_Z3 CHOPPER_TIMING_E + #endif + static constexpr chopper_timing_t chopper_timing_Z3 = CHOPPER_TIMING_Z3; #if ENABLED(SOFTWARE_DRIVER_ENABLE) #define Z3_ENABLE_INIT() NOOP - #define Z3_ENABLE_WRITE(STATE) stepperZ3.toff((STATE)==Z_ENABLE_ON ? chopper_timing.toff : 0) + #define Z3_ENABLE_WRITE(STATE) stepperZ3.toff((STATE)==Z_ENABLE_ON ? chopper_timing_Z3.toff : 0) #define Z3_ENABLE_READ() stepperZ3.isEnabled() #endif #if AXIS_HAS_SQUARE_WAVE(Z3) @@ -181,9 +211,13 @@ void reset_trinamic_drivers(); // Z4 Stepper #if HAS_Z4_ENABLE && AXIS_IS_TMC(Z4) extern TMC_CLASS(Z4, Z) stepperZ4; + #ifndef CHOPPER_TIMING_Z4 + #define CHOPPER_TIMING_Z4 CHOPPER_TIMING_E + #endif + static constexpr chopper_timing_t chopper_timing_Z4 = CHOPPER_TIMING_Z4; #if ENABLED(SOFTWARE_DRIVER_ENABLE) #define Z4_ENABLE_INIT() NOOP - #define Z4_ENABLE_WRITE(STATE) stepperZ4.toff((STATE)==Z_ENABLE_ON ? chopper_timing.toff : 0) + #define Z4_ENABLE_WRITE(STATE) stepperZ4.toff((STATE)==Z_ENABLE_ON ? chopper_timing_Z4.toff : 0) #define Z4_ENABLE_READ() stepperZ4.isEnabled() #endif #if AXIS_HAS_SQUARE_WAVE(Z4) @@ -194,9 +228,13 @@ void reset_trinamic_drivers(); // E0 Stepper #if AXIS_IS_TMC(E0) extern TMC_CLASS_E(0) stepperE0; + #ifndef CHOPPER_TIMING_E0 + #define CHOPPER_TIMING_E0 CHOPPER_TIMING_E + #endif + static constexpr chopper_timing_t chopper_timing_E0 = CHOPPER_TIMING_E0; #if ENABLED(SOFTWARE_DRIVER_ENABLE) && AXIS_IS_TMC(E0) #define E0_ENABLE_INIT() NOOP - #define E0_ENABLE_WRITE(STATE) stepperE0.toff((STATE)==E_ENABLE_ON ? chopper_timing.toff : 0) + #define E0_ENABLE_WRITE(STATE) stepperE0.toff((STATE)==E_ENABLE_ON ? chopper_timing_E0.toff : 0) #define E0_ENABLE_READ() stepperE0.isEnabled() #endif #if AXIS_HAS_SQUARE_WAVE(E0) @@ -207,9 +245,13 @@ void reset_trinamic_drivers(); // E1 Stepper #if AXIS_IS_TMC(E1) extern TMC_CLASS_E(1) stepperE1; + #ifndef CHOPPER_TIMING_E1 + #define CHOPPER_TIMING_E1 CHOPPER_TIMING_E + #endif + static constexpr chopper_timing_t chopper_timing_E1 = CHOPPER_TIMING_E1; #if ENABLED(SOFTWARE_DRIVER_ENABLE) && AXIS_IS_TMC(E1) #define E1_ENABLE_INIT() NOOP - #define E1_ENABLE_WRITE(STATE) stepperE1.toff((STATE)==E_ENABLE_ON ? chopper_timing.toff : 0) + #define E1_ENABLE_WRITE(STATE) stepperE1.toff((STATE)==E_ENABLE_ON ? chopper_timing_E1.toff : 0) #define E1_ENABLE_READ() stepperE1.isEnabled() #endif #if AXIS_HAS_SQUARE_WAVE(E1) @@ -220,9 +262,13 @@ void reset_trinamic_drivers(); // E2 Stepper #if AXIS_IS_TMC(E2) extern TMC_CLASS_E(2) stepperE2; + #ifndef CHOPPER_TIMING_E2 + #define CHOPPER_TIMING_E2 CHOPPER_TIMING_E + #endif + static constexpr chopper_timing_t chopper_timing_E2 = CHOPPER_TIMING_E2; #if ENABLED(SOFTWARE_DRIVER_ENABLE) && AXIS_IS_TMC(E2) #define E2_ENABLE_INIT() NOOP - #define E2_ENABLE_WRITE(STATE) stepperE2.toff((STATE)==E_ENABLE_ON ? chopper_timing.toff : 0) + #define E2_ENABLE_WRITE(STATE) stepperE2.toff((STATE)==E_ENABLE_ON ? chopper_timing_E2.toff : 0) #define E2_ENABLE_READ() stepperE2.isEnabled() #endif #if AXIS_HAS_SQUARE_WAVE(E2) @@ -233,9 +279,13 @@ void reset_trinamic_drivers(); // E3 Stepper #if AXIS_IS_TMC(E3) extern TMC_CLASS_E(3) stepperE3; + #ifndef CHOPPER_TIMING_E3 + #define CHOPPER_TIMING_E3 CHOPPER_TIMING_E + #endif + static constexpr chopper_timing_t chopper_timing_E3 = CHOPPER_TIMING_E3; #if ENABLED(SOFTWARE_DRIVER_ENABLE) && AXIS_IS_TMC(E3) #define E3_ENABLE_INIT() NOOP - #define E3_ENABLE_WRITE(STATE) stepperE3.toff((STATE)==E_ENABLE_ON ? chopper_timing.toff : 0) + #define E3_ENABLE_WRITE(STATE) stepperE3.toff((STATE)==E_ENABLE_ON ? chopper_timing_E3.toff : 0) #define E3_ENABLE_READ() stepperE3.isEnabled() #endif #if AXIS_HAS_SQUARE_WAVE(E3) @@ -246,9 +296,13 @@ void reset_trinamic_drivers(); // E4 Stepper #if AXIS_IS_TMC(E4) extern TMC_CLASS_E(4) stepperE4; + #ifndef CHOPPER_TIMING_E4 + #define CHOPPER_TIMING_E4 CHOPPER_TIMING_E + #endif + static constexpr chopper_timing_t chopper_timing_E4 = CHOPPER_TIMING_E4; #if ENABLED(SOFTWARE_DRIVER_ENABLE) && AXIS_IS_TMC(E4) #define E4_ENABLE_INIT() NOOP - #define E4_ENABLE_WRITE(STATE) stepperE4.toff((STATE)==E_ENABLE_ON ? chopper_timing.toff : 0) + #define E4_ENABLE_WRITE(STATE) stepperE4.toff((STATE)==E_ENABLE_ON ? chopper_timing_E4.toff : 0) #define E4_ENABLE_READ() stepperE4.isEnabled() #endif #if AXIS_HAS_SQUARE_WAVE(E4) @@ -259,9 +313,13 @@ void reset_trinamic_drivers(); // E5 Stepper #if AXIS_IS_TMC(E5) extern TMC_CLASS_E(5) stepperE5; + #ifndef CHOPPER_TIMING_E5 + #define CHOPPER_TIMING_E5 CHOPPER_TIMING_E + #endif + static constexpr chopper_timing_t chopper_timing_E5 = CHOPPER_TIMING_E5; #if ENABLED(SOFTWARE_DRIVER_ENABLE) && AXIS_IS_TMC(E5) #define E5_ENABLE_INIT() NOOP - #define E5_ENABLE_WRITE(STATE) stepperE5.toff((STATE)==E_ENABLE_ON ? chopper_timing.toff : 0) + #define E5_ENABLE_WRITE(STATE) stepperE5.toff((STATE)==E_ENABLE_ON ? chopper_timing_E5.toff : 0) #define E5_ENABLE_READ() stepperE5.isEnabled() #endif #if AXIS_HAS_SQUARE_WAVE(E5) @@ -272,9 +330,13 @@ void reset_trinamic_drivers(); // E6 Stepper #if AXIS_IS_TMC(E6) extern TMC_CLASS_E(6) stepperE6; + #ifndef CHOPPER_TIMING_E6 + #define CHOPPER_TIMING_E6 CHOPPER_TIMING_E + #endif + static constexpr chopper_timing_t chopper_timing_E6 = CHOPPER_TIMING_E6; #if ENABLED(SOFTWARE_DRIVER_ENABLE) && AXIS_IS_TMC(E6) #define E6_ENABLE_INIT() NOOP - #define E6_ENABLE_WRITE(STATE) stepperE6.toff((STATE)==E_ENABLE_ON ? chopper_timing.toff : 0) + #define E6_ENABLE_WRITE(STATE) stepperE6.toff((STATE)==E_ENABLE_ON ? chopper_timing_E6.toff : 0) #define E6_ENABLE_READ() stepperE6.isEnabled() #endif #if AXIS_HAS_SQUARE_WAVE(E6) @@ -285,9 +347,13 @@ void reset_trinamic_drivers(); // E7 Stepper #if AXIS_IS_TMC(E7) extern TMC_CLASS_E(7) stepperE7; + #ifndef CHOPPER_TIMING_E7 + #define CHOPPER_TIMING_E7 CHOPPER_TIMING_E + #endif + static constexpr chopper_timing_t chopper_timing_E7 = CHOPPER_TIMING_E7; #if ENABLED(SOFTWARE_DRIVER_ENABLE) && AXIS_IS_TMC(E7) #define E7_ENABLE_INIT() NOOP - #define E7_ENABLE_WRITE(STATE) stepperE7.toff((STATE)==E_ENABLE_ON ? chopper_timing.toff : 0) + #define E7_ENABLE_WRITE(STATE) stepperE7.toff((STATE)==E_ENABLE_ON ? chopper_timing_E7.toff : 0) #define E7_ENABLE_READ() stepperE7.isEnabled() #endif #if AXIS_HAS_SQUARE_WAVE(E7) From b0f0dc683da8c70696c6a3704193b9db58cb9825 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Sun, 18 Oct 2020 00:20:25 -0500 Subject: [PATCH 059/226] ABM Teensy 3.6 build --- Marlin/src/pins/pins.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Marlin/src/pins/pins.h b/Marlin/src/pins/pins.h index bd85c44899..8792cd3dfa 100644 --- a/Marlin/src/pins/pins.h +++ b/Marlin/src/pins/pins.h @@ -581,7 +581,7 @@ #elif MB(TEENSY31_32) #include "teensy3/pins_TEENSY31_32.h" // TEENSY31_32 env:teensy31 #elif MB(TEENSY35_36) - #include "teensy3/pins_TEENSY35_36.h" // TEENSY35_36 env:teensy35 + #include "teensy3/pins_TEENSY35_36.h" // TEENSY35_36 env:teensy35 env:teensy36 // // STM32 ARM Cortex-M4F From 6375829448eebe01b2835689aac69b73b63ebfd8 Mon Sep 17 00:00:00 2001 From: InsanityAutomation <38436470+InsanityAutomation@users.noreply.github.com> Date: Sun, 18 Oct 2020 16:53:12 -0400 Subject: [PATCH 060/226] Apply home offsets to probing, Z Safe Homing (#19423) Co-authored-by: Scott Lahteine --- Marlin/src/gcode/bedlevel/abl/G29.cpp | 26 +++++-------- Marlin/src/gcode/calibrate/G28.cpp | 10 ++++- Marlin/src/gcode/geometry/M206_M428.cpp | 12 +++++- Marlin/src/module/motion.h | 4 -- Marlin/src/module/probe.h | 52 +++++++++---------------- 5 files changed, 47 insertions(+), 57 deletions(-) diff --git a/Marlin/src/gcode/bedlevel/abl/G29.cpp b/Marlin/src/gcode/bedlevel/abl/G29.cpp index fcdab742cf..f387dd9bd8 100644 --- a/Marlin/src/gcode/bedlevel/abl/G29.cpp +++ b/Marlin/src/gcode/bedlevel/abl/G29.cpp @@ -361,32 +361,24 @@ G29_TYPE GcodeSuite::G29() { if (parser.seen('H')) { const int16_t size = (int16_t)parser.value_linear_units(); - probe_position_lf.set( - _MAX(X_CENTER - size / 2, x_min), - _MAX(Y_CENTER - size / 2, y_min) - ); - probe_position_rb.set( - _MIN(probe_position_lf.x + size, x_max), - _MIN(probe_position_lf.y + size, y_max) - ); + probe_position_lf.set(_MAX((X_CENTER) - size / 2, x_min), _MAX((Y_CENTER) - size / 2, y_min)); + probe_position_rb.set(_MIN(probe_position_lf.x + size, x_max), _MIN(probe_position_lf.y + size, y_max)); } else { - probe_position_lf.set( - parser.seenval('L') ? RAW_X_POSITION(parser.value_linear_units()) : x_min, - parser.seenval('F') ? RAW_Y_POSITION(parser.value_linear_units()) : y_min - ); - probe_position_rb.set( - parser.seenval('R') ? RAW_X_POSITION(parser.value_linear_units()) : x_max, - parser.seenval('B') ? RAW_Y_POSITION(parser.value_linear_units()) : y_max - ); + probe_position_lf.set(parser.linearval('L', x_min), parser.linearval('F', y_min)); + probe_position_rb.set(parser.linearval('R', x_max), parser.linearval('B', y_max)); } if (!probe.good_bounds(probe_position_lf, probe_position_rb)) { + if (DEBUGGING(LEVELING)) { + DEBUG_ECHOLNPAIR("G29 L", probe_position_lf.x, " R", probe_position_rb.x, + " F", probe_position_lf.y, " B", probe_position_rb.y); + } SERIAL_ECHOLNPGM("? (L,R,F,B) out of bounds."); G29_RETURN(false); } - // probe at the points of a lattice grid + // Probe at the points of a lattice grid gridSpacing.set((probe_position_rb.x - probe_position_lf.x) / (abl_grid_points.x - 1), (probe_position_rb.y - probe_position_lf.y) / (abl_grid_points.y - 1)); diff --git a/Marlin/src/gcode/calibrate/G28.cpp b/Marlin/src/gcode/calibrate/G28.cpp index 06b9fee257..a91dd82a2a 100644 --- a/Marlin/src/gcode/calibrate/G28.cpp +++ b/Marlin/src/gcode/calibrate/G28.cpp @@ -126,7 +126,15 @@ * Move the Z probe (or just the nozzle) to the safe homing point * (Z is already at the right height) */ - destination.set(safe_homing_xy, current_position.z); + constexpr xy_float_t safe_homing_xy = { Z_SAFE_HOMING_X_POINT, Z_SAFE_HOMING_Y_POINT }; + #if HAS_HOME_OFFSET + xy_float_t okay_homing_xy = safe_homing_xy; + okay_homing_xy -= home_offset; + #else + constexpr xy_float_t okay_homing_xy = safe_homing_xy; + #endif + + destination.set(okay_homing_xy, current_position.z); TERN_(HOMING_Z_WITH_PROBE, destination -= probe.offset_xy); diff --git a/Marlin/src/gcode/geometry/M206_M428.cpp b/Marlin/src/gcode/geometry/M206_M428.cpp index 70cb1e19e5..efb89fbcf2 100644 --- a/Marlin/src/gcode/geometry/M206_M428.cpp +++ b/Marlin/src/gcode/geometry/M206_M428.cpp @@ -28,6 +28,13 @@ #include "../../module/motion.h" #include "../../lcd/marlinui.h" #include "../../libs/buzzer.h" +#include "../../MarlinCore.h" + +extern const char SP_Y_STR[], SP_Z_STR[]; + +void m206_report() { + SERIAL_ECHOLNPAIR_P(PSTR("M206 X"), home_offset.x, SP_Y_STR, home_offset.y, SP_Z_STR, home_offset.z); +} /** * M206: Set Additional Homing Offset (X Y Z). SCARA aliases T=X, P=Y @@ -46,7 +53,10 @@ void GcodeSuite::M206() { if (parser.seen('P')) set_home_offset(B_AXIS, parser.value_float()); // Psi #endif - report_current_position(); + if (!parser.seen("XYZ")) + m206_report(); + else + report_current_position(); } /** diff --git a/Marlin/src/module/motion.h b/Marlin/src/module/motion.h index 5a8a8e0045..abc59f92b8 100644 --- a/Marlin/src/module/motion.h +++ b/Marlin/src/module/motion.h @@ -78,10 +78,6 @@ extern xyz_pos_t cartes; #define XY_PROBE_FEEDRATE_MM_S PLANNER_XY_FEEDRATE() #endif -#if ENABLED(Z_SAFE_HOMING) - constexpr xy_float_t safe_homing_xy = { Z_SAFE_HOMING_X_POINT, Z_SAFE_HOMING_Y_POINT }; -#endif - /** * Feed rates are often configured with mm/m * but the planner and stepper like mm/s units. diff --git a/Marlin/src/module/probe.h b/Marlin/src/module/probe.h index f0f56ec191..98e6aff1b5 100644 --- a/Marlin/src/module/probe.h +++ b/Marlin/src/module/probe.h @@ -133,53 +133,37 @@ public: #if HAS_BED_PROBE || HAS_LEVELING #if IS_KINEMATIC static constexpr float printable_radius = ( - #if ENABLED(DELTA) - DELTA_PRINTABLE_RADIUS - #elif IS_SCARA - SCARA_PRINTABLE_RADIUS - #endif + TERN_(DELTA, DELTA_PRINTABLE_RADIUS) + TERN_(IS_SCARA, SCARA_PRINTABLE_RADIUS) ); - static inline float probe_radius() { return printable_radius - _MAX(PROBING_MARGIN, HYPOT(offset_xy.x, offset_xy.y)); } #endif static inline float min_x() { - return ( - #if IS_KINEMATIC - (X_CENTER) - probe_radius() - #else - _MAX((X_MIN_BED) + (PROBING_MARGIN_LEFT), (X_MIN_POS) + offset_xy.x) - #endif - ); + return TERN(IS_KINEMATIC, + (X_CENTER) - probe_radius(), + _MAX((X_MIN_BED) + (PROBING_MARGIN_LEFT), (X_MIN_POS) + offset_xy.x) + ) - TERN0(NOZZLE_AS_PROBE, home_offset.x); } static inline float max_x() { - return ( - #if IS_KINEMATIC - (X_CENTER) + probe_radius() - #else - _MIN((X_MAX_BED) - (PROBING_MARGIN_RIGHT), (X_MAX_POS) + offset_xy.x) - #endif - ); + return TERN(IS_KINEMATIC, + (X_CENTER) + probe_radius(), + _MIN((X_MAX_BED) - (PROBING_MARGIN_RIGHT), (X_MAX_POS) + offset_xy.x) + ) - TERN0(NOZZLE_AS_PROBE, home_offset.x); } static inline float min_y() { - return ( - #if IS_KINEMATIC - (Y_CENTER) - probe_radius() - #else - _MAX((Y_MIN_BED) + (PROBING_MARGIN_FRONT), (Y_MIN_POS) + offset_xy.y) - #endif - ); + return TERN(IS_KINEMATIC, + (Y_CENTER) - probe_radius(), + _MAX((Y_MIN_BED) + (PROBING_MARGIN_FRONT), (Y_MIN_POS) + offset_xy.y) + ) - TERN0(NOZZLE_AS_PROBE, home_offset.y); } static inline float max_y() { - return ( - #if IS_KINEMATIC - (Y_CENTER) + probe_radius() - #else - _MIN((Y_MAX_BED) - (PROBING_MARGIN_BACK), (Y_MAX_POS) + offset_xy.y) - #endif - ); + return TERN(IS_KINEMATIC, + (Y_CENTER) + probe_radius(), + _MIN((Y_MAX_BED) - (PROBING_MARGIN_BACK), (Y_MAX_POS) + offset_xy.y) + ) - TERN0(NOZZLE_AS_PROBE, home_offset.y); } #if NEEDS_THREE_PROBE_POINTS From 8285953c1b5be6ecc7ff9103f287776bede8cfb2 Mon Sep 17 00:00:00 2001 From: thinkyhead Date: Mon, 19 Oct 2020 00:16:11 +0000 Subject: [PATCH 061/226] [cron] Bump distribution date (2020-10-19) --- Marlin/src/inc/Version.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Marlin/src/inc/Version.h b/Marlin/src/inc/Version.h index cf21b49bd8..9fdbc72153 100644 --- a/Marlin/src/inc/Version.h +++ b/Marlin/src/inc/Version.h @@ -42,7 +42,7 @@ * version was tagged. */ #ifndef STRING_DISTRIBUTION_DATE - #define STRING_DISTRIBUTION_DATE "2020-10-18" + #define STRING_DISTRIBUTION_DATE "2020-10-19" #endif /** From f5019307280a8216d5ea506fc7ff3bbb39a1cdf9 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Mon, 19 Oct 2020 00:37:32 -0500 Subject: [PATCH 062/226] Document M125 P --- Marlin/src/gcode/feature/pause/M125.cpp | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/Marlin/src/gcode/feature/pause/M125.cpp b/Marlin/src/gcode/feature/pause/M125.cpp index ed9a393310..b1d76e83ae 100644 --- a/Marlin/src/gcode/feature/pause/M125.cpp +++ b/Marlin/src/gcode/feature/pause/M125.cpp @@ -49,10 +49,13 @@ * position and waits, resuming with a button click or M108. * Without PARK_HEAD_ON_PAUSE the M125 command does nothing. * - * L = override retract length - * X = override X - * Y = override Y - * Z = override Z raise + * L = Override retract Length + * X = Override park position X + * Y = Override park position Y + * Z = Override Z raise + * + * With an LCD menu: + * P = Always show a prompt and await a response */ void GcodeSuite::M125() { // Initial retract before move to filament change position @@ -75,7 +78,8 @@ void GcodeSuite::M125() { TERN_(HAS_LCD_MENU, lcd_pause_show_message(PAUSE_MESSAGE_PARKING, PAUSE_MODE_PAUSE_PRINT)); - const bool show_lcd = TERN0(HAS_LCD_MENU, parser.seenval('P')); + // If possible, show an LCD prompt with the 'P' flag + const bool show_lcd = TERN0(HAS_LCD_MENU, parser.boolval('P')); if (pause_print(retract, park_point, 0, show_lcd)) { TERN_(POWER_LOSS_RECOVERY, if (recovery.enabled) recovery.save(true)); From ea80b2c8fc4209160eed377437610c298312e97f Mon Sep 17 00:00:00 2001 From: ellensp Date: Mon, 19 Oct 2020 21:16:02 +1300 Subject: [PATCH 063/226] Ensure A4988 for unspecified driver type (#19798) Co-authored-by: Scott Lahteine --- Marlin/Configuration.h | 8 +-- Marlin/src/inc/Conditionals_LCD.h | 113 +++++++++++++++++++++++++----- Marlin/src/inc/SanityCheck.h | 54 ++++++++++++++ buildroot/tests/teensy35-tests | 3 +- buildroot/tests/teensy41-tests | 3 +- 5 files changed, 156 insertions(+), 25 deletions(-) diff --git a/Marlin/Configuration.h b/Marlin/Configuration.h index 1f6b0db946..60f8368517 100644 --- a/Marlin/Configuration.h +++ b/Marlin/Configuration.h @@ -678,15 +678,15 @@ * TMC5130, TMC5130_STANDALONE, TMC5160, TMC5160_STANDALONE * :['A4988', 'A5984', 'DRV8825', 'LV8729', 'L6470', 'L6474', 'POWERSTEP01', 'TB6560', 'TB6600', 'TMC2100', 'TMC2130', 'TMC2130_STANDALONE', 'TMC2160', 'TMC2160_STANDALONE', 'TMC2208', 'TMC2208_STANDALONE', 'TMC2209', 'TMC2209_STANDALONE', 'TMC26X', 'TMC26X_STANDALONE', 'TMC2660', 'TMC2660_STANDALONE', 'TMC5130', 'TMC5130_STANDALONE', 'TMC5160', 'TMC5160_STANDALONE'] */ -//#define X_DRIVER_TYPE A4988 -//#define Y_DRIVER_TYPE A4988 -//#define Z_DRIVER_TYPE A4988 +#define X_DRIVER_TYPE A4988 +#define Y_DRIVER_TYPE A4988 +#define Z_DRIVER_TYPE A4988 //#define X2_DRIVER_TYPE A4988 //#define Y2_DRIVER_TYPE A4988 //#define Z2_DRIVER_TYPE A4988 //#define Z3_DRIVER_TYPE A4988 //#define Z4_DRIVER_TYPE A4988 -//#define E0_DRIVER_TYPE A4988 +#define E0_DRIVER_TYPE A4988 //#define E1_DRIVER_TYPE A4988 //#define E2_DRIVER_TYPE A4988 //#define E3_DRIVER_TYPE A4988 diff --git a/Marlin/src/inc/Conditionals_LCD.h b/Marlin/src/inc/Conditionals_LCD.h index cbc75cfb6d..f909112507 100644 --- a/Marlin/src/inc/Conditionals_LCD.h +++ b/Marlin/src/inc/Conditionals_LCD.h @@ -755,19 +755,7 @@ #define GRID_LOOP(A,B) LOOP_L_N(A, GRID_MAX_POINTS_X) LOOP_L_N(B, GRID_MAX_POINTS_Y) #endif -#ifndef INVERT_X_DIR - #define INVERT_X_DIR false -#endif -#ifndef INVERT_Y_DIR - #define INVERT_Y_DIR false -#endif -#ifndef INVERT_Z_DIR - #define INVERT_Z_DIR false -#endif -#ifndef INVERT_E_DIR - #define INVERT_E_DIR false -#endif - +// Slim menu optimizations #if ENABLED(SLIM_LCD_MENUS) #define BOOT_MARLIN_LOGO_SMALL #endif @@ -786,14 +774,105 @@ #define HAS_CLASSIC_E_JERK 1 #endif -#ifndef SPI_SPEED - #define SPI_SPEED SPI_FULL_SPEED -#endif - #if SERIAL_PORT == -1 || SERIAL_PORT_2 == -1 #define HAS_USB_SERIAL 1 #endif +// Fallback Stepper Driver types +#ifndef X_DRIVER_TYPE + #define X_DRIVER_TYPE A4988 +#endif +#ifndef Y_DRIVER_TYPE + #define Y_DRIVER_TYPE A4988 +#endif +#ifndef Z_DRIVER_TYPE + #define Z_DRIVER_TYPE A4988 +#endif +#if NONE(DUAL_X_CARRIAGE, X_DUAL_STEPPER_DRIVERS) + #undef X2_DRIVER_TYPE +#elif !defined(X2_DRIVER_TYPE) + #define X2_DRIVER_TYPE A4988 +#endif +#if DISABLED(Y_DUAL_STEPPER_DRIVERS) + #undef Y2_DRIVER_TYPE +#elif !defined(Y2_DRIVER_TYPE) + #define Y2_DRIVER_TYPE A4988 +#endif +#if NUM_Z_STEPPER_DRIVERS < 2 + #undef Z2_DRIVER_TYPE +#elif !defined(Z2_DRIVER_TYPE) + #define Z2_DRIVER_TYPE A4988 +#endif +#if NUM_Z_STEPPER_DRIVERS < 3 + #undef Z3_DRIVER_TYPE +#elif !defined(Z3_DRIVER_TYPE) + #define Z3_DRIVER_TYPE A4988 +#endif +#if NUM_Z_STEPPER_DRIVERS < 4 + #undef Z4_DRIVER_TYPE +#elif !defined(Z4_DRIVER_TYPE) + #define Z4_DRIVER_TYPE A4988 +#endif +#if E_STEPPERS < 1 + #undef E0_DRIVER_TYPE +#elif !defined(E0_DRIVER_TYPE) + #define E0_DRIVER_TYPE A4988 +#endif +#if E_STEPPERS < 2 + #undef E1_DRIVER_TYPE +#elif !defined(E1_DRIVER_TYPE) + #define E1_DRIVER_TYPE A4988 +#endif +#if E_STEPPERS < 3 + #undef E2_DRIVER_TYPE +#elif !defined(E2_DRIVER_TYPE) + #define E2_DRIVER_TYPE A4988 +#endif +#if E_STEPPERS < 4 + #undef E3_DRIVER_TYPE +#elif !defined(E3_DRIVER_TYPE) + #define E3_DRIVER_TYPE A4988 +#endif +#if E_STEPPERS < 5 + #undef E4_DRIVER_TYPE +#elif !defined(E4_DRIVER_TYPE) + #define E4_DRIVER_TYPE A4988 +#endif +#if E_STEPPERS < 6 + #undef E5_DRIVER_TYPE +#elif !defined(E5_DRIVER_TYPE) + #define E5_DRIVER_TYPE A4988 +#endif +#if E_STEPPERS < 7 + #undef E6_DRIVER_TYPE +#elif !defined(E6_DRIVER_TYPE) + #define E6_DRIVER_TYPE A4988 +#endif +#if E_STEPPERS < 8 + #undef E7_DRIVER_TYPE +#elif !defined(E7_DRIVER_TYPE) + #define E7_DRIVER_TYPE A4988 +#endif + +// Fallback axis inverting +#ifndef INVERT_X_DIR + #define INVERT_X_DIR false +#endif +#ifndef INVERT_Y_DIR + #define INVERT_Y_DIR false +#endif +#ifndef INVERT_Z_DIR + #define INVERT_Z_DIR false +#endif +#ifndef INVERT_E_DIR + #define INVERT_E_DIR false +#endif + +// Fallback SPI Speed +#ifndef SPI_SPEED + #define SPI_SPEED SPI_FULL_SPEED +#endif + /** * This setting is also used by M109 when trying to calculate * a ballpark safe margin to prevent wait-forever situation. diff --git a/Marlin/src/inc/SanityCheck.h b/Marlin/src/inc/SanityCheck.h index 9aea18c2d7..657e055241 100644 --- a/Marlin/src/inc/SanityCheck.h +++ b/Marlin/src/inc/SanityCheck.h @@ -3179,5 +3179,59 @@ static_assert( _ARR_TEST(3,0) && _ARR_TEST(3,1) && _ARR_TEST(3,2) #endif #endif +/** + * Sanity check for valid stepper driver types + */ +#define _BAD_DRIVER(A) (defined(A##_DRIVER_TYPE) && !_DRIVER_ID(A##_DRIVER_TYPE)) +#if _BAD_DRIVER(X) + #error "X_DRIVER_TYPE is not recognized." +#endif +#if _BAD_DRIVER(Y) + #error "Y_DRIVER_TYPE is not recognized." +#endif +#if _BAD_DRIVER(Z) + #error "Z_DRIVER_TYPE is not recognized." +#endif +#if _BAD_DRIVER(X2) + #error "X2_DRIVER_TYPE is not recognized." +#endif +#if _BAD_DRIVER(Y2) + #error "Y2_DRIVER_TYPE is not recognized." +#endif +#if _BAD_DRIVER(Z2) + #error "Z2_DRIVER_TYPE is not recognized." +#endif +#if _BAD_DRIVER(Z3) + #error "Z3_DRIVER_TYPE is not recognized." +#endif +#if _BAD_DRIVER(Z4) + #error "Z4_DRIVER_TYPE is not recognized." +#endif +#if _BAD_DRIVER(E0) + #error "E0_DRIVER_TYPE is not recognized." +#endif +#if _BAD_DRIVER(E1) + #error "E1_DRIVER_TYPE is not recognized." +#endif +#if _BAD_DRIVER(E2) + #error "E2_DRIVER_TYPE is not recognized." +#endif +#if _BAD_DRIVER(E3) + #error "E3_DRIVER_TYPE is not recognized." +#endif +#if _BAD_DRIVER(E4) + #error "E4_DRIVER_TYPE is not recognized." +#endif +#if _BAD_DRIVER(E5) + #error "E5_DRIVER_TYPE is not recognized." +#endif +#if _BAD_DRIVER(E6) + #error "E6_DRIVER_TYPE is not recognized." +#endif +#if _BAD_DRIVER(E7) + #error "E7_DRIVER_TYPE is not recognized." +#endif +#undef _BAD_DRIVER + // Misc. Cleanup #undef _TEST_PWM diff --git a/buildroot/tests/teensy35-tests b/buildroot/tests/teensy35-tests index c729f212a4..20a0c19726 100755 --- a/buildroot/tests/teensy35-tests +++ b/buildroot/tests/teensy35-tests @@ -112,11 +112,10 @@ exec_test $1 $2 "Teensy 3.5/3.6 COREXZ" # restore_configs opt_set MOTHERBOARD BOARD_TEENSY35_36 -opt_enable Z_MULTI_ENDSTOPS opt_set NUM_Z_STEPPER_DRIVERS 2 +opt_enable Z_MULTI_ENDSTOPS USE_XMAX_PLUG pins_set ramps/RAMPS X_MAX_PIN -1 opt_add Z2_MAX_PIN 2 -opt_enable USE_XMAX_PLUG exec_test $1 $2 "Dual Z with Dual Z endstops" # Clean up diff --git a/buildroot/tests/teensy41-tests b/buildroot/tests/teensy41-tests index 8d32d131e9..415d551f55 100644 --- a/buildroot/tests/teensy41-tests +++ b/buildroot/tests/teensy41-tests @@ -113,11 +113,10 @@ exec_test $1 $2 "Teensy 4.0/4.1 COREXZ" # restore_configs opt_set MOTHERBOARD BOARD_TEENSY41 -opt_enable Z_MULTI_ENDSTOPS +opt_enable Z_MULTI_ENDSTOPS USE_XMAX_PLUG opt_set NUM_Z_STEPPER_DRIVERS 2 pins_set ramps/RAMPS X_MAX_PIN -1 opt_add Z2_MAX_PIN 2 -opt_enable USE_XMAX_PLUG exec_test $1 $2 "Dual Z with Dual Z endstops" # Clean up From 21ce39aa9b304d627e6f2f7eecde873c7edb7af9 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Mon, 19 Oct 2020 04:24:57 -0500 Subject: [PATCH 064/226] Use PGM serial strings --- Marlin/src/feature/runout.cpp | 15 +++------ Marlin/src/gcode/gcode.cpp | 4 +-- .../extui/lib/anycubic_chiron/chiron_tft.cpp | 2 +- Marlin/src/lcd/tft/touch.cpp | 4 +-- Marlin/src/module/tool_change.cpp | 31 ++++++------------- Marlin/src/module/tool_change.h | 2 ++ 6 files changed, 22 insertions(+), 36 deletions(-) diff --git a/Marlin/src/feature/runout.cpp b/Marlin/src/feature/runout.cpp index 71f31f2145..50e18e52ef 100644 --- a/Marlin/src/feature/runout.cpp +++ b/Marlin/src/feature/runout.cpp @@ -40,8 +40,9 @@ bool FilamentMonitorBase::enabled = true, #endif #if ENABLED(TOOLCHANGE_MIGRATION_FEATURE) - //#define DEBUG_TOOLCHANGE_MIGRATION_FEATURE #include "../module/tool_change.h" + #define DEBUG_OUT ENABLED(DEBUG_TOOLCHANGE_MIGRATION_FEATURE) + #include "../core/debug_out.h" #endif #if HAS_FILAMENT_RUNOUT_DISTANCE @@ -74,15 +75,11 @@ void event_filament_runout() { #if ENABLED(TOOLCHANGE_MIGRATION_FEATURE) if (migration.in_progress) { - #if ENABLED(DEBUG_TOOLCHANGE_MIGRATION_FEATURE) - SERIAL_ECHOLN("Migration Already In Progress"); - #endif + DEBUG_ECHOLNPGM("Migration Already In Progress"); return; // Action already in progress. Purge triggered repeated runout. } if (migration.automode) { - #if ENABLED(DEBUG_TOOLCHANGE_MIGRATION_FEATURE) - SERIAL_ECHOLN("Migration Starting"); - #endif + DEBUG_ECHOLNPGM("Migration Starting"); if (extruder_migration()) return; } #endif @@ -109,9 +106,7 @@ void event_filament_runout() { if (run_runout_script && ( strstr(FILAMENT_RUNOUT_SCRIPT, "M600") || strstr(FILAMENT_RUNOUT_SCRIPT, "M125") - #if ENABLED(ADVANCED_PAUSE_FEATURE) - || strstr(FILAMENT_RUNOUT_SCRIPT, "M25") - #endif + || TERN0(ADVANCED_PAUSE_FEATURE, strstr(FILAMENT_RUNOUT_SCRIPT, "M25")) ) ) { host_action_paused(false); diff --git a/Marlin/src/gcode/gcode.cpp b/Marlin/src/gcode/gcode.cpp index f2bd81e670..852d389b13 100644 --- a/Marlin/src/gcode/gcode.cpp +++ b/Marlin/src/gcode/gcode.cpp @@ -754,8 +754,8 @@ void GcodeSuite::process_parsed_command(const bool no_ok/*=false*/) { case 511: M511(); break; // M511: Unlock Printer #endif #if ENABLED(PASSWORD_CHANGE_GCODE) - case 512: M512(); break; - #endif // M512: Set/Change/Remove Password + case 512: M512(); break; // M512: Set/Change/Remove Password + #endif #endif #if ENABLED(SDSUPPORT) diff --git a/Marlin/src/lcd/extui/lib/anycubic_chiron/chiron_tft.cpp b/Marlin/src/lcd/extui/lib/anycubic_chiron/chiron_tft.cpp index 5e492573e7..109d82b2a2 100644 --- a/Marlin/src/lcd/extui/lib/anycubic_chiron/chiron_tft.cpp +++ b/Marlin/src/lcd/extui/lib/anycubic_chiron/chiron_tft.cpp @@ -294,7 +294,7 @@ namespace Anycubic { void ChironTFT::SendtoTFTLN(PGM_P str = nullptr) { if (str != nullptr) { #if ACDEBUG(AC_SOME) - SERIAL_ECHO("> "); + SERIAL_ECHOPGM("> "); #endif SendtoTFT(str); #if ACDEBUG(AC_SOME) diff --git a/Marlin/src/lcd/tft/touch.cpp b/Marlin/src/lcd/tft/touch.cpp index 6dcddc5d56..3e0945b227 100644 --- a/Marlin/src/lcd/tft/touch.cpp +++ b/Marlin/src/lcd/tft/touch.cpp @@ -189,12 +189,12 @@ void Touch::touch(touch_control_t *control) { } if (calibration_state == CALIBRATION_SUCCESS) { - SERIAL_ECHOLN("Touch screen calibration completed"); + SERIAL_ECHOLNPGM("Touch screen calibration completed"); SERIAL_ECHOLNPAIR("TOUCH_CALIBRATION_X ", calibration.x); SERIAL_ECHOLNPAIR("TOUCH_CALIBRATION_Y ", calibration.y); SERIAL_ECHOLNPAIR("TOUCH_OFFSET_X ", calibration.offset_x); SERIAL_ECHOLNPAIR("TOUCH_OFFSET_Y ", calibration.offset_y); - SERIAL_ECHO("TOUCH_ORIENTATION "); if (calibration.orientation == TOUCH_LANDSCAPE) SERIAL_ECHOLN("TOUCH_LANDSCAPE"); else SERIAL_ECHOLN("TOUCH_PORTRAIT"); + SERIAL_ECHOPGM("TOUCH_ORIENTATION "); if (calibration.orientation == TOUCH_LANDSCAPE) SERIAL_ECHOLNPGM("TOUCH_LANDSCAPE"); else SERIAL_ECHOLNPGM("TOUCH_PORTRAIT"); } break; default: break; diff --git a/Marlin/src/module/tool_change.cpp b/Marlin/src/module/tool_change.cpp index 2c1a1a6017..1cdafe019d 100644 --- a/Marlin/src/module/tool_change.cpp +++ b/Marlin/src/module/tool_change.cpp @@ -1209,25 +1209,22 @@ void tool_change(const uint8_t new_tool, bool no_move/*=false*/) { #if ENABLED(TOOLCHANGE_MIGRATION_FEATURE) + #define DEBUG_OUT ENABLED(DEBUG_TOOLCHANGE_MIGRATION_FEATURE) + #include "../core/debug_out.h" + bool extruder_migration() { #if ENABLED(PREVENT_COLD_EXTRUSION) if (thermalManager.targetTooColdToExtrude(active_extruder)) { - #if ENABLED(DEBUG_TOOLCHANGE_MIGRATION_FEATURE) - SERIAL_ECHOLN("Migration Source Too Cold"); - #endif + DEBUG_ECHOLNPGM("Migration Source Too Cold"); return false; } #endif // No auto-migration or specified target? if (!migration.target && active_extruder >= migration.last) { - #if ENABLED(DEBUG_TOOLCHANGE_MIGRATION_FEATURE) - SERIAL_ECHO_MSG("No Migration Target"); - SERIAL_ECHO_MSG("Target: ", migration.target, - " Last: ", migration.last, - " Active: ", active_extruder); - #endif + DEBUG_ECHO_MSG("No Migration Target"); + DEBUG_ECHO_MSG("Target: ", migration.target, " Last: ", migration.last, " Active: ", active_extruder); migration.automode = false; return false; } @@ -1237,9 +1234,7 @@ void tool_change(const uint8_t new_tool, bool no_move/*=false*/) { uint8_t migration_extruder = active_extruder; if (migration.target) { - #if ENABLED(DEBUG_TOOLCHANGE_MIGRATION_FEATURE) - SERIAL_ECHOLN("Migration using fixed target"); - #endif + DEBUG_ECHOLNPGM("Migration using fixed target"); // Specified target ok? const int16_t t = migration.target - 1; if (t != active_extruder) migration_extruder = t; @@ -1248,16 +1243,12 @@ void tool_change(const uint8_t new_tool, bool no_move/*=false*/) { migration_extruder++; if (migration_extruder == active_extruder) { - #if ENABLED(DEBUG_TOOLCHANGE_MIGRATION_FEATURE) - SERIAL_ECHOLN("Migration source matches active"); - #endif + DEBUG_ECHOLNPGM("Migration source matches active"); return false; } // Migration begins - #if ENABLED(DEBUG_TOOLCHANGE_MIGRATION_FEATURE) - SERIAL_ECHOLN("Beginning migration"); - #endif + DEBUG_ECHOLNPGM("Beginning migration"); migration.in_progress = true; // Prevent runout script planner.synchronize(); @@ -1303,9 +1294,7 @@ void tool_change(const uint8_t new_tool, bool no_move/*=false*/) { planner.synchronize(); planner.set_e_position_mm(current_position.e); // New extruder primed and ready - #if ENABLED(DEBUG_TOOLCHANGE_MIGRATION_FEATURE) - SERIAL_ECHOLN("Migration Complete"); - #endif + DEBUG_ECHOLNPGM("Migration Complete"); return true; } diff --git a/Marlin/src/module/tool_change.h b/Marlin/src/module/tool_change.h index 38347191d3..0b22f8b6f1 100644 --- a/Marlin/src/module/tool_change.h +++ b/Marlin/src/module/tool_change.h @@ -24,6 +24,8 @@ #include "../inc/MarlinConfigPre.h" #include "../core/types.h" +//#define DEBUG_TOOLCHANGE_MIGRATION_FEATURE + #if HAS_MULTI_EXTRUDER typedef struct { From 35b9e9b4a5628252b22d78dc0657531ccbb3d8e8 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Mon, 19 Oct 2020 00:25:51 -0500 Subject: [PATCH 065/226] Tweak a host prompt call --- Marlin/src/feature/host_actions.cpp | 12 ++++++++++-- Marlin/src/feature/host_actions.h | 1 + Marlin/src/feature/pause.cpp | 7 ++++--- 3 files changed, 15 insertions(+), 5 deletions(-) diff --git a/Marlin/src/feature/host_actions.cpp b/Marlin/src/feature/host_actions.cpp index 3012639220..a8b2b51dfc 100644 --- a/Marlin/src/feature/host_actions.cpp +++ b/Marlin/src/feature/host_actions.cpp @@ -113,12 +113,20 @@ void host_action(PGM_P const pstr, const bool eol) { void host_action_prompt_button(PGM_P const pstr) { host_action_prompt_plus(PSTR("button"), pstr); } void host_action_prompt_end() { host_action_prompt(PSTR("end")); } void host_action_prompt_show() { host_action_prompt(PSTR("show")); } - void host_prompt_do(const PromptReason reason, PGM_P const pstr, PGM_P const btn1/*=nullptr*/, PGM_P const btn2/*=nullptr*/) { - host_action_prompt_begin(reason, pstr); + + void _host_prompt_show(PGM_P const btn1/*=nullptr*/, PGM_P const btn2/*=nullptr*/) { if (btn1) host_action_prompt_button(btn1); if (btn2) host_action_prompt_button(btn2); host_action_prompt_show(); } + void host_prompt_do(const PromptReason reason, PGM_P const pstr, PGM_P const btn1/*=nullptr*/, PGM_P const btn2/*=nullptr*/) { + host_action_prompt_begin(reason, pstr); + _host_prompt_show(btn1, btn2); + } + void host_prompt_do(const PromptReason reason, PGM_P const pstr, const char extra_char, PGM_P const btn1/*=nullptr*/, PGM_P const btn2/*=nullptr*/) { + host_action_prompt_begin(reason, pstr, extra_char); + _host_prompt_show(btn1, btn2); + } void filament_load_host_prompt() { const bool disable_to_continue = TERN0(HAS_FILAMENT_SENSOR, runout.filament_ran_out); diff --git a/Marlin/src/feature/host_actions.h b/Marlin/src/feature/host_actions.h index 09eeed23e2..065b59d755 100644 --- a/Marlin/src/feature/host_actions.h +++ b/Marlin/src/feature/host_actions.h @@ -71,6 +71,7 @@ void host_action(PGM_P const pstr, const bool eol=true); void host_action_prompt_end(); void host_action_prompt_show(); void host_prompt_do(const PromptReason reason, PGM_P const pstr, PGM_P const btn1=nullptr, PGM_P const btn2=nullptr); + void host_prompt_do(const PromptReason reason, PGM_P const pstr, const char extra_char, PGM_P const btn1=nullptr, PGM_P const btn2=nullptr); inline void host_prompt_open(const PromptReason reason, PGM_P const pstr, PGM_P const btn1=nullptr, PGM_P const btn2=nullptr) { if (host_prompt_reason == PROMPT_NOT_DEFINED) host_prompt_do(reason, pstr, btn1, btn2); } diff --git a/Marlin/src/feature/pause.cpp b/Marlin/src/feature/pause.cpp index 6f970d1a4c..0a3609b3a1 100644 --- a/Marlin/src/feature/pause.cpp +++ b/Marlin/src/feature/pause.cpp @@ -199,17 +199,18 @@ bool load_filament(const float &slow_load_length/*=0*/, const float &fast_load_l first_impatient_beep(max_beep_count); KEEPALIVE_STATE(PAUSED_FOR_USER); + #if ENABLED(HOST_PROMPT_SUPPORT) const char tool = '0' #if NUM_RUNOUT_SENSORS > 1 + active_extruder #endif ; - host_action_prompt_begin(PROMPT_USER_CONTINUE, PSTR("Load Filament T"), tool); - host_action_prompt_button(CONTINUE_STR); - host_action_prompt_show(); + host_prompt_do(PROMPT_USER_CONTINUE, PSTR("Load Filament T"), tool, CONTINUE_STR); #endif + TERN_(EXTENSIBLE_UI, ExtUI::onUserConfirmRequired_P(PSTR("Load Filament"))); + while (wait_for_user) { impatient_beep(max_beep_count); idle_no_sleep(); From b320b1a3c2919e95430884fe7916d0ef0a6f9297 Mon Sep 17 00:00:00 2001 From: thinkyhead Date: Tue, 20 Oct 2020 00:15:55 +0000 Subject: [PATCH 066/226] [cron] Bump distribution date (2020-10-20) --- Marlin/src/inc/Version.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Marlin/src/inc/Version.h b/Marlin/src/inc/Version.h index 9fdbc72153..246aa698ae 100644 --- a/Marlin/src/inc/Version.h +++ b/Marlin/src/inc/Version.h @@ -42,7 +42,7 @@ * version was tagged. */ #ifndef STRING_DISTRIBUTION_DATE - #define STRING_DISTRIBUTION_DATE "2020-10-19" + #define STRING_DISTRIBUTION_DATE "2020-10-20" #endif /** From 92767f5513924842498af90e8557bdf3da91c000 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Mon, 19 Oct 2020 20:38:24 -0500 Subject: [PATCH 067/226] Misc. cleanup, serial strings --- Marlin/src/HAL/TEENSY40_41/HAL.h | 2 +- Marlin/src/gcode/gcode_d.cpp | 12 ++++++------ Marlin/src/gcode/host/M118.cpp | 6 +++--- Marlin/src/gcode/parser.cpp | 4 ---- Marlin/src/module/settings.cpp | 2 +- Marlin/src/pins/stm32f1/pins_JGAURORA_A5S_A1.h | 3 --- buildroot/tests/teensy41-tests | 2 +- 7 files changed, 12 insertions(+), 19 deletions(-) diff --git a/Marlin/src/HAL/TEENSY40_41/HAL.h b/Marlin/src/HAL/TEENSY40_41/HAL.h index 75c10e9395..e5bc0d5038 100644 --- a/Marlin/src/HAL/TEENSY40_41/HAL.h +++ b/Marlin/src/HAL/TEENSY40_41/HAL.h @@ -69,7 +69,7 @@ #elif WITHIN(SERIAL_PORT_2, 0, 8) #define MYSERIAL1 MSERIAL(SERIAL_PORT_2) #else - #error "SERIAL_PORT_2 must be from -1 to 8. Please update your configuration." + #error "SERIAL_PORT_2 must be from -2 to 8. Please update your configuration." #endif #endif diff --git a/Marlin/src/gcode/gcode_d.cpp b/Marlin/src/gcode/gcode_d.cpp index 1f38a85b91..99968b625a 100644 --- a/Marlin/src/gcode/gcode_d.cpp +++ b/Marlin/src/gcode/gcode_d.cpp @@ -107,7 +107,7 @@ SERIAL_EOL(); persistentStore.access_finish(); #else - SERIAL_ECHOLN("NO EEPROM"); + SERIAL_ECHOLNPGM("NO EEPROM"); #endif } else { @@ -125,13 +125,13 @@ SERIAL_EOL(); persistentStore.access_finish(); #else - SERIAL_ECHOLN("NO EEPROM"); + SERIAL_ECHOLNPGM("NO EEPROM"); #endif } SERIAL_EOL(); } } break; - #endif + #endif case 4: { // D4 Read / Write PIN // const uint8_t pin = parser.byteval('P'); @@ -173,8 +173,8 @@ } break; case 100: { // D100 Disable heaters and attempt a hard hang (Watchdog Test) - SERIAL_ECHOLN("Disabling heaters and attempting to trigger Watchdog"); - SERIAL_ECHOLN("(USE_WATCHDOG " TERN(USE_WATCHDOG, "ENABLED", "DISABLED") ")"); + SERIAL_ECHOLNPGM("Disabling heaters and attempting to trigger Watchdog"); + SERIAL_ECHOLNPGM("(USE_WATCHDOG " TERN(USE_WATCHDOG, "ENABLED", "DISABLED") ")"); thermalManager.disable_all_heaters(); delay(1000); // Allow time to print DISABLE_ISRS(); @@ -183,7 +183,7 @@ // watchdog does not work. DELAY_US(10000000); ENABLE_ISRS(); - SERIAL_ECHOLN("FAILURE: Watchdog did not trigger board reset."); + SERIAL_ECHOLNPGM("FAILURE: Watchdog did not trigger board reset."); } } } diff --git a/Marlin/src/gcode/host/M118.cpp b/Marlin/src/gcode/host/M118.cpp index 3be2902541..06576bb75e 100644 --- a/Marlin/src/gcode/host/M118.cpp +++ b/Marlin/src/gcode/host/M118.cpp @@ -57,9 +57,9 @@ void GcodeSuite::M118() { if (WITHIN(port, 0, NUM_SERIAL)) serial_port_index = ( port == 0 ? SERIAL_BOTH - : port == 1 ? SERIAL_PORT - #ifdef SERIAL_PORT_2 - : port == 2 ? SERIAL_PORT_2 + : port == 1 ? 0 + #if HAS_MULTI_SERIAL + : port == 2 ? 1 #endif : SERIAL_PORT ); diff --git a/Marlin/src/gcode/parser.cpp b/Marlin/src/gcode/parser.cpp index 9c5085b97e..bba64dbbc4 100644 --- a/Marlin/src/gcode/parser.cpp +++ b/Marlin/src/gcode/parser.cpp @@ -28,10 +28,6 @@ #include "../MarlinCore.h" -#if HAS_MULTI_SERIAL - #include "queue.h" -#endif - // Must be declared for allocation and to satisfy the linker // Zero values need no initialization. diff --git a/Marlin/src/module/settings.cpp b/Marlin/src/module/settings.cpp index f5a954f5de..e65ace2e01 100644 --- a/Marlin/src/module/settings.cpp +++ b/Marlin/src/module/settings.cpp @@ -2296,7 +2296,7 @@ void MarlinSettings::postprocess() { #if ENABLED(EEPROM_CHITCHAT) && DISABLED(DISABLE_M503) // Report the EEPROM settings - if (!validating && (DISABLED(EEPROM_BOOT_SILENT) || IsRunning())) report(); + if (!validating && TERN1(EEPROM_BOOT_SILENT, IsRunning())) report(); #endif EEPROM_FINISH(); diff --git a/Marlin/src/pins/stm32f1/pins_JGAURORA_A5S_A1.h b/Marlin/src/pins/stm32f1/pins_JGAURORA_A5S_A1.h index 3c277233d7..0dd8fb69a5 100644 --- a/Marlin/src/pins/stm32f1/pins_JGAURORA_A5S_A1.h +++ b/Marlin/src/pins/stm32f1/pins_JGAURORA_A5S_A1.h @@ -49,9 +49,6 @@ //#define MARLIN_EEPROM_SIZE 0x1000UL // 4KB //#define MARLIN_EEPROM_SIZE (EEPROM_START_ADDRESS + (EEPROM_PAGE_SIZE) * 2UL) -//#define EEPROM_CHITCHAT -//#define DEBUG_EEPROM_READWRITE - // // Limit Switches // diff --git a/buildroot/tests/teensy41-tests b/buildroot/tests/teensy41-tests index 415d551f55..ab4d87d1af 100644 --- a/buildroot/tests/teensy41-tests +++ b/buildroot/tests/teensy41-tests @@ -57,7 +57,7 @@ exec_test $1 $2 "Sled Z Probe with Linear leveling" # exec_test $1 $2 "...with AUTO_BED_LEVELING_3POINT, DEBUG_LEVELING_FEATURE, EEPROM_SETTINGS, EEPROM_CHITCHAT, EXTENDED_CAPABILITIES_REPORT, and AUTO_REPORT_TEMPERATURES" # -# Test MAGNETIC_PARKING_EXTRUDER with LCD +# Test MAGNETIC_PARKING_EXTRUDER with no LCD # restore_configs opt_set MOTHERBOARD BOARD_TEENSY41 From 9baa944460e0bf5f15e46a501b64ebd39a9d5f34 Mon Sep 17 00:00:00 2001 From: bilsef Date: Tue, 20 Oct 2020 12:35:29 -0700 Subject: [PATCH 068/226] Teensy 4.1 Ethernet support (#19801) --- Marlin/Configuration.h | 3 +- Marlin/Configuration_adv.h | 7 + Marlin/src/HAL/TEENSY40_41/HAL.h | 2 + Marlin/src/MarlinCore.cpp | 13 +- Marlin/src/core/serial.h | 9 +- Marlin/src/feature/ethernet.cpp | 175 ++++++++++++++++++ Marlin/src/feature/ethernet.h | 39 ++++ .../src/gcode/feature/network/M552-M554.cpp | 125 +++++++++++++ Marlin/src/gcode/gcode.cpp | 6 + Marlin/src/gcode/gcode.h | 9 + Marlin/src/gcode/queue.cpp | 21 ++- Marlin/src/inc/Conditionals_LCD.h | 3 + Marlin/src/module/settings.cpp | 67 ++++++- buildroot/tests/teensy41-tests | 5 +- platformio.ini | 5 + 15 files changed, 478 insertions(+), 11 deletions(-) create mode 100644 Marlin/src/feature/ethernet.cpp create mode 100644 Marlin/src/feature/ethernet.h create mode 100644 Marlin/src/gcode/feature/network/M552-M554.cpp diff --git a/Marlin/Configuration.h b/Marlin/Configuration.h index 60f8368517..b5dfb43fa2 100644 --- a/Marlin/Configuration.h +++ b/Marlin/Configuration.h @@ -107,7 +107,8 @@ /** * Select a secondary serial port on the board to use for communication with the host. - * :[-1, 0, 1, 2, 3, 4, 5, 6, 7] + * Currently Ethernet (-2) is only supported on Teensy 4.1 boards. + * :[-2, -1, 0, 1, 2, 3, 4, 5, 6, 7] */ //#define SERIAL_PORT_2 -1 diff --git a/Marlin/Configuration_adv.h b/Marlin/Configuration_adv.h index d6f31658cd..fc77345b9b 100644 --- a/Marlin/Configuration_adv.h +++ b/Marlin/Configuration_adv.h @@ -3456,6 +3456,13 @@ // Default behavior is limited to Z axis only. #endif +/** + * Ethernet. Use M552 to enable and set the IP address. + */ +#if HAS_ETHERNET + #define MAC_ADDRESS { 0xDE, 0xAD, 0xBE, 0xEF, 0xF0, 0x0D } // A MAC address unique to your network +#endif + /** * WiFi Support (Espressif ESP32 WiFi) */ diff --git a/Marlin/src/HAL/TEENSY40_41/HAL.h b/Marlin/src/HAL/TEENSY40_41/HAL.h index e5bc0d5038..1e0043342d 100644 --- a/Marlin/src/HAL/TEENSY40_41/HAL.h +++ b/Marlin/src/HAL/TEENSY40_41/HAL.h @@ -66,6 +66,8 @@ #ifdef SERIAL_PORT_2 #if SERIAL_PORT_2 == -1 #define MYSERIAL1 usbSerial + #elif SERIAL_PORT_2 == -2 + #define MYSERIAL1 ethernet.telnetClient #elif WITHIN(SERIAL_PORT_2, 0, 8) #define MYSERIAL1 MSERIAL(SERIAL_PORT_2) #else diff --git a/Marlin/src/MarlinCore.cpp b/Marlin/src/MarlinCore.cpp index 786a847fa6..e395bdccb8 100644 --- a/Marlin/src/MarlinCore.cpp +++ b/Marlin/src/MarlinCore.cpp @@ -77,6 +77,10 @@ #include "lcd/dwin/e3v2/rotary_encoder.h" #endif +#if HAS_ETHERNET + #include "feature/ethernet.h" +#endif + #if ENABLED(IIC_BL24CXX_EEPROM) #include "libs/BL24CXX.h" #endif @@ -713,6 +717,9 @@ void idle(TERN_(ADVANCED_PAUSE_FEATURE, bool no_stepper_sleep/*=false*/)) { HAL_idletask(); #endif + // Check network connection + TERN_(HAS_ETHERNET, ethernet.check()); + // Handle Power-Loss Recovery #if ENABLED(POWER_LOSS_RECOVERY) && PIN_EXISTS(POWER_LOSS) if (printJobOngoing()) recovery.outage(); @@ -968,7 +975,7 @@ void setup() { MYSERIAL0.begin(BAUDRATE); uint32_t serial_connect_timeout = millis() + 1000UL; while (!MYSERIAL0 && PENDING(millis(), serial_connect_timeout)) { /*nada*/ } - #if HAS_MULTI_SERIAL + #if HAS_MULTI_SERIAL && !HAS_ETHERNET MYSERIAL1.begin(BAUDRATE); serial_connect_timeout = millis() + 1000UL; while (!MYSERIAL1 && PENDING(millis(), serial_connect_timeout)) { /*nada*/ } @@ -1090,6 +1097,10 @@ void setup() { SETUP_RUN(settings.first_load()); // Load data from EEPROM if available (or use defaults) // This also updates variables in the planner, elsewhere + #if HAS_ETHERNET + SETUP_RUN(ethernet.init()); + #endif + #if HAS_TOUCH_XPT2046 SETUP_RUN(touch.init()); #endif diff --git a/Marlin/src/core/serial.h b/Marlin/src/core/serial.h index fc830736a5..c3baaf9ada 100644 --- a/Marlin/src/core/serial.h +++ b/Marlin/src/core/serial.h @@ -23,6 +23,10 @@ #include "../inc/MarlinConfig.h" +#if HAS_ETHERNET + #include "../feature/ethernet.h" +#endif + /** * Define debug bit-masks */ @@ -56,8 +60,9 @@ extern uint8_t marlin_debug_flags; #define SERIAL_OUT(WHAT, V...) (void)CAT(MYSERIAL,SERIAL_CATCHALL).WHAT(V) #else #define SERIAL_OUT(WHAT, V...) do{ \ - if (!serial_port_index || serial_port_index == SERIAL_BOTH) (void)MYSERIAL0.WHAT(V); \ - if ( serial_port_index) (void)MYSERIAL1.WHAT(V); \ + const bool port2_open = TERN1(HAS_ETHERNET, ethernet.have_telnet_client); \ + if ( serial_port_index == 0 || serial_port_index == SERIAL_BOTH) (void)MYSERIAL0.WHAT(V); \ + if ((serial_port_index == 1 || serial_port_index == SERIAL_BOTH) && port2_open) (void)MYSERIAL1.WHAT(V); \ }while(0) #endif diff --git a/Marlin/src/feature/ethernet.cpp b/Marlin/src/feature/ethernet.cpp new file mode 100644 index 0000000000..ff3ba76b89 --- /dev/null +++ b/Marlin/src/feature/ethernet.cpp @@ -0,0 +1,175 @@ +/** + * Marlin 3D Printer Firmware + * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] + * + * Based on Sprinter and grbl. + * Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + * + */ + +#include "../inc/MarlinConfigPre.h" + +#if HAS_ETHERNET + +#include "ethernet.h" +#include "../core/serial.h" + +#define DEBUG_OUT ENABLED(DEBUG_ETHERNET) +#include "../core/debug_out.h" + +bool MarlinEthernet::hardware_enabled, // = false + MarlinEthernet::have_telnet_client; // = false + +IPAddress MarlinEthernet::ip, + MarlinEthernet::myDns, + MarlinEthernet::gateway, + MarlinEthernet::subnet; + +EthernetClient MarlinEthernet::telnetClient; // connected client + +MarlinEthernet ethernet; + +EthernetServer server(23); // telnet server + +enum linkStates { UNLINKED, LINKING, LINKED, CONNECTING, CONNECTED, NO_HARDWARE } linkState; + +#ifdef __IMXRT1062__ + + static void teensyMAC(uint8_t * const mac) { + const uint32_t m1 = HW_OCOTP_MAC1, m2 = HW_OCOTP_MAC0; + mac[0] = m1 >> 8; + mac[1] = m1 >> 0; + mac[2] = m2 >> 24; + mac[3] = m2 >> 16; + mac[4] = m2 >> 8; + mac[5] = m2 >> 0; + } + +#else + + byte mac[] = MAC_ADDRESS; + +#endif + +void ethernet_cable_error() { SERIAL_ERROR_MSG("Ethernet cable is not connected."); } + +void MarlinEthernet::init() { + if (!hardware_enabled) return; + + SERIAL_ECHO_MSG("Starting network..."); + + // Init the Ethernet device + #ifdef __IMXRT1062__ + uint8_t mac[6]; + teensyMAC(mac); + #endif + + if (!ip) { + Ethernet.begin(mac); // use DHCP + } + else { + if (!gateway) { + gateway = ip; + gateway[3] = 1; + myDns = gateway; + subnet = IPAddress(255,255,255,0); + } + if (!myDns) myDns = gateway; + if (!subnet) subnet = IPAddress(255,255,255,0); + Ethernet.begin(mac, ip, myDns, gateway, subnet); + } + + // Check for Ethernet hardware present + if (Ethernet.hardwareStatus() == EthernetNoHardware) { + SERIAL_ERROR_MSG("No Ethernet hardware found."); + linkState = NO_HARDWARE; + return; + } + + linkState = UNLINKED; + + if (Ethernet.linkStatus() == LinkOFF) + ethernet_cable_error(); +} + +void MarlinEthernet::check() { + if (!hardware_enabled) return; + + switch (linkState) { + case NO_HARDWARE: + break; + + case UNLINKED: + if (Ethernet.linkStatus() == LinkOFF) break; + + SERIAL_ECHOLNPGM("Ethernet cable connected"); + server.begin(); + linkState = LINKING; + break; + + case LINKING: + if (!Ethernet.localIP()) break; + + SERIAL_ECHOPGM("Successfully started telnet server with IP "); + MYSERIAL0.println(Ethernet.localIP()); + + linkState = LINKED; + break; + + case LINKED: + if (Ethernet.linkStatus() == LinkOFF) { + ethernet_cable_error(); + linkState = UNLINKED; + break; + } + telnetClient = server.accept(); + if (telnetClient) linkState = CONNECTING; + break; + + case CONNECTING: + telnetClient.println("Marlin " SHORT_BUILD_VERSION); + #if defined(STRING_DISTRIBUTION_DATE) && defined(STRING_CONFIG_H_AUTHOR) + telnetClient.println( + " Last Updated: " STRING_DISTRIBUTION_DATE + " | Author: " STRING_CONFIG_H_AUTHOR + ); + #endif + telnetClient.println("Compiled: " __DATE__); + + SERIAL_ECHOLNPGM("Client connected"); + have_telnet_client = true; + linkState = CONNECTED; + break; + + case CONNECTED: + if (telnetClient && !telnetClient.connected()) { + SERIAL_ECHOLNPGM("Client disconnected"); + telnetClient.stop(); + have_telnet_client = false; + linkState = LINKED; + } + if (Ethernet.linkStatus() == LinkOFF) { + ethernet_cable_error(); + if (telnetClient) telnetClient.stop(); + linkState = UNLINKED; + } + break; + + default: break; + } +} + +#endif // HAS_ETHERNET diff --git a/Marlin/src/feature/ethernet.h b/Marlin/src/feature/ethernet.h new file mode 100644 index 0000000000..70a58efce7 --- /dev/null +++ b/Marlin/src/feature/ethernet.h @@ -0,0 +1,39 @@ +/** + * Marlin 3D Printer Firmware + * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] + * + * Based on Sprinter and grbl. + * Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + * + */ +#pragma once + +#ifdef __IMXRT1062__ + #include +#endif + +// Teensy 4.1 uses internal MAC Address + +class MarlinEthernet { + public: + static bool hardware_enabled, have_telnet_client; + static IPAddress ip, myDns, gateway, subnet; + static EthernetClient telnetClient; + static void init(); + static void check(); +}; + +extern MarlinEthernet ethernet; diff --git a/Marlin/src/gcode/feature/network/M552-M554.cpp b/Marlin/src/gcode/feature/network/M552-M554.cpp new file mode 100644 index 0000000000..d88c38cb5a --- /dev/null +++ b/Marlin/src/gcode/feature/network/M552-M554.cpp @@ -0,0 +1,125 @@ +/** + * Marlin 3D Printer Firmware + * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] + * + * Based on Sprinter and grbl. + * Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + * + */ + +#include "../../../inc/MarlinConfigPre.h" + +#if HAS_ETHERNET + +#include "../../../feature/ethernet.h" +#include "../../../core/serial.h" +#include "../../gcode.h" + +void say_ethernet() { SERIAL_ECHOPGM(" Ethernet "); } + +void ETH0_report() { + say_ethernet(); + SERIAL_ECHO_TERNARY(ethernet.hardware_enabled, "port ", "en", "dis", "abled.\n"); + if (ethernet.hardware_enabled) { + say_ethernet(); + SERIAL_ECHO_TERNARY(ethernet.have_telnet_client, "client ", "en", "dis", "abled.\n"); + } + else + SERIAL_ECHOLNPGM("Send 'M552 S1' to enable."); +} + +void MAC_report() { + uint8_t mac[6]; + if (ethernet.hardware_enabled) { + Ethernet.MACAddress(mac); + SERIAL_ECHOPGM(" MAC: "); + LOOP_L_N(i, 6) { + SERIAL_PRINTF("%02X", mac[i]); + if (i < 5) SERIAL_CHAR(':'); + } + } + SERIAL_EOL(); +} + +// Display current values when the link is active, +// otherwise show the stored values +void ip_report(const uint16_t cmd, PGM_P const post, const IPAddress &ipo) { + SERIAL_CHAR('M'); SERIAL_ECHO(cmd); SERIAL_CHAR(' '); + LOOP_L_N(i, 4) { + SERIAL_ECHO(ipo[i]); + if (i < 3) SERIAL_CHAR('.'); + } + SERIAL_ECHOPGM(" ; "); + SERIAL_ECHOPGM_P(post); + SERIAL_EOL(); +} +void M552_report() { + ip_report(552, PSTR("ip address"), Ethernet.linkStatus() == LinkON ? Ethernet.localIP() : ethernet.ip); +} +void M553_report() { + ip_report(553, PSTR("subnet mask"), Ethernet.linkStatus() == LinkON ? Ethernet.subnetMask() : ethernet.subnet); +} +void M554_report() { + ip_report(554, PSTR("gateway"), Ethernet.linkStatus() == LinkON ? Ethernet.gatewayIP() : ethernet.gateway); +} + +/** + * M552: Set IP address, enable/disable network interface + * + * S0 : disable networking + * S1 : enable networking + * S-1 : reset network interface + * + * Pnnn : Set IP address, 0.0.0.0 means acquire an IP address using DHCP + */ +void GcodeSuite::M552() { + const bool seenP = parser.seenval('P'); + if (seenP) ethernet.ip.fromString(parser.value_string()); + + const bool seenS = parser.seenval('S'); + if (seenS) { + switch (parser.value_int()) { + case -1: + if (ethernet.telnetClient) ethernet.telnetClient.stop(); + ethernet.init(); + break; + case 0: ethernet.hardware_enabled = false; break; + case 1: ethernet.hardware_enabled = true; break; + default: break; + } + } + const bool nopar = !seenS && !seenP; + if (nopar || seenS) ETH0_report(); + if (nopar || seenP) M552_report(); +} + +/** + * M553 Pnnn - Set netmask + */ +void GcodeSuite::M553() { + if (parser.seenval('P')) ethernet.subnet.fromString(parser.value_string()); + M553_report(); +} + +/** + * M554 Pnnn - Set Gateway + */ +void GcodeSuite::M554() { + if (parser.seenval('P')) ethernet.gateway.fromString(parser.value_string()); + M554_report(); +} + +#endif // HAS_ETHERNET diff --git a/Marlin/src/gcode/gcode.cpp b/Marlin/src/gcode/gcode.cpp index 852d389b13..e2c70ad3ae 100644 --- a/Marlin/src/gcode/gcode.cpp +++ b/Marlin/src/gcode/gcode.cpp @@ -766,6 +766,12 @@ void GcodeSuite::process_parsed_command(const bool no_ok/*=false*/) { case 540: M540(); break; // M540: Set abort on endstop hit for SD printing #endif + #if HAS_ETHERNET + case 552: M552(); break; // M552: Set IP address + case 553: M553(); break; // M553: Set gateway + case 554: M554(); break; // M554: Set netmask + #endif + #if ENABLED(BAUD_RATE_GCODE) case 575: M575(); break; // M575: Set serial baudrate #endif diff --git a/Marlin/src/gcode/gcode.h b/Marlin/src/gcode/gcode.h index 3d745eff89..34df51e517 100644 --- a/Marlin/src/gcode/gcode.h +++ b/Marlin/src/gcode/gcode.h @@ -230,6 +230,9 @@ * M512 - Set/Change/Remove Password * M524 - Abort the current SD print job started with M24. (Requires SDSUPPORT) * M540 - Enable/disable SD card abort on endstop hit: "M540 S". (Requires SD_ABORT_ON_ENDSTOP_HIT) + * M552 - Get or set IP address. Enable/disable network interface. (Requires enabled Ethernet port) + * M553 - Get or set IP netmask. (Requires enabled Ethernet port) + * M554 - Get or set IP gateway. (Requires enabled Ethernet port) * M569 - Enable stealthChop on an axis. (Requires at least one _DRIVER_TYPE to be TMC2130/2160/2208/2209/5130/5160) * M600 - Pause for filament change: "M600 X Y Z E L". (Requires ADVANCED_PAUSE_FEATURE) * M603 - Configure filament change: "M603 T U L". (Requires ADVANCED_PAUSE_FEATURE) @@ -778,6 +781,12 @@ private: TERN_(SD_ABORT_ON_ENDSTOP_HIT, static void M540()); + #if HAS_ETHERNET + static void M552(); + static void M553(); + static void M554(); + #endif + TERN_(BAUD_RATE_GCODE, static void M575()); #if ENABLED(ADVANCED_PAUSE_FEATURE) diff --git a/Marlin/src/gcode/queue.cpp b/Marlin/src/gcode/queue.cpp index 4de5056fb2..6139e3e2b8 100644 --- a/Marlin/src/gcode/queue.cpp +++ b/Marlin/src/gcode/queue.cpp @@ -39,6 +39,10 @@ GCodeQueue queue; #include "../feature/leds/printer_event_leds.h" #endif +#if HAS_ETHERNET + #include "../feature/ethernet.h" +#endif + #if ENABLED(BINARY_FILE_TRANSFER) #include "../feature/binary_stream.h" #endif @@ -312,15 +316,24 @@ void GCodeQueue::flush_and_request_resend() { } inline bool serial_data_available() { - return MYSERIAL0.available() || TERN0(HAS_MULTI_SERIAL, MYSERIAL1.available()); + byte data_available = 0; + if (MYSERIAL0.available()) data_available++; + #ifdef SERIAL_PORT_2 + const bool port2_open = TERN1(HAS_ETHERNET, ethernet.have_telnet_client); + if (port2_open && MYSERIAL1.available()) data_available++; + #endif + return data_available > 0; } inline int read_serial(const uint8_t index) { switch (index) { case 0: return MYSERIAL0.read(); - #if HAS_MULTI_SERIAL - case 1: return MYSERIAL1.read(); - #endif + case 1: { + #if HAS_MULTI_SERIAL + const bool port2_open = TERN1(HAS_ETHERNET, ethernet.have_telnet_client); + if (port2_open) return MYSERIAL1.read(); + #endif + } default: return -1; } } diff --git a/Marlin/src/inc/Conditionals_LCD.h b/Marlin/src/inc/Conditionals_LCD.h index f909112507..d4cae0b64c 100644 --- a/Marlin/src/inc/Conditionals_LCD.h +++ b/Marlin/src/inc/Conditionals_LCD.h @@ -777,6 +777,9 @@ #if SERIAL_PORT == -1 || SERIAL_PORT_2 == -1 #define HAS_USB_SERIAL 1 #endif +#if SERIAL_PORT_2 == -2 + #define HAS_ETHERNET 1 +#endif // Fallback Stepper Driver types #ifndef X_DRIVER_TYPE diff --git a/Marlin/src/module/settings.cpp b/Marlin/src/module/settings.cpp index e65ace2e01..9ed78efd63 100644 --- a/Marlin/src/module/settings.cpp +++ b/Marlin/src/module/settings.cpp @@ -150,8 +150,20 @@ #include "../lcd/tft/touch.h" #endif +#if HAS_ETHERNET + #include "../feature/ethernet.h" +#endif + #pragma pack(push, 1) // No padding between variables +#if HAS_ETHERNET + void ETH0_report(); + void MAC_report(); + void M552_report(); + void M553_report(); + void M554_report(); +#endif + typedef struct { uint16_t X, Y, Z, X2, Y2, Z2, Z3, Z4, E0, E1, E2, E3, E4, E5, E6, E7; } tmc_stepper_current_t; typedef struct { uint32_t X, Y, Z, X2, Y2, Z2, Z3, Z4, E0, E1, E2, E3, E4, E5, E6, E7; } tmc_hybrid_threshold_t; typedef struct { int16_t X, Y, Z, X2, Y2, Z2, Z3, Z4; } tmc_sgt_t; @@ -431,6 +443,15 @@ typedef struct SettingsDataStruct { touch_calibration_t touch_calibration; #endif + // Ethernet settings + #if HAS_ETHERNET + bool ethernet_hardware_enabled; // M552 S + uint32_t ethernet_ip, // M552 P + ethernet_dns, + ethernet_gateway, // M553 P + ethernet_subnet; // M554 P + #endif + } SettingsData; //static_assert(sizeof(SettingsData) <= MARLIN_EEPROM_SIZE, "EEPROM too small to contain SettingsData!"); @@ -1384,7 +1405,26 @@ void MarlinSettings::postprocess() { #endif // - // Validate CRC and Data Size + // Ethernet network info + // + #if HAS_ETHERNET + { + _FIELD_TEST(ethernet_hardware_enabled); + const bool ethernet_hardware_enabled = ethernet.hardware_enabled; + const uint32_t ethernet_ip = ethernet.ip, + ethernet_dns = ethernet.myDns, + ethernet_gateway = ethernet.gateway, + ethernet_subnet = ethernet.subnet; + EEPROM_WRITE(ethernet_hardware_enabled); + EEPROM_WRITE(ethernet_ip); + EEPROM_WRITE(ethernet_dns); + EEPROM_WRITE(ethernet_gateway); + EEPROM_WRITE(ethernet_subnet); + } + #endif + + // + // Report final CRC and Data Size // if (!eeprom_error) { const uint16_t eeprom_size = eeprom_index - (EEPROM_OFFSET), @@ -2241,6 +2281,22 @@ void MarlinSettings::postprocess() { EEPROM_READ(touch.calibration); #endif + // + // Ethernet network info + // + #if HAS_ETHERNET + _FIELD_TEST(ethernet_hardware_enabled); + uint32_t ethernet_ip, ethernet_dns, ethernet_gateway, ethernet_subnet; + EEPROM_READ(ethernet.hardware_enabled); + EEPROM_READ(ethernet_ip); ethernet.ip = ethernet_ip; + EEPROM_READ(ethernet_dns); ethernet.myDns = ethernet_dns; + EEPROM_READ(ethernet_gateway); ethernet.gateway = ethernet_gateway; + EEPROM_READ(ethernet_subnet); ethernet.subnet = ethernet_subnet; + #endif + + // + // Validate Final Size and CRC + // eeprom_error = size_error(eeprom_index - (EEPROM_OFFSET)); if (eeprom_error) { DEBUG_ECHO_START(); @@ -3784,6 +3840,15 @@ void MarlinSettings::reset() { #endif ); #endif + + #if HAS_ETHERNET + CONFIG_ECHO_HEADING("Ethernet:"); + if (!forReplay) { CONFIG_ECHO_START(); ETH0_report(); } + CONFIG_ECHO_START(); SERIAL_ECHO_SP(2); MAC_report(); + CONFIG_ECHO_START(); SERIAL_ECHO_SP(2); M552_report(); + CONFIG_ECHO_START(); SERIAL_ECHO_SP(2); M553_report(); + CONFIG_ECHO_START(); SERIAL_ECHO_SP(2); M554_report(); + #endif } #endif // !DISABLE_M503 diff --git a/buildroot/tests/teensy41-tests b/buildroot/tests/teensy41-tests index ab4d87d1af..628b295a7f 100644 --- a/buildroot/tests/teensy41-tests +++ b/buildroot/tests/teensy41-tests @@ -63,8 +63,9 @@ restore_configs opt_set MOTHERBOARD BOARD_TEENSY41 opt_set EXTRUDERS 2 opt_set TEMP_SENSOR_1 1 -opt_enable MAGNETIC_PARKING_EXTRUDER -exec_test $1 $2 "MAGNETIC_PARKING_EXTRUDER with LCD" +opt_set SERIAL_PORT_2 -2 +opt_enable EEPROM_SETTINGS MAGNETIC_PARKING_EXTRUDER +exec_test $1 $2 "Ethernet, EEPROM, Magnetic Parking Extruder, No LCD" # # Mixing Extruder diff --git a/platformio.ini b/platformio.ini index 0abb4ac388..9d5f6c5ab8 100644 --- a/platformio.ini +++ b/platformio.ini @@ -284,6 +284,7 @@ EMERGENCY_PARSER = src_filter=+ - IIC_BL24CXX_EEPROM = src_filter=+ HAS_SPI_FLASH = src_filter=+ +HAS_ETHERNET = src_filter=+ HAS_FANMUX = src_filter=+ FILAMENT_WIDTH_SENSOR = src_filter=+ + FWRETRACT = src_filter=+ + @@ -1321,6 +1322,7 @@ platform = espressif32@1.11.2 board = esp32dev build_flags = ${common.build_flags} -DCORE_DEBUG_LEVEL=0 src_filter = ${common.default_src_filter} + +lib_ignore = NativeEthernet upload_speed = 115200 #upload_port = marlinesp.local #board_build.flash_mode = qio @@ -1332,6 +1334,7 @@ upload_speed = 115200 platform = teensy board = teensy31 src_filter = ${common.default_src_filter} + +lib_ignore = NativeEthernet # # Teensy 3.5 / 3.6 (ARM Cortex-M4) @@ -1340,11 +1343,13 @@ src_filter = ${common.default_src_filter} + platform = teensy board = teensy35 src_filter = ${common.default_src_filter} + +lib_ignore = NativeEthernet [env:teensy36] platform = teensy board = teensy36 src_filter = ${common.default_src_filter} + +lib_ignore = NativeEthernet # # Teensy 4.0 / 4.1 (ARM Cortex-M7) From 69d55cabd483c93ab5421bf98e9bec2b597a00f3 Mon Sep 17 00:00:00 2001 From: ellensp Date: Wed, 21 Oct 2020 09:01:46 +1300 Subject: [PATCH 069/226] Handle dependent Stepper Driver defaults later (#19820) Co-authored-by: Scott Lahteine --- Marlin/src/inc/Conditionals_LCD.h | 52 +++++++++++++------------------ Marlin/src/inc/Conditionals_adv.h | 27 +++++++++++++--- 2 files changed, 44 insertions(+), 35 deletions(-) diff --git a/Marlin/src/inc/Conditionals_LCD.h b/Marlin/src/inc/Conditionals_LCD.h index d4cae0b64c..b22c608658 100644 --- a/Marlin/src/inc/Conditionals_LCD.h +++ b/Marlin/src/inc/Conditionals_LCD.h @@ -781,77 +781,67 @@ #define HAS_ETHERNET 1 #endif -// Fallback Stepper Driver types +// Fallback Stepper Driver types that don't depend on Configuration_adv.h #ifndef X_DRIVER_TYPE - #define X_DRIVER_TYPE A4988 + #define X_DRIVER_TYPE A4988 #endif -#ifndef Y_DRIVER_TYPE - #define Y_DRIVER_TYPE A4988 -#endif -#ifndef Z_DRIVER_TYPE - #define Z_DRIVER_TYPE A4988 -#endif -#if NONE(DUAL_X_CARRIAGE, X_DUAL_STEPPER_DRIVERS) - #undef X2_DRIVER_TYPE -#elif !defined(X2_DRIVER_TYPE) +#ifndef X2_DRIVER_TYPE #define X2_DRIVER_TYPE A4988 #endif -#if DISABLED(Y_DUAL_STEPPER_DRIVERS) - #undef Y2_DRIVER_TYPE -#elif !defined(Y2_DRIVER_TYPE) +#ifndef Y_DRIVER_TYPE + #define Y_DRIVER_TYPE A4988 +#endif +#ifndef Y2_DRIVER_TYPE #define Y2_DRIVER_TYPE A4988 #endif -#if NUM_Z_STEPPER_DRIVERS < 2 - #undef Z2_DRIVER_TYPE -#elif !defined(Z2_DRIVER_TYPE) +#ifndef Z_DRIVER_TYPE + #define Z_DRIVER_TYPE A4988 +#endif +#ifndef Z2_DRIVER_TYPE #define Z2_DRIVER_TYPE A4988 #endif -#if NUM_Z_STEPPER_DRIVERS < 3 - #undef Z3_DRIVER_TYPE -#elif !defined(Z3_DRIVER_TYPE) +#ifndef Z3_DRIVER_TYPE #define Z3_DRIVER_TYPE A4988 #endif -#if NUM_Z_STEPPER_DRIVERS < 4 - #undef Z4_DRIVER_TYPE -#elif !defined(Z4_DRIVER_TYPE) +#ifndef Z4_DRIVER_TYPE #define Z4_DRIVER_TYPE A4988 #endif -#if E_STEPPERS < 1 +#if E_STEPPERS <= 0 #undef E0_DRIVER_TYPE #elif !defined(E0_DRIVER_TYPE) #define E0_DRIVER_TYPE A4988 #endif -#if E_STEPPERS < 2 +#if E_STEPPERS <= 1 #undef E1_DRIVER_TYPE #elif !defined(E1_DRIVER_TYPE) #define E1_DRIVER_TYPE A4988 #endif -#if E_STEPPERS < 3 +#if E_STEPPERS <= 2 #undef E2_DRIVER_TYPE #elif !defined(E2_DRIVER_TYPE) #define E2_DRIVER_TYPE A4988 #endif -#if E_STEPPERS < 4 +#if E_STEPPERS <= 3 #undef E3_DRIVER_TYPE #elif !defined(E3_DRIVER_TYPE) #define E3_DRIVER_TYPE A4988 #endif -#if E_STEPPERS < 5 +#if E_STEPPERS <= 4 #undef E4_DRIVER_TYPE #elif !defined(E4_DRIVER_TYPE) #define E4_DRIVER_TYPE A4988 #endif -#if E_STEPPERS < 6 +#if E_STEPPERS <= 5 #undef E5_DRIVER_TYPE #elif !defined(E5_DRIVER_TYPE) #define E5_DRIVER_TYPE A4988 #endif -#if E_STEPPERS < 7 +#if E_STEPPERS <= 6 #undef E6_DRIVER_TYPE #elif !defined(E6_DRIVER_TYPE) #define E6_DRIVER_TYPE A4988 #endif -#if E_STEPPERS < 8 +#if E_STEPPERS <= 7 #undef E7_DRIVER_TYPE #elif !defined(E7_DRIVER_TYPE) #define E7_DRIVER_TYPE A4988 diff --git a/Marlin/src/inc/Conditionals_adv.h b/Marlin/src/inc/Conditionals_adv.h index 78c014865c..05935be549 100644 --- a/Marlin/src/inc/Conditionals_adv.h +++ b/Marlin/src/inc/Conditionals_adv.h @@ -178,16 +178,35 @@ #define HAS_MOTOR_CURRENT_I2C 1 #endif +#if ENABLED(Z_STEPPER_AUTO_ALIGN) + #if ENABLED(Z_STEPPER_ALIGN_KNOWN_STEPPER_POSITIONS) + #undef Z_STEPPER_ALIGN_AMP + #endif + #ifndef Z_STEPPER_ALIGN_AMP + #define Z_STEPPER_ALIGN_AMP 1.0 + #endif +#endif + // Multiple Z steppers #ifndef NUM_Z_STEPPER_DRIVERS #define NUM_Z_STEPPER_DRIVERS 1 #endif -#if ENABLED(Z_STEPPER_ALIGN_KNOWN_STEPPER_POSITIONS) - #undef Z_STEPPER_ALIGN_AMP +// Fallback Stepper Driver types that depend on Configuration_adv.h +#if NONE(DUAL_X_CARRIAGE, X_DUAL_STEPPER_DRIVERS) + #undef X2_DRIVER_TYPE #endif -#ifndef Z_STEPPER_ALIGN_AMP - #define Z_STEPPER_ALIGN_AMP 1.0 +#if DISABLED(Y_DUAL_STEPPER_DRIVERS) + #undef Y2_DRIVER_TYPE +#endif +#if NUM_Z_STEPPER_DRIVERS < 2 + #undef Z2_DRIVER_TYPE +#endif +#if NUM_Z_STEPPER_DRIVERS < 3 + #undef Z3_DRIVER_TYPE +#endif +#if NUM_Z_STEPPER_DRIVERS < 4 + #undef Z4_DRIVER_TYPE #endif // From d04ec15849eff1be08f742d035418ae191a6afe4 Mon Sep 17 00:00:00 2001 From: Tanguy Pruvot Date: Tue, 20 Oct 2020 22:06:06 +0200 Subject: [PATCH 070/226] Longer3D: LONGER_LK_TFT28 now set by config (#19817) --- Marlin/src/pins/stm32f1/pins_LONGER3D_LK.h | 15 --------------- 1 file changed, 15 deletions(-) diff --git a/Marlin/src/pins/stm32f1/pins_LONGER3D_LK.h b/Marlin/src/pins/stm32f1/pins_LONGER3D_LK.h index af81bbebe2..c685570707 100644 --- a/Marlin/src/pins/stm32f1/pins_LONGER3D_LK.h +++ b/Marlin/src/pins/stm32f1/pins_LONGER3D_LK.h @@ -106,18 +106,6 @@ //#undef Z_MAX_PIN // Uncomment if using ZMAX connector (PE5) #endif -/** - * Note: Alfawise screens use various TFT controllers. Supported screens - * are based on the ILI9341, ILI9328 and ST7798V. Define init sequences for - * other screens in u8g_dev_tft_320x240_upscale_from_128x64.cpp - * - * If the screen stays white, disable 'LCD_RESET_PIN' to let the bootloader - * init the screen. - * - * Setting an 'LCD_RESET_PIN' may cause a flicker when entering the LCD menu - * because Marlin uses the reset as a failsafe to revive a glitchy LCD. - */ - #define TFT_RESET_PIN PC4 // pin 33 #define TFT_BACKLIGHT_PIN PD12 // pin 59 #define FSMC_CS_PIN PD7 // pin 88 = FSMC_NE1 @@ -130,9 +118,6 @@ #define DOGLCD_MOSI -1 // Prevent auto-define by Conditionals_post.h #define DOGLCD_SCK -1 -// Longer/Alfawise TFT -#define LONGER_LK_TFT28 - // Buffer for Color UI #define TFT_BUFFER_SIZE 3200 From 11badea96212f25f86c36f070709b61108c3838e Mon Sep 17 00:00:00 2001 From: thinkyhead Date: Wed, 21 Oct 2020 00:16:12 +0000 Subject: [PATCH 071/226] [cron] Bump distribution date (2020-10-21) --- Marlin/src/inc/Version.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Marlin/src/inc/Version.h b/Marlin/src/inc/Version.h index 246aa698ae..a4c9aebbb0 100644 --- a/Marlin/src/inc/Version.h +++ b/Marlin/src/inc/Version.h @@ -42,7 +42,7 @@ * version was tagged. */ #ifndef STRING_DISTRIBUTION_DATE - #define STRING_DISTRIBUTION_DATE "2020-10-20" + #define STRING_DISTRIBUTION_DATE "2020-10-21" #endif /** From a596969049a8522c630ec064e727e5277b6f1cff Mon Sep 17 00:00:00 2001 From: uwedamm <46942357+uwedamm@users.noreply.github.com> Date: Wed, 21 Oct 2020 03:26:07 +0200 Subject: [PATCH 072/226] Fix G2/G3 P E and Z motion (#19797) Co-authored-by: Scott Lahteine --- Marlin/src/gcode/bedlevel/G26.cpp | 4 ++-- Marlin/src/gcode/motion/G2_G3.cpp | 39 ++++++++++++++++++++++--------- 2 files changed, 30 insertions(+), 13 deletions(-) diff --git a/Marlin/src/gcode/bedlevel/G26.cpp b/Marlin/src/gcode/bedlevel/G26.cpp index 6123fbf6c8..1c0d8cba8e 100644 --- a/Marlin/src/gcode/bedlevel/G26.cpp +++ b/Marlin/src/gcode/bedlevel/G26.cpp @@ -136,7 +136,7 @@ #define G26_ERR true #if ENABLED(ARC_SUPPORT) - void plan_arc(const xyze_pos_t &cart, const ab_float_t &offset, const uint8_t clockwise); + void plan_arc(const xyze_pos_t&, const ab_float_t&, const bool, const uint8_t); #endif constexpr float g26_e_axis_feedrate = 0.025; @@ -783,7 +783,7 @@ void GcodeSuite::G26() { const feedRate_t old_feedrate = feedrate_mm_s; feedrate_mm_s = PLANNER_XY_FEEDRATE() * 0.1f; - plan_arc(endpoint, arc_offset, false); // Draw a counter-clockwise arc + plan_arc(endpoint, arc_offset, false, 0); // Draw a counter-clockwise arc feedrate_mm_s = old_feedrate; destination = current_position; diff --git a/Marlin/src/gcode/motion/G2_G3.cpp b/Marlin/src/gcode/motion/G2_G3.cpp index 61d9f1d3a6..c713877a0e 100644 --- a/Marlin/src/gcode/motion/G2_G3.cpp +++ b/Marlin/src/gcode/motion/G2_G3.cpp @@ -52,7 +52,8 @@ void plan_arc( const xyze_pos_t &cart, // Destination position const ab_float_t &offset, // Center of rotation relative to current_position - const uint8_t clockwise // Clockwise? + const bool clockwise, // Clockwise? + const uint8_t circles // Take the scenic route ) { #if ENABLED(CNC_WORKSPACE_PLANES) AxisEnum p_axis, q_axis, l_axis; @@ -74,9 +75,7 @@ void plan_arc( center_Q = current_position[q_axis] - rvec.b, rt_X = cart[p_axis] - center_P, rt_Y = cart[q_axis] - center_Q, - start_L = current_position[l_axis], - linear_travel = cart[l_axis] - start_L, - extruder_travel = cart.e - current_position.e; + start_L = current_position[l_axis]; // CCW angle of rotation between position and target from the circle center. Only one atan2() trig computation required. float angular_travel = ATAN2(rvec.a * rt_Y - rvec.b * rt_X, rvec.a * rt_X + rvec.b * rt_Y); @@ -90,13 +89,32 @@ void plan_arc( if (clockwise) angular_travel -= RADIANS(360); // Make a circle if the angular rotation is 0 and the target is current position - if (angular_travel == 0 && current_position[p_axis] == cart[p_axis] && current_position[q_axis] == cart[q_axis]) { + if (NEAR_ZERO(angular_travel) && NEAR(current_position[p_axis], cart[p_axis]) && NEAR(current_position[q_axis], cart[q_axis])) { angular_travel = RADIANS(360); #ifdef MIN_ARC_SEGMENTS min_segments = MIN_ARC_SEGMENTS; #endif } + float linear_travel = cart[l_axis] - start_L, + extruder_travel = cart.e - current_position.e; + + // If circling around... + if (ENABLED(ARC_P_CIRCLES) && circles) { + const float total_angular = angular_travel + circles * RADIANS(360), // Total rotation with all circles and remainder + part_per_circle = RADIANS(360) / total_angular, // Each circle's part of the total + l_per_circle = linear_travel * part_per_circle, // L movement per circle + e_per_circle = extruder_travel * part_per_circle; // E movement per circle + xyze_pos_t temp_position = current_position; // for plan_arc to compare to current_position + for (uint16_t n = circles; n--;) { + temp_position.e += e_per_circle; // Destination E axis + temp_position[l_axis] += l_per_circle; // Destination L axis + plan_arc(temp_position, offset, clockwise, 0); // Plan a single whole circle + } + linear_travel = cart[l_axis] - current_position[l_axis]; + extruder_travel = cart.e - current_position.e; + } + const float flat_mm = radius * angular_travel, mm_of_travel = linear_travel ? HYPOT(flat_mm, linear_travel) : ABS(flat_mm); if (mm_of_travel < 0.001f) return; @@ -150,7 +168,7 @@ void plan_arc( linear_per_segment = linear_travel / segments, extruder_per_segment = extruder_travel / segments, sq_theta_per_segment = sq(theta_per_segment), - sin_T = theta_per_segment - sq_theta_per_segment*theta_per_segment/6, + sin_T = theta_per_segment - sq_theta_per_segment * theta_per_segment / 6, cos_T = 1 - 0.5f * sq_theta_per_segment; // Small angle approximation // Initialize the linear axis @@ -320,16 +338,15 @@ void GcodeSuite::G2_G3(const bool clockwise) { #if ENABLED(ARC_P_CIRCLES) // P indicates number of circles to do - int8_t circles_to_do = parser.byteval('P'); + const int8_t circles_to_do = parser.byteval('P'); if (!WITHIN(circles_to_do, 0, 100)) SERIAL_ERROR_MSG(STR_ERR_ARC_ARGS); - - while (circles_to_do--) - plan_arc(current_position, arc_offset, clockwise); + #else + constexpr uint8_t circles_to_do = 0; #endif // Send the arc to the planner - plan_arc(destination, arc_offset, clockwise); + plan_arc(destination, arc_offset, clockwise, circles_to_do); reset_stepper_timeout(); } else From 1f7c085527ef0237bfc9068c141288b159ef309a Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Tue, 20 Oct 2020 22:36:22 -0500 Subject: [PATCH 073/226] ESP32: i2s_init requires I2S_STEPPER_STREAM --- Marlin/src/HAL/ESP32/HAL.cpp | 2 +- Marlin/src/gcode/feature/password/M510-M512.cpp | 2 +- Marlin/src/pins/esp32/pins_MRR_ESPA.h | 10 ++++------ Marlin/src/pins/esp32/pins_MRR_ESPE.h | 4 +--- 4 files changed, 7 insertions(+), 11 deletions(-) diff --git a/Marlin/src/HAL/ESP32/HAL.cpp b/Marlin/src/HAL/ESP32/HAL.cpp index 1e00df5177..ead448d78d 100644 --- a/Marlin/src/HAL/ESP32/HAL.cpp +++ b/Marlin/src/HAL/ESP32/HAL.cpp @@ -86,7 +86,7 @@ volatile int numPWMUsed = 0, #endif -void HAL_init() { i2s_init(); } +void HAL_init() { TERN_(I2S_STEPPER_STREAM, i2s_init()); } void HAL_init_board() { diff --git a/Marlin/src/gcode/feature/password/M510-M512.cpp b/Marlin/src/gcode/feature/password/M510-M512.cpp index 79f1da065b..eeb9b1df22 100644 --- a/Marlin/src/gcode/feature/password/M510-M512.cpp +++ b/Marlin/src/gcode/feature/password/M510-M512.cpp @@ -58,7 +58,7 @@ void GcodeSuite::M510() { if (password.is_set && parser.ulongval('P') != password.value) { SERIAL_ECHOLNPGM(STR_WRONG_PASSWORD); return; - } + } if (parser.seenval('S')) { password.value_entry = parser.ulongval('S'); diff --git a/Marlin/src/pins/esp32/pins_MRR_ESPA.h b/Marlin/src/pins/esp32/pins_MRR_ESPA.h index 0457b0afca..52837df741 100644 --- a/Marlin/src/pins/esp32/pins_MRR_ESPA.h +++ b/Marlin/src/pins/esp32/pins_MRR_ESPA.h @@ -42,12 +42,10 @@ // // Disable I2S stepper stream // -#ifdef I2S_STEPPER_STREAM - #undef I2S_STEPPER_STREAM -#endif -#define I2S_WS -1 -#define I2S_BCK -1 -#define I2S_DATA -1 +#undef I2S_STEPPER_STREAM +#undef I2S_WS +#undef I2S_BCK +#undef I2S_DATA // // Limit Switches diff --git a/Marlin/src/pins/esp32/pins_MRR_ESPE.h b/Marlin/src/pins/esp32/pins_MRR_ESPE.h index d22a82d7a4..0c489dd7b4 100644 --- a/Marlin/src/pins/esp32/pins_MRR_ESPE.h +++ b/Marlin/src/pins/esp32/pins_MRR_ESPE.h @@ -52,12 +52,10 @@ // #undef I2S_STEPPER_STREAM #define I2S_STEPPER_STREAM - -#undef LIN_ADVANCE // Currently, I2S stream does not work with linear advance - #define I2S_WS 26 #define I2S_BCK 25 #define I2S_DATA 27 +#undef LIN_ADVANCE // Currently, I2S stream does not work with linear advance // // Steppers From 072f996af70b5ac635893eca2d4bd4bbb4f00acc Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Wed, 21 Oct 2020 12:45:27 -0500 Subject: [PATCH 074/226] General cleanup, mostly MKS UI (#19825) --- .gitignore | 1 - Marlin/src/inc/Conditionals_LCD.h | 10 +- .../src/lcd/extui/lib/mks_ui/draw_about.cpp | 7 +- .../lib/mks_ui/draw_acceleration_settings.cpp | 6 +- .../lib/mks_ui/draw_advance_settings.cpp | 6 +- .../draw_auto_level_offset_settings.cpp | 7 +- .../extui/lib/mks_ui/draw_baby_stepping.cpp | 10 +- .../extui/lib/mks_ui/draw_change_speed.cpp | 11 +- .../src/lcd/extui/lib/mks_ui/draw_dialog.cpp | 12 +- .../extui/lib/mks_ui/draw_eeprom_settings.cpp | 6 +- .../lib/mks_ui/draw_encoder_settings.cpp | 48 +- .../extui/lib/mks_ui/draw_error_message.cpp | 10 +- .../lcd/extui/lib/mks_ui/draw_extrusion.cpp | 14 +- Marlin/src/lcd/extui/lib/mks_ui/draw_fan.cpp | 10 +- .../extui/lib/mks_ui/draw_filament_change.cpp | 11 +- .../lib/mks_ui/draw_filament_settings.cpp | 7 +- Marlin/src/lcd/extui/lib/mks_ui/draw_home.cpp | 9 +- .../draw_homing_sensitivity_settings.cpp | 13 +- .../extui/lib/mks_ui/draw_jerk_settings.cpp | 6 +- .../lcd/extui/lib/mks_ui/draw_keyboard.cpp | 5 +- .../lcd/extui/lib/mks_ui/draw_language.cpp | 6 +- .../extui/lib/mks_ui/draw_level_settings.cpp | 6 +- .../extui/lib/mks_ui/draw_machine_para.cpp | 6 +- .../lib/mks_ui/draw_machine_settings.cpp | 6 +- .../lcd/extui/lib/mks_ui/draw_manuaLevel.cpp | 9 +- .../mks_ui/draw_manual_level_pos_settings.cpp | 6 +- .../lib/mks_ui/draw_max_feedrate_settings.cpp | 6 +- .../extui/lib/mks_ui/draw_motor_settings.cpp | 6 +- .../lcd/extui/lib/mks_ui/draw_move_motor.cpp | 11 +- .../lcd/extui/lib/mks_ui/draw_number_key.cpp | 14 +- .../lcd/extui/lib/mks_ui/draw_operation.cpp | 25 +- .../extui/lib/mks_ui/draw_pause_message.cpp | 4 +- .../extui/lib/mks_ui/draw_pause_position.cpp | 6 +- .../src/lcd/extui/lib/mks_ui/draw_preHeat.cpp | 14 +- .../lcd/extui/lib/mks_ui/draw_print_file.cpp | 9 +- .../lcd/extui/lib/mks_ui/draw_printing.cpp | 30 +- .../lcd/extui/lib/mks_ui/draw_ready_print.cpp | 8 +- Marlin/src/lcd/extui/lib/mks_ui/draw_set.cpp | 12 +- .../extui/lib/mks_ui/draw_step_settings.cpp | 6 +- .../lib/mks_ui/draw_tmc_current_settings.cpp | 7 +- .../mks_ui/draw_tmc_step_mode_settings.cpp | 9 +- Marlin/src/lcd/extui/lib/mks_ui/draw_tool.cpp | 6 +- Marlin/src/lcd/extui/lib/mks_ui/draw_ui.cpp | 58 +- Marlin/src/lcd/extui/lib/mks_ui/draw_ui.h | 8 +- Marlin/src/lcd/extui/lib/mks_ui/draw_wifi.cpp | 9 +- .../lcd/extui/lib/mks_ui/draw_wifi_list.cpp | 7 +- .../extui/lib/mks_ui/draw_wifi_settings.cpp | 54 +- .../lcd/extui/lib/mks_ui/draw_wifi_tips.cpp | 7 +- .../src/lcd/extui/lib/mks_ui/irq_overrid.cpp | 3 +- .../src/lcd/extui/lib/mks_ui/pic_manager.cpp | 4 +- .../extui/lib/mks_ui/printer_operation.cpp | 28 +- .../lib/mks_ui/tft_lvgl_configuration.cpp | 63 +- .../src/lcd/extui/lib/mks_ui/wifiSerial.cpp | 6 +- .../src/lcd/extui/lib/mks_ui/wifi_module.cpp | 698 ++++++++---------- Marlin/src/pins/esp32/pins_E4D.h | 30 +- Marlin/src/pins/pins.h | 1 + platformio.ini | 2 - 57 files changed, 616 insertions(+), 783 deletions(-) diff --git a/.gitignore b/.gitignore index c163d339df..1ac1abbe15 100755 --- a/.gitignore +++ b/.gitignore @@ -77,7 +77,6 @@ tags *.out *.app - # # C # diff --git a/Marlin/src/inc/Conditionals_LCD.h b/Marlin/src/inc/Conditionals_LCD.h index b22c608658..6f632aa569 100644 --- a/Marlin/src/inc/Conditionals_LCD.h +++ b/Marlin/src/inc/Conditionals_LCD.h @@ -341,7 +341,7 @@ #define DOGLCD #define IS_ULTIPANEL 1 #define DELAYED_BACKLIGHT_INIT -#elif ENABLED(TFT_LVGL_UI) +#elif HAS_TFT_LVGL_UI #define DELAYED_BACKLIGHT_INIT #endif @@ -957,16 +957,16 @@ // FSMC/SPI TFT Panels using standard HAL/tft/tft_(fsmc|spi).h #if ENABLED(TFT_INTERFACE_FSMC) #define HAS_FSMC_TFT 1 - #if ENABLED(TFT_CLASSIC_UI) + #if TFT_SCALED_DOGLCD #define HAS_FSMC_GRAPHICAL_TFT 1 - #elif ENABLED(TFT_LVGL_UI) + #elif HAS_TFT_LVGL_UI #define HAS_TFT_LVGL_UI_FSMC 1 #endif #elif ENABLED(TFT_INTERFACE_SPI) #define HAS_SPI_TFT 1 - #if ENABLED(TFT_CLASSIC_UI) + #if TFT_SCALED_DOGLCD #define HAS_SPI_GRAPHICAL_TFT 1 - #elif ENABLED(TFT_LVGL_UI) + #elif HAS_TFT_LVGL_UI #define HAS_TFT_LVGL_UI_SPI 1 #endif #endif diff --git a/Marlin/src/lcd/extui/lib/mks_ui/draw_about.cpp b/Marlin/src/lcd/extui/lib/mks_ui/draw_about.cpp index 34b7427860..68d1993b6f 100644 --- a/Marlin/src/lcd/extui/lib/mks_ui/draw_about.cpp +++ b/Marlin/src/lcd/extui/lib/mks_ui/draw_about.cpp @@ -23,15 +23,14 @@ #if HAS_TFT_LVGL_UI -#include "lv_conf.h" #include "draw_ui.h" +#include //#include "../lvgl/src/lv_objx/lv_imgbtn.h" //#include "../lvgl/src/lv_objx/lv_img.h" //#include "../lvgl/src/lv_core/lv_disp.h" //#include "../lvgl/src/lv_core/lv_refr.h" -#include "../../../../MarlinCore.h" -#include "../../../../module/temperature.h" +#include "../../../../inc/MarlinConfig.h" extern lv_group_t * g; static lv_obj_t * scr; @@ -94,7 +93,7 @@ void lv_draw_about(void) { // Create a label on the image button label_Back = lv_label_create(buttonBack, NULL); - if (gCfgItems.multiple_language != 0) { + if (gCfgItems.multiple_language) { lv_label_set_text(label_Back, common_menu.text_back); lv_obj_align(label_Back, buttonBack, LV_ALIGN_IN_BOTTOM_MID, 0, BUTTON_TEXT_Y_OFFSET); } diff --git a/Marlin/src/lcd/extui/lib/mks_ui/draw_acceleration_settings.cpp b/Marlin/src/lcd/extui/lib/mks_ui/draw_acceleration_settings.cpp index a30c99dba0..e362e5bff1 100644 --- a/Marlin/src/lcd/extui/lib/mks_ui/draw_acceleration_settings.cpp +++ b/Marlin/src/lcd/extui/lib/mks_ui/draw_acceleration_settings.cpp @@ -23,11 +23,11 @@ #if HAS_TFT_LVGL_UI -#include "lv_conf.h" #include "draw_ui.h" +#include -#include "../../../../MarlinCore.h" #include "../../../../module/planner.h" +#include "../../../../inc/MarlinConfig.h" extern lv_group_t * g; static lv_obj_t * scr; @@ -383,7 +383,7 @@ void lv_draw_acceleration_settings(void) { //lv_obj_set_pos(buttonBack, PARA_UI_BACL_POS_X, PARA_UI_BACL_POS_Y); //lv_btn_set_layout(buttonBack, LV_LAYOUT_OFF); - if (gCfgItems.multiple_language != 0) { + if (gCfgItems.multiple_language) { if (uiCfg.para_ui_page != 1) { lv_label_set_text(labelTurnPage, machine_menu.next); diff --git a/Marlin/src/lcd/extui/lib/mks_ui/draw_advance_settings.cpp b/Marlin/src/lcd/extui/lib/mks_ui/draw_advance_settings.cpp index 5b1b241716..f81fe6c728 100644 --- a/Marlin/src/lcd/extui/lib/mks_ui/draw_advance_settings.cpp +++ b/Marlin/src/lcd/extui/lib/mks_ui/draw_advance_settings.cpp @@ -23,10 +23,10 @@ #if HAS_TFT_LVGL_UI -#include "lv_conf.h" #include "draw_ui.h" +#include -#include "../../../../MarlinCore.h" +#include "../../../../inc/MarlinConfig.h" extern lv_group_t * g; static lv_obj_t * scr; @@ -302,7 +302,7 @@ void lv_draw_advance_settings(void) { lv_btn_set_layout(buttonBack, LV_LAYOUT_OFF); label_Back = lv_label_create(buttonBack, NULL); - if (gCfgItems.multiple_language != 0) { + if (gCfgItems.multiple_language) { lv_label_set_text(label_Back, common_menu.text_back); lv_obj_align(label_Back, buttonBack, LV_ALIGN_CENTER, 0, 0); diff --git a/Marlin/src/lcd/extui/lib/mks_ui/draw_auto_level_offset_settings.cpp b/Marlin/src/lcd/extui/lib/mks_ui/draw_auto_level_offset_settings.cpp index bb6b45aebe..be2015ed9e 100644 --- a/Marlin/src/lcd/extui/lib/mks_ui/draw_auto_level_offset_settings.cpp +++ b/Marlin/src/lcd/extui/lib/mks_ui/draw_auto_level_offset_settings.cpp @@ -23,12 +23,11 @@ #if BOTH(HAS_TFT_LVGL_UI, HAS_BED_PROBE) -#include "lv_conf.h" #include "draw_ui.h" +#include -#include "../../../../MarlinCore.h" -#include "../../../../module/planner.h" #include "../../../../module/probe.h" +#include "../../../../inc/MarlinConfig.h" extern lv_group_t * g; static lv_obj_t * scr; @@ -172,7 +171,7 @@ void lv_draw_auto_level_offset_settings(void) { } #endif - if (gCfgItems.multiple_language != 0) { + if (gCfgItems.multiple_language) { ZERO(public_buf_l); sprintf_P(public_buf_l, PSTR("%.1f"), TERN(HAS_PROBE_XY_OFFSET, probe.offset.x, 0)); lv_label_set_text(labelXValue, public_buf_l); diff --git a/Marlin/src/lcd/extui/lib/mks_ui/draw_baby_stepping.cpp b/Marlin/src/lcd/extui/lib/mks_ui/draw_baby_stepping.cpp index 70564c036c..6891060274 100644 --- a/Marlin/src/lcd/extui/lib/mks_ui/draw_baby_stepping.cpp +++ b/Marlin/src/lcd/extui/lib/mks_ui/draw_baby_stepping.cpp @@ -23,12 +23,12 @@ #if HAS_TFT_LVGL_UI -#include "lv_conf.h" #include "draw_ui.h" +#include -#include "../../../../MarlinCore.h" #include "../../../../gcode/queue.h" #include "../../../../gcode/gcode.h" +#include "../../../../inc/MarlinConfig.h" #if HAS_BED_PROBE #include "../../../../module/probe.h" @@ -52,7 +52,7 @@ static float babystep_dist=0.01; static uint8_t has_adjust_z = 0; static void event_handler(lv_obj_t * obj, lv_event_t event) { - char baby_buf[30]={0}; + char baby_buf[30] = { 0 }; switch (obj->mks_obj_id) { case ID_BABY_STEP_X_P: if (event == LV_EVENT_CLICKED) { @@ -259,7 +259,7 @@ void lv_draw_baby_stepping(void) { labelV = lv_label_create(buttonV, NULL); lv_obj_t *label_Back = lv_label_create(buttonBack, NULL); - if (gCfgItems.multiple_language != 0) { + if (gCfgItems.multiple_language) { lv_label_set_text(labelXI, move_menu.x_add); lv_obj_align(labelXI, buttonXI, LV_ALIGN_IN_BOTTOM_MID, 0, BUTTON_TEXT_Y_OFFSET); @@ -318,7 +318,7 @@ void disp_baby_step_dist() { lv_imgbtn_set_src(buttonV, LV_BTN_STATE_REL, "F:/bmp_baby_move0_1.bin"); lv_imgbtn_set_src(buttonV, LV_BTN_STATE_PR, "F:/bmp_baby_move0_1.bin"); } - if (gCfgItems.multiple_language != 0) { + if (gCfgItems.multiple_language) { if ((int)(100 * babystep_dist) == 1) { lv_label_set_text(labelV, move_menu.step_001mm); lv_obj_align(labelV, buttonV, LV_ALIGN_IN_BOTTOM_MID, 0, BUTTON_TEXT_Y_OFFSET); diff --git a/Marlin/src/lcd/extui/lib/mks_ui/draw_change_speed.cpp b/Marlin/src/lcd/extui/lib/mks_ui/draw_change_speed.cpp index c60000afae..f9399b8a45 100644 --- a/Marlin/src/lcd/extui/lib/mks_ui/draw_change_speed.cpp +++ b/Marlin/src/lcd/extui/lib/mks_ui/draw_change_speed.cpp @@ -23,16 +23,15 @@ #if HAS_TFT_LVGL_UI -#include "lv_conf.h" #include "draw_ui.h" +#include //#include "../lvgl/src/lv_objx/lv_imgbtn.h" //#include "../lvgl/src/lv_objx/lv_img.h" //#include "../lvgl/src/lv_core/lv_disp.h" //#include "../lvgl/src/lv_core/lv_refr.h" -#include "../../../../MarlinCore.h" -#include "../../../../module/temperature.h" #include "../../../../module/planner.h" +#include "../../../../inc/MarlinConfig.h" extern lv_group_t * g; static lv_obj_t * scr; @@ -239,7 +238,7 @@ void lv_draw_change_speed(void) { labelStep = lv_label_create(buttonStep, NULL); lv_obj_t *label_Back = lv_label_create(buttonBack, NULL); - if (gCfgItems.multiple_language != 0) { + if (gCfgItems.multiple_language) { lv_label_set_text(labelAdd, speed_menu.add); lv_obj_align(labelAdd, buttonAdd, LV_ALIGN_IN_BOTTOM_MID, 0, BUTTON_TEXT_Y_OFFSET); @@ -281,7 +280,7 @@ void disp_speed_step() { lv_imgbtn_set_src(buttonStep, LV_BTN_STATE_REL, "F:/bmp_step10_percent.bin"); lv_imgbtn_set_src(buttonStep, LV_BTN_STATE_PR, "F:/bmp_step10_percent.bin"); } - if (gCfgItems.multiple_language != 0) { + if (gCfgItems.multiple_language) { if (uiCfg.stepPrintSpeed == 1) { lv_label_set_text(labelStep, speed_menu.step_1percent); lv_obj_align(labelStep, buttonStep, LV_ALIGN_IN_BOTTOM_MID, 0, BUTTON_TEXT_Y_OFFSET); @@ -337,7 +336,7 @@ void disp_speed_type() { lv_obj_refresh_ext_draw_pad(buttonExt); lv_obj_refresh_ext_draw_pad(buttonMov); - if (gCfgItems.multiple_language != 0) { + if (gCfgItems.multiple_language) { lv_label_set_text(labelMov, speed_menu.move); lv_obj_align(labelMov, buttonMov, LV_ALIGN_IN_BOTTOM_MID, 0, BUTTON_TEXT_Y_OFFSET); diff --git a/Marlin/src/lcd/extui/lib/mks_ui/draw_dialog.cpp b/Marlin/src/lcd/extui/lib/mks_ui/draw_dialog.cpp index c848323010..489d8466ce 100644 --- a/Marlin/src/lcd/extui/lib/mks_ui/draw_dialog.cpp +++ b/Marlin/src/lcd/extui/lib/mks_ui/draw_dialog.cpp @@ -28,20 +28,20 @@ #if HAS_TFT_LVGL_UI -#include "lv_conf.h" #include "draw_ui.h" +#include //#include "../lvgl/src/lv_objx/lv_imgbtn.h" //#include "../lvgl/src/lv_objx/lv_img.h" //#include "../lvgl/src/lv_core/lv_disp.h" //#include "../lvgl/src/lv_core/lv_refr.h" -#include "../../../../MarlinCore.h" #include "../../../../sd/cardreader.h" #include "../../../../gcode/queue.h" #include "../../../../module/temperature.h" #include "../../../../module/planner.h" #include "../../../../gcode/gcode.h" +#include "../../../../inc/MarlinConfig.h" #if ENABLED(POWER_LOSS_RECOVERY) #include "../../../../feature/powerloss.h" @@ -50,7 +50,6 @@ #if ENABLED(PARK_HEAD_ON_PAUSE) #include "../../../../feature/pause.h" #endif -#include "../../../../gcode/gcode.h" extern lv_group_t * g; static lv_obj_t * scr; @@ -58,8 +57,7 @@ static lv_obj_t * tempText1; static lv_obj_t * filament_bar; extern uint8_t sel_id; -extern uint8_t once_flag; -extern uint8_t gcode_preview_over; +extern bool once_flag, gcode_preview_over; extern int upload_result ; extern uint32_t upload_time; extern uint32_t upload_size; @@ -82,7 +80,7 @@ static void btn_ok_event_cb(lv_obj_t * btn, lv_event_t event) { lv_draw_printing(); #if ENABLED(SDSUPPORT) - if (gcode_preview_over != 1) { + if (!gcode_preview_over) { char *cur_name; cur_name = strrchr(list_file.file_name[sel_id], '/'); @@ -109,7 +107,7 @@ static void btn_ok_event_cb(lv_obj_t * btn, lv_event_t event) { #if ENABLED(POWER_LOSS_RECOVERY) recovery.prepare(); #endif - once_flag = 0; + once_flag = false; } } #endif diff --git a/Marlin/src/lcd/extui/lib/mks_ui/draw_eeprom_settings.cpp b/Marlin/src/lcd/extui/lib/mks_ui/draw_eeprom_settings.cpp index ca7d2d1e31..08fdb007fc 100644 --- a/Marlin/src/lcd/extui/lib/mks_ui/draw_eeprom_settings.cpp +++ b/Marlin/src/lcd/extui/lib/mks_ui/draw_eeprom_settings.cpp @@ -23,10 +23,10 @@ #if HAS_TFT_LVGL_UI -#include "lv_conf.h" #include "draw_ui.h" +#include -#include "../../../../MarlinCore.h" +#include "../../../../inc/MarlinConfig.h" extern lv_group_t * g; static lv_obj_t * scr; @@ -191,7 +191,7 @@ void lv_draw_eeprom_settings(void) { lv_btn_set_layout(buttonBack, LV_LAYOUT_OFF); label_Back = lv_label_create(buttonBack, NULL); - if (gCfgItems.multiple_language != 0) { + if (gCfgItems.multiple_language) { lv_label_set_text(label_Back, common_menu.text_back); lv_obj_align(label_Back, buttonBack, LV_ALIGN_CENTER, 0, 0); diff --git a/Marlin/src/lcd/extui/lib/mks_ui/draw_encoder_settings.cpp b/Marlin/src/lcd/extui/lib/mks_ui/draw_encoder_settings.cpp index 0ad2bb5f1d..1476fe0a74 100644 --- a/Marlin/src/lcd/extui/lib/mks_ui/draw_encoder_settings.cpp +++ b/Marlin/src/lcd/extui/lib/mks_ui/draw_encoder_settings.cpp @@ -23,15 +23,10 @@ #if HAS_TFT_LVGL_UI -#include "lv_conf.h" #include "draw_ui.h" +#include -#include "../../../../MarlinCore.h" -#include "../../../../module/planner.h" -#include "../../../../module/stepper/indirection.h" -#include "../../../../feature/tmc_util.h" -#include "../../../../gcode/gcode.h" -#include "../../../../module/planner.h" +#include "../../../../inc/MarlinConfig.h" #if BUTTONS_EXIST(EN1, EN2) @@ -59,20 +54,11 @@ static void event_handler(lv_obj_t * obj, lv_event_t event) { } else if (event == LV_EVENT_RELEASED) { - if (gCfgItems.encoder_enable) { - gCfgItems.encoder_enable = false; - lv_imgbtn_set_src(buttonEncoderState, LV_BTN_STATE_REL, "F:/bmp_disable.bin"); - lv_imgbtn_set_src(buttonEncoderState, LV_BTN_STATE_PR, "F:/bmp_disable.bin"); - lv_label_set_text(labelEncoderState, machine_menu.disable); - update_spi_flash(); - } - else { - gCfgItems.encoder_enable = true; - lv_imgbtn_set_src(buttonEncoderState, LV_BTN_STATE_REL, "F:/bmp_enable.bin"); - lv_imgbtn_set_src(buttonEncoderState, LV_BTN_STATE_PR, "F:/bmp_enable.bin"); - lv_label_set_text(labelEncoderState, machine_menu.enable); - update_spi_flash(); - } + gCfgItems.encoder_enable ^= true; + lv_imgbtn_set_src(buttonEncoderState, LV_BTN_STATE_REL, gCfgItems.encoder_enable ? "F:/bmp_enable.bin" : "F:/bmp_disable.bin"); + lv_imgbtn_set_src(buttonEncoderState, LV_BTN_STATE_PR, gCfgItems.encoder_enable ? "F:/bmp_enable.bin" : "F:/bmp_disable.bin"); + lv_label_set_text(labelEncoderState, machine_menu.enable); + update_spi_flash(); } break; } @@ -110,14 +96,8 @@ void lv_draw_encoder_settings(void) { buttonEncoderState = lv_imgbtn_create(scr, NULL); lv_obj_set_pos(buttonEncoderState, PARA_UI_STATE_POS_X, PARA_UI_POS_Y + PARA_UI_STATE_V); - if (gCfgItems.encoder_enable) { - lv_imgbtn_set_src(buttonEncoderState, LV_BTN_STATE_REL, "F:/bmp_enable.bin"); - lv_imgbtn_set_src(buttonEncoderState, LV_BTN_STATE_PR, "F:/bmp_enable.bin"); - } - else { - lv_imgbtn_set_src(buttonEncoderState, LV_BTN_STATE_REL, "F:/bmp_disable.bin"); - lv_imgbtn_set_src(buttonEncoderState, LV_BTN_STATE_PR, "F:/bmp_disable.bin"); - } + lv_imgbtn_set_src(buttonEncoderState, LV_BTN_STATE_REL, gCfgItems.encoder_enable ? "F:/bmp_enable.bin" : "F:/bmp_disable.bin"); + lv_imgbtn_set_src(buttonEncoderState, LV_BTN_STATE_PR, gCfgItems.encoder_enable ? "F:/bmp_enable.bin" : "F:/bmp_disable.bin"); lv_obj_set_event_cb_mks(buttonEncoderState, event_handler, ID_ENCODER_STATE, NULL, 0); @@ -140,14 +120,8 @@ void lv_draw_encoder_settings(void) { lv_btn_set_layout(buttonBack, LV_LAYOUT_OFF); label_Back = lv_label_create(buttonBack, NULL); - if (gCfgItems.encoder_enable) { - lv_label_set_text(labelEncoderState, machine_menu.enable); - lv_obj_align(labelEncoderState, buttonEncoderState, LV_ALIGN_CENTER, 0, 0); - } - else { - lv_label_set_text(labelEncoderState, machine_menu.disable); - lv_obj_align(labelEncoderState, buttonEncoderState, LV_ALIGN_CENTER, 0, 0); - } + lv_label_set_text(labelEncoderState, gCfgItems.encoder_enable ? machine_menu.enable : machine_menu.disable); + lv_obj_align(labelEncoderState, buttonEncoderState, LV_ALIGN_CENTER, 0, 0); lv_label_set_text(label_Back, common_menu.text_back); lv_obj_align(label_Back, buttonBack, LV_ALIGN_CENTER, 0, 0); diff --git a/Marlin/src/lcd/extui/lib/mks_ui/draw_error_message.cpp b/Marlin/src/lcd/extui/lib/mks_ui/draw_error_message.cpp index c21ee3612c..2a20fe39f4 100644 --- a/Marlin/src/lcd/extui/lib/mks_ui/draw_error_message.cpp +++ b/Marlin/src/lcd/extui/lib/mks_ui/draw_error_message.cpp @@ -23,18 +23,18 @@ #if HAS_TFT_LVGL_UI -#include "SPI_TFT.h" - -#include "lv_conf.h" #include "draw_ui.h" +#include + #include "tft_lvgl_configuration.h" -#include "mks_hardware_test.h" //#include "../lvgl/src/lv_objx/lv_imgbtn.h" //#include "../lvgl/src/lv_objx/lv_img.h" //#include "../lvgl/src/lv_core/lv_disp.h" //#include "../lvgl/src/lv_core/lv_refr.h" -#include "../../../../MarlinCore.h" +#include "SPI_TFT.h" +#include "mks_hardware_test.h" +#include "../../../../inc/MarlinConfig.h" static lv_obj_t * scr; diff --git a/Marlin/src/lcd/extui/lib/mks_ui/draw_extrusion.cpp b/Marlin/src/lcd/extui/lib/mks_ui/draw_extrusion.cpp index 543202067f..4bd320b640 100644 --- a/Marlin/src/lcd/extui/lib/mks_ui/draw_extrusion.cpp +++ b/Marlin/src/lcd/extui/lib/mks_ui/draw_extrusion.cpp @@ -23,16 +23,16 @@ #if HAS_TFT_LVGL_UI -#include "lv_conf.h" #include "draw_ui.h" +#include //#include "../lvgl/src/lv_objx/lv_imgbtn.h" //#include "../lvgl/src/lv_objx/lv_img.h" //#include "../lvgl/src/lv_core/lv_disp.h" //#include "../lvgl/src/lv_core/lv_refr.h" -#include "../../../../MarlinCore.h" #include "../../../../module/temperature.h" #include "../../../../gcode/queue.h" +#include "../../../../inc/MarlinConfig.h" static lv_obj_t * scr; extern lv_group_t* g; @@ -235,7 +235,7 @@ void lv_draw_extrusion(void) { labelSpeed = lv_label_create(buttonSpeed, NULL); lv_obj_t *label_Back = lv_label_create(buttonBack, NULL); - if (gCfgItems.multiple_language != 0) { + if (gCfgItems.multiple_language) { lv_label_set_text(labelAdd, extrude_menu.in); lv_obj_align(labelAdd, buttonAdd, LV_ALIGN_IN_BOTTOM_MID, 0, BUTTON_TEXT_Y_OFFSET); @@ -274,7 +274,7 @@ void disp_ext_type() { if (uiCfg.curSprayerChoose == 1) { lv_imgbtn_set_src(buttoType, LV_BTN_STATE_REL, "F:/bmp_extru2.bin"); lv_imgbtn_set_src(buttoType, LV_BTN_STATE_PR, "F:/bmp_extru2.bin"); - if (gCfgItems.multiple_language != 0) { + if (gCfgItems.multiple_language) { lv_label_set_text(labelType, extrude_menu.ext2); lv_obj_align(labelType, buttoType, LV_ALIGN_IN_BOTTOM_MID, 0, BUTTON_TEXT_Y_OFFSET); } @@ -282,7 +282,7 @@ void disp_ext_type() { else { lv_imgbtn_set_src(buttoType, LV_BTN_STATE_REL, "F:/bmp_extru1.bin"); lv_imgbtn_set_src(buttoType, LV_BTN_STATE_PR, "F:/bmp_extru1.bin"); - if (gCfgItems.multiple_language != 0) { + if (gCfgItems.multiple_language) { lv_label_set_text(labelType, extrude_menu.ext1); lv_obj_align(labelType, buttoType, LV_ALIGN_IN_BOTTOM_MID, 0, BUTTON_TEXT_Y_OFFSET); } @@ -303,7 +303,7 @@ void disp_ext_speed() { lv_imgbtn_set_src(buttonSpeed, LV_BTN_STATE_PR, "F:/bmp_speed_normal.bin"); } - if (gCfgItems.multiple_language != 0) { + if (gCfgItems.multiple_language) { if (uiCfg.extruSpeed == 20) { lv_label_set_text(labelSpeed, extrude_menu.high); lv_obj_align(labelSpeed, buttonSpeed, LV_ALIGN_IN_BOTTOM_MID, 0, BUTTON_TEXT_Y_OFFSET); @@ -377,7 +377,7 @@ void disp_ext_step() { lv_imgbtn_set_src(buttonStep, LV_BTN_STATE_PR, "F:/bmp_step10_mm.bin"); } - if (gCfgItems.multiple_language != 0) { + if (gCfgItems.multiple_language) { if (uiCfg.extruStep == 1) { lv_label_set_text(labelStep, extrude_menu.step_1mm); lv_obj_align(labelStep, buttonStep, LV_ALIGN_IN_BOTTOM_MID, 0, BUTTON_TEXT_Y_OFFSET); diff --git a/Marlin/src/lcd/extui/lib/mks_ui/draw_fan.cpp b/Marlin/src/lcd/extui/lib/mks_ui/draw_fan.cpp index 8cdc14964f..5d7bb335dc 100644 --- a/Marlin/src/lcd/extui/lib/mks_ui/draw_fan.cpp +++ b/Marlin/src/lcd/extui/lib/mks_ui/draw_fan.cpp @@ -23,17 +23,17 @@ #if HAS_TFT_LVGL_UI -#include "../../../../MarlinCore.h" -#include "lv_conf.h" +#include "draw_ui.h" +#include //#include "../lvgl/src/lv_objx/lv_imgbtn.h" //#include "../lvgl/src/lv_objx/lv_img.h" //#include "../lvgl/src/lv_core/lv_disp.h" //#include "../lvgl/src/lv_core/lv_refr.h" -#include "../../../../../Configuration.h" -#include "draw_ui.h" + #include "../../../../module/temperature.h" #include "../../../../gcode/queue.h" #include "../../../../gcode/gcode.h" +#include "../../../../inc/MarlinConfig.h" extern lv_group_t * g; static lv_obj_t * scr; @@ -209,7 +209,7 @@ void lv_draw_fan(void) { lv_obj_t *labelOff = lv_label_create(buttonOff, NULL); lv_obj_t *label_Back = lv_label_create(buttonBack, NULL); - if (gCfgItems.multiple_language != 0) { + if (gCfgItems.multiple_language) { lv_label_set_text(labelAdd, fan_menu.add); lv_obj_align(labelAdd, buttonAdd, LV_ALIGN_IN_BOTTOM_MID, 0, BUTTON_TEXT_Y_OFFSET); diff --git a/Marlin/src/lcd/extui/lib/mks_ui/draw_filament_change.cpp b/Marlin/src/lcd/extui/lib/mks_ui/draw_filament_change.cpp index 83f9e53677..4c9060c6a2 100644 --- a/Marlin/src/lcd/extui/lib/mks_ui/draw_filament_change.cpp +++ b/Marlin/src/lcd/extui/lib/mks_ui/draw_filament_change.cpp @@ -23,15 +23,14 @@ #if HAS_TFT_LVGL_UI -#include "lv_conf.h" #include "draw_ui.h" +#include -#include "../../../../MarlinCore.h" #include "../../../../module/temperature.h" -#include "../../../../gcode/queue.h" #include "../../../../gcode/gcode.h" #include "../../../../module/motion.h" #include "../../../../module/planner.h" +#include "../../../../inc/MarlinConfig.h" extern lv_group_t * g; static lv_obj_t * scr; @@ -197,7 +196,7 @@ void lv_draw_filament_change(void) { labelType = lv_label_create(buttoType, NULL); lv_obj_t *label_Back = lv_label_create(buttonBack, NULL); - if (gCfgItems.multiple_language != 0) { + if (gCfgItems.multiple_language) { lv_label_set_text(labelIn, filament_menu.in); lv_obj_align(labelIn, buttonIn, LV_ALIGN_IN_BOTTOM_MID, 0, BUTTON_TEXT_Y_OFFSET); @@ -228,7 +227,7 @@ void disp_filament_type() { if (uiCfg.curSprayerChoose == 1) { lv_imgbtn_set_src(buttoType, LV_BTN_STATE_REL, "F:/bmp_extru2.bin"); lv_imgbtn_set_src(buttoType, LV_BTN_STATE_PR, "F:/bmp_extru2.bin"); - if (gCfgItems.multiple_language != 0) { + if (gCfgItems.multiple_language) { lv_label_set_text(labelType, preheat_menu.ext2); lv_obj_align(labelType, buttoType, LV_ALIGN_IN_BOTTOM_MID, 0, BUTTON_TEXT_Y_OFFSET); } @@ -236,7 +235,7 @@ void disp_filament_type() { else { lv_imgbtn_set_src(buttoType, LV_BTN_STATE_REL, "F:/bmp_extru1.bin"); lv_imgbtn_set_src(buttoType, LV_BTN_STATE_PR, "F:/bmp_extru1.bin"); - if (gCfgItems.multiple_language != 0) { + if (gCfgItems.multiple_language) { lv_label_set_text(labelType, preheat_menu.ext1); lv_obj_align(labelType, buttoType, LV_ALIGN_IN_BOTTOM_MID, 0, BUTTON_TEXT_Y_OFFSET); } diff --git a/Marlin/src/lcd/extui/lib/mks_ui/draw_filament_settings.cpp b/Marlin/src/lcd/extui/lib/mks_ui/draw_filament_settings.cpp index 06ab35f3f0..377c44edb7 100644 --- a/Marlin/src/lcd/extui/lib/mks_ui/draw_filament_settings.cpp +++ b/Marlin/src/lcd/extui/lib/mks_ui/draw_filament_settings.cpp @@ -23,11 +23,10 @@ #if HAS_TFT_LVGL_UI -#include "lv_conf.h" #include "draw_ui.h" +#include -#include "../../../../MarlinCore.h" -#include "../../../../module/planner.h" +#include "../../../../inc/MarlinConfig.h" extern lv_group_t * g; static lv_obj_t * scr; @@ -279,7 +278,7 @@ void lv_draw_filament_settings(void) { if (gCfgItems.encoder_enable) lv_group_add_obj(g, buttonBack); #endif - if (gCfgItems.multiple_language != 0) { + if (gCfgItems.multiple_language) { if (uiCfg.para_ui_page != 1) { ZERO(public_buf_l); sprintf_P(public_buf_l, PSTR("%d"), gCfgItems.filamentchange_load_length); diff --git a/Marlin/src/lcd/extui/lib/mks_ui/draw_home.cpp b/Marlin/src/lcd/extui/lib/mks_ui/draw_home.cpp index 22e05f0e00..c7264f2765 100644 --- a/Marlin/src/lcd/extui/lib/mks_ui/draw_home.cpp +++ b/Marlin/src/lcd/extui/lib/mks_ui/draw_home.cpp @@ -23,16 +23,17 @@ #if HAS_TFT_LVGL_UI -#include "../../../../MarlinCore.h" #include "draw_ready_print.h" #include "draw_set.h" -#include "lv_conf.h" +#include "draw_ui.h" +#include //#include "../lvgl/src/lv_objx/lv_imgbtn.h" //#include "../lvgl/src/lv_objx/lv_img.h" //#include "../lvgl/src/lv_core/lv_disp.h" //#include "../lvgl/src/lv_core/lv_refr.h" -#include "draw_ui.h" + #include "../../../../gcode/queue.h" +#include "../../../../inc/MarlinConfig.h" extern lv_group_t * g; static lv_obj_t * scr; @@ -206,7 +207,7 @@ void lv_draw_home(void) { lv_obj_t *labelOffXY = lv_label_create(buttonOffXY, NULL); lv_obj_t *label_Back = lv_label_create(buttonBack, NULL); - if (gCfgItems.multiple_language != 0) { + if (gCfgItems.multiple_language) { lv_label_set_text(labelHomeAll, home_menu.home_all); lv_obj_align(labelHomeAll, buttonHomeAll, LV_ALIGN_IN_BOTTOM_MID, 0, BUTTON_TEXT_Y_OFFSET); diff --git a/Marlin/src/lcd/extui/lib/mks_ui/draw_homing_sensitivity_settings.cpp b/Marlin/src/lcd/extui/lib/mks_ui/draw_homing_sensitivity_settings.cpp index d22eeb157e..d819aa01f6 100644 --- a/Marlin/src/lcd/extui/lib/mks_ui/draw_homing_sensitivity_settings.cpp +++ b/Marlin/src/lcd/extui/lib/mks_ui/draw_homing_sensitivity_settings.cpp @@ -19,18 +19,15 @@ * along with this program. If not, see . * */ -#include "../../../../inc/MarlinConfigPre.h" +#include "../../../../inc/MarlinConfig.h" -#if HAS_TFT_LVGL_UI +#if HAS_TFT_LVGL_UI && USE_SENSORLESS -#include "lv_conf.h" #include "draw_ui.h" +#include -#include "../../../../MarlinCore.h" #include "../../../../module/planner.h" #include "../../../../module/probe.h" - -#if USE_SENSORLESS #include "../../../../module/stepper/indirection.h" #include "../../../../feature/tmc_util.h" @@ -222,7 +219,7 @@ void lv_draw_homing_sensitivity_settings(void) { if (gCfgItems.encoder_enable) lv_group_add_obj(g, buttonBack); #endif - if (gCfgItems.multiple_language != 0) { + if (gCfgItems.multiple_language) { ZERO(public_buf_l); sprintf_P(public_buf_l, PSTR("%d"), TERN(X_SENSORLESS, stepperX.homing_threshold(), 0)); lv_label_set_text(labelXValue, public_buf_l); @@ -257,6 +254,4 @@ void lv_clear_homing_sensitivity_settings() { lv_obj_del(scr); } -#endif // USE_SENSORLESS - #endif // HAS_TFT_LVGL_UI && USE_SENSORLESS diff --git a/Marlin/src/lcd/extui/lib/mks_ui/draw_jerk_settings.cpp b/Marlin/src/lcd/extui/lib/mks_ui/draw_jerk_settings.cpp index 8c359233e6..65649b793e 100644 --- a/Marlin/src/lcd/extui/lib/mks_ui/draw_jerk_settings.cpp +++ b/Marlin/src/lcd/extui/lib/mks_ui/draw_jerk_settings.cpp @@ -23,11 +23,11 @@ #if BOTH(HAS_TFT_LVGL_UI, HAS_CLASSIC_JERK) -#include "lv_conf.h" #include "draw_ui.h" +#include -#include "../../../../MarlinCore.h" #include "../../../../module/planner.h" +#include "../../../../inc/MarlinConfig.h" extern lv_group_t * g; static lv_obj_t * scr; @@ -201,7 +201,7 @@ void lv_draw_jerk_settings(void) { } #endif - if (gCfgItems.multiple_language != 0) { + if (gCfgItems.multiple_language) { ZERO(public_buf_l); sprintf_P(public_buf_l, PSTR("%.1f"), planner.max_jerk[X_AXIS]); lv_label_set_text(labelXValue, public_buf_l); diff --git a/Marlin/src/lcd/extui/lib/mks_ui/draw_keyboard.cpp b/Marlin/src/lcd/extui/lib/mks_ui/draw_keyboard.cpp index 902472b884..35ad439c6e 100644 --- a/Marlin/src/lcd/extui/lib/mks_ui/draw_keyboard.cpp +++ b/Marlin/src/lcd/extui/lib/mks_ui/draw_keyboard.cpp @@ -23,11 +23,10 @@ #if HAS_TFT_LVGL_UI -#include "lv_conf.h" #include "draw_ui.h" +#include -#include "../../../../../Configuration.h" -#include "../../../../MarlinCore.h" +#include "../../../../inc/MarlinConfig.h" extern lv_group_t * g; static lv_obj_t * scr; diff --git a/Marlin/src/lcd/extui/lib/mks_ui/draw_language.cpp b/Marlin/src/lcd/extui/lib/mks_ui/draw_language.cpp index 3e4ad06477..4cd2cab72f 100644 --- a/Marlin/src/lcd/extui/lib/mks_ui/draw_language.cpp +++ b/Marlin/src/lcd/extui/lib/mks_ui/draw_language.cpp @@ -23,14 +23,14 @@ #if HAS_TFT_LVGL_UI -#include "lv_conf.h" #include "draw_ui.h" +#include //#include "../lvgl/src/lv_objx/lv_imgbtn.h" //#include "../lvgl/src/lv_objx/lv_img.h" //#include "../lvgl/src/lv_core/lv_disp.h" //#include "../lvgl/src/lv_core/lv_refr.h" -#include "../../../../MarlinCore.h" +#include "../../../../inc/MarlinConfig.h" #include //static lv_obj_t *buttonMoveZ,*buttonTest,*buttonZ0,*buttonStop,*buttonReturn; @@ -352,7 +352,7 @@ void lv_draw_language(void) { disp_language(gCfgItems.language, SELECTED); - if (gCfgItems.multiple_language != 0) { + if (gCfgItems.multiple_language) { lv_label_set_text(label_CN, language_menu.chinese_s); lv_obj_align(label_CN, buttonCN, LV_ALIGN_IN_BOTTOM_MID, 0, BUTTON_TEXT_Y_OFFSET); diff --git a/Marlin/src/lcd/extui/lib/mks_ui/draw_level_settings.cpp b/Marlin/src/lcd/extui/lib/mks_ui/draw_level_settings.cpp index 0e0283d32a..2f4fe327fd 100644 --- a/Marlin/src/lcd/extui/lib/mks_ui/draw_level_settings.cpp +++ b/Marlin/src/lcd/extui/lib/mks_ui/draw_level_settings.cpp @@ -23,10 +23,10 @@ #if HAS_TFT_LVGL_UI -#include "lv_conf.h" #include "draw_ui.h" +#include -#include "../../../../MarlinCore.h" +#include "../../../../inc/MarlinConfig.h" extern lv_group_t * g; static lv_obj_t * scr; @@ -234,7 +234,7 @@ void lv_draw_level_settings(void) { lv_btn_set_layout(buttonBack, LV_LAYOUT_OFF); label_Back = lv_label_create(buttonBack, NULL); - if (gCfgItems.multiple_language != 0) { + if (gCfgItems.multiple_language) { lv_label_set_text(label_Back, common_menu.text_back); lv_obj_align(label_Back, buttonBack, LV_ALIGN_CENTER, 0, 0); diff --git a/Marlin/src/lcd/extui/lib/mks_ui/draw_machine_para.cpp b/Marlin/src/lcd/extui/lib/mks_ui/draw_machine_para.cpp index 9f03793c24..b79e84e8cb 100644 --- a/Marlin/src/lcd/extui/lib/mks_ui/draw_machine_para.cpp +++ b/Marlin/src/lcd/extui/lib/mks_ui/draw_machine_para.cpp @@ -23,10 +23,10 @@ #if HAS_TFT_LVGL_UI -#include "lv_conf.h" #include "draw_ui.h" +#include -#include "../../../../MarlinCore.h" +#include "../../../../inc/MarlinConfig.h" extern lv_group_t * g; static lv_obj_t * scr; @@ -252,7 +252,7 @@ void lv_draw_machine_para(void) { lv_btn_set_layout(buttonBack, LV_LAYOUT_OFF); label_Back = lv_label_create(buttonBack, NULL); - if (gCfgItems.multiple_language != 0) { + if (gCfgItems.multiple_language) { lv_label_set_text(label_Back, common_menu.text_back); lv_obj_align(label_Back, buttonBack, LV_ALIGN_CENTER, 0, -2); diff --git a/Marlin/src/lcd/extui/lib/mks_ui/draw_machine_settings.cpp b/Marlin/src/lcd/extui/lib/mks_ui/draw_machine_settings.cpp index 0cf5bbaf7f..930d2639bb 100644 --- a/Marlin/src/lcd/extui/lib/mks_ui/draw_machine_settings.cpp +++ b/Marlin/src/lcd/extui/lib/mks_ui/draw_machine_settings.cpp @@ -23,10 +23,10 @@ #if HAS_TFT_LVGL_UI -#include "lv_conf.h" #include "draw_ui.h" +#include -#include "../../../../MarlinCore.h" +#include "../../../../inc/MarlinConfig.h" extern lv_group_t * g; static lv_obj_t * scr; @@ -218,7 +218,7 @@ void lv_draw_machine_settings(void) { lv_btn_set_layout(buttonBack, LV_LAYOUT_OFF); label_Back = lv_label_create(buttonBack, NULL); - if (gCfgItems.multiple_language != 0) { + if (gCfgItems.multiple_language) { lv_label_set_text(label_Back, common_menu.text_back); lv_obj_align(label_Back, buttonBack, LV_ALIGN_CENTER, 0, 0); diff --git a/Marlin/src/lcd/extui/lib/mks_ui/draw_manuaLevel.cpp b/Marlin/src/lcd/extui/lib/mks_ui/draw_manuaLevel.cpp index 3d68019b35..f1040ba214 100644 --- a/Marlin/src/lcd/extui/lib/mks_ui/draw_manuaLevel.cpp +++ b/Marlin/src/lcd/extui/lib/mks_ui/draw_manuaLevel.cpp @@ -23,14 +23,15 @@ #if HAS_TFT_LVGL_UI -#include "../../../../MarlinCore.h" -#include "lv_conf.h" +#include "draw_ui.h" +#include //#include "../lvgl/src/lv_objx/lv_imgbtn.h" //#include "../lvgl/src/lv_objx/lv_img.h" //#include "../lvgl/src/lv_core/lv_disp.h" //#include "../lvgl/src/lv_core/lv_refr.h" -#include "draw_ui.h" + #include "../../../../gcode/queue.h" +#include "../../../../inc/MarlinConfig.h" extern lv_group_t * g; static lv_obj_t * scr; @@ -253,7 +254,7 @@ void lv_draw_manualLevel(void) { lv_obj_t *label_Point5 = lv_label_create(buttonPoint5, NULL); lv_obj_t *label_Back = lv_label_create(buttonBack, NULL); - if (gCfgItems.multiple_language != 0) { + if (gCfgItems.multiple_language) { lv_label_set_text(label_Point1, leveling_menu.position1); lv_obj_align(label_Point1, buttonPoint1, LV_ALIGN_IN_BOTTOM_MID, 0, BUTTON_TEXT_Y_OFFSET); diff --git a/Marlin/src/lcd/extui/lib/mks_ui/draw_manual_level_pos_settings.cpp b/Marlin/src/lcd/extui/lib/mks_ui/draw_manual_level_pos_settings.cpp index 9b7200b5a9..c27718b31d 100644 --- a/Marlin/src/lcd/extui/lib/mks_ui/draw_manual_level_pos_settings.cpp +++ b/Marlin/src/lcd/extui/lib/mks_ui/draw_manual_level_pos_settings.cpp @@ -23,11 +23,11 @@ #if HAS_TFT_LVGL_UI -#include "lv_conf.h" #include "draw_ui.h" +#include -#include "../../../../MarlinCore.h" #include "../../../../module/planner.h" +#include "../../../../inc/MarlinConfig.h" extern lv_group_t * g; static lv_obj_t * scr; @@ -384,7 +384,7 @@ void lv_draw_manual_level_pos_settings(void) { if (gCfgItems.encoder_enable) lv_group_add_obj(g, buttonBack); #endif - if (gCfgItems.multiple_language != 0) { + if (gCfgItems.multiple_language) { if (uiCfg.para_ui_page != 1) { ZERO(public_buf_l); sprintf_P(public_buf_l, PSTR("%d"), gCfgItems.levelingPos[0][0]); diff --git a/Marlin/src/lcd/extui/lib/mks_ui/draw_max_feedrate_settings.cpp b/Marlin/src/lcd/extui/lib/mks_ui/draw_max_feedrate_settings.cpp index e82124f705..6b43b8257b 100644 --- a/Marlin/src/lcd/extui/lib/mks_ui/draw_max_feedrate_settings.cpp +++ b/Marlin/src/lcd/extui/lib/mks_ui/draw_max_feedrate_settings.cpp @@ -23,11 +23,11 @@ #if HAS_TFT_LVGL_UI -#include "lv_conf.h" #include "draw_ui.h" +#include -#include "../../../../MarlinCore.h" #include "../../../../module/planner.h" +#include "../../../../inc/MarlinConfig.h" extern lv_group_t * g; static lv_obj_t * scr; @@ -284,7 +284,7 @@ void lv_draw_max_feedrate_settings(void) { if (gCfgItems.encoder_enable) lv_group_add_obj(g, buttonBack); #endif - if (gCfgItems.multiple_language != 0) { + if (gCfgItems.multiple_language) { if (uiCfg.para_ui_page != 1) { lv_label_set_text(labelTurnPage, machine_menu.next); diff --git a/Marlin/src/lcd/extui/lib/mks_ui/draw_motor_settings.cpp b/Marlin/src/lcd/extui/lib/mks_ui/draw_motor_settings.cpp index f6568df143..1766abf061 100644 --- a/Marlin/src/lcd/extui/lib/mks_ui/draw_motor_settings.cpp +++ b/Marlin/src/lcd/extui/lib/mks_ui/draw_motor_settings.cpp @@ -23,10 +23,10 @@ #if HAS_TFT_LVGL_UI -#include "lv_conf.h" #include "draw_ui.h" +#include -#include "../../../../MarlinCore.h" +#include "../../../../inc/MarlinConfig.h" extern lv_group_t * g; static lv_obj_t * scr; @@ -310,7 +310,7 @@ void lv_draw_motor_settings(void) { if (gCfgItems.encoder_enable) lv_group_add_obj(g, buttonBack); #endif - if (gCfgItems.multiple_language != 0) { + if (gCfgItems.multiple_language) { lv_label_set_text(label_Back, common_menu.text_back); lv_obj_align(label_Back, buttonBack, LV_ALIGN_CENTER, 0, 0); diff --git a/Marlin/src/lcd/extui/lib/mks_ui/draw_move_motor.cpp b/Marlin/src/lcd/extui/lib/mks_ui/draw_move_motor.cpp index a6c0c0551a..8e8302d707 100644 --- a/Marlin/src/lcd/extui/lib/mks_ui/draw_move_motor.cpp +++ b/Marlin/src/lcd/extui/lib/mks_ui/draw_move_motor.cpp @@ -23,14 +23,15 @@ #if HAS_TFT_LVGL_UI -#include "../../../../MarlinCore.h" -#include "lv_conf.h" +#include "draw_ui.h" +#include //#include "../lvgl/src/lv_objx/lv_imgbtn.h" //#include "../lvgl/src/lv_objx/lv_img.h" //#include "../lvgl/src/lv_core/lv_disp.h" //#include "../lvgl/src/lv_core/lv_refr.h" -#include "draw_ui.h" + #include "../../../../gcode/queue.h" +#include "../../../../inc/MarlinConfig.h" extern lv_group_t * g; static lv_obj_t * scr; @@ -268,7 +269,7 @@ void lv_draw_move_motor(void) { labelV = lv_label_create(buttonV, NULL); lv_obj_t *label_Back = lv_label_create(buttonBack, NULL); - if (gCfgItems.multiple_language != 0) { + if (gCfgItems.multiple_language) { lv_label_set_text(labelXI, move_menu.x_add); lv_obj_align(labelXI, buttonXI, LV_ALIGN_IN_BOTTOM_MID, 0, BUTTON_TEXT_Y_OFFSET); @@ -321,7 +322,7 @@ void disp_move_dist() { lv_imgbtn_set_src(buttonV, LV_BTN_STATE_REL, "F:/bmp_step_move10.bin"); lv_imgbtn_set_src(buttonV, LV_BTN_STATE_PR, "F:/bmp_step_move10.bin"); } - if (gCfgItems.multiple_language != 0) { + if (gCfgItems.multiple_language) { if ((int)(10 * uiCfg.move_dist) == 1) { lv_label_set_text(labelV, move_menu.step_01mm); lv_obj_align(labelV, buttonV, LV_ALIGN_IN_BOTTOM_MID, 0, BUTTON_TEXT_Y_OFFSET); diff --git a/Marlin/src/lcd/extui/lib/mks_ui/draw_number_key.cpp b/Marlin/src/lcd/extui/lib/mks_ui/draw_number_key.cpp index 4842776304..585c2fa75e 100644 --- a/Marlin/src/lcd/extui/lib/mks_ui/draw_number_key.cpp +++ b/Marlin/src/lcd/extui/lib/mks_ui/draw_number_key.cpp @@ -23,25 +23,23 @@ #if HAS_TFT_LVGL_UI -#include "lv_conf.h" +#include "draw_ui.h" +#include //#include "../../lvgl/src/lv_objx/lv_imgbtn.h" //#include "../../lvgl/src/lv_objx/lv_img.h" //#include "../../lvgl/src/lv_core/lv_disp.h" //#include "../../lvgl/src/lv_core/lv_refr.h" -//#include "../../MarlinCore.h" -#include "draw_ui.h" -#include "../../../../MarlinCore.h" -#include "../../../../module/temperature.h" +#include "../../../../gcode/gcode.h" #include "../../../../gcode/queue.h" +#include "../../../../module/planner.h" +#include "../../../../module/temperature.h" +#include "../../../../inc/MarlinConfig.h" #if ENABLED(POWER_LOSS_RECOVERY) #include "../../../../feature/powerloss.h" #endif -#include "../../../../gcode/gcode.h" -#include "../../../../module/planner.h" - #if HAS_TRINAMIC_CONFIG #include "../../../../module/stepper/indirection.h" #include "../../../../feature/tmc_util.h" diff --git a/Marlin/src/lcd/extui/lib/mks_ui/draw_operation.cpp b/Marlin/src/lcd/extui/lib/mks_ui/draw_operation.cpp index 4a4a0ee130..6ee5ac88c0 100644 --- a/Marlin/src/lcd/extui/lib/mks_ui/draw_operation.cpp +++ b/Marlin/src/lcd/extui/lib/mks_ui/draw_operation.cpp @@ -23,17 +23,17 @@ #if HAS_TFT_LVGL_UI -#include "lv_conf.h" #include "draw_ui.h" +#include //#include "../lvgl/src/lv_objx/lv_imgbtn.h" //#include "../lvgl/src/lv_objx/lv_img.h" //#include "../lvgl/src/lv_core/lv_disp.h" //#include "../lvgl/src/lv_core/lv_refr.h" -#include "../../../../MarlinCore.h" #include "../../../../module/temperature.h" #include "../../../../module/motion.h" #include "../../../../sd/cardreader.h" +#include "../../../../inc/MarlinConfig.h" extern lv_group_t * g; static lv_obj_t * scr; @@ -135,24 +135,21 @@ static void event_handler(lv_obj_t * obj, lv_event_t event) { // nothing to do } else if (event == LV_EVENT_RELEASED) { - if (gCfgItems.finish_power_off == 1) { - gCfgItems.finish_power_off = 0; + if (gCfgItems.finish_power_off) { + gCfgItems.finish_power_off = false; lv_imgbtn_set_src(buttonPowerOff, LV_BTN_STATE_REL, "F:/bmp_manual_off.bin"); lv_imgbtn_set_src(buttonPowerOff, LV_BTN_STATE_PR, "F:/bmp_manual_off.bin"); lv_label_set_text(label_PowerOff, printing_more_menu.manual); - lv_obj_align(label_PowerOff, buttonPowerOff, LV_ALIGN_IN_BOTTOM_MID, 0, BUTTON_TEXT_Y_OFFSET); - lv_obj_refresh_ext_draw_pad(label_PowerOff); - update_spi_flash(); } else { - gCfgItems.finish_power_off = 1; + gCfgItems.finish_power_off = true; lv_imgbtn_set_src(buttonPowerOff, LV_BTN_STATE_REL, "F:/bmp_auto_off.bin"); lv_imgbtn_set_src(buttonPowerOff, LV_BTN_STATE_PR, "F:/bmp_auto_off.bin"); lv_label_set_text(label_PowerOff, printing_more_menu.auto_close); - lv_obj_align(label_PowerOff, buttonPowerOff, LV_ALIGN_IN_BOTTOM_MID, 0, BUTTON_TEXT_Y_OFFSET); - lv_obj_refresh_ext_draw_pad(label_PowerOff); - update_spi_flash(); } + lv_obj_align(label_PowerOff, buttonPowerOff, LV_ALIGN_IN_BOTTOM_MID, 0, BUTTON_TEXT_Y_OFFSET); + lv_obj_refresh_ext_draw_pad(label_PowerOff); + update_spi_flash(); } break; case ID_O_BABY_STEP: @@ -229,7 +226,7 @@ void lv_draw_operation(void) { lv_imgbtn_set_style(buttonFan, LV_BTN_STATE_PR, &tft_style_label_pre); lv_imgbtn_set_style(buttonFan, LV_BTN_STATE_REL, &tft_style_label_rel); - if (gCfgItems.finish_power_off == 1) { + if (gCfgItems.finish_power_off) { lv_imgbtn_set_src(buttonPowerOff, LV_BTN_STATE_REL, "F:/bmp_auto_off.bin"); lv_imgbtn_set_src(buttonPowerOff, LV_BTN_STATE_PR, "F:/bmp_auto_off.bin"); } @@ -362,7 +359,7 @@ void lv_draw_operation(void) { } label_Back = lv_label_create(buttonBack, NULL); - if (gCfgItems.multiple_language != 0) { + if (gCfgItems.multiple_language) { lv_label_set_text(labelPreHeat, operation_menu.temp); lv_obj_align(labelPreHeat, buttonPreHeat, LV_ALIGN_IN_BOTTOM_MID, 0, BUTTON_TEXT_Y_OFFSET); @@ -372,7 +369,7 @@ void lv_draw_operation(void) { lv_label_set_text(label_Fan, operation_menu.fan); lv_obj_align(label_Fan, buttonFan, LV_ALIGN_IN_BOTTOM_MID, 0, BUTTON_TEXT_Y_OFFSET); - if (gCfgItems.finish_power_off == 1) + if (gCfgItems.finish_power_off) lv_label_set_text(label_PowerOff, printing_more_menu.auto_close); else lv_label_set_text(label_PowerOff, printing_more_menu.manual); diff --git a/Marlin/src/lcd/extui/lib/mks_ui/draw_pause_message.cpp b/Marlin/src/lcd/extui/lib/mks_ui/draw_pause_message.cpp index f7dd2060b8..ec6129446a 100644 --- a/Marlin/src/lcd/extui/lib/mks_ui/draw_pause_message.cpp +++ b/Marlin/src/lcd/extui/lib/mks_ui/draw_pause_message.cpp @@ -24,14 +24,14 @@ #if BOTH(HAS_TFT_LVGL_UI, ADVANCED_PAUSE_FEATURE) #include "draw_ui.h" -#include "lv_conf.h" +#include //#include "../lvgl/src/lv_objx/lv_imgbtn.h" //#include "../lvgl/src/lv_objx/lv_img.h" //#include "../lvgl/src/lv_core/lv_disp.h" //#include "../lvgl/src/lv_core/lv_refr.h" -#include "../../../../MarlinCore.h" #include "../../../../feature/pause.h" +#include "../../../../inc/MarlinConfig.h" void lv_draw_pause_message(const PauseMessage msg) { switch (msg) { diff --git a/Marlin/src/lcd/extui/lib/mks_ui/draw_pause_position.cpp b/Marlin/src/lcd/extui/lib/mks_ui/draw_pause_position.cpp index 9b99971f4f..d1c3a4a795 100644 --- a/Marlin/src/lcd/extui/lib/mks_ui/draw_pause_position.cpp +++ b/Marlin/src/lcd/extui/lib/mks_ui/draw_pause_position.cpp @@ -23,11 +23,11 @@ #if HAS_TFT_LVGL_UI -#include "lv_conf.h" #include "draw_ui.h" +#include -#include "../../../../MarlinCore.h" #include "../../../../module/planner.h" +#include "../../../../inc/MarlinConfig.h" extern lv_group_t * g; static lv_obj_t * scr; @@ -163,7 +163,7 @@ void lv_draw_pause_position(void) { lv_btn_set_style(buttonBack, LV_BTN_STYLE_PR, &style_para_back); label_Back = lv_label_create(buttonBack, NULL); - if (gCfgItems.multiple_language != 0) { + if (gCfgItems.multiple_language) { ZERO(public_buf_l); sprintf_P(public_buf_l, PSTR("%.1f"), gCfgItems.pausePosX); lv_label_set_text(labelXValue, public_buf_l); diff --git a/Marlin/src/lcd/extui/lib/mks_ui/draw_preHeat.cpp b/Marlin/src/lcd/extui/lib/mks_ui/draw_preHeat.cpp index f58a47b341..b08c9bd947 100644 --- a/Marlin/src/lcd/extui/lib/mks_ui/draw_preHeat.cpp +++ b/Marlin/src/lcd/extui/lib/mks_ui/draw_preHeat.cpp @@ -23,15 +23,15 @@ #if HAS_TFT_LVGL_UI -#include "lv_conf.h" #include "draw_ui.h" +#include //#include "../lvgl/src/lv_objx/lv_imgbtn.h" //#include "../lvgl/src/lv_objx/lv_img.h" //#include "../lvgl/src/lv_core/lv_disp.h" //#include "../lvgl/src/lv_core/lv_refr.h" -#include "../../../../MarlinCore.h" #include "../../../../module/temperature.h" +#include "../../../../inc/MarlinConfig.h" static lv_obj_t * scr; extern lv_group_t* g; @@ -275,7 +275,7 @@ void lv_draw_preHeat(void) { lv_obj_t *labelOff = lv_label_create(buttonOff, NULL); lv_obj_t *label_Back = lv_label_create(buttonBack, NULL); - if (gCfgItems.multiple_language != 0) { + if (gCfgItems.multiple_language) { lv_label_set_text(labelAdd, preheat_menu.add); lv_obj_align(labelAdd, buttonAdd, LV_ALIGN_IN_BOTTOM_MID, 0, BUTTON_TEXT_Y_OFFSET); @@ -312,7 +312,7 @@ void disp_temp_type() { if (uiCfg.curSprayerChoose == 1) { lv_imgbtn_set_src(buttoType, LV_BTN_STATE_REL, "F:/bmp_extru2.bin"); lv_imgbtn_set_src(buttoType, LV_BTN_STATE_PR, "F:/bmp_extru2.bin"); - if (gCfgItems.multiple_language != 0) { + if (gCfgItems.multiple_language) { lv_label_set_text(labelType, preheat_menu.ext2); lv_obj_align(labelType, buttoType, LV_ALIGN_IN_BOTTOM_MID, 0, BUTTON_TEXT_Y_OFFSET); } @@ -320,7 +320,7 @@ void disp_temp_type() { else { lv_imgbtn_set_src(buttoType, LV_BTN_STATE_REL, "F:/bmp_extru1.bin"); lv_imgbtn_set_src(buttoType, LV_BTN_STATE_PR, "F:/bmp_extru1.bin"); - if (gCfgItems.multiple_language != 0) { + if (gCfgItems.multiple_language) { lv_label_set_text(labelType, preheat_menu.ext1); lv_obj_align(labelType, buttoType, LV_ALIGN_IN_BOTTOM_MID, 0, BUTTON_TEXT_Y_OFFSET); } @@ -330,7 +330,7 @@ void disp_temp_type() { else { lv_imgbtn_set_src(buttoType, LV_BTN_STATE_REL, "F:/bmp_bed.bin"); lv_imgbtn_set_src(buttoType, LV_BTN_STATE_PR, "F:/bmp_bed.bin"); - if (gCfgItems.multiple_language != 0) { + if (gCfgItems.multiple_language) { lv_label_set_text(labelType, preheat_menu.hotbed); lv_obj_align(labelType, buttoType, LV_ALIGN_IN_BOTTOM_MID, 0, BUTTON_TEXT_Y_OFFSET); } @@ -375,7 +375,7 @@ void disp_step_heat() { lv_imgbtn_set_src(buttonStep, LV_BTN_STATE_PR, "F:/bmp_step10_degree.bin"); } - if (gCfgItems.multiple_language != 0) { + if (gCfgItems.multiple_language) { if (uiCfg.stepHeat == 1) { lv_label_set_text(labelStep, preheat_menu.step_1c); lv_obj_align(labelStep, buttonStep, LV_ALIGN_IN_BOTTOM_MID, 0, BUTTON_TEXT_Y_OFFSET); diff --git a/Marlin/src/lcd/extui/lib/mks_ui/draw_print_file.cpp b/Marlin/src/lcd/extui/lib/mks_ui/draw_print_file.cpp index e84bb395e0..d92943a37c 100644 --- a/Marlin/src/lcd/extui/lib/mks_ui/draw_print_file.cpp +++ b/Marlin/src/lcd/extui/lib/mks_ui/draw_print_file.cpp @@ -23,14 +23,15 @@ #if HAS_TFT_LVGL_UI -#include "../../../../MarlinCore.h" -#include "lv_conf.h" +#include "draw_ui.h" +#include //#include "../lvgl/src/lv_objx/lv_imgbtn.h" //#include "../lvgl/src/lv_objx/lv_img.h" //#include "../lvgl/src/lv_core/lv_disp.h" //#include "../lvgl/src/lv_core/lv_refr.h" -#include "draw_ui.h" + #include "../../../../sd/cardreader.h" +#include "../../../../inc/MarlinConfig.h" static lv_obj_t * scr; extern lv_group_t* g; @@ -270,7 +271,7 @@ void lv_draw_print_file(void) { //lv_obj_t *label_Back = lv_label_create(buttonBack, NULL); /* - if (gCfgItems.multiple_language != 0) { + if (gCfgItems.multiple_language) { lv_label_set_text(labelPageUp, tool_menu.preheat); lv_obj_align(labelPageUp, buttonPageUp, LV_ALIGN_IN_BOTTOM_MID,0, BUTTON_TEXT_Y_OFFSET); diff --git a/Marlin/src/lcd/extui/lib/mks_ui/draw_printing.cpp b/Marlin/src/lcd/extui/lib/mks_ui/draw_printing.cpp index 0b49bf4ab7..6481061800 100644 --- a/Marlin/src/lcd/extui/lib/mks_ui/draw_printing.cpp +++ b/Marlin/src/lcd/extui/lib/mks_ui/draw_printing.cpp @@ -23,23 +23,25 @@ #if HAS_TFT_LVGL_UI -#include "lv_conf.h" #include "draw_ui.h" +#include //#include "../lvgl/src/lv_objx/lv_imgbtn.h" //#include "../lvgl/src/lv_objx/lv_img.h" //#include "../lvgl/src/lv_core/lv_disp.h" //#include "../lvgl/src/lv_core/lv_refr.h" -#include "../../../../MarlinCore.h" +#include "../../../../MarlinCore.h" // for marlin_state #include "../../../../module/temperature.h" #include "../../../../module/motion.h" #include "../../../../sd/cardreader.h" #include "../../../../gcode/queue.h" #include "../../../../gcode/gcode.h" +#include "../../../../inc/MarlinConfig.h" #if ENABLED(POWER_LOSS_RECOVERY) #include "../../../../feature/powerloss.h" #endif + #if BOTH(LCD_SET_PROGRESS_MANUALLY, USE_M73_REMAINING_TIME) #include "../../../marlinui.h" #endif @@ -60,11 +62,9 @@ static lv_obj_t * buttonPause, *buttonOperat, *buttonStop; #define ID_STOP 2 #define ID_OPTION 3 -uint8_t once_flag = 0; +bool once_flag; // = false +extern bool flash_preview_begin, default_preview_flg, gcode_preview_over; extern uint32_t To_pre_view; -extern uint8_t flash_preview_begin; -extern uint8_t default_preview_flg; -extern uint8_t gcode_preview_over; static void event_handler(lv_obj_t * obj, lv_event_t event) { switch (obj->mks_obj_id) { @@ -73,7 +73,7 @@ static void event_handler(lv_obj_t * obj, lv_event_t event) { // nothing to do } else if (event == LV_EVENT_RELEASED) { - if (gcode_preview_over != 1) { + if (!gcode_preview_over) { if (uiCfg.print_state == WORKING) { // #if ENABLED(PARK_HEAD_ON_PAUSE) // queue.inject_P(PSTR("M25 P\nM24")); @@ -117,7 +117,7 @@ static void event_handler(lv_obj_t * obj, lv_event_t event) { // nothing to do } else if (event == LV_EVENT_RELEASED) { - if (gcode_preview_over != 1) { + if (!gcode_preview_over) { lv_clear_printing(); lv_draw_dialog(DIALOG_TYPE_STOP); } @@ -128,7 +128,7 @@ static void event_handler(lv_obj_t * obj, lv_event_t event) { // nothing to do } else if (event == LV_EVENT_RELEASED) { - if (gcode_preview_over != 1) { + if (!gcode_preview_over) { lv_clear_printing(); lv_draw_operation(); } @@ -290,7 +290,7 @@ void lv_draw_printing(void) { labelStop = lv_label_create(buttonStop, NULL); labelOperat = lv_label_create(buttonOperat, NULL); - if (gCfgItems.multiple_language != 0) { + if (gCfgItems.multiple_language) { lv_label_set_text(labelPause, uiCfg.print_state == WORKING ? printing_menu.pause : printing_menu.resume); lv_obj_align(labelPause, buttonPause, LV_ALIGN_CENTER, 20, 0); @@ -378,7 +378,7 @@ void setProBarRate() { int rate; volatile long long rate_tmp_r; - if (gCfgItems.from_flash_pic != 1) { + if (!gCfgItems.from_flash_pic) { #if ENABLED(SDSUPPORT) rate_tmp_r = (long long)card.getIndex() * 100; #endif @@ -405,15 +405,15 @@ void setProBarRate() { if (once_flag == 0) { stop_print_time(); - flash_preview_begin = 0; - default_preview_flg = 0; + flash_preview_begin = false; + default_preview_flg = false; lv_clear_printing(); lv_draw_dialog(DIALOG_TYPE_FINISH_PRINT); - once_flag = 1; + once_flag = true; #if HAS_SUICIDE - if (gCfgItems.finish_power_off == 1) { + if (gCfgItems.finish_power_off) { gcode.process_subcommands_now_P(PSTR("M1001")); queue.inject_P(PSTR("M81")); marlin_state = MF_RUNNING; diff --git a/Marlin/src/lcd/extui/lib/mks_ui/draw_ready_print.cpp b/Marlin/src/lcd/extui/lib/mks_ui/draw_ready_print.cpp index 54ffdca64a..276e8fb551 100644 --- a/Marlin/src/lcd/extui/lib/mks_ui/draw_ready_print.cpp +++ b/Marlin/src/lcd/extui/lib/mks_ui/draw_ready_print.cpp @@ -25,7 +25,7 @@ #include "draw_ready_print.h" #include "draw_tool.h" -#include "lv_conf.h" +#include //#include "../lvgl/src/lv_objx/lv_imgbtn.h" //#include "../lvgl/src/lv_objx/lv_img.h" //#include "../lvgl/src/lv_core/lv_disp.h" @@ -36,8 +36,8 @@ #include -#include "../../../../MarlinCore.h" #include "../../../../module/temperature.h" +#include "../../../../inc/MarlinConfig.h" #include @@ -186,7 +186,7 @@ void lv_draw_ready_print(void) { //lv_obj_t *label_print = lv_label_create(buttonPrint, NULL); //lv_obj_t *label_set = lv_label_create(buttonSet, NULL); lv_obj_t *label_tool = lv_label_create(buttonTool, NULL); - if (gCfgItems.multiple_language != 0) { + if (gCfgItems.multiple_language) { //lv_label_set_text(label_print, main_menu.print); //lv_obj_align(label_print, buttonPrint, LV_ALIGN_IN_BOTTOM_MID,0, BUTTON_TEXT_Y_OFFSET); @@ -279,7 +279,7 @@ void lv_draw_ready_print(void) { lv_obj_t *label_print = lv_label_create(buttonPrint, NULL); lv_btn_set_layout(buttonPrint, LV_LAYOUT_OFF); - if (gCfgItems.multiple_language != 0) { + if (gCfgItems.multiple_language) { lv_label_set_text(label_print, main_menu.print); lv_obj_align(label_print, buttonPrint, LV_ALIGN_IN_BOTTOM_MID, 0, BUTTON_TEXT_Y_OFFSET); diff --git a/Marlin/src/lcd/extui/lib/mks_ui/draw_set.cpp b/Marlin/src/lcd/extui/lib/mks_ui/draw_set.cpp index 6c10713d8a..d23fe40182 100644 --- a/Marlin/src/lcd/extui/lib/mks_ui/draw_set.cpp +++ b/Marlin/src/lcd/extui/lib/mks_ui/draw_set.cpp @@ -23,18 +23,20 @@ #if HAS_TFT_LVGL_UI -#include "../../../../MarlinCore.h" #include "draw_ready_print.h" #include "draw_set.h" -#include "lv_conf.h" +#include "draw_ui.h" +#include //#include "../lvgl/src/lv_objx/lv_imgbtn.h" //#include "../lvgl/src/lv_objx/lv_img.h" //#include "../lvgl/src/lv_core/lv_disp.h" //#include "../lvgl/src/lv_core/lv_refr.h" -#include "draw_ui.h" -#include "../../../../gcode/queue.h" + #include "pic_manager.h" +#include "../../../../gcode/queue.h" +#include "../../../../inc/MarlinConfig.h" + static lv_obj_t * scr; extern lv_group_t* g; @@ -331,7 +333,7 @@ void lv_draw_set(void) { #endif lv_obj_t *label_Back = lv_label_create(buttonBack, NULL); - if (gCfgItems.multiple_language != 0) { + if (gCfgItems.multiple_language) { lv_label_set_text(label_EepromSet, set_menu.eepromSet); lv_obj_align(label_EepromSet, buttonEepromSet, LV_ALIGN_IN_BOTTOM_MID, 0, BUTTON_TEXT_Y_OFFSET); diff --git a/Marlin/src/lcd/extui/lib/mks_ui/draw_step_settings.cpp b/Marlin/src/lcd/extui/lib/mks_ui/draw_step_settings.cpp index baad23f9ae..ff45fba461 100644 --- a/Marlin/src/lcd/extui/lib/mks_ui/draw_step_settings.cpp +++ b/Marlin/src/lcd/extui/lib/mks_ui/draw_step_settings.cpp @@ -23,11 +23,11 @@ #if HAS_TFT_LVGL_UI -#include "lv_conf.h" #include "draw_ui.h" +#include -#include "../../../../MarlinCore.h" #include "../../../../module/planner.h" +#include "../../../../inc/MarlinConfig.h" extern lv_group_t * g; static lv_obj_t * scr; @@ -278,7 +278,7 @@ void lv_draw_step_settings(void) { if (gCfgItems.encoder_enable) lv_group_add_obj(g, buttonBack); #endif - if (gCfgItems.multiple_language != 0) { + if (gCfgItems.multiple_language) { if (uiCfg.para_ui_page != 1) { lv_label_set_text(labelTurnPage, machine_menu.next); lv_obj_align(labelTurnPage, buttonTurnPage, LV_ALIGN_CENTER, 0, 0); diff --git a/Marlin/src/lcd/extui/lib/mks_ui/draw_tmc_current_settings.cpp b/Marlin/src/lcd/extui/lib/mks_ui/draw_tmc_current_settings.cpp index 10aa7badff..b19048f1c0 100644 --- a/Marlin/src/lcd/extui/lib/mks_ui/draw_tmc_current_settings.cpp +++ b/Marlin/src/lcd/extui/lib/mks_ui/draw_tmc_current_settings.cpp @@ -23,13 +23,12 @@ #if BOTH(HAS_TFT_LVGL_UI, HAS_TRINAMIC_CONFIG) -#include "lv_conf.h" #include "draw_ui.h" +#include -#include "../../../../MarlinCore.h" -#include "../../../../module/planner.h" #include "../../../../module/stepper/indirection.h" #include "../../../../feature/tmc_util.h" +#include "../../../../inc/MarlinConfig.h" extern lv_group_t * g; static lv_obj_t * scr; @@ -310,7 +309,7 @@ void lv_draw_tmc_current_settings(void) { lv_obj_set_size(buttonBack, PARA_UI_BACK_BTN_X_SIZE, PARA_UI_BACK_BTN_Y_SIZE); label_Back = lv_label_create(buttonBack, NULL); - if (gCfgItems.multiple_language != 0) { + if (gCfgItems.multiple_language) { if (uiCfg.para_ui_page != 1) { //#if AXIS_IS_TMC(E1) lv_label_set_text(labelTurnPage, machine_menu.next); diff --git a/Marlin/src/lcd/extui/lib/mks_ui/draw_tmc_step_mode_settings.cpp b/Marlin/src/lcd/extui/lib/mks_ui/draw_tmc_step_mode_settings.cpp index 3e014a781c..04087f632e 100644 --- a/Marlin/src/lcd/extui/lib/mks_ui/draw_tmc_step_mode_settings.cpp +++ b/Marlin/src/lcd/extui/lib/mks_ui/draw_tmc_step_mode_settings.cpp @@ -23,15 +23,13 @@ #if BOTH(HAS_TFT_LVGL_UI, HAS_STEALTHCHOP) -#include "lv_conf.h" #include "draw_ui.h" +#include -#include "../../../../MarlinCore.h" -#include "../../../../module/planner.h" #include "../../../../module/stepper/indirection.h" #include "../../../../feature/tmc_util.h" #include "../../../../gcode/gcode.h" -#include "../../../../module/planner.h" +#include "../../../../inc/MarlinConfig.h" extern lv_group_t * g; static lv_obj_t * scr; @@ -232,7 +230,6 @@ void lv_draw_tmc_step_mode_settings(void) { lv_obj_t *buttonE1Text = NULL, *labelE1Text = NULL; //#endif - labelXState = NULL; buttonXState = NULL; labelYState = NULL; @@ -493,7 +490,7 @@ void lv_draw_tmc_step_mode_settings(void) { lv_btn_set_layout(buttonBack, LV_LAYOUT_OFF); label_Back = lv_label_create(buttonBack, NULL); - if (gCfgItems.multiple_language != 0) { + if (gCfgItems.multiple_language) { if (uiCfg.para_ui_page != 1) { lv_label_set_text(labelXText, machine_menu.X_StepMode); lv_obj_align(labelXText, buttonXText, LV_ALIGN_IN_LEFT_MID, 0, 0); diff --git a/Marlin/src/lcd/extui/lib/mks_ui/draw_tool.cpp b/Marlin/src/lcd/extui/lib/mks_ui/draw_tool.cpp index 3681b1b2d6..b6ef6e64da 100644 --- a/Marlin/src/lcd/extui/lib/mks_ui/draw_tool.cpp +++ b/Marlin/src/lcd/extui/lib/mks_ui/draw_tool.cpp @@ -23,16 +23,16 @@ #if HAS_TFT_LVGL_UI -#include "lv_conf.h" #include "draw_ui.h" +#include //#include "../lvgl/src/lv_objx/lv_imgbtn.h" //#include "../lvgl/src/lv_objx/lv_img.h" //#include "../lvgl/src/lv_core/lv_disp.h" //#include "../lvgl/src/lv_core/lv_refr.h" -#include "../../../../MarlinCore.h" #include "../../../../gcode/queue.h" #include "../../../../module/temperature.h" +#include "../../../../inc/MarlinConfig.h" extern lv_group_t * g; static lv_obj_t * scr; @@ -236,7 +236,7 @@ void lv_draw_tool(void) { //lv_obj_t *label_More = lv_label_create(buttonMore, NULL); lv_obj_t *label_Back = lv_label_create(buttonBack, NULL); - if (gCfgItems.multiple_language != 0) { + if (gCfgItems.multiple_language) { lv_label_set_text(labelPreHeat, tool_menu.preheat); lv_obj_align(labelPreHeat, buttonPreHeat, LV_ALIGN_IN_BOTTOM_MID, 0, BUTTON_TEXT_Y_OFFSET); diff --git a/Marlin/src/lcd/extui/lib/mks_ui/draw_ui.cpp b/Marlin/src/lcd/extui/lib/mks_ui/draw_ui.cpp index 519fae2f39..1f21136668 100644 --- a/Marlin/src/lcd/extui/lib/mks_ui/draw_ui.cpp +++ b/Marlin/src/lcd/extui/lib/mks_ui/draw_ui.cpp @@ -34,10 +34,11 @@ #include -#include "../../../../MarlinCore.h" +#include "../../../../MarlinCore.h" // for marlin_state #include "../../../../sd/cardreader.h" #include "../../../../module/motion.h" #include "../../../../module/planner.h" +#include "../../../../inc/MarlinConfig.h" #if ENABLED(POWER_LOSS_RECOVERY) #include "../../../../feature/powerloss.h" @@ -57,15 +58,13 @@ num_key_value_state value; keyboard_value_state keyboard_value; uint32_t To_pre_view; -uint8_t gcode_preview_over; -uint8_t flash_preview_begin; -uint8_t default_preview_flg; +bool gcode_preview_over, flash_preview_begin, default_preview_flg; uint32_t size = 809; uint16_t row; uint8_t temperature_change_frequency; uint8_t printing_rate_update_flag; -extern uint8_t once_flag; +extern bool once_flag; extern uint8_t sel_id; extern uint8_t public_buf[512]; extern uint8_t bmp_public_buf[17 * 1024]; @@ -116,10 +115,10 @@ void gCfgItems_init() { gCfgItems.language = LANG_PORTUGUESE; #endif gCfgItems.leveling_mode = 0; - gCfgItems.from_flash_pic = 0; + gCfgItems.from_flash_pic = false; gCfgItems.curFilesize = 0; - gCfgItems.finish_power_off = 0; - gCfgItems.pause_reprint = 0; + gCfgItems.finish_power_off = false; + gCfgItems.pause_reprint = false; gCfgItems.pausePosX = -1; gCfgItems.pausePosY = -1; gCfgItems.pausePosZ = 5; @@ -407,7 +406,6 @@ void tft_style_init() { lv_bar_style_indic.body.main_color = lv_color_hex3(0xADF); lv_bar_style_indic.body.grad_color = lv_color_hex3(0xADF); lv_bar_style_indic.body.border.color = lv_color_hex3(0xADF); - } #define MAX_TITLE_LEN 28 @@ -609,14 +607,14 @@ char *creat_title_text() { pre_read_cnt = (uint32_t)p1 - (uint32_t)((uint32_t *)(&public_buf[0])); To_pre_view = pre_read_cnt; - gcode_preview_over = 1; - gCfgItems.from_flash_pic = 1; + gcode_preview_over = true; + gCfgItems.from_flash_pic = true; update_spi_flash(); } else { - gcode_preview_over = 0; - default_preview_flg = 1; - gCfgItems.from_flash_pic = 0; + gcode_preview_over = false; + default_preview_flg = true; + gCfgItems.from_flash_pic = false; update_spi_flash(); } card.closefile(); @@ -681,8 +679,8 @@ char *creat_title_text() { size = 809; row = 0; - gcode_preview_over = 0; - //flash_preview_begin = 1; + gcode_preview_over = false; + //flash_preview_begin = true; card.closefile(); @@ -696,7 +694,7 @@ char *creat_title_text() { //bakup_file_path((uint8_t *)curFileName, strlen(curFileName)); srcfp = file; mksReprint.mks_printer_state = MKS_WORKING; - once_flag = 0; + once_flag = false; } } */ @@ -727,7 +725,7 @@ char *creat_title_text() { #endif card.startFileprint(); TERN_(POWER_LOSS_RECOVERY, recovery.prepare()); - once_flag = 0; + once_flag = false; } return; } @@ -813,8 +811,8 @@ char *creat_title_text() { size = 809; row = 0; - gcode_preview_over = 0; - //flash_preview_begin = 1; + gcode_preview_over = false; + //flash_preview_begin = true; card.closefile(); @@ -828,7 +826,7 @@ char *creat_title_text() { //bakup_file_path((uint8_t *)curFileName, strlen(curFileName)); srcfp = file; mksReprint.mks_printer_state = MKS_WORKING; - once_flag = 0; + once_flag = false; } } */ @@ -859,7 +857,7 @@ char *creat_title_text() { #endif card.startFileprint(); TERN_(POWER_LOSS_RECOVERY, recovery.prepare()); - once_flag = 0; + once_flag = false; } return; } @@ -894,17 +892,17 @@ char *creat_title_text() { } void disp_pre_gcode(int xpos_pixel, int ypos_pixel) { - if (gcode_preview_over == 1) gcode_preview(list_file.file_name[sel_id], xpos_pixel, ypos_pixel); + if (gcode_preview_over) gcode_preview(list_file.file_name[sel_id], xpos_pixel, ypos_pixel); #if HAS_BAK_VIEW_IN_FLASH - if (flash_preview_begin == 1) { - flash_preview_begin = 0; + if (flash_preview_begin) { + flash_preview_begin = false; Draw_default_preview(xpos_pixel, ypos_pixel, 1); } #endif #if HAS_GCODE_DEFAULT_VIEW_IN_FLASH - if (default_preview_flg == 1) { + if (default_preview_flg) { Draw_default_preview(xpos_pixel, ypos_pixel, 0); - default_preview_flg = 0; + default_preview_flg = false; } #endif } @@ -971,7 +969,7 @@ void GUI_RefreshPage() { } if (printing_rate_update_flag || marlin_state == MF_SD_COMPLETE) { printing_rate_update_flag = 0; - if (gcode_preview_over == 0) setProBarRate(); + if (!gcode_preview_over) setProBarRate(); } break; @@ -1359,8 +1357,8 @@ void draw_return_ui() { lv_draw_print_file(); break; case PRINTING_UI: - if (gCfgItems.from_flash_pic == 1) flash_preview_begin = 1; - else default_preview_flg = 1; + if (gCfgItems.from_flash_pic) flash_preview_begin = true; + else default_preview_flg = true; lv_draw_printing(); break; case MOVE_MOTOR_UI: diff --git a/Marlin/src/lcd/extui/lib/mks_ui/draw_ui.h b/Marlin/src/lcd/extui/lib/mks_ui/draw_ui.h index 51782688c0..00faedac4e 100644 --- a/Marlin/src/lcd/extui/lib/mks_ui/draw_ui.h +++ b/Marlin/src/lcd/extui/lib/mks_ui/draw_ui.h @@ -174,12 +174,12 @@ extern char public_buf_l[30]; typedef struct { uint32_t spi_flash_flag; uint8_t disp_rotation_180; - uint8_t multiple_language; + bool multiple_language; uint8_t language; uint8_t leveling_mode; - uint8_t from_flash_pic; - uint8_t finish_power_off; - uint8_t pause_reprint; + bool from_flash_pic; + bool finish_power_off; + bool pause_reprint; uint8_t wifi_mode_sel; uint8_t fileSysType; uint8_t wifi_type; diff --git a/Marlin/src/lcd/extui/lib/mks_ui/draw_wifi.cpp b/Marlin/src/lcd/extui/lib/mks_ui/draw_wifi.cpp index 9cf4555b25..ce158ef7fb 100644 --- a/Marlin/src/lcd/extui/lib/mks_ui/draw_wifi.cpp +++ b/Marlin/src/lcd/extui/lib/mks_ui/draw_wifi.cpp @@ -23,13 +23,12 @@ #if HAS_TFT_LVGL_UI -#include "lv_conf.h" -#include "draw_ui.h" +#include +#include "tft_lvgl_configuration.h" #if ENABLED(USE_WIFI_FUNCTION) -#include "../../../../../Configuration.h" -#include "../../../../module/temperature.h" +#include "draw_ui.h" extern lv_group_t * g; static lv_obj_t *scr, *wifi_name_text, *wifi_key_text, *wifi_state_text, *wifi_ip_text; @@ -135,7 +134,7 @@ void lv_draw_wifi(void) { label_Reconnect = lv_label_create(buttonReconnect, NULL); } - if (gCfgItems.multiple_language !=0) { + if (gCfgItems.multiple_language) { lv_label_set_text(label_Back, common_menu.text_back); lv_obj_align(label_Back, buttonBack, LV_ALIGN_IN_BOTTOM_MID,0, BUTTON_TEXT_Y_OFFSET); diff --git a/Marlin/src/lcd/extui/lib/mks_ui/draw_wifi_list.cpp b/Marlin/src/lcd/extui/lib/mks_ui/draw_wifi_list.cpp index 14fd63f852..2680194868 100644 --- a/Marlin/src/lcd/extui/lib/mks_ui/draw_wifi_list.cpp +++ b/Marlin/src/lcd/extui/lib/mks_ui/draw_wifi_list.cpp @@ -23,13 +23,12 @@ #if HAS_TFT_LVGL_UI -#include "lv_conf.h" -#include "draw_ui.h" +#include +#include "tft_lvgl_configuration.h" #if ENABLED(USE_WIFI_FUNCTION) -#include "../../../../../Configuration.h" -#include "../../../../module/temperature.h" +#include "draw_ui.h" #define NAME_BTN_X 330 #define NAME_BTN_Y 48 diff --git a/Marlin/src/lcd/extui/lib/mks_ui/draw_wifi_settings.cpp b/Marlin/src/lcd/extui/lib/mks_ui/draw_wifi_settings.cpp index 86733470dd..81a5f5c3be 100644 --- a/Marlin/src/lcd/extui/lib/mks_ui/draw_wifi_settings.cpp +++ b/Marlin/src/lcd/extui/lib/mks_ui/draw_wifi_settings.cpp @@ -23,13 +23,12 @@ #if HAS_TFT_LVGL_UI -#include "lv_conf.h" -#include "draw_ui.h" +#include +#include "tft_lvgl_configuration.h" #if ENABLED(USE_WIFI_FUNCTION) -#include "../../../../../Configuration.h" -#include "../../../../module/planner.h" +#include "draw_ui.h" extern lv_group_t * g; static lv_obj_t *scr, *labelModelValue = NULL, *buttonModelValue = NULL, *labelCloudValue = NULL; @@ -48,8 +47,8 @@ static void event_handler(lv_obj_t * obj, lv_event_t event) { } else if (event == LV_EVENT_RELEASED) { - lv_clear_wifi_settings(); - draw_return_ui(); + lv_clear_wifi_settings(); + draw_return_ui(); } break; case ID_WIFI_MODEL: @@ -57,18 +56,18 @@ static void event_handler(lv_obj_t * obj, lv_event_t event) { } else if (event == LV_EVENT_RELEASED) { - if (gCfgItems.wifi_mode_sel == AP_MODEL) { - gCfgItems.wifi_mode_sel = STA_MODEL; - lv_label_set_text(labelModelValue, WIFI_STA_TEXT); - lv_obj_align(labelModelValue, buttonModelValue, LV_ALIGN_CENTER,0, 0); - update_spi_flash(); - } - else{ - gCfgItems.wifi_mode_sel = AP_MODEL; - lv_label_set_text(labelModelValue, WIFI_AP_TEXT); - lv_obj_align(labelModelValue, buttonModelValue, LV_ALIGN_CENTER,0, 0); - update_spi_flash(); - } + if (gCfgItems.wifi_mode_sel == AP_MODEL) { + gCfgItems.wifi_mode_sel = STA_MODEL; + lv_label_set_text(labelModelValue, WIFI_STA_TEXT); + lv_obj_align(labelModelValue, buttonModelValue, LV_ALIGN_CENTER,0, 0); + update_spi_flash(); + } + else { + gCfgItems.wifi_mode_sel = AP_MODEL; + lv_label_set_text(labelModelValue, WIFI_AP_TEXT); + lv_obj_align(labelModelValue, buttonModelValue, LV_ALIGN_CENTER,0, 0); + update_spi_flash(); + } } break; case ID_WIFI_NAME: @@ -76,9 +75,9 @@ static void event_handler(lv_obj_t * obj, lv_event_t event) { } else if (event == LV_EVENT_RELEASED) { - keyboard_value=wifiName; - lv_clear_wifi_settings(); - lv_draw_keyboard(); + keyboard_value = wifiName; + lv_clear_wifi_settings(); + lv_draw_keyboard(); } break; case ID_WIFI_PASSWORD: @@ -87,8 +86,8 @@ static void event_handler(lv_obj_t * obj, lv_event_t event) { } else if (event == LV_EVENT_RELEASED) { keyboard_value=wifiPassWord; - lv_clear_wifi_settings(); - lv_draw_keyboard(); + lv_clear_wifi_settings(); + lv_draw_keyboard(); } break; case ID_WIFI_CLOUD: @@ -115,8 +114,8 @@ static void event_handler(lv_obj_t * obj, lv_event_t event) { } else if (event == LV_EVENT_RELEASED) { - lv_clear_wifi_settings(); - lv_draw_dialog(DIALOG_WIFI_CONFIG_TIPS); + lv_clear_wifi_settings(); + lv_draw_dialog(DIALOG_WIFI_CONFIG_TIPS); } break; } @@ -211,7 +210,7 @@ void lv_draw_wifi_settings(void) { lv_imgbtn_set_src(buttonCloudValue, LV_BTN_STATE_REL, "F:/bmp_disable.bin"); lv_imgbtn_set_src(buttonCloudValue, LV_BTN_STATE_PR, "F:/bmp_disable.bin"); } - lv_obj_set_event_cb_mks(buttonCloudValue, event_handler,ID_WIFI_CLOUD, NULL,0); + lv_obj_set_event_cb_mks(buttonCloudValue, event_handler,ID_WIFI_CLOUD, NULL,0); lv_imgbtn_set_style(buttonCloudValue, LV_BTN_STATE_PR, &tft_style_label_pre); lv_imgbtn_set_style(buttonCloudValue, LV_BTN_STATE_REL, &tft_style_label_rel); lv_btn_set_layout(buttonCloudValue, LV_LAYOUT_OFF); @@ -240,7 +239,7 @@ void lv_draw_wifi_settings(void) { lv_btn_set_layout(buttonBack, LV_LAYOUT_OFF); label_Back = lv_label_create(buttonBack, NULL); - if (gCfgItems.multiple_language !=0) { + if (gCfgItems.multiple_language) { if (gCfgItems.wifi_mode_sel == AP_MODEL) { lv_label_set_text(labelModelValue, WIFI_AP_TEXT); lv_obj_align(labelModelValue, buttonModelValue, LV_ALIGN_CENTER,0, 0); @@ -295,5 +294,4 @@ void lv_clear_wifi_settings() { } #endif // USE_WIFI_FUNCTION - #endif // HAS_TFT_LVGL_UI diff --git a/Marlin/src/lcd/extui/lib/mks_ui/draw_wifi_tips.cpp b/Marlin/src/lcd/extui/lib/mks_ui/draw_wifi_tips.cpp index 50fa0aaf99..059656bbb5 100644 --- a/Marlin/src/lcd/extui/lib/mks_ui/draw_wifi_tips.cpp +++ b/Marlin/src/lcd/extui/lib/mks_ui/draw_wifi_tips.cpp @@ -23,13 +23,12 @@ #if HAS_TFT_LVGL_UI -#include "lv_conf.h" -#include "draw_ui.h" +#include +#include "tft_lvgl_configuration.h" #if ENABLED(USE_WIFI_FUNCTION) -#include "../../../../../Configuration.h" -#include "../../../../module/temperature.h" +#include "draw_ui.h" static lv_obj_t * scr; diff --git a/Marlin/src/lcd/extui/lib/mks_ui/irq_overrid.cpp b/Marlin/src/lcd/extui/lib/mks_ui/irq_overrid.cpp index cf64571292..b9c7ccd9e6 100644 --- a/Marlin/src/lcd/extui/lib/mks_ui/irq_overrid.cpp +++ b/Marlin/src/lcd/extui/lib/mks_ui/irq_overrid.cpp @@ -23,10 +23,11 @@ #if HAS_TFT_LVGL_UI -#include "draw_ui.h" +#include "tft_lvgl_configuration.h" #if ENABLED(USE_WIFI_FUNCTION) +#include "draw_ui.h" #include "wifiSerial.h" #include diff --git a/Marlin/src/lcd/extui/lib/mks_ui/pic_manager.cpp b/Marlin/src/lcd/extui/lib/mks_ui/pic_manager.cpp index 07ac563802..70c48f5c8e 100644 --- a/Marlin/src/lcd/extui/lib/mks_ui/pic_manager.cpp +++ b/Marlin/src/lcd/extui/lib/mks_ui/pic_manager.cpp @@ -206,11 +206,11 @@ static const char assets[][LONG_FILENAME_LENGTH] = { "bmp_return.bin", #if ENABLED(USE_WIFI_FUNCTION) - //wifi screen + // wifi screen "bmp_wifi.bin", #endif - //babystep screen + // babystep screen "bmp_baby_move0_01.bin", "bmp_baby_move0_05.bin", "bmp_baby_move0_1.bin" diff --git a/Marlin/src/lcd/extui/lib/mks_ui/printer_operation.cpp b/Marlin/src/lcd/extui/lib/mks_ui/printer_operation.cpp index 2b6f5f89f6..e6c30b30f8 100644 --- a/Marlin/src/lcd/extui/lib/mks_ui/printer_operation.cpp +++ b/Marlin/src/lcd/extui/lib/mks_ui/printer_operation.cpp @@ -23,24 +23,22 @@ #if HAS_TFT_LVGL_UI -#include "../../../../MarlinCore.h" - -#include "lv_conf.h" #include "draw_ui.h" +#include + +#include "../../../../gcode/gcode.h" #include "../../../../module/temperature.h" +#include "../../../../module/planner.h" #include "../../../../module/motion.h" #include "../../../../sd/cardreader.h" -#include "../../../../gcode/queue.h" +#include "../../../../inc/MarlinConfig.h" #if ENABLED(POWER_LOSS_RECOVERY) #include "../../../../feature/powerloss.h" #endif -#include "../../../../gcode/gcode.h" -#include "../../../../module/planner.h" - extern uint32_t To_pre_view; -extern uint8_t flash_preview_begin, default_preview_flg, gcode_preview_over; +extern bool flash_preview_begin, default_preview_flg, gcode_preview_over; void printer_state_polling() { if (uiCfg.print_state == PAUSING) { @@ -76,7 +74,7 @@ void printer_state_polling() { // #if ENABLED(POWER_LOSS_RECOVERY) // if (recovery.enabled) recovery.save(true); // #endif - gCfgItems.pause_reprint = 1; + gCfgItems.pause_reprint = true; update_spi_flash(); } #endif @@ -105,7 +103,7 @@ void printer_state_polling() { uiCfg.print_state = WORKING; start_print_time(); - gCfgItems.pause_reprint = 0; + gCfgItems.pause_reprint = false; update_spi_flash(); } } @@ -137,7 +135,7 @@ void printer_state_polling() { ); gcode.process_subcommands_now(public_buf_m); - if ((gCfgItems.pause_reprint) == 1 && (gCfgItems.pausePosZ != (float)-1)) { + if (gCfgItems.pause_reprint && gCfgItems.pausePosZ != -1.0f) { gcode.process_subcommands_now_P(PSTR("G91")); ZERO(public_buf_l); sprintf_P(public_buf_l, PSTR("G1 Z-%.1f"), gCfgItems.pausePosZ); @@ -148,7 +146,7 @@ void printer_state_polling() { uiCfg.print_state = WORKING; start_print_time(); - gCfgItems.pause_reprint = 0; + gCfgItems.pause_reprint = false; update_spi_flash(); } #endif @@ -240,10 +238,10 @@ void filament_check() { stop_print_time(); uiCfg.print_state = PAUSING; - if (gCfgItems.from_flash_pic == 1) - flash_preview_begin = 1; + if (gCfgItems.from_flash_pic) + flash_preview_begin = true; else - default_preview_flg = 1; + default_preview_flg = true; lv_draw_printing(); } diff --git a/Marlin/src/lcd/extui/lib/mks_ui/tft_lvgl_configuration.cpp b/Marlin/src/lcd/extui/lib/mks_ui/tft_lvgl_configuration.cpp index f74ed3c798..6143037c2b 100644 --- a/Marlin/src/lcd/extui/lib/mks_ui/tft_lvgl_configuration.cpp +++ b/Marlin/src/lcd/extui/lib/mks_ui/tft_lvgl_configuration.cpp @@ -72,7 +72,7 @@ lv_group_t* g; uint16_t DeviceCode = 0x9488; extern uint8_t sel_id; -extern uint8_t gcode_preview_over, flash_preview_begin, default_preview_flg; +extern bool flash_preview_begin, default_preview_flg, gcode_preview_over; uint8_t bmp_public_buf[17 * 1024]; @@ -80,9 +80,8 @@ void SysTick_Callback() { lv_tick_inc(1); print_time_count(); #if ENABLED(USE_WIFI_FUNCTION) - if (tips_disp.timer == TIPS_TIMER_START) { + if (tips_disp.timer == TIPS_TIMER_START) tips_disp.timer_count++; - } #endif if (uiCfg.filament_loading_time_flg == 1) { uiCfg.filament_loading_time_cnt++; @@ -193,10 +192,10 @@ void tft_lvgl_init() { #if ENABLED(POWER_LOSS_RECOVERY) recovery.load(); if (recovery.valid()) { - if (gCfgItems.from_flash_pic == 1) - flash_preview_begin = 1; + if (gCfgItems.from_flash_pic) + flash_preview_begin = true; else - default_preview_flg = 1; + default_preview_flg = true; uiCfg.print_state = REPRINTING; @@ -408,36 +407,32 @@ lv_fs_res_t sd_tell_cb(lv_fs_drv_t * drv, void * file_p, uint32_t * pos_p) { } void lv_encoder_pin_init() { - #if 1 // HAS_DIGITAL_BUTTONS + #if BUTTON_EXISTS(EN1) + SET_INPUT_PULLUP(BTN_EN1); + #endif + #if BUTTON_EXISTS(EN2) + SET_INPUT_PULLUP(BTN_EN2); + #endif + #if BUTTON_EXISTS(ENC) + SET_INPUT_PULLUP(BTN_ENC); + #endif - #if BUTTON_EXISTS(EN1) - SET_INPUT_PULLUP(BTN_EN1); - #endif - #if BUTTON_EXISTS(EN2) - SET_INPUT_PULLUP(BTN_EN2); - #endif - #if BUTTON_EXISTS(ENC) - SET_INPUT_PULLUP(BTN_ENC); - #endif + #if BUTTON_EXISTS(BACK) + SET_INPUT_PULLUP(BTN_BACK); + #endif - #if BUTTON_EXISTS(BACK) - SET_INPUT_PULLUP(BTN_BACK); - #endif - - #if BUTTON_EXISTS(UP) - SET_INPUT(BTN_UP); - #endif - #if BUTTON_EXISTS(DWN) - SET_INPUT(BTN_DWN); - #endif - #if BUTTON_EXISTS(LFT) - SET_INPUT(BTN_LFT); - #endif - #if BUTTON_EXISTS(RT) - SET_INPUT(BTN_RT); - #endif - - #endif // HAS_DIGITAL_BUTTONS + #if BUTTON_EXISTS(UP) + SET_INPUT(BTN_UP); + #endif + #if BUTTON_EXISTS(DWN) + SET_INPUT(BTN_DWN); + #endif + #if BUTTON_EXISTS(LFT) + SET_INPUT(BTN_LFT); + #endif + #if BUTTON_EXISTS(RT) + SET_INPUT(BTN_RT); + #endif } #if 1 // HAS_ENCODER_ACTION diff --git a/Marlin/src/lcd/extui/lib/mks_ui/wifiSerial.cpp b/Marlin/src/lcd/extui/lib/mks_ui/wifiSerial.cpp index 01c86ad7cb..6e15deffae 100644 --- a/Marlin/src/lcd/extui/lib/mks_ui/wifiSerial.cpp +++ b/Marlin/src/lcd/extui/lib/mks_ui/wifiSerial.cpp @@ -23,11 +23,13 @@ #if HAS_TFT_LVGL_UI -#include "draw_ui.h" -#include "wifiSerial.h" +#include "tft_lvgl_configuration.h" #if ENABLED(USE_WIFI_FUNCTION) +#include "draw_ui.h" +#include "wifiSerial.h" + #include #include #include diff --git a/Marlin/src/lcd/extui/lib/mks_ui/wifi_module.cpp b/Marlin/src/lcd/extui/lib/mks_ui/wifi_module.cpp index e4fb4ece03..bfc23f238c 100644 --- a/Marlin/src/lcd/extui/lib/mks_ui/wifi_module.cpp +++ b/Marlin/src/lcd/extui/lib/mks_ui/wifi_module.cpp @@ -66,14 +66,13 @@ int cfg_cloud_flag = 0; extern PRINT_TIME print_time; -char wifi_firm_ver[20] = {0}; +char wifi_firm_ver[20] = { 0 }; WIFI_GCODE_BUFFER espGcodeFifo; extern uint8_t pause_resum; uint8_t wifi_connect_flg = 0; extern volatile uint8_t get_temp_flag; - #define WIFI_MODE 2 #define WIFI_AP_MODE 3 @@ -96,7 +95,7 @@ extern uint32_t wifi_loop_cycle; volatile TRANSFER_STATE esp_state; uint8_t left_to_send = 0; -uint8_t left_to_save[96] = {0}; +uint8_t left_to_save[96] = { 0 }; volatile WIFI_DMA_RCV_FIFO wifiDmaRcvFifo; @@ -109,53 +108,44 @@ extern WIFI_PARA wifiPara; extern IP_PARA ipPara; extern CLOUD_PARA cloud_para; -extern uint8_t once_flag; -extern uint8_t flash_preview_begin; -extern uint8_t default_preview_flg; -extern uint8_t gcode_preview_over; +extern bool once_flag, flash_preview_begin, default_preview_flg, gcode_preview_over; extern uint8_t bmp_public_buf[17 * 1024]; -uint32_t getWifiTick() { +uint32_t getWifiTick() { return millis(); } -uint32_t getWifiTickDiff(int32_t lastTick, int32_t curTick) { - if (lastTick <= curTick) { +uint32_t getWifiTickDiff(int32_t lastTick, int32_t curTick) { + if (lastTick <= curTick) return (curTick - lastTick) * TICK_CYCLE; - } - else { + else return (0xFFFFFFFF - lastTick + curTick) * TICK_CYCLE; - } } void wifi_delay(int n) { uint32_t begin = getWifiTick(); uint32_t end = begin; - - while (getWifiTickDiff(begin, end) < (uint32_t)n) { + while (getWifiTickDiff(begin, end) < (uint32_t)n) end = getWifiTick(); - } } void wifi_reset() { uint32_t start, now; start = getWifiTick(); now = start; - WIFI_RESET(); - while (getWifiTickDiff(start, now) < 500) { + WIFI_RESET(); + while (getWifiTickDiff(start, now) < 500) now = getWifiTick(); - } - WIFI_SET(); + WIFI_SET(); } void mount_file_sys(uint8_t disk_type) { if (disk_type == FILE_SYS_SD) { - card.mount(); + TERN_(SDSUPPORT, card.mount()); } else if (disk_type == FILE_SYS_USB) { - } } @@ -201,7 +191,6 @@ static void dma_init() { memset(wifiDmaRcvFifo.bufferAddr[0], 0, 1024 * TRANS_RCV_FIFO_BLOCK_NUM); wifiDmaRcvFifo.read_cur = 0; wifiDmaRcvFifo.write_cur = 0; - } static void wifi_deInit() { @@ -300,7 +289,7 @@ void esp_port_begin(uint8_t interrupt) { WIFISERIAL.begin(WIFI_BAUDRATE); uint32_t serial_connect_timeout = millis() + 1000UL; while (/*!WIFISERIAL && */PENDING(millis(), serial_connect_timeout)) { /*nada*/ } - //for(uint8_t i=0;i<100;i++)WIFISERIAL.write(0x33); + //for (uint8_t i=0;i<100;i++)WIFISERIAL.write(0x33); #endif } else { @@ -310,7 +299,7 @@ void esp_port_begin(uint8_t interrupt) { WIFISERIAL.begin(WIFI_UPLOAD_BAUDRATE); uint32_t serial_connect_timeout = millis() + 1000UL; while (/*!WIFISERIAL && */PENDING(millis(), serial_connect_timeout)) { /*nada*/ } - //for(uint16_t i=0;i<65535;i++);//WIFISERIAL.write(0x33); + //for (uint16_t i=0;i<65535;i++);//WIFISERIAL.write(0x33); #endif dma_init(); } @@ -318,16 +307,14 @@ void esp_port_begin(uint8_t interrupt) { #if ENABLED(USE_WIFI_FUNCTION) -int raw_send_to_wifi(char *buf, int len) { - if (buf == 0 || len <= 0) return 0; + int raw_send_to_wifi(char *buf, int len) { + if (buf == 0 || len <= 0) return 0; + for (int i = 0; i < len; i++) + WIFISERIAL.write(*(buf + i)); + return len; + } - for (int i = 0; i < len; i++) - WIFISERIAL.write(*(buf + i)); - - return len; -} - -#endif // USE_WIFI_FUNCTION +#endif void wifi_ret_ack() {} @@ -342,7 +329,7 @@ int package_to_wifi(WIFI_RET_TYPE type,char *buf, int len) { int apLen = strlen((const char *)uiCfg.wifi_name); int keyLen = strlen((const char *)uiCfg.wifi_key); - memset(buf_to_wifi, 0, sizeof(buf_to_wifi)); + ZERO(buf_to_wifi); index_to_wifi = 0; buf_to_wifi[data_offset] = gCfgItems.wifi_mode_sel; @@ -361,18 +348,17 @@ int package_to_wifi(WIFI_RET_TYPE type,char *buf, int len) { raw_send_to_wifi(buf_to_wifi, 5 + index_to_wifi); - memset(buf_to_wifi, 0, sizeof(buf_to_wifi)); + ZERO(buf_to_wifi); index_to_wifi = 0; - } else if (type == WIFI_TRANS_INF) { if (len > (int)(sizeof(buf_to_wifi) - index_to_wifi - 5)) { - memset(buf_to_wifi, 0, sizeof(buf_to_wifi)); + ZERO(buf_to_wifi); index_to_wifi = 0; return 0; } - if (len > 0) { + if (len > 0) { memcpy(&buf_to_wifi[4 + index_to_wifi], buf, len); index_to_wifi += len; @@ -380,12 +366,12 @@ int package_to_wifi(WIFI_RET_TYPE type,char *buf, int len) { return 0; if (buf_to_wifi[index_to_wifi + 3] == '\n') { - //mask "wait" "busy" "X:" + // mask "wait" "busy" "X:" if (((buf_to_wifi[4] == 'w') && (buf_to_wifi[5] == 'a') && (buf_to_wifi[6] == 'i') && (buf_to_wifi[7] == 't') ) || ((buf_to_wifi[4] == 'b') && (buf_to_wifi[5] == 'u') && (buf_to_wifi[6] == 's') && (buf_to_wifi[7] == 'y') ) || ((buf_to_wifi[4] == 'X') && (buf_to_wifi[5] == ':') ) - ) { - memset(buf_to_wifi, 0, sizeof(buf_to_wifi)); + ) { + ZERO(buf_to_wifi); index_to_wifi = 0; return 0; } @@ -398,13 +384,13 @@ int package_to_wifi(WIFI_RET_TYPE type,char *buf, int len) { raw_send_to_wifi(buf_to_wifi, 5 + index_to_wifi); - memset(buf_to_wifi, 0, sizeof(buf_to_wifi)); - index_to_wifi = 0; - } + ZERO(buf_to_wifi); + index_to_wifi = 0; + } } } else if (type == WIFI_EXCEP_INF) { - memset(buf_to_wifi, 0, sizeof(buf_to_wifi)); + ZERO(buf_to_wifi); buf_to_wifi[0] = wifi_ret_head; buf_to_wifi[1] = type; @@ -415,25 +401,21 @@ int package_to_wifi(WIFI_RET_TYPE type,char *buf, int len) { raw_send_to_wifi(buf_to_wifi, 6); - memset(buf_to_wifi, 0, sizeof(buf_to_wifi)); + ZERO(buf_to_wifi); index_to_wifi = 0; } else if (type == WIFI_CLOUD_CFG) { int data_offset = 4; int urlLen = strlen((const char *)uiCfg.cloud_hostUrl); - memset(buf_to_wifi, 0, sizeof(buf_to_wifi)); + ZERO(buf_to_wifi); index_to_wifi = 0; - if (gCfgItems.cloud_enable == true) - buf_to_wifi[data_offset] = 0x0A; - else - buf_to_wifi[data_offset] = 0x05; - + buf_to_wifi[data_offset] = gCfgItems.cloud_enable ? 0x0A : 0x05; buf_to_wifi[data_offset + 1] = urlLen; strncpy(&buf_to_wifi[data_offset + 2], (const char *)uiCfg.cloud_hostUrl, urlLen); - buf_to_wifi[data_offset + urlLen + 2] = uiCfg.cloud_port & 0xFF; - buf_to_wifi[data_offset + urlLen + 3] = (uiCfg.cloud_port >> 8) & 0xFF; + buf_to_wifi[data_offset + urlLen + 2] = uiCfg.cloud_port & 0xFF; + buf_to_wifi[data_offset + urlLen + 3] = (uiCfg.cloud_port >> 8) & 0xFF; buf_to_wifi[data_offset + urlLen + 4] = wifi_ret_tail; index_to_wifi = urlLen + 4; @@ -445,11 +427,11 @@ int package_to_wifi(WIFI_RET_TYPE type,char *buf, int len) { raw_send_to_wifi(buf_to_wifi, 5 + index_to_wifi); - memset(buf_to_wifi, 0, sizeof(buf_to_wifi)); + ZERO(buf_to_wifi); index_to_wifi = 0; } else if (type == WIFI_CLOUD_UNBIND) { - memset(buf_to_wifi, 0, sizeof(buf_to_wifi)); + ZERO(buf_to_wifi); buf_to_wifi[0] = wifi_ret_head; buf_to_wifi[1] = type; @@ -459,7 +441,7 @@ int package_to_wifi(WIFI_RET_TYPE type,char *buf, int len) { raw_send_to_wifi(buf_to_wifi, 5); - memset(buf_to_wifi, 0, sizeof(buf_to_wifi)); + ZERO(buf_to_wifi); index_to_wifi = 0; } } @@ -467,22 +449,16 @@ int package_to_wifi(WIFI_RET_TYPE type,char *buf, int len) { int send_to_wifi(char *buf, int len) { return package_to_wifi(WIFI_TRANS_INF, buf, len); } -void set_cur_file_sys(int fileType) { - gCfgItems.fileSysType = fileType; -} +void set_cur_file_sys(int fileType) { gCfgItems.fileSysType = fileType; } void get_file_list(char *path) { - if ( path == 0) { - return; - } + if (!path) return; if (gCfgItems.fileSysType == FILE_SYS_SD) { - #if ENABLED(SDSUPPORT) - card.mount(); - #endif + TERN_(SDSUPPORT, card.mount()); } else if (gCfgItems.fileSysType == FILE_SYS_USB) { - //udisk + // udisk } Explore_Disk(path, 0); } @@ -502,24 +478,19 @@ FILE_WRITER file_writer; int32_t lastFragment = 0; -char lastBinaryCmd[50] = {0}; +char lastBinaryCmd[50] = { 0 }; int total_write = 0; -char binary_head[2] = {0, 0}; +char binary_head[2] = { 0, 0 }; unsigned char binary_data_len = 0; int write_to_file(char *buf, int len) { - int i; - int res; - - for (i = 0; i < len; i++) { + for (int i = 0; i < len; i++) { file_writer.write_buf[file_writer.write_index++] = buf[i]; if (file_writer.write_index >= 512) { - res = card.write(file_writer.write_buf, file_writer.write_index); - if (res == -1) { - return -1; - } - memset(file_writer.write_buf, 0, sizeof(file_writer.write_buf)); + int res = card.write(file_writer.write_buf, file_writer.write_index); + if (res == -1) return -1; + ZERO(file_writer.write_buf); file_writer.write_index = 0; } } @@ -536,7 +507,7 @@ int write_to_file(char *buf, int len) { #define ESP_TYPE_WIFI_LIST (uint8_t)0x4 -uint8_t esp_msg_buf[UART_RX_BUFFER_SIZE] = {0}; +uint8_t esp_msg_buf[UART_RX_BUFFER_SIZE] = { 0 }; uint16_t esp_msg_index = 0; typedef struct { @@ -564,93 +535,71 @@ static int cut_msg_head(uint8_t *msg, uint16_t msgLen, uint16_t cutLen) { return msgLen - cutLen; } +uint8_t Explore_Disk(char* path , uint8_t recu_level) { + char tmp[200]; + char Fstream[200]; -uint8_t Explore_Disk (char* path , uint8_t recu_level) { - char tmp[200]; - char Fstream[200]; - - if (path == 0)return 0; + if (!path) return 0; const uint8_t fileCnt = card.get_num_Files(); for (uint8_t i = 0; i < fileCnt; i++) { - const uint16_t nr = - #if ENABLED(SDCARD_RATHERRECENTFIRST) && DISABLED(SDCARD_SORT_ALPHA) - fileCnt - 1 - - #endif - i; + card.getfilename_sorted(SD_ORDER(i, fileCnt)); - #if ENABLED(SDCARD_SORT_ALPHA) - card.getfilename_sorted(nr); - #else - card.getfilename_sorted(nr); - #endif - memset(tmp, 0, sizeof(tmp)); - //if (card.longFilename[0] == 0) - strcpy(tmp, card.filename); - //else - //strcpy(tmp, card.longFilename); + //if (card.longFilename[0] == 0) + strcpy(tmp, card.filename); + //else + // strcpy(tmp, card.longFilename); - memset(Fstream, 0, sizeof(Fstream)); - strcpy(Fstream, tmp); + ZERO(Fstream); + strcpy(Fstream, tmp); - if (card.flag.filenameIsDir && (recu_level <= 10)) { - strcat(Fstream, ".DIR\r\n"); - send_to_wifi(Fstream, strlen(Fstream)); - } - else { - strcat(Fstream, "\r\n"); - send_to_wifi(Fstream, strlen(Fstream)); - } + if (card.flag.filenameIsDir && recu_level <= 10) + strcat(Fstream, ".DIR"); + + strcat(Fstream, "\r\n"); + send_to_wifi(Fstream, strlen(Fstream)); } return fileCnt; } static void wifi_gcode_exec(uint8_t *cmd_line) { - int8_t tempBuf[100] = {0}; + int8_t tempBuf[100] = { 0 }; uint8_t *tmpStr = 0; int cmd_value; volatile int print_rate; - if ((strstr((char *)&cmd_line[0], "\n") != 0) && ((strstr((char *)&cmd_line[0], "G") != 0) || (strstr((char *)&cmd_line[0], "M") != 0) || (strstr((char *)&cmd_line[0], "T") != 0) )) { + if (strchr((char *)cmd_line, '\n') && (strchr((char *)cmd_line, 'G') || strchr((char *)cmd_line, 'M') || strchr((char *)cmd_line, 'T'))) { + tmpStr = (uint8_t *)strchr((char *)cmd_line, '\n'); + if (tmpStr) *tmpStr = '\0'; - tmpStr = (uint8_t *)strstr((char *)&cmd_line[0], "\n"); + tmpStr = (uint8_t *)strchr((char *)cmd_line, '\r'); + if (tmpStr) *tmpStr = '\0'; + + tmpStr = (uint8_t *)strchr((char *)cmd_line, '*'); + if (tmpStr) *tmpStr = '\0'; + + tmpStr = (uint8_t *)strchr((char *)cmd_line, 'M'); if (tmpStr) { - *tmpStr = '\0'; - } - tmpStr = (uint8_t *)strstr((char *)&cmd_line[0], "\r"); - if (tmpStr) { - *tmpStr = '\0'; - } - tmpStr = (uint8_t *)strstr((char *)&cmd_line[0], "*"); - if (tmpStr) { - *tmpStr = '\0'; - } - tmpStr = (uint8_t *)strstr((char *)&cmd_line[0], "M"); - if ( tmpStr) { cmd_value = atoi((char *)(tmpStr + 1)); - tmpStr = (uint8_t *)strstr((char *)tmpStr, " "); + tmpStr = (uint8_t *)strchr((char *)tmpStr, ' '); switch (cmd_value) { - case 20: //print sd / udisk file + case 20: // M20: Print SD / µdisk file if (uiCfg.print_state == IDLE) { int index = 0; if (tmpStr == 0) { gCfgItems.fileSysType = FILE_SYS_SD; send_to_wifi((char *)"Begin file list\r\n", strlen("Begin file list\r\n")); - get_file_list((char *)"0:/"); - send_to_wifi((char *)"End file list\r\n", strlen("End file list\r\n")); - send_to_wifi((char *)"ok\r\n", strlen("ok\r\n")); break; } - while (tmpStr[index] == ' ') - index++; + while (tmpStr[index] == ' ') index++; if (gCfgItems.wifi_type == ESP_WIFI) { char *path = (char *)tempBuf; @@ -658,13 +607,11 @@ static void wifi_gcode_exec(uint8_t *cmd_line) { if (strlen((char *)&tmpStr[index]) < 80) { send_to_wifi((char *)"Begin file list\r\n", strlen("Begin file list\r\n")); - if (strncmp((char *)&tmpStr[index], "1:", 2) == 0) { + if (strncmp((char *)&tmpStr[index], "1:", 2) == 0) gCfgItems.fileSysType = FILE_SYS_SD; - - } - else if (strncmp((char *)&tmpStr[index], "0:", 2) == 0) { + else if (strncmp((char *)&tmpStr[index], "0:", 2) == 0) gCfgItems.fileSysType = FILE_SYS_USB; - } + strcpy((char *)path, (char *)&tmpStr[index]); get_file_list(path); send_to_wifi((char *)"End file list\r\n", strlen("End file list\r\n")); @@ -683,49 +630,37 @@ static void wifi_gcode_exec(uint8_t *cmd_line) { /*select the file*/ if (uiCfg.print_state == IDLE) { int index = 0; - while (tmpStr[index] == ' ') - index++; + while (tmpStr[index] == ' ') index++; if (strstr((char *)&tmpStr[index], ".g") || strstr((char *)&tmpStr[index], ".G")) { if (strlen((char *)&tmpStr[index]) < 80) { - memset(list_file.file_name[sel_id], 0, sizeof(list_file.file_name[sel_id])); + ZERO(list_file.file_name[sel_id]); if (gCfgItems.wifi_type == ESP_WIFI) { - if (strncmp((char *)&tmpStr[index], "1:", 2) == 0) { + if (strncmp((char *)&tmpStr[index], "1:", 2) == 0) gCfgItems.fileSysType = FILE_SYS_SD; - - } - else if (strncmp((char *)&tmpStr[index], "0:", 2) == 0) { + else if (strncmp((char *)&tmpStr[index], "0:", 2) == 0) gCfgItems.fileSysType = FILE_SYS_USB; - } - else { - if (tmpStr[index] != '/') - strcat((char *)list_file.file_name[0], "/"); - } + else if (tmpStr[index] != '/') + strcat((char *)list_file.file_name[0], "/"); strcat((char *)list_file.file_name[sel_id], (char *)&tmpStr[index]); } - else { + else strcpy(list_file.file_name[sel_id], (char *)&tmpStr[index]); - } char *cur_name=strrchr(list_file.file_name[sel_id],'/'); card.openFileRead(cur_name); - if (card.isFileOpen()) { + if (card.isFileOpen()) send_to_wifi((char *)"File selected\r\n", strlen("File selected\r\n")); - - } else { send_to_wifi((char *)"file.open failed\r\n", strlen("file.open failed\r\n")); strcpy(list_file.file_name[sel_id], "notValid"); } send_to_wifi((char *)"ok\r\n", strlen("ok\r\n")); - } - - } } break; @@ -740,60 +675,57 @@ static void wifi_gcode_exec(uint8_t *cmd_line) { uiCfg.print_state = WORKING; lv_draw_printing(); - if (gcode_preview_over != 1) { - #if ENABLED(SDSUPPORT) - char *cur_name; - cur_name=strrchr(list_file.file_name[sel_id],'/'); + #if ENABLED(SDSUPPORT) + if (!gcode_preview_over) { + char *cur_name = strrchr(list_file.file_name[sel_id], '/'); - SdFile file; - SdFile *curDir; - card.endFilePrint(); - const char * const fname = card.diveToFile(true, curDir, cur_name); - if (!fname) return; - if (file.open(curDir, fname, O_READ)) { - gCfgItems.curFilesize = file.fileSize(); - file.close(); - update_spi_flash(); - } - card.openFileRead(cur_name); - if (card.isFileOpen()) { - feedrate_percentage = 100; - //saved_feedrate_percentage = feedrate_percentage; - planner.flow_percentage[0] = 100; - planner.e_factor[0]= planner.flow_percentage[0]*0.01; - if (EXTRUDERS==2) { - planner.flow_percentage[1] = 100; - planner.e_factor[1]= planner.flow_percentage[1]*0.01; - } - card.startFileprint(); - #if ENABLED(POWER_LOSS_RECOVERY) - recovery.prepare(); - #endif - once_flag = 0; - } - #endif + card.endFilePrint(); - } + SdFile file; + SdFile *curDir; + const char * const fname = card.diveToFile(true, curDir, cur_name); + if (!fname) return; + if (file.open(curDir, fname, O_READ)) { + gCfgItems.curFilesize = file.fileSize(); + file.close(); + update_spi_flash(); + } + card.openFileRead(cur_name); + if (card.isFileOpen()) { + //saved_feedrate_percentage = feedrate_percentage; + feedrate_percentage = 100; + planner.flow_percentage[0] = 100; + planner.e_factor[0] = planner.flow_percentage[0] * 0.01f; + #if EXTRUDERS == 2 + planner.flow_percentage[1] = 100; + planner.e_factor[1] = planner.flow_percentage[1] * 0.01f; + #endif + card.startFileprint(); + TERN_(POWER_LOSS_RECOVERY, recovery.prepare()); + once_flag = false; + } + } + #endif } else if (uiCfg.print_state == PAUSED) { uiCfg.print_state = RESUMING; clear_cur_ui(); start_print_time(); - if (gCfgItems.from_flash_pic==1) - flash_preview_begin = 1; + if (gCfgItems.from_flash_pic) + flash_preview_begin = true; else - default_preview_flg = 1; - lv_draw_printing(); + default_preview_flg = true; + lv_draw_printing(); } else if (uiCfg.print_state == REPRINTING) { uiCfg.print_state = REPRINTED; clear_cur_ui(); start_print_time(); - if (gCfgItems.from_flash_pic==1) - flash_preview_begin = 1; + if (gCfgItems.from_flash_pic) + flash_preview_begin = true; else - default_preview_flg = 1; + default_preview_flg = true; lv_draw_printing(); } } @@ -808,13 +740,13 @@ static void wifi_gcode_exec(uint8_t *cmd_line) { clear_cur_ui(); #if ENABLED(SDSUPPORT) - card.pauseSDPrint(); - uiCfg.print_state = PAUSING; - #endif - if (gCfgItems.from_flash_pic==1) - flash_preview_begin = 1; + card.pauseSDPrint(); + uiCfg.print_state = PAUSING; + #endif + if (gCfgItems.from_flash_pic) + flash_preview_begin = true; else - default_preview_flg = 1; + default_preview_flg = true; lv_draw_printing(); send_to_wifi((char *)"ok\r\n", strlen("ok\r\n")); } @@ -826,9 +758,9 @@ static void wifi_gcode_exec(uint8_t *cmd_line) { stop_print_time(); clear_cur_ui(); - #if ENABLED(SDSUPPORT) - uiCfg.print_state = IDLE; - card.flag.abort_sd_printing = true; + #if ENABLED(SDSUPPORT) + uiCfg.print_state = IDLE; + card.flag.abort_sd_printing = true; #endif lv_draw_ready_print(); @@ -841,15 +773,10 @@ static void wifi_gcode_exec(uint8_t *cmd_line) { /*report print rate*/ if ((uiCfg.print_state == WORKING) || (uiCfg.print_state == PAUSED)|| (uiCfg.print_state == REPRINTING)) { print_rate = uiCfg.totalSend; - - memset((char *)tempBuf, 0, sizeof(tempBuf)); - + ZERO(tempBuf); sprintf((char *)tempBuf, "M27 %d\r\n", print_rate); - send_to_wifi((char *)tempBuf, strlen((char *)tempBuf)); - } - break; case 28: @@ -857,112 +784,105 @@ static void wifi_gcode_exec(uint8_t *cmd_line) { if (uiCfg.print_state == IDLE) { int index = 0; - while (tmpStr[index] == ' ') - index++; + while (tmpStr[index] == ' ') index++; if (strstr((char *)&tmpStr[index], ".g") || strstr((char *)&tmpStr[index], ".G")) { strcpy((char *)file_writer.saveFileName, (char *)&tmpStr[index]); if (gCfgItems.fileSysType == FILE_SYS_SD) { - memset(tempBuf, 0, sizeof(tempBuf)); + ZERO(tempBuf); sprintf((char *)tempBuf, "%s", file_writer.saveFileName); } else if (gCfgItems.fileSysType == FILE_SYS_USB) { - memset(tempBuf, 0, sizeof(tempBuf)); + ZERO(tempBuf); sprintf((char *)tempBuf, "%s", (char *)file_writer.saveFileName); } mount_file_sys(gCfgItems.fileSysType); #if ENABLED(SDSUPPORT) - char *cur_name=strrchr(list_file.file_name[sel_id],'/'); - card.openFileWrite(cur_name); - if (card.isFileOpen()) { - memset(file_writer.saveFileName, 0, sizeof(file_writer.saveFileName)); - strcpy((char *)file_writer.saveFileName, (char *)&tmpStr[index]); - memset(tempBuf, 0, sizeof(tempBuf)); - sprintf((char *)tempBuf, "Writing to file: %s\r\n", (char *)file_writer.saveFileName); - wifi_ret_ack(); - send_to_wifi((char *)tempBuf, strlen((char *)tempBuf)); - - total_write = 0; - wifi_link_state = WIFI_WAIT_TRANS_START; - - } - else{ - wifi_link_state = WIFI_CONNECTED; - clear_cur_ui(); - lv_draw_dialog(DIALOG_TRANSFER_NO_DEVICE); - } + char *cur_name = strrchr(list_file.file_name[sel_id], '/'); + card.openFileWrite(cur_name); + if (card.isFileOpen()) { + ZERO(file_writer.saveFileName); + strcpy((char *)file_writer.saveFileName, (char *)&tmpStr[index]); + ZERO(tempBuf); + sprintf((char *)tempBuf, "Writing to file: %s\r\n", (char *)file_writer.saveFileName); + wifi_ret_ack(); + send_to_wifi((char *)tempBuf, strlen((char *)tempBuf)); + total_write = 0; + wifi_link_state = WIFI_WAIT_TRANS_START; + } + else { + wifi_link_state = WIFI_CONNECTED; + clear_cur_ui(); + lv_draw_dialog(DIALOG_TRANSFER_NO_DEVICE); + } #endif - } - } break; case 105: case 991: - memset(tempBuf, 0, sizeof(tempBuf)); + ZERO(tempBuf); if (cmd_value == 105) { send_to_wifi((char *)"ok\r\n", strlen("ok\r\n")); sprintf((char *)tempBuf,"T:%.1f /%.1f B:%.1f /%.1f T0:%.1f /%.1f T1:%.1f /%.1f @:0 B@:0\r\n", - (float)thermalManager.temp_hotend[0].celsius,(float)thermalManager.temp_hotend[0].target, + (float)thermalManager.temp_hotend[0].celsius, (float)thermalManager.temp_hotend[0].target, #if HAS_HEATED_BED - (float)thermalManager.temp_bed.celsius,(float)thermalManager.temp_bed.target, + (float)thermalManager.temp_bed.celsius, (float)thermalManager.temp_bed.target, #else - (float)0,(float)0, + 0.0f, 0.0f, #endif - (float)thermalManager.temp_hotend[0].celsius,(float)thermalManager.temp_hotend[0].target, + (float)thermalManager.temp_hotend[0].celsius, (float)thermalManager.temp_hotend[0].target, #if !defined(SINGLENOZZLE) && HAS_MULTI_EXTRUDER - (float)thermalManager.temp_hotend[1].celsius,(float)thermalManager.temp_hotend[1].target + (float)thermalManager.temp_hotend[1].celsius, (float)thermalManager.temp_hotend[1].target #else - (float)0,(float)0 + 0.0f, 0.0f #endif ); } else { sprintf((char *)tempBuf,"T:%d /%d B:%d /%d T0:%d /%d T1:%d /%d @:0 B@:0\r\n", - (int)thermalManager.temp_hotend[0].celsius,(int)thermalManager.temp_hotend[0].target, + (int)thermalManager.temp_hotend[0].celsius, (int)thermalManager.temp_hotend[0].target, #if HAS_HEATED_BED - (int)thermalManager.temp_bed.celsius,(int)thermalManager.temp_bed.target, + (int)thermalManager.temp_bed.celsius, (int)thermalManager.temp_bed.target, #else - 0,0, - #endif - (int)thermalManager.temp_hotend[0].celsius,(int)thermalManager.temp_hotend[0].target, - #if !defined(SINGLENOZZLE) && HAS_MULTI_EXTRUDER - (int)thermalManager.temp_hotend[1].celsius,(int)thermalManager.temp_hotend[1].target - #else - 0,0 + 0, 0, #endif + (int)thermalManager.temp_hotend[0].celsius, (int)thermalManager.temp_hotend[0].target, + #if !defined(SINGLENOZZLE) && HAS_MULTI_EXTRUDER + (int)thermalManager.temp_hotend[1].celsius, (int)thermalManager.temp_hotend[1].target + #else + 0, 0 + #endif ); } send_to_wifi((char *)tempBuf, strlen((char *)tempBuf)); - queue.enqueue_one_P(PSTR("M105")); - break; + case 992: if ((uiCfg.print_state == WORKING) || (uiCfg.print_state == PAUSED)) { - memset(tempBuf,0,sizeof(tempBuf)); + ZERO(tempBuf); sprintf((char *)tempBuf, "M992 %d%d:%d%d:%d%d\r\n", print_time.hours/10, print_time.hours%10, print_time.minutes/10, print_time.minutes%10, print_time.seconds/10, print_time.seconds%10); wifi_ret_ack(); send_to_wifi((char *)tempBuf, strlen((char *)tempBuf)); } - break; + case 994: if ((uiCfg.print_state == WORKING) || (uiCfg.print_state == PAUSED)) { - memset(tempBuf,0,sizeof(tempBuf)); - if (strlen((char *)list_file.file_name[sel_id]) > (100-1)) { - return; - } + ZERO(tempBuf); + if (strlen((char *)list_file.file_name[sel_id]) > (100 - 1)) return; sprintf((char *)tempBuf, "M994 %s;%d\n", list_file.file_name[sel_id],(int)gCfgItems.curFilesize); wifi_ret_ack(); send_to_wifi((char *)tempBuf, strlen((char *)tempBuf)); } break; + case 997: if (uiCfg.print_state == IDLE) { wifi_ret_ack(); @@ -985,18 +905,17 @@ static void wifi_gcode_exec(uint8_t *cmd_line) { case 998: if (uiCfg.print_state == IDLE) { - if (atoi((char *)tmpStr) == 0) { + int v = atoi((char *)tmpStr); + if (v == 0) set_cur_file_sys(0); - } - else if (atoi((char *)tmpStr) == 1) { + else if (v == 1) set_cur_file_sys(1); - } wifi_ret_ack(); } break; case 115: - memset(tempBuf,0,sizeof(tempBuf)); + ZERO(tempBuf); send_to_wifi((char *)"ok\r\n", strlen("ok\r\n")); send_to_wifi((char *)"FIRMWARE_NAME:Robin_nano\r\n", strlen("FIRMWARE_NAME:Robin_nano\r\n")); break; @@ -1004,55 +923,50 @@ static void wifi_gcode_exec(uint8_t *cmd_line) { default: strcat((char *)cmd_line, "\n"); - uint32_t left; + if (espGcodeFifo.wait_tick > 5) { + uint32_t left; + if (espGcodeFifo.r > espGcodeFifo.w) + left = espGcodeFifo.r - espGcodeFifo.w - 1; + else + left = WIFI_GCODE_BUFFER_SIZE + espGcodeFifo.r - espGcodeFifo.w - 1; - if (espGcodeFifo.wait_tick> 5) { - - if (espGcodeFifo.r > espGcodeFifo.w) - left = espGcodeFifo.r - espGcodeFifo.w - 1; - else - left = WIFI_GCODE_BUFFER_SIZE + espGcodeFifo.r - espGcodeFifo.w - 1; - if (left >= strlen((const char *)cmd_line)) { - uint32_t index = 0; - while (index < strlen((const char *)cmd_line)) { - espGcodeFifo.Buffer[espGcodeFifo.w] = cmd_line[index] ; - espGcodeFifo.w = (espGcodeFifo.w + 1) % WIFI_GCODE_BUFFER_SIZE; - index++; - } + if (left >= strlen((const char *)cmd_line)) { + uint32_t index = 0; + while (index < strlen((const char *)cmd_line)) { + espGcodeFifo.Buffer[espGcodeFifo.w] = cmd_line[index] ; + espGcodeFifo.w = (espGcodeFifo.w + 1) % WIFI_GCODE_BUFFER_SIZE; + index++; + } if (left - WIFI_GCODE_BUFFER_LEAST_SIZE >= strlen((const char *)cmd_line)) send_to_wifi((char *)"ok\r\n", strlen("ok\r\n")); else need_ok_later = true; - - } - - } + } + } break; - } } - else{ + else { strcat((char *)cmd_line, "\n"); - uint32_t left_g; - if (espGcodeFifo.wait_tick > 5) { - - if (espGcodeFifo.r > espGcodeFifo.w) - left_g = espGcodeFifo.r - espGcodeFifo.w - 1; + if (espGcodeFifo.wait_tick > 5) { + uint32_t left_g; + if (espGcodeFifo.r > espGcodeFifo.w) + left_g = espGcodeFifo.r - espGcodeFifo.w - 1; else left_g = WIFI_GCODE_BUFFER_SIZE + espGcodeFifo.r - espGcodeFifo.w - 1; + if (left_g >= strlen((const char *)cmd_line)) { uint32_t index = 0; while (index < strlen((const char *)cmd_line)) { espGcodeFifo.Buffer[espGcodeFifo.w] = cmd_line[index] ; - espGcodeFifo.w = (espGcodeFifo.w + 1) % WIFI_GCODE_BUFFER_SIZE; + espGcodeFifo.w = (espGcodeFifo.w + 1) % WIFI_GCODE_BUFFER_SIZE; index++; } - if (left_g - WIFI_GCODE_BUFFER_LEAST_SIZE >= strlen((const char *)cmd_line)) - send_to_wifi((char *)"ok\r\n", strlen("ok\r\n")); - else - need_ok_later = true; - + if (left_g - WIFI_GCODE_BUFFER_LEAST_SIZE >= strlen((const char *)cmd_line)) + send_to_wifi((char *)"ok\r\n", strlen("ok\r\n")); + else + need_ok_later = true; } } } @@ -1066,12 +980,7 @@ static int32_t charAtArray(const uint8_t *_array, uint32_t _arrayLen, uint8_t _c } void get_wifi_list_command_send() { - char buf[6] = {0}; - buf[0] = 0xA5; - buf[1] = 0x07; - buf[2] = 0x00; - buf[3] = 0x00; - buf[4] = 0xFC; + char buf[] = { 0xA5, 0x07, 0x00, 0x00, 0xFC }; raw_send_to_wifi(buf, 5); } @@ -1079,60 +988,57 @@ static void net_msg_handle(uint8_t * msg, uint16_t msgLen) { int wifiNameLen, wifiKeyLen, hostLen, id_len, ver_len; if (msgLen <= 0) return; - //ip + + // ip sprintf(ipPara.ip_addr, "%d.%d.%d.%d", msg[0], msg[1], msg[2], msg[3]); - //port - //connect state - if (msg[6] == 0x0A) - wifi_link_state = WIFI_CONNECTED; - else if (msg[6] == 0x0E) - wifi_link_state = WIFI_EXCEPTION; - else - wifi_link_state = WIFI_NOT_CONFIG; + // port + // connect state + switch (msg[6]) { + case 0x0A: wifi_link_state = WIFI_CONNECTED; break; + case 0x0E: wifi_link_state = WIFI_EXCEPTION; break; + default: wifi_link_state = WIFI_NOT_CONFIG; break; + } - //mode + // mode wifiPara.mode = msg[7]; - - //wifi name + // wifi name wifiNameLen = msg[8]; wifiKeyLen = msg[9 + wifiNameLen]; if (wifiNameLen < 32) { - memset(wifiPara.ap_name, 0, sizeof(wifiPara.ap_name)); + ZERO(wifiPara.ap_name); memcpy(wifiPara.ap_name, &msg[9], wifiNameLen); - memset(&wifi_list.wifiConnectedName,0,sizeof(wifi_list.wifiConnectedName)); - memcpy(&wifi_list.wifiConnectedName,&msg[9],wifiNameLen); + memset(&wifi_list.wifiConnectedName, 0, sizeof(wifi_list.wifiConnectedName)); + memcpy(&wifi_list.wifiConnectedName, &msg[9], wifiNameLen); - //wifi key + // wifi key if (wifiKeyLen < 64) { - memset(wifiPara.keyCode, 0, sizeof(wifiPara.keyCode)); + ZERO(wifiPara.keyCode); memcpy(wifiPara.keyCode, &msg[10 + wifiNameLen], wifiKeyLen); } } - cloud_para.state =msg[10 + wifiNameLen + wifiKeyLen]; hostLen = msg[11 + wifiNameLen + wifiKeyLen]; if (cloud_para.state) { if (hostLen < 96) { - memset(cloud_para.hostUrl, 0, sizeof(cloud_para.hostUrl)); + ZERO(cloud_para.hostUrl); memcpy(cloud_para.hostUrl, &msg[12 + wifiNameLen + wifiKeyLen], hostLen); } cloud_para.port = msg[12 + wifiNameLen + wifiKeyLen + hostLen] + (msg[13 + wifiNameLen + wifiKeyLen + hostLen] << 8); - } // id id_len = msg[14 + wifiNameLen + wifiKeyLen + hostLen]; if (id_len == 20) { - memset(cloud_para.id, 0, sizeof(cloud_para.id)); + ZERO(cloud_para.id); memcpy(cloud_para.id, (const char *)&msg[15 + wifiNameLen + wifiKeyLen + hostLen], id_len); } ver_len = msg[15 + wifiNameLen + wifiKeyLen + hostLen + id_len]; if (ver_len < 20) { - memset(wifi_firm_ver, 0, sizeof(wifi_firm_ver)); + ZERO(wifi_firm_ver); memcpy(wifi_firm_ver, (const char *)&msg[16 + wifiNameLen + wifiKeyLen + hostLen + id_len], ver_len); } @@ -1155,35 +1061,29 @@ static void net_msg_handle(uint8_t * msg, uint16_t msgLen) { } static void wifi_list_msg_handle(uint8_t * msg, uint16_t msgLen) { - int wifiNameLen,wifiMsgIdex=1; - int8_t wifi_name_is_same=0; - int8_t i,j; - int8_t wifi_name_num=0; - uint8_t *str=0; + int wifiNameLen,wifiMsgIdex = 1; + int8_t wifi_name_is_same = 0; + int8_t i, j; + int8_t wifi_name_num = 0; + uint8_t *str = 0; int8_t valid_name_num; - if (msgLen <= 0) - return; - if (disp_state == KEY_BOARD_UI) - return; + if (msgLen <= 0) return; + if (disp_state == KEY_BOARD_UI) return; wifi_list.getNameNum = msg[0]; if (wifi_list.getNameNum < 20) { uiCfg.command_send = 1; - - memset(wifi_list.wifiName,0,sizeof(wifi_list.wifiName)); - + ZERO(wifi_list.wifiName); wifi_name_num = wifi_list.getNameNum; - - valid_name_num=0; - str = wifi_list.wifiName[valid_name_num]; + valid_name_num = 0; + str = wifi_list.wifiName[0]; if (wifi_list.getNameNum > 0) wifi_list.currentWifipage = 1; - for (i = 0; i 0x80) { wifi_name_is_same = 1; //break; @@ -1211,65 +1110,50 @@ static void wifi_list_msg_handle(uint8_t * msg, uint16_t msgLen) { //i--; continue; } - if (i < WIFI_TOTAL_NUMBER-1) { + if (i < WIFI_TOTAL_NUMBER - 1) str = wifi_list.wifiName[++valid_name_num]; - } } - wifiMsgIdex += wifiNameLen; - wifi_list.RSSI[i] = msg[wifiMsgIdex]; - wifiMsgIdex += 1; + wifiMsgIdex += wifiNameLen; + wifi_list.RSSI[i] = msg[wifiMsgIdex++]; } wifi_list.getNameNum = wifi_name_num; - if (wifi_list.getNameNum % NUMBER_OF_PAGE == 0) { - wifi_list.getPage = wifi_list.getNameNum/NUMBER_OF_PAGE; - } - else { - wifi_list.getPage = wifi_list.getNameNum/NUMBER_OF_PAGE + 1; - } + wifi_list.getPage = wifi_list.getNameNum / NUMBER_OF_PAGE + ((wifi_list.getNameNum % NUMBER_OF_PAGE) != 0); wifi_list.nameIndex = 0; - if (disp_state == WIFI_LIST_UI) - disp_wifi_list(); + + if (disp_state == WIFI_LIST_UI) disp_wifi_list(); } } static void gcode_msg_handle(uint8_t * msg, uint16_t msgLen) { - uint8_t gcodeBuf[100] = {0}; - char *index_s; - char *index_e; + uint8_t gcodeBuf[100] = { 0 }; + char *index_s, *index_e; - if (msgLen <= 0) - return; + if (msgLen <= 0) return; index_s = (char *)msg; - index_e = (char *)strstr((char *)msg, "\n"); + index_e = (char *)strchr((char *)msg, '\n'); if (*msg == 'N') { - index_s = (char *)strstr((char *)msg, " "); - while ((*index_s) == ' ') { - index_s++; - } + index_s = (char *)strchr((char *)msg, ' '); + while (*index_s == ' ') index_s++; } while ((index_e != 0) && ((int)index_s < (int)index_e)) { if ((int)(index_e - index_s) < (int)sizeof(gcodeBuf)) { - memset(gcodeBuf, 0, sizeof(gcodeBuf)); - + ZERO(gcodeBuf); memcpy(gcodeBuf, index_s, index_e - index_s + 1); - wifi_gcode_exec(gcodeBuf); } - while ((*index_e == '\r') || (*index_e == '\n')) - index_e++; - + while ((*index_e == '\r') || (*index_e == '\n')) index_e++; index_s = index_e; - index_e = (char *)strstr(index_s, "\n"); + index_e = (char *)strchr(index_s, '\n'); } } void utf8_2_unicode(uint8_t *source,uint8_t Len) { - uint8_t i=0,char_i=0,char_byte_num=0; - uint16_t u16_h,u16_m,u16_l,u16_value; + uint8_t i = 0, char_i = 0, char_byte_num = 0; + uint16_t u16_h, u16_m, u16_l, u16_value; uint8_t FileName_unicode[30]; - memset(FileName_unicode, 0, sizeof(FileName_unicode)); + ZERO(FileName_unicode); while (1) { char_byte_num = source[i] & 0xF0; @@ -1282,8 +1166,8 @@ void utf8_2_unicode(uint8_t *source,uint8_t Len) { else if (char_byte_num == 0XC0 || char_byte_num == 0XD0) { //--2byte - u16_h = (((uint16_t)source[i] <<8) & 0x1F00) >> 2; - u16_l = ((uint16_t)source[i+1] & 0x003F); + u16_h = (((uint16_t)source[i] << 8) & 0x1F00) >> 2; + u16_l = ((uint16_t)source[i + 1] & 0x003F); u16_value = (u16_h | u16_l); FileName_unicode[char_i] = (uint8_t)((u16_value & 0xFF00) >> 8); FileName_unicode[char_i + 1] = (uint8_t)(u16_value & 0x00FF); @@ -1292,9 +1176,9 @@ void utf8_2_unicode(uint8_t *source,uint8_t Len) { } else if (char_byte_num == 0XE0) { //--3byte - u16_h = (((uint16_t)source[i] <<8 ) & 0x0F00) << 4; - u16_m = (((uint16_t)source[i+1] << 8) & 0x3F00) >> 2; - u16_l = ((uint16_t)source[i+2] & 0x003F); + u16_h = (((uint16_t)source[i] << 8) & 0x0F00) << 4; + u16_m = (((uint16_t)source[i + 1] << 8) & 0x3F00) >> 2; + u16_l = ((uint16_t)source[i + 2] & 0x003F); u16_value = (u16_h | u16_m | u16_l); FileName_unicode[char_i] = (uint8_t)((u16_value & 0xFF00) >> 8); FileName_unicode[char_i + 1] = (uint8_t)(u16_value & 0x00FF); @@ -1309,9 +1193,9 @@ void utf8_2_unicode(uint8_t *source,uint8_t Len) { else { break; } - if (i >= Len || i >= 255)break; + if (i >= Len || i >= 255) break; } - memcpy(source, FileName_unicode, sizeof(FileName_unicode)); + COPY(source, FileName_unicode); } char saveFilePath[50]; @@ -1343,18 +1227,18 @@ static void file_first_msg_handle(uint8_t * msg, uint16_t msgLen) { if (msgLen != fileNameLen + 5) return; file_writer.fileLen = *((uint32_t *)(msg + 1)); - memset(file_writer.saveFileName, 0, sizeof(file_writer.saveFileName)); + ZERO(file_writer.saveFileName); memcpy(file_writer.saveFileName, msg + 5, fileNameLen); utf8_2_unicode(file_writer.saveFileName,fileNameLen); - memset(file_writer.write_buf, 0, sizeof(file_writer.write_buf)); + ZERO(file_writer.write_buf); if (strlen((const char *)file_writer.saveFileName) > sizeof(saveFilePath)) return; - memset(saveFilePath, 0, sizeof(saveFilePath)); + ZERO(saveFilePath); if (gCfgItems.fileSysType == FILE_SYS_SD) { //sprintf((char *)saveFilePath, "/%s", file_writer.saveFileName); @@ -1392,7 +1276,7 @@ static void file_first_msg_handle(uint8_t * msg, uint16_t msgLen) { sprintf((char *)saveFilePath, "/%s", dosName); ZERO(list_file.long_name[sel_id]); - memcpy(list_file.long_name[sel_id],dosName,sizeof(dosName)); + memcpy(list_file.long_name[sel_id], dosName, sizeof(dosName)); char *cur_name=strrchr((const char *)saveFilePath,'/'); @@ -1412,7 +1296,8 @@ static void file_first_msg_handle(uint8_t * msg, uint16_t msgLen) { lv_draw_dialog(DIALOG_TYPE_UPLOAD_FILE); return; } - #endif + + #endif // SDSUPPORT wifi_link_state = WIFI_TRANS_FILE; @@ -1432,14 +1317,14 @@ static void file_fragment_msg_handle(uint8_t * msg, uint16_t msgLen) { uint32_t frag = *((uint32_t *)msg); if ((frag & FRAG_MASK) != (uint32_t)(lastFragment + 1)) { - memset(file_writer.write_buf, 0, sizeof(file_writer.write_buf)); + ZERO(file_writer.write_buf); file_writer.write_index = 0; wifi_link_state = WIFI_CONNECTED; upload_result = 2; } else { if (write_to_file((char *)msg + 4, msgLen - 4) < 0) { - memset(file_writer.write_buf, 0, sizeof(file_writer.write_buf)); + ZERO(file_writer.write_buf); file_writer.write_index = 0; wifi_link_state = WIFI_CONNECTED; upload_result = 2; @@ -1450,13 +1335,13 @@ static void file_fragment_msg_handle(uint8_t * msg, uint16_t msgLen) { if ((frag & (~FRAG_MASK))) { int res = card.write(file_writer.write_buf, file_writer.write_index); if (res == -1) { - memset(file_writer.write_buf, 0, sizeof(file_writer.write_buf)); + ZERO(file_writer.write_buf); file_writer.write_index = 0; wifi_link_state = WIFI_CONNECTED; upload_result = 2; return; } - memset(file_writer.write_buf, 0, sizeof(file_writer.write_buf)); + ZERO(file_writer.write_buf); file_writer.write_index = 0; file_writer.tick_end = getWifiTick(); upload_time = getWifiTickDiff(file_writer.tick_begin, file_writer.tick_end) / 1000; @@ -1493,7 +1378,7 @@ void esp_data_parser(char *cmdRxBuf, int len) { if (tail_pos == -1) { if (esp_msg_index >= sizeof(esp_msg_buf)) { - memset(esp_msg_buf, 0, sizeof(esp_msg_buf)); + ZERO(esp_msg_buf); esp_msg_index = 0; } return; @@ -1503,7 +1388,7 @@ void esp_data_parser(char *cmdRxBuf, int len) { head_pos = charAtArray((uint8_t const *)&cmdRxBuf[len - leftLen], leftLen, ESP_PROTOC_HEAD); if (head_pos == -1) return; - memset(esp_msg_buf, 0, sizeof(esp_msg_buf)); + ZERO(esp_msg_buf); memcpy(esp_msg_buf, &cmdRxBuf[len - leftLen + head_pos], leftLen - head_pos); esp_msg_index = leftLen - head_pos; @@ -1513,7 +1398,7 @@ void esp_data_parser(char *cmdRxBuf, int len) { tail_pos = charAtArray(esp_msg_buf, esp_msg_index, ESP_PROTOC_TAIL); if (tail_pos == -1) { if (esp_msg_index >= sizeof(esp_msg_buf)) { - memset(esp_msg_buf, 0, sizeof(esp_msg_buf)); + ZERO(esp_msg_buf); esp_msg_index = 0; } return; @@ -1521,10 +1406,13 @@ void esp_data_parser(char *cmdRxBuf, int len) { } esp_frame.type = esp_msg_buf[1]; - if ((esp_frame.type != ESP_TYPE_NET) && (esp_frame.type != ESP_TYPE_GCODE) - && (esp_frame.type != ESP_TYPE_FILE_FIRST) && (esp_frame.type != ESP_TYPE_FILE_FRAGMENT) - &&(esp_frame.type != ESP_TYPE_WIFI_LIST)) { - memset(esp_msg_buf, 0, sizeof(esp_msg_buf)); + if ( esp_frame.type != ESP_TYPE_NET + && esp_frame.type != ESP_TYPE_GCODE + && esp_frame.type != ESP_TYPE_FILE_FIRST + && esp_frame.type != ESP_TYPE_FILE_FRAGMENT + && esp_frame.type != ESP_TYPE_WIFI_LIST + ) { + ZERO(esp_msg_buf); esp_msg_index = 0; return; } @@ -1532,14 +1420,14 @@ void esp_data_parser(char *cmdRxBuf, int len) { esp_frame.dataLen = esp_msg_buf[2] + (esp_msg_buf[3] << 8); if ((int)(4 + esp_frame.dataLen) > (int)(sizeof(esp_msg_buf))) { - memset(esp_msg_buf, 0, sizeof(esp_msg_buf)); + ZERO(esp_msg_buf); esp_msg_index = 0; return; } if (esp_msg_buf[4 + esp_frame.dataLen] != ESP_PROTOC_TAIL) { if (esp_msg_index >= sizeof(esp_msg_buf)) { - memset(esp_msg_buf, 0, sizeof(esp_msg_buf)); + ZERO(esp_msg_buf); esp_msg_index = 0; } return; @@ -1568,7 +1456,7 @@ void esp_data_parser(char *cmdRxBuf, int len) { esp_msg_index = cut_msg_head(esp_msg_buf, esp_msg_index, esp_frame.dataLen + 5); if (esp_msg_index > 0) { if (charAtArray(esp_msg_buf, esp_msg_index, ESP_PROTOC_HEAD) == -1) { - memset(esp_msg_buf, 0, sizeof(esp_msg_buf)); + ZERO(esp_msg_buf); esp_msg_index = 0; return; } @@ -1626,7 +1514,7 @@ void stopEspTransfer() { void wifi_rcv_handle() { int32_t len = 0; - uint8_t ucStr[(UART_RX_BUFFER_SIZE) + 1] = {0}; + uint8_t ucStr[(UART_RX_BUFFER_SIZE) + 1] = { 0 }; int8_t getDataF = 0; if (wifi_link_state == WIFI_TRANS_FILE) { @@ -1717,7 +1605,7 @@ void wifi_rcv_handle() { } void wifi_looping() { - do { wifi_rcv_handle(); } while (wifi_link_state == WIFI_TRANS_FILE); + do { wifi_rcv_handle(); } while (wifi_link_state == WIFI_TRANS_FILE); } void mks_esp_wifi_init() { diff --git a/Marlin/src/pins/esp32/pins_E4D.h b/Marlin/src/pins/esp32/pins_E4D.h index 7b5595444c..ebb8e1af7d 100644 --- a/Marlin/src/pins/esp32/pins_E4D.h +++ b/Marlin/src/pins/esp32/pins_E4D.h @@ -42,30 +42,30 @@ // // Limit Switches // -#define X_MIN_PIN 34 -#define Y_MIN_PIN 35 -#define Z_MIN_PIN 16 // 15 +#define X_STOP_PIN 34 +#define Y_STOP_PIN 35 +#define Z_STOP_PIN 16 // // Steppers // -#define X_STEP_PIN 12 // 34//27 -#define X_DIR_PIN 13 // 35//26 -#define X_ENABLE_PIN 17 // 0//17//25 // used free pin +#define X_STEP_PIN 12 +#define X_DIR_PIN 13 +#define X_ENABLE_PIN 17 //#define X_CS_PIN 0 -#define Y_STEP_PIN 32 // 33 -#define Y_DIR_PIN 33 // 32 +#define Y_STEP_PIN 32 +#define Y_DIR_PIN 33 #define Y_ENABLE_PIN X_ENABLE_PIN //#define Y_CS_PIN 13 -#define Z_STEP_PIN 25 // 14 -#define Z_DIR_PIN 26 // 12 +#define Z_STEP_PIN 25 +#define Z_DIR_PIN 26 #define Z_ENABLE_PIN X_ENABLE_PIN //#define Z_CS_PIN 5 // SS_PIN -#define E0_STEP_PIN 27 // 16 -#define E0_DIR_PIN 14 // 17 +#define E0_STEP_PIN 27 +#define E0_DIR_PIN 14 #define E0_ENABLE_PIN X_ENABLE_PIN //#define E0_CS_PIN 21 @@ -78,9 +78,9 @@ // // Heaters / Fans // -#define HEATER_0_PIN 2 // 4//2//(D8) -#define FAN_PIN 0 // 2//15//13 (D9) -#define HEATER_BED_PIN 15 // 15//0 //(D10) +#define HEATER_0_PIN 2 +#define FAN_PIN 0 +#define HEATER_BED_PIN 15 // SPI #define SDSS 5 diff --git a/Marlin/src/pins/pins.h b/Marlin/src/pins/pins.h index 8792cd3dfa..5259b147fb 100644 --- a/Marlin/src/pins/pins.h +++ b/Marlin/src/pins/pins.h @@ -666,6 +666,7 @@ // // Custom board (with custom PIO env) // + #elif MB(CUSTOM) #include "pins_custom.h" // env:custom diff --git a/platformio.ini b/platformio.ini index 9d5f6c5ab8..8416b93a27 100644 --- a/platformio.ini +++ b/platformio.ini @@ -977,7 +977,6 @@ extends = env:mks_robin extra_scripts = ${common.extra_scripts} buildroot/share/PlatformIO/scripts/mks_robin_pro.py - # # TRIGORILLA PRO (STM32F103ZET6) # @@ -1026,7 +1025,6 @@ board = genericSTM32F103RC extra_scripts = ${common.extra_scripts} buildroot/share/PlatformIO/scripts/mks_robin_lite.py - # # MKS ROBIN LITE3 (STM32F103RCT6) # From cf74248949cd91f601f270cc68a94d65caef3a6b Mon Sep 17 00:00:00 2001 From: TheMichalcinOfficial <73078661+TheMichalcinOfficial@users.noreply.github.com> Date: Wed, 21 Oct 2020 20:44:55 +0200 Subject: [PATCH 075/226] Support for Ramps-S v1.2 (#19815) --- Marlin/src/core/boards.h | 3 + Marlin/src/pins/pins.h | 6 + Marlin/src/pins/ramps/pins_RAMPS.h | 2 +- Marlin/src/pins/ramps/pins_RAMPS_S_12.h | 275 ++++++++++++++++++++++++ 4 files changed, 285 insertions(+), 1 deletion(-) create mode 100644 Marlin/src/pins/ramps/pins_RAMPS_S_12.h diff --git a/Marlin/src/core/boards.h b/Marlin/src/core/boards.h index da7d15ec33..605f2e74a4 100644 --- a/Marlin/src/core/boards.h +++ b/Marlin/src/core/boards.h @@ -109,6 +109,9 @@ #define BOARD_COPYMASTER_3D 1153 // Copymaster 3D #define BOARD_ORTUR_4 1154 // Ortur 4 #define BOARD_TENLOG_D3_HERO 1155 // Tenlog D3 Hero IDEX printer +#define BOARD_RAMPS_S_12_EEFB 1156 // Ramps S 1.2 by Sakul.cz (Power outputs: Hotend0, Hotend1, Fan, Bed) +#define BOARD_RAMPS_S_12_EEEB 1157 // Ramps S 1.2 by Sakul.cz (Power outputs: Hotend0, Hotend1, Hotend2, Bed) +#define BOARD_RAMPS_S_12_EFFB 1158 // Ramps S 1.2 by Sakul.cz (Power outputs: Hotend, Fan0, Fan1, Bed) // // RAMBo and derivatives diff --git a/Marlin/src/pins/pins.h b/Marlin/src/pins/pins.h index 5259b147fb..1e2da66228 100644 --- a/Marlin/src/pins/pins.h +++ b/Marlin/src/pins/pins.h @@ -207,6 +207,12 @@ #include "ramps/pins_TENLOG_D3_HERO.h" // ATmega2560 env:mega2560 #elif MB(MKS_GEN_L_V21) #include "ramps/pins_MKS_GEN_L_V21.h" // ATmega2560 env:mega2560 +#elif MB(RAMPS_S_12_EEFB) + #include "ramps/pins_RAMPS_S_12.h" // ATmega2560 env:mega2560 +#elif MB(RAMPS_S_12_EEEB) + #include "ramps/pins_RAMPS_S_12.h" // ATmega2560 env:mega2560 +#elif MB(RAMPS_S_12_EFFB) + #include "ramps/pins_RAMPS_S_12.h" // ATmega2560 env:mega2560 // // RAMBo and derivatives diff --git a/Marlin/src/pins/ramps/pins_RAMPS.h b/Marlin/src/pins/ramps/pins_RAMPS.h index c8578f2fa1..69a80d6b27 100644 --- a/Marlin/src/pins/ramps/pins_RAMPS.h +++ b/Marlin/src/pins/ramps/pins_RAMPS.h @@ -52,7 +52,7 @@ #endif #if NOT_TARGET(IS_RAMPS_SMART, IS_RAMPS_DUO, IS_RAMPS4DUE, TARGET_LPC1768, __AVR_ATmega1280__, __AVR_ATmega2560__) - #error "Oops! Select 'Arduino/Genuino Mega or Mega 2560' in 'Tools > Board.'" + #error "Oops! Select 'Arduino/Genuino Mega or Mega 2560' (or other appropriate target) in 'Tools > Board.'" #endif // Custom flags and defines for the build diff --git a/Marlin/src/pins/ramps/pins_RAMPS_S_12.h b/Marlin/src/pins/ramps/pins_RAMPS_S_12.h new file mode 100644 index 0000000000..1e063c269d --- /dev/null +++ b/Marlin/src/pins/ramps/pins_RAMPS_S_12.h @@ -0,0 +1,275 @@ +/** + * Marlin 3D Printer Firmware + * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] + * + * Based on Sprinter and grbl. + * Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + * + */ +#pragma once + +/** + * Arduino Mega with RAMPS-S v1.2 by Sakul.cz pin assignments + * Written by Michal Rábek + * + * Applies to the following boards: + * + * BOARD_RAMPS_S_12_EEFB Ramps S 1.2 (Hotend0, Hotend1, Fan, Bed) + * BOARD_RAMPS_S_12_EEEB Ramps S 1.2 (Hotend0, Hotend1, Hotend2, Bed) + * BOARD_RAMPS_S_12_EFFB Ramps S 1.2 (Hotend, Fan0, Fan1, Bed) + * + * Other pins_MYBOARD.h files may override these defaults + */ + +#if NOT_TARGET(__AVR_ATmega1280__, __AVR_ATmega2560__) + #error "Oops! Select 'Arduino/Genuino Mega or Mega 2560' in 'Tools > Board.'" +#endif + +// Custom flags and defines for the build +//#define BOARD_CUSTOM_BUILD_FLAGS -D__FOO__ + +#ifndef BOARD_INFO_NAME + #define BOARD_INFO_NAME "RAMPS S 1.2" +#endif + +// +// Servos +// +#ifndef SERVO0_PIN + #define SERVO0_PIN 10 +#endif +#ifndef SERVO1_PIN + #define SERVO1_PIN 11 +#endif +#ifndef SERVO2_PIN + #define SERVO2_PIN 12 +#endif +#ifndef SERVO3_PIN + #define SERVO3_PIN 44 +#endif + +// +// Limit Switches +// +#ifndef X_STOP_PIN + #ifndef X_MIN_PIN + #define X_MIN_PIN 37 + #endif + #ifndef X_MAX_PIN + #define X_MAX_PIN 36 + #endif +#endif +#ifndef Y_STOP_PIN + #ifndef Y_MIN_PIN + #define Y_MIN_PIN 35 + #endif + #ifndef Y_MAX_PIN + #define Y_MAX_PIN 34 + #endif +#endif +#ifndef Z_STOP_PIN + #ifndef Z_MIN_PIN + #define Z_MIN_PIN 33 + #endif + #ifndef Z_MAX_PIN + #define Z_MAX_PIN 32 + #endif +#endif + +// +// Z Probe (when not Z_MIN_PIN) +// +#ifndef Z_MIN_PROBE_PIN + #define Z_MIN_PROBE_PIN 5 +#endif + +// +// Filament Runout Sensor +// +#ifndef FIL_RUNOUT_PIN + #define FIL_RUNOUT_PIN 44 // RAMPS_S S3 on the servos connector +#endif + +// +// Steppers +// +#define X_STEP_PIN 17 +#define X_DIR_PIN 16 +#define X_ENABLE_PIN 48 + +#define Y_STEP_PIN 54 +#define Y_DIR_PIN 47 +#define Y_ENABLE_PIN 55 + +#ifndef Z_STEP_PIN + #define Z_STEP_PIN 57 +#endif +#define Z_DIR_PIN 56 +#define Z_ENABLE_PIN 62 + +#define E0_STEP_PIN 23 +#define E0_DIR_PIN 22 +#define E0_ENABLE_PIN 24 + +#define E1_STEP_PIN 26 +#define E1_DIR_PIN 25 +#define E1_ENABLE_PIN 27 + +#define E2_STEP_PIN 29 +#define E2_DIR_PIN 28 +#define E2_ENABLE_PIN 39 + +// +// Temperature Sensors +// +#ifndef TEMP_0_PIN + #define TEMP_0_PIN 15 // Analog Input +#endif +#ifndef TEMP_1_PIN + #define TEMP_1_PIN 14 // Analog Input +#endif +#ifndef TEMP_2_PIN + #define TEMP_2_PIN 13 // Analog Input +#endif +#ifndef TEMP_3_PIN + #define TEMP_3_PIN 12 // Analog Input +#endif +#ifndef TEMP_BED_PIN + #define TEMP_BED_PIN 11 // Analog Input +#endif + +// +// Heaters / Fans +// +#ifndef MOSFET_D_PIN + #define MOSFET_D_PIN -1 +#endif +#ifndef RAMPS_S_HE_0 + #define RAMPS_S_HE_0 2 +#endif +#ifndef RAMPS_S_HE_1 + #define RAMPS_S_HE_1 3 +#endif +#ifndef RAMPS_S_HE_2 + #define RAMPS_S_HE_2 6 +#endif + +#define HEATER_BED_PIN 9 + +#define HEATER_0_PIN RAMPS_S_HE_0 + +#if MB(RAMPS_S_12_EEFB) // Hotend0, Hotend1, Fan, Bed + #define HEATER_1_PIN RAMPS_S_HE_1 + #define FAN_PIN RAMPS_S_HE_2 +#elif MB(RAMPS_S_12_EEEB) // Hotend0, Hotend1, Hotend2, Bed + #define HEATER_1_PIN RAMPS_S_HE_1 + #define HEATER_2_PIN RAMPS_S_HE_2 +#elif MB(RAMPS_S_12_EFFB) // Hotend, Fan0, Fan1, Bed + #define FAN_PIN RAMPS_S_HE_1 + #define FAN1_PIN RAMPS_S_HE_2 +#endif + +// +// Misc. Functions +// +#define SDSS 53 +#define LED_PIN 13 + +#ifndef KILL_PIN + #define KILL_PIN 46 +#endif + +#ifndef FILWIDTH_PIN + #define FILWIDTH_PIN 60 // Analog Input on EXTEND +#endif + +#ifndef PS_ON_PIN + #define PS_ON_PIN 12 // RAMPS_S S2 on the servos connector +#endif + +#if ENABLED(CASE_LIGHT_ENABLE) && !defined(CASE_LIGHT_PIN) && !defined(SPINDLE_LASER_ENA_PIN) + #if NUM_SERVOS <= 1 // Prefer the servo connector + #define CASE_LIGHT_PIN 12 // Hardware PWM (RAMPS_S S1 on the servos connector) + #elif HAS_FREE_AUX2_PINS + #define CASE_LIGHT_PIN 44 // Hardware PWM + #endif +#endif + +// +// M3/M4/M5 - Spindle/Laser Control +// +#if HAS_CUTTER && !defined(SPINDLE_LASER_ENA_PIN) + #define SPINDLE_LASER_ENA_PIN 4 // Pullup or pulldown! + #define SPINDLE_LASER_PWM_PIN 6 // Hardware PWM + #define SPINDLE_DIR_PIN 5 +#endif + +// +// TMC software SPI +// +#if ENABLED(TMC_USE_SW_SPI) + #ifndef TMC_SW_MOSI + #define TMC_SW_MOSI 51 + #endif + #ifndef TMC_SW_MISO + #define TMC_SW_MISO 50 + #endif + #ifndef TMC_SW_SCK + #define TMC_SW_SCK 53 + #endif +#endif + +// +// Průša i3 MK2 Multiplexer Support +// +#ifndef E_MUX0_PIN + #define E_MUX0_PIN 29 // E2_STEP_PIN +#endif +#ifndef E_MUX1_PIN + #define E_MUX1_PIN 28 // E2_DIR_PIN +#endif +#ifndef E_MUX2_PIN + #define E_MUX2_PIN 39 // E2_ENABLE_PIN +#endif + +////////////////////////// +// LCDs and Controllers // +////////////////////////// + +// +// LCD Display output pins +// +#if HAS_WIRED_LCD + #define BEEPER_PIN 45 + #define LCD_PINS_RS 19 + #define LCD_PINS_ENABLE 49 + #define LCD_PINS_D4 18 + #define LCD_PINS_D5 30 + #define LCD_PINS_D6 41 + #define LCD_PINS_D7 31 + #ifndef SD_DETECT_PIN + #define SD_DETECT_PIN 38 + #endif +#endif + +// +// LCD Display input pins +// +#if IS_NEWPANEL + #define BTN_EN1 40 + #define BTN_EN2 42 + #define BTN_ENC 43 +#endif From 4fe4fb05858e929db288e78b9a507d4b1a608dde Mon Sep 17 00:00:00 2001 From: Mauro Date: Wed, 21 Oct 2020 20:51:14 +0200 Subject: [PATCH 076/226] Fresh Web GUI (based on bootstrap.js) (#19812) --- data/www/bootstrap.min.css | 6 + data/www/bootstrap.min.js | 6 + data/www/bootstrap4-toggle.min.js | 10 + data/www/chart.lineargauge.js | 234 ++++++++ data/www/chart.min.js | 7 + data/www/filesaver.min.js | 1 + data/www/index-ie.html | 22 + data/www/index.html | 766 +++++++++++++++++++++++++- data/www/jquery-3.5.1.slim.min.js | 2 + data/www/jquery.browser.min.js | 10 + data/www/marlin-logo-dark.png | Bin 0 -> 881 bytes data/www/marlin-logo.png | Bin 2349 -> 0 bytes data/www/marlin.css | 166 ------ data/www/marlin.js | 24 - data/www/marlinui.eot | Bin 0 -> 9456 bytes data/www/marlinui.svg | 56 ++ data/www/marlinui.ttf | Bin 0 -> 9288 bytes data/www/marlinui.woff | Bin 0 -> 6632 bytes data/www/moment.min.js | 7 + data/www/webmarlin-class.js | 426 +++++++++++++++ data/www/webmarlin-font.css | 169 ++++++ data/www/webmarlin.css | 45 ++ data/www/webmarlin.js | 872 ++++++++++++++++++++++++++++++ 23 files changed, 2612 insertions(+), 217 deletions(-) create mode 100644 data/www/bootstrap.min.css create mode 100644 data/www/bootstrap.min.js create mode 100644 data/www/bootstrap4-toggle.min.js create mode 100644 data/www/chart.lineargauge.js create mode 100644 data/www/chart.min.js create mode 100644 data/www/filesaver.min.js create mode 100644 data/www/index-ie.html create mode 100644 data/www/jquery-3.5.1.slim.min.js create mode 100644 data/www/jquery.browser.min.js create mode 100644 data/www/marlin-logo-dark.png delete mode 100644 data/www/marlin-logo.png delete mode 100644 data/www/marlin.css delete mode 100644 data/www/marlin.js create mode 100644 data/www/marlinui.eot create mode 100644 data/www/marlinui.svg create mode 100644 data/www/marlinui.ttf create mode 100644 data/www/marlinui.woff create mode 100644 data/www/moment.min.js create mode 100644 data/www/webmarlin-class.js create mode 100644 data/www/webmarlin-font.css create mode 100644 data/www/webmarlin.css create mode 100644 data/www/webmarlin.js diff --git a/data/www/bootstrap.min.css b/data/www/bootstrap.min.css new file mode 100644 index 0000000000..387b56b2cc --- /dev/null +++ b/data/www/bootstrap.min.css @@ -0,0 +1,6 @@ +/*! + * Bootstrap v4.5.0 (https://getbootstrap.com/) + * Copyright 2011-2020 The Bootstrap Authors + * Copyright 2011-2020 Twitter, Inc. + * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE) + */:root{--blue:#007bff;--indigo:#6610f2;--purple:#6f42c1;--pink:#e83e8c;--red:#dc3545;--orange:#fd7e14;--yellow:#ffc107;--green:#28a745;--teal:#20c997;--cyan:#17a2b8;--white:#fff;--gray:#6c757d;--gray-dark:#343a40;--primary:#007bff;--secondary:#6c757d;--success:#28a745;--info:#17a2b8;--warning:#ffc107;--danger:#dc3545;--light:#f8f9fa;--dark:#343a40;--breakpoint-xs:0;--breakpoint-sm:576px;--breakpoint-md:768px;--breakpoint-lg:992px;--breakpoint-xl:1200px;--font-family-sans-serif:-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,"Helvetica Neue",Arial,"Noto Sans",sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol","Noto Color Emoji";--font-family-monospace:SFMono-Regular,Menlo,Monaco,Consolas,"Liberation Mono","Courier New",monospace}*,::after,::before{box-sizing:border-box}html{font-family:sans-serif;line-height:1.15;-webkit-text-size-adjust:100%;-webkit-tap-highlight-color:transparent}article,aside,figcaption,figure,footer,header,hgroup,main,nav,section{display:block}body{margin:0;font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,"Helvetica Neue",Arial,"Noto Sans",sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol","Noto Color Emoji";font-size:1rem;font-weight:400;line-height:1.5;color:#212529;text-align:left;background-color:#fff}[tabindex="-1"]:focus:not(:focus-visible){outline:0!important}hr{box-sizing:content-box;height:0;overflow:visible}h1,h2,h3,h4,h5,h6{margin-top:0;margin-bottom:.5rem}p{margin-top:0;margin-bottom:1rem}abbr[data-original-title],abbr[title]{text-decoration:underline;-webkit-text-decoration:underline dotted;text-decoration:underline dotted;cursor:help;border-bottom:0;-webkit-text-decoration-skip-ink:none;text-decoration-skip-ink:none}address{margin-bottom:1rem;font-style:normal;line-height:inherit}dl,ol,ul{margin-top:0;margin-bottom:1rem}ol ol,ol ul,ul ol,ul ul{margin-bottom:0}dt{font-weight:700}dd{margin-bottom:.5rem;margin-left:0}blockquote{margin:0 0 1rem}b,strong{font-weight:bolder}small{font-size:80%}sub,sup{position:relative;font-size:75%;line-height:0;vertical-align:baseline}sub{bottom:-.25em}sup{top:-.5em}a{color:#007bff;text-decoration:none;background-color:transparent}a:hover{color:#0056b3;text-decoration:underline}a:not([href]){color:inherit;text-decoration:none}a:not([href]):hover{color:inherit;text-decoration:none}code,kbd,pre,samp{font-family:SFMono-Regular,Menlo,Monaco,Consolas,"Liberation Mono","Courier New",monospace;font-size:1em}pre{margin-top:0;margin-bottom:1rem;overflow:auto;-ms-overflow-style:scrollbar}figure{margin:0 0 1rem}img{vertical-align:middle;border-style:none}svg{overflow:hidden;vertical-align:middle}table{border-collapse:collapse}caption{padding-top:.75rem;padding-bottom:.75rem;color:#6c757d;text-align:left;caption-side:bottom}th{text-align:inherit}label{display:inline-block;margin-bottom:.5rem}button{border-radius:0}button:focus{outline:1px dotted;outline:5px auto -webkit-focus-ring-color}button,input,optgroup,select,textarea{margin:0;font-family:inherit;font-size:inherit;line-height:inherit}button,input{overflow:visible}button,select{text-transform:none}[role=button]{cursor:pointer}select{word-wrap:normal}[type=button],[type=reset],[type=submit],button{-webkit-appearance:button}[type=button]:not(:disabled),[type=reset]:not(:disabled),[type=submit]:not(:disabled),button:not(:disabled){cursor:pointer}[type=button]::-moz-focus-inner,[type=reset]::-moz-focus-inner,[type=submit]::-moz-focus-inner,button::-moz-focus-inner{padding:0;border-style:none}input[type=checkbox],input[type=radio]{box-sizing:border-box;padding:0}textarea{overflow:auto;resize:vertical}fieldset{min-width:0;padding:0;margin:0;border:0}legend{display:block;width:100%;max-width:100%;padding:0;margin-bottom:.5rem;font-size:1.5rem;line-height:inherit;color:inherit;white-space:normal}progress{vertical-align:baseline}[type=number]::-webkit-inner-spin-button,[type=number]::-webkit-outer-spin-button{height:auto}[type=search]{outline-offset:-2px;-webkit-appearance:none}[type=search]::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{font:inherit;-webkit-appearance:button}output{display:inline-block}summary{display:list-item;cursor:pointer}template{display:none}[hidden]{display:none!important}.h1,.h2,.h3,.h4,.h5,.h6,h1,h2,h3,h4,h5,h6{margin-bottom:.5rem;font-weight:500;line-height:1.2}.h1,h1{font-size:2.5rem}.h2,h2{font-size:2rem}.h3,h3{font-size:1.75rem}.h4,h4{font-size:1.5rem}.h5,h5{font-size:1.25rem}.h6,h6{font-size:1rem}.lead{font-size:1.25rem;font-weight:300}.display-1{font-size:6rem;font-weight:300;line-height:1.2}.display-2{font-size:5.5rem;font-weight:300;line-height:1.2}.display-3{font-size:4.5rem;font-weight:300;line-height:1.2}.display-4{font-size:3.5rem;font-weight:300;line-height:1.2}hr{margin-top:1rem;margin-bottom:1rem;border:0;border-top:1px solid rgba(0,0,0,.1)}.small,small{font-size:80%;font-weight:400}.mark,mark{padding:.2em;background-color:#fcf8e3}.list-unstyled{padding-left:0;list-style:none}.list-inline{padding-left:0;list-style:none}.list-inline-item{display:inline-block}.list-inline-item:not(:last-child){margin-right:.5rem}.initialism{font-size:90%;text-transform:uppercase}.blockquote{margin-bottom:1rem;font-size:1.25rem}.blockquote-footer{display:block;font-size:80%;color:#6c757d}.blockquote-footer::before{content:"\2014\00A0"}.img-fluid{max-width:100%;height:auto}.img-thumbnail{padding:.25rem;background-color:#fff;border:1px solid #dee2e6;border-radius:.25rem;max-width:100%;height:auto}.figure{display:inline-block}.figure-img{margin-bottom:.5rem;line-height:1}.figure-caption{font-size:90%;color:#6c757d}code{font-size:87.5%;color:#e83e8c;word-wrap:break-word}a>code{color:inherit}kbd{padding:.2rem .4rem;font-size:87.5%;color:#fff;background-color:#212529;border-radius:.2rem}kbd kbd{padding:0;font-size:100%;font-weight:700}pre{display:block;font-size:87.5%;color:#212529}pre code{font-size:inherit;color:inherit;word-break:normal}.pre-scrollable{max-height:340px;overflow-y:scroll}.container{width:100%;padding-right:15px;padding-left:15px;margin-right:auto;margin-left:auto}@media (min-width:576px){.container{max-width:540px}}@media (min-width:768px){.container{max-width:720px}}@media (min-width:992px){.container{max-width:960px}}@media (min-width:1200px){.container{max-width:1140px}}.container-fluid,.container-lg,.container-md,.container-sm,.container-xl{width:100%;padding-right:15px;padding-left:15px;margin-right:auto;margin-left:auto}@media (min-width:576px){.container,.container-sm{max-width:540px}}@media (min-width:768px){.container,.container-md,.container-sm{max-width:720px}}@media (min-width:992px){.container,.container-lg,.container-md,.container-sm{max-width:960px}}@media (min-width:1200px){.container,.container-lg,.container-md,.container-sm,.container-xl{max-width:1140px}}.row{display:-ms-flexbox;display:flex;-ms-flex-wrap:wrap;flex-wrap:wrap;margin-right:-15px;margin-left:-15px}.no-gutters{margin-right:0;margin-left:0}.no-gutters>.col,.no-gutters>[class*=col-]{padding-right:0;padding-left:0}.col,.col-1,.col-10,.col-11,.col-12,.col-2,.col-3,.col-4,.col-5,.col-6,.col-7,.col-8,.col-9,.col-auto,.col-lg,.col-lg-1,.col-lg-10,.col-lg-11,.col-lg-12,.col-lg-2,.col-lg-3,.col-lg-4,.col-lg-5,.col-lg-6,.col-lg-7,.col-lg-8,.col-lg-9,.col-lg-auto,.col-md,.col-md-1,.col-md-10,.col-md-11,.col-md-12,.col-md-2,.col-md-3,.col-md-4,.col-md-5,.col-md-6,.col-md-7,.col-md-8,.col-md-9,.col-md-auto,.col-sm,.col-sm-1,.col-sm-10,.col-sm-11,.col-sm-12,.col-sm-2,.col-sm-3,.col-sm-4,.col-sm-5,.col-sm-6,.col-sm-7,.col-sm-8,.col-sm-9,.col-sm-auto,.col-xl,.col-xl-1,.col-xl-10,.col-xl-11,.col-xl-12,.col-xl-2,.col-xl-3,.col-xl-4,.col-xl-5,.col-xl-6,.col-xl-7,.col-xl-8,.col-xl-9,.col-xl-auto{position:relative;width:100%;padding-right:15px;padding-left:15px}.col{-ms-flex-preferred-size:0;flex-basis:0;-ms-flex-positive:1;flex-grow:1;min-width:0;max-width:100%}.row-cols-1>*{-ms-flex:0 0 100%;flex:0 0 100%;max-width:100%}.row-cols-2>*{-ms-flex:0 0 50%;flex:0 0 50%;max-width:50%}.row-cols-3>*{-ms-flex:0 0 33.333333%;flex:0 0 33.333333%;max-width:33.333333%}.row-cols-4>*{-ms-flex:0 0 25%;flex:0 0 25%;max-width:25%}.row-cols-5>*{-ms-flex:0 0 20%;flex:0 0 20%;max-width:20%}.row-cols-6>*{-ms-flex:0 0 16.666667%;flex:0 0 16.666667%;max-width:16.666667%}.col-auto{-ms-flex:0 0 auto;flex:0 0 auto;width:auto;max-width:100%}.col-1{-ms-flex:0 0 8.333333%;flex:0 0 8.333333%;max-width:8.333333%}.col-2{-ms-flex:0 0 16.666667%;flex:0 0 16.666667%;max-width:16.666667%}.col-3{-ms-flex:0 0 25%;flex:0 0 25%;max-width:25%}.col-4{-ms-flex:0 0 33.333333%;flex:0 0 33.333333%;max-width:33.333333%}.col-5{-ms-flex:0 0 41.666667%;flex:0 0 41.666667%;max-width:41.666667%}.col-6{-ms-flex:0 0 50%;flex:0 0 50%;max-width:50%}.col-7{-ms-flex:0 0 58.333333%;flex:0 0 58.333333%;max-width:58.333333%}.col-8{-ms-flex:0 0 66.666667%;flex:0 0 66.666667%;max-width:66.666667%}.col-9{-ms-flex:0 0 75%;flex:0 0 75%;max-width:75%}.col-10{-ms-flex:0 0 83.333333%;flex:0 0 83.333333%;max-width:83.333333%}.col-11{-ms-flex:0 0 91.666667%;flex:0 0 91.666667%;max-width:91.666667%}.col-12{-ms-flex:0 0 100%;flex:0 0 100%;max-width:100%}.order-first{-ms-flex-order:-1;order:-1}.order-last{-ms-flex-order:13;order:13}.order-0{-ms-flex-order:0;order:0}.order-1{-ms-flex-order:1;order:1}.order-2{-ms-flex-order:2;order:2}.order-3{-ms-flex-order:3;order:3}.order-4{-ms-flex-order:4;order:4}.order-5{-ms-flex-order:5;order:5}.order-6{-ms-flex-order:6;order:6}.order-7{-ms-flex-order:7;order:7}.order-8{-ms-flex-order:8;order:8}.order-9{-ms-flex-order:9;order:9}.order-10{-ms-flex-order:10;order:10}.order-11{-ms-flex-order:11;order:11}.order-12{-ms-flex-order:12;order:12}.offset-1{margin-left:8.333333%}.offset-2{margin-left:16.666667%}.offset-3{margin-left:25%}.offset-4{margin-left:33.333333%}.offset-5{margin-left:41.666667%}.offset-6{margin-left:50%}.offset-7{margin-left:58.333333%}.offset-8{margin-left:66.666667%}.offset-9{margin-left:75%}.offset-10{margin-left:83.333333%}.offset-11{margin-left:91.666667%}@media (min-width:576px){.col-sm{-ms-flex-preferred-size:0;flex-basis:0;-ms-flex-positive:1;flex-grow:1;min-width:0;max-width:100%}.row-cols-sm-1>*{-ms-flex:0 0 100%;flex:0 0 100%;max-width:100%}.row-cols-sm-2>*{-ms-flex:0 0 50%;flex:0 0 50%;max-width:50%}.row-cols-sm-3>*{-ms-flex:0 0 33.333333%;flex:0 0 33.333333%;max-width:33.333333%}.row-cols-sm-4>*{-ms-flex:0 0 25%;flex:0 0 25%;max-width:25%}.row-cols-sm-5>*{-ms-flex:0 0 20%;flex:0 0 20%;max-width:20%}.row-cols-sm-6>*{-ms-flex:0 0 16.666667%;flex:0 0 16.666667%;max-width:16.666667%}.col-sm-auto{-ms-flex:0 0 auto;flex:0 0 auto;width:auto;max-width:100%}.col-sm-1{-ms-flex:0 0 8.333333%;flex:0 0 8.333333%;max-width:8.333333%}.col-sm-2{-ms-flex:0 0 16.666667%;flex:0 0 16.666667%;max-width:16.666667%}.col-sm-3{-ms-flex:0 0 25%;flex:0 0 25%;max-width:25%}.col-sm-4{-ms-flex:0 0 33.333333%;flex:0 0 33.333333%;max-width:33.333333%}.col-sm-5{-ms-flex:0 0 41.666667%;flex:0 0 41.666667%;max-width:41.666667%}.col-sm-6{-ms-flex:0 0 50%;flex:0 0 50%;max-width:50%}.col-sm-7{-ms-flex:0 0 58.333333%;flex:0 0 58.333333%;max-width:58.333333%}.col-sm-8{-ms-flex:0 0 66.666667%;flex:0 0 66.666667%;max-width:66.666667%}.col-sm-9{-ms-flex:0 0 75%;flex:0 0 75%;max-width:75%}.col-sm-10{-ms-flex:0 0 83.333333%;flex:0 0 83.333333%;max-width:83.333333%}.col-sm-11{-ms-flex:0 0 91.666667%;flex:0 0 91.666667%;max-width:91.666667%}.col-sm-12{-ms-flex:0 0 100%;flex:0 0 100%;max-width:100%}.order-sm-first{-ms-flex-order:-1;order:-1}.order-sm-last{-ms-flex-order:13;order:13}.order-sm-0{-ms-flex-order:0;order:0}.order-sm-1{-ms-flex-order:1;order:1}.order-sm-2{-ms-flex-order:2;order:2}.order-sm-3{-ms-flex-order:3;order:3}.order-sm-4{-ms-flex-order:4;order:4}.order-sm-5{-ms-flex-order:5;order:5}.order-sm-6{-ms-flex-order:6;order:6}.order-sm-7{-ms-flex-order:7;order:7}.order-sm-8{-ms-flex-order:8;order:8}.order-sm-9{-ms-flex-order:9;order:9}.order-sm-10{-ms-flex-order:10;order:10}.order-sm-11{-ms-flex-order:11;order:11}.order-sm-12{-ms-flex-order:12;order:12}.offset-sm-0{margin-left:0}.offset-sm-1{margin-left:8.333333%}.offset-sm-2{margin-left:16.666667%}.offset-sm-3{margin-left:25%}.offset-sm-4{margin-left:33.333333%}.offset-sm-5{margin-left:41.666667%}.offset-sm-6{margin-left:50%}.offset-sm-7{margin-left:58.333333%}.offset-sm-8{margin-left:66.666667%}.offset-sm-9{margin-left:75%}.offset-sm-10{margin-left:83.333333%}.offset-sm-11{margin-left:91.666667%}}@media (min-width:768px){.col-md{-ms-flex-preferred-size:0;flex-basis:0;-ms-flex-positive:1;flex-grow:1;min-width:0;max-width:100%}.row-cols-md-1>*{-ms-flex:0 0 100%;flex:0 0 100%;max-width:100%}.row-cols-md-2>*{-ms-flex:0 0 50%;flex:0 0 50%;max-width:50%}.row-cols-md-3>*{-ms-flex:0 0 33.333333%;flex:0 0 33.333333%;max-width:33.333333%}.row-cols-md-4>*{-ms-flex:0 0 25%;flex:0 0 25%;max-width:25%}.row-cols-md-5>*{-ms-flex:0 0 20%;flex:0 0 20%;max-width:20%}.row-cols-md-6>*{-ms-flex:0 0 16.666667%;flex:0 0 16.666667%;max-width:16.666667%}.col-md-auto{-ms-flex:0 0 auto;flex:0 0 auto;width:auto;max-width:100%}.col-md-1{-ms-flex:0 0 8.333333%;flex:0 0 8.333333%;max-width:8.333333%}.col-md-2{-ms-flex:0 0 16.666667%;flex:0 0 16.666667%;max-width:16.666667%}.col-md-3{-ms-flex:0 0 25%;flex:0 0 25%;max-width:25%}.col-md-4{-ms-flex:0 0 33.333333%;flex:0 0 33.333333%;max-width:33.333333%}.col-md-5{-ms-flex:0 0 41.666667%;flex:0 0 41.666667%;max-width:41.666667%}.col-md-6{-ms-flex:0 0 50%;flex:0 0 50%;max-width:50%}.col-md-7{-ms-flex:0 0 58.333333%;flex:0 0 58.333333%;max-width:58.333333%}.col-md-8{-ms-flex:0 0 66.666667%;flex:0 0 66.666667%;max-width:66.666667%}.col-md-9{-ms-flex:0 0 75%;flex:0 0 75%;max-width:75%}.col-md-10{-ms-flex:0 0 83.333333%;flex:0 0 83.333333%;max-width:83.333333%}.col-md-11{-ms-flex:0 0 91.666667%;flex:0 0 91.666667%;max-width:91.666667%}.col-md-12{-ms-flex:0 0 100%;flex:0 0 100%;max-width:100%}.order-md-first{-ms-flex-order:-1;order:-1}.order-md-last{-ms-flex-order:13;order:13}.order-md-0{-ms-flex-order:0;order:0}.order-md-1{-ms-flex-order:1;order:1}.order-md-2{-ms-flex-order:2;order:2}.order-md-3{-ms-flex-order:3;order:3}.order-md-4{-ms-flex-order:4;order:4}.order-md-5{-ms-flex-order:5;order:5}.order-md-6{-ms-flex-order:6;order:6}.order-md-7{-ms-flex-order:7;order:7}.order-md-8{-ms-flex-order:8;order:8}.order-md-9{-ms-flex-order:9;order:9}.order-md-10{-ms-flex-order:10;order:10}.order-md-11{-ms-flex-order:11;order:11}.order-md-12{-ms-flex-order:12;order:12}.offset-md-0{margin-left:0}.offset-md-1{margin-left:8.333333%}.offset-md-2{margin-left:16.666667%}.offset-md-3{margin-left:25%}.offset-md-4{margin-left:33.333333%}.offset-md-5{margin-left:41.666667%}.offset-md-6{margin-left:50%}.offset-md-7{margin-left:58.333333%}.offset-md-8{margin-left:66.666667%}.offset-md-9{margin-left:75%}.offset-md-10{margin-left:83.333333%}.offset-md-11{margin-left:91.666667%}}@media (min-width:992px){.col-lg{-ms-flex-preferred-size:0;flex-basis:0;-ms-flex-positive:1;flex-grow:1;min-width:0;max-width:100%}.row-cols-lg-1>*{-ms-flex:0 0 100%;flex:0 0 100%;max-width:100%}.row-cols-lg-2>*{-ms-flex:0 0 50%;flex:0 0 50%;max-width:50%}.row-cols-lg-3>*{-ms-flex:0 0 33.333333%;flex:0 0 33.333333%;max-width:33.333333%}.row-cols-lg-4>*{-ms-flex:0 0 25%;flex:0 0 25%;max-width:25%}.row-cols-lg-5>*{-ms-flex:0 0 20%;flex:0 0 20%;max-width:20%}.row-cols-lg-6>*{-ms-flex:0 0 16.666667%;flex:0 0 16.666667%;max-width:16.666667%}.col-lg-auto{-ms-flex:0 0 auto;flex:0 0 auto;width:auto;max-width:100%}.col-lg-1{-ms-flex:0 0 8.333333%;flex:0 0 8.333333%;max-width:8.333333%}.col-lg-2{-ms-flex:0 0 16.666667%;flex:0 0 16.666667%;max-width:16.666667%}.col-lg-3{-ms-flex:0 0 25%;flex:0 0 25%;max-width:25%}.col-lg-4{-ms-flex:0 0 33.333333%;flex:0 0 33.333333%;max-width:33.333333%}.col-lg-5{-ms-flex:0 0 41.666667%;flex:0 0 41.666667%;max-width:41.666667%}.col-lg-6{-ms-flex:0 0 50%;flex:0 0 50%;max-width:50%}.col-lg-7{-ms-flex:0 0 58.333333%;flex:0 0 58.333333%;max-width:58.333333%}.col-lg-8{-ms-flex:0 0 66.666667%;flex:0 0 66.666667%;max-width:66.666667%}.col-lg-9{-ms-flex:0 0 75%;flex:0 0 75%;max-width:75%}.col-lg-10{-ms-flex:0 0 83.333333%;flex:0 0 83.333333%;max-width:83.333333%}.col-lg-11{-ms-flex:0 0 91.666667%;flex:0 0 91.666667%;max-width:91.666667%}.col-lg-12{-ms-flex:0 0 100%;flex:0 0 100%;max-width:100%}.order-lg-first{-ms-flex-order:-1;order:-1}.order-lg-last{-ms-flex-order:13;order:13}.order-lg-0{-ms-flex-order:0;order:0}.order-lg-1{-ms-flex-order:1;order:1}.order-lg-2{-ms-flex-order:2;order:2}.order-lg-3{-ms-flex-order:3;order:3}.order-lg-4{-ms-flex-order:4;order:4}.order-lg-5{-ms-flex-order:5;order:5}.order-lg-6{-ms-flex-order:6;order:6}.order-lg-7{-ms-flex-order:7;order:7}.order-lg-8{-ms-flex-order:8;order:8}.order-lg-9{-ms-flex-order:9;order:9}.order-lg-10{-ms-flex-order:10;order:10}.order-lg-11{-ms-flex-order:11;order:11}.order-lg-12{-ms-flex-order:12;order:12}.offset-lg-0{margin-left:0}.offset-lg-1{margin-left:8.333333%}.offset-lg-2{margin-left:16.666667%}.offset-lg-3{margin-left:25%}.offset-lg-4{margin-left:33.333333%}.offset-lg-5{margin-left:41.666667%}.offset-lg-6{margin-left:50%}.offset-lg-7{margin-left:58.333333%}.offset-lg-8{margin-left:66.666667%}.offset-lg-9{margin-left:75%}.offset-lg-10{margin-left:83.333333%}.offset-lg-11{margin-left:91.666667%}}@media (min-width:1200px){.col-xl{-ms-flex-preferred-size:0;flex-basis:0;-ms-flex-positive:1;flex-grow:1;min-width:0;max-width:100%}.row-cols-xl-1>*{-ms-flex:0 0 100%;flex:0 0 100%;max-width:100%}.row-cols-xl-2>*{-ms-flex:0 0 50%;flex:0 0 50%;max-width:50%}.row-cols-xl-3>*{-ms-flex:0 0 33.333333%;flex:0 0 33.333333%;max-width:33.333333%}.row-cols-xl-4>*{-ms-flex:0 0 25%;flex:0 0 25%;max-width:25%}.row-cols-xl-5>*{-ms-flex:0 0 20%;flex:0 0 20%;max-width:20%}.row-cols-xl-6>*{-ms-flex:0 0 16.666667%;flex:0 0 16.666667%;max-width:16.666667%}.col-xl-auto{-ms-flex:0 0 auto;flex:0 0 auto;width:auto;max-width:100%}.col-xl-1{-ms-flex:0 0 8.333333%;flex:0 0 8.333333%;max-width:8.333333%}.col-xl-2{-ms-flex:0 0 16.666667%;flex:0 0 16.666667%;max-width:16.666667%}.col-xl-3{-ms-flex:0 0 25%;flex:0 0 25%;max-width:25%}.col-xl-4{-ms-flex:0 0 33.333333%;flex:0 0 33.333333%;max-width:33.333333%}.col-xl-5{-ms-flex:0 0 41.666667%;flex:0 0 41.666667%;max-width:41.666667%}.col-xl-6{-ms-flex:0 0 50%;flex:0 0 50%;max-width:50%}.col-xl-7{-ms-flex:0 0 58.333333%;flex:0 0 58.333333%;max-width:58.333333%}.col-xl-8{-ms-flex:0 0 66.666667%;flex:0 0 66.666667%;max-width:66.666667%}.col-xl-9{-ms-flex:0 0 75%;flex:0 0 75%;max-width:75%}.col-xl-10{-ms-flex:0 0 83.333333%;flex:0 0 83.333333%;max-width:83.333333%}.col-xl-11{-ms-flex:0 0 91.666667%;flex:0 0 91.666667%;max-width:91.666667%}.col-xl-12{-ms-flex:0 0 100%;flex:0 0 100%;max-width:100%}.order-xl-first{-ms-flex-order:-1;order:-1}.order-xl-last{-ms-flex-order:13;order:13}.order-xl-0{-ms-flex-order:0;order:0}.order-xl-1{-ms-flex-order:1;order:1}.order-xl-2{-ms-flex-order:2;order:2}.order-xl-3{-ms-flex-order:3;order:3}.order-xl-4{-ms-flex-order:4;order:4}.order-xl-5{-ms-flex-order:5;order:5}.order-xl-6{-ms-flex-order:6;order:6}.order-xl-7{-ms-flex-order:7;order:7}.order-xl-8{-ms-flex-order:8;order:8}.order-xl-9{-ms-flex-order:9;order:9}.order-xl-10{-ms-flex-order:10;order:10}.order-xl-11{-ms-flex-order:11;order:11}.order-xl-12{-ms-flex-order:12;order:12}.offset-xl-0{margin-left:0}.offset-xl-1{margin-left:8.333333%}.offset-xl-2{margin-left:16.666667%}.offset-xl-3{margin-left:25%}.offset-xl-4{margin-left:33.333333%}.offset-xl-5{margin-left:41.666667%}.offset-xl-6{margin-left:50%}.offset-xl-7{margin-left:58.333333%}.offset-xl-8{margin-left:66.666667%}.offset-xl-9{margin-left:75%}.offset-xl-10{margin-left:83.333333%}.offset-xl-11{margin-left:91.666667%}}.table{width:100%;margin-bottom:1rem;color:#212529}.table td,.table th{padding:.75rem;vertical-align:top;border-top:1px solid #dee2e6}.table thead th{vertical-align:bottom;border-bottom:2px solid #dee2e6}.table tbody+tbody{border-top:2px solid #dee2e6}.table-sm td,.table-sm th{padding:.3rem}.table-bordered{border:1px solid #dee2e6}.table-bordered td,.table-bordered th{border:1px solid #dee2e6}.table-bordered thead td,.table-bordered thead th{border-bottom-width:2px}.table-borderless tbody+tbody,.table-borderless td,.table-borderless th,.table-borderless thead th{border:0}.table-striped tbody tr:nth-of-type(odd){background-color:rgba(0,0,0,.05)}.table-hover tbody tr:hover{color:#212529;background-color:rgba(0,0,0,.075)}.table-primary,.table-primary>td,.table-primary>th{background-color:#b8daff}.table-primary tbody+tbody,.table-primary td,.table-primary th,.table-primary thead th{border-color:#7abaff}.table-hover .table-primary:hover{background-color:#9fcdff}.table-hover .table-primary:hover>td,.table-hover .table-primary:hover>th{background-color:#9fcdff}.table-secondary,.table-secondary>td,.table-secondary>th{background-color:#d6d8db}.table-secondary tbody+tbody,.table-secondary td,.table-secondary th,.table-secondary thead th{border-color:#b3b7bb}.table-hover .table-secondary:hover{background-color:#c8cbcf}.table-hover .table-secondary:hover>td,.table-hover .table-secondary:hover>th{background-color:#c8cbcf}.table-success,.table-success>td,.table-success>th{background-color:#c3e6cb}.table-success tbody+tbody,.table-success td,.table-success th,.table-success thead th{border-color:#8fd19e}.table-hover .table-success:hover{background-color:#b1dfbb}.table-hover .table-success:hover>td,.table-hover .table-success:hover>th{background-color:#b1dfbb}.table-info,.table-info>td,.table-info>th{background-color:#bee5eb}.table-info tbody+tbody,.table-info td,.table-info th,.table-info thead th{border-color:#86cfda}.table-hover .table-info:hover{background-color:#abdde5}.table-hover .table-info:hover>td,.table-hover .table-info:hover>th{background-color:#abdde5}.table-warning,.table-warning>td,.table-warning>th{background-color:#ffeeba}.table-warning tbody+tbody,.table-warning td,.table-warning th,.table-warning thead th{border-color:#ffdf7e}.table-hover .table-warning:hover{background-color:#ffe8a1}.table-hover .table-warning:hover>td,.table-hover .table-warning:hover>th{background-color:#ffe8a1}.table-danger,.table-danger>td,.table-danger>th{background-color:#f5c6cb}.table-danger tbody+tbody,.table-danger td,.table-danger th,.table-danger thead th{border-color:#ed969e}.table-hover .table-danger:hover{background-color:#f1b0b7}.table-hover .table-danger:hover>td,.table-hover .table-danger:hover>th{background-color:#f1b0b7}.table-light,.table-light>td,.table-light>th{background-color:#fdfdfe}.table-light tbody+tbody,.table-light td,.table-light th,.table-light thead th{border-color:#fbfcfc}.table-hover .table-light:hover{background-color:#ececf6}.table-hover .table-light:hover>td,.table-hover .table-light:hover>th{background-color:#ececf6}.table-dark,.table-dark>td,.table-dark>th{background-color:#c6c8ca}.table-dark tbody+tbody,.table-dark td,.table-dark th,.table-dark thead th{border-color:#95999c}.table-hover .table-dark:hover{background-color:#b9bbbe}.table-hover .table-dark:hover>td,.table-hover .table-dark:hover>th{background-color:#b9bbbe}.table-active,.table-active>td,.table-active>th{background-color:rgba(0,0,0,.075)}.table-hover .table-active:hover{background-color:rgba(0,0,0,.075)}.table-hover .table-active:hover>td,.table-hover .table-active:hover>th{background-color:rgba(0,0,0,.075)}.table .thead-dark th{color:#fff;background-color:#343a40;border-color:#454d55}.table .thead-light th{color:#495057;background-color:#e9ecef;border-color:#dee2e6}.table-dark{color:#fff;background-color:#343a40}.table-dark td,.table-dark th,.table-dark thead th{border-color:#454d55}.table-dark.table-bordered{border:0}.table-dark.table-striped tbody tr:nth-of-type(odd){background-color:rgba(255,255,255,.05)}.table-dark.table-hover tbody tr:hover{color:#fff;background-color:rgba(255,255,255,.075)}@media (max-width:575.98px){.table-responsive-sm{display:block;width:100%;overflow-x:auto;-webkit-overflow-scrolling:touch}.table-responsive-sm>.table-bordered{border:0}}@media (max-width:767.98px){.table-responsive-md{display:block;width:100%;overflow-x:auto;-webkit-overflow-scrolling:touch}.table-responsive-md>.table-bordered{border:0}}@media (max-width:991.98px){.table-responsive-lg{display:block;width:100%;overflow-x:auto;-webkit-overflow-scrolling:touch}.table-responsive-lg>.table-bordered{border:0}}@media (max-width:1199.98px){.table-responsive-xl{display:block;width:100%;overflow-x:auto;-webkit-overflow-scrolling:touch}.table-responsive-xl>.table-bordered{border:0}}.table-responsive{display:block;width:100%;overflow-x:auto;-webkit-overflow-scrolling:touch}.table-responsive>.table-bordered{border:0}.form-control{display:block;width:100%;height:calc(1.5em + .75rem + 2px);padding:.375rem .75rem;font-size:1rem;font-weight:400;line-height:1.5;color:#495057;background-color:#fff;background-clip:padding-box;border:1px solid #ced4da;border-radius:.25rem;transition:border-color .15s ease-in-out,box-shadow .15s ease-in-out}@media (prefers-reduced-motion:reduce){.form-control{transition:none}}.form-control::-ms-expand{background-color:transparent;border:0}.form-control:-moz-focusring{color:transparent;text-shadow:0 0 0 #495057}.form-control:focus{color:#495057;background-color:#fff;border-color:#80bdff;outline:0;box-shadow:0 0 0 .2rem rgba(0,123,255,.25)}.form-control::-webkit-input-placeholder{color:#6c757d;opacity:1}.form-control::-moz-placeholder{color:#6c757d;opacity:1}.form-control:-ms-input-placeholder{color:#6c757d;opacity:1}.form-control::-ms-input-placeholder{color:#6c757d;opacity:1}.form-control::placeholder{color:#6c757d;opacity:1}.form-control:disabled,.form-control[readonly]{background-color:#e9ecef;opacity:1}input[type=date].form-control,input[type=datetime-local].form-control,input[type=month].form-control,input[type=time].form-control{-webkit-appearance:none;-moz-appearance:none;appearance:none}select.form-control:focus::-ms-value{color:#495057;background-color:#fff}.form-control-file,.form-control-range{display:block;width:100%}.col-form-label{padding-top:calc(.375rem + 1px);padding-bottom:calc(.375rem + 1px);margin-bottom:0;font-size:inherit;line-height:1.5}.col-form-label-lg{padding-top:calc(.5rem + 1px);padding-bottom:calc(.5rem + 1px);font-size:1.25rem;line-height:1.5}.col-form-label-sm{padding-top:calc(.25rem + 1px);padding-bottom:calc(.25rem + 1px);font-size:.875rem;line-height:1.5}.form-control-plaintext{display:block;width:100%;padding:.375rem 0;margin-bottom:0;font-size:1rem;line-height:1.5;color:#212529;background-color:transparent;border:solid transparent;border-width:1px 0}.form-control-plaintext.form-control-lg,.form-control-plaintext.form-control-sm{padding-right:0;padding-left:0}.form-control-sm{height:calc(1.5em + .5rem + 2px);padding:.25rem .5rem;font-size:.875rem;line-height:1.5;border-radius:.2rem}.form-control-lg{height:calc(1.5em + 1rem + 2px);padding:.5rem 1rem;font-size:1.25rem;line-height:1.5;border-radius:.3rem}select.form-control[multiple],select.form-control[size]{height:auto}textarea.form-control{height:auto}.form-group{margin-bottom:1rem}.form-text{display:block;margin-top:.25rem}.form-row{display:-ms-flexbox;display:flex;-ms-flex-wrap:wrap;flex-wrap:wrap;margin-right:-5px;margin-left:-5px}.form-row>.col,.form-row>[class*=col-]{padding-right:5px;padding-left:5px}.form-check{position:relative;display:block;padding-left:1.25rem}.form-check-input{position:absolute;margin-top:.3rem;margin-left:-1.25rem}.form-check-input:disabled~.form-check-label,.form-check-input[disabled]~.form-check-label{color:#6c757d}.form-check-label{margin-bottom:0}.form-check-inline{display:-ms-inline-flexbox;display:inline-flex;-ms-flex-align:center;align-items:center;padding-left:0;margin-right:.75rem}.form-check-inline .form-check-input{position:static;margin-top:0;margin-right:.3125rem;margin-left:0}.valid-feedback{display:none;width:100%;margin-top:.25rem;font-size:80%;color:#28a745}.valid-tooltip{position:absolute;top:100%;z-index:5;display:none;max-width:100%;padding:.25rem .5rem;margin-top:.1rem;font-size:.875rem;line-height:1.5;color:#fff;background-color:rgba(40,167,69,.9);border-radius:.25rem}.is-valid~.valid-feedback,.is-valid~.valid-tooltip,.was-validated :valid~.valid-feedback,.was-validated :valid~.valid-tooltip{display:block}.form-control.is-valid,.was-validated .form-control:valid{border-color:#28a745;padding-right:calc(1.5em + .75rem);background-image:url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' width='8' height='8' viewBox='0 0 8 8'%3e%3cpath fill='%2328a745' d='M2.3 6.73L.6 4.53c-.4-1.04.46-1.4 1.1-.8l1.1 1.4 3.4-3.8c.6-.63 1.6-.27 1.2.7l-4 4.6c-.43.5-.8.4-1.1.1z'/%3e%3c/svg%3e");background-repeat:no-repeat;background-position:right calc(.375em + .1875rem) center;background-size:calc(.75em + .375rem) calc(.75em + .375rem)}.form-control.is-valid:focus,.was-validated .form-control:valid:focus{border-color:#28a745;box-shadow:0 0 0 .2rem rgba(40,167,69,.25)}.was-validated textarea.form-control:valid,textarea.form-control.is-valid{padding-right:calc(1.5em + .75rem);background-position:top calc(.375em + .1875rem) right calc(.375em + .1875rem)}.custom-select.is-valid,.was-validated .custom-select:valid{border-color:#28a745;padding-right:calc(.75em + 2.3125rem);background:url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' width='4' height='5' viewBox='0 0 4 5'%3e%3cpath fill='%23343a40' d='M2 0L0 2h4zm0 5L0 3h4z'/%3e%3c/svg%3e") no-repeat right .75rem center/8px 10px,url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' width='8' height='8' viewBox='0 0 8 8'%3e%3cpath fill='%2328a745' d='M2.3 6.73L.6 4.53c-.4-1.04.46-1.4 1.1-.8l1.1 1.4 3.4-3.8c.6-.63 1.6-.27 1.2.7l-4 4.6c-.43.5-.8.4-1.1.1z'/%3e%3c/svg%3e") #fff no-repeat center right 1.75rem/calc(.75em + .375rem) calc(.75em + .375rem)}.custom-select.is-valid:focus,.was-validated .custom-select:valid:focus{border-color:#28a745;box-shadow:0 0 0 .2rem rgba(40,167,69,.25)}.form-check-input.is-valid~.form-check-label,.was-validated .form-check-input:valid~.form-check-label{color:#28a745}.form-check-input.is-valid~.valid-feedback,.form-check-input.is-valid~.valid-tooltip,.was-validated .form-check-input:valid~.valid-feedback,.was-validated .form-check-input:valid~.valid-tooltip{display:block}.custom-control-input.is-valid~.custom-control-label,.was-validated .custom-control-input:valid~.custom-control-label{color:#28a745}.custom-control-input.is-valid~.custom-control-label::before,.was-validated .custom-control-input:valid~.custom-control-label::before{border-color:#28a745}.custom-control-input.is-valid:checked~.custom-control-label::before,.was-validated .custom-control-input:valid:checked~.custom-control-label::before{border-color:#34ce57;background-color:#34ce57}.custom-control-input.is-valid:focus~.custom-control-label::before,.was-validated .custom-control-input:valid:focus~.custom-control-label::before{box-shadow:0 0 0 .2rem rgba(40,167,69,.25)}.custom-control-input.is-valid:focus:not(:checked)~.custom-control-label::before,.was-validated .custom-control-input:valid:focus:not(:checked)~.custom-control-label::before{border-color:#28a745}.custom-file-input.is-valid~.custom-file-label,.was-validated .custom-file-input:valid~.custom-file-label{border-color:#28a745}.custom-file-input.is-valid:focus~.custom-file-label,.was-validated .custom-file-input:valid:focus~.custom-file-label{border-color:#28a745;box-shadow:0 0 0 .2rem rgba(40,167,69,.25)}.invalid-feedback{display:none;width:100%;margin-top:.25rem;font-size:80%;color:#dc3545}.invalid-tooltip{position:absolute;top:100%;z-index:5;display:none;max-width:100%;padding:.25rem .5rem;margin-top:.1rem;font-size:.875rem;line-height:1.5;color:#fff;background-color:rgba(220,53,69,.9);border-radius:.25rem}.is-invalid~.invalid-feedback,.is-invalid~.invalid-tooltip,.was-validated :invalid~.invalid-feedback,.was-validated :invalid~.invalid-tooltip{display:block}.form-control.is-invalid,.was-validated .form-control:invalid{border-color:#dc3545;padding-right:calc(1.5em + .75rem);background-image:url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='none' stroke='%23dc3545' viewBox='0 0 12 12'%3e%3ccircle cx='6' cy='6' r='4.5'/%3e%3cpath stroke-linejoin='round' d='M5.8 3.6h.4L6 6.5z'/%3e%3ccircle cx='6' cy='8.2' r='.6' fill='%23dc3545' stroke='none'/%3e%3c/svg%3e");background-repeat:no-repeat;background-position:right calc(.375em + .1875rem) center;background-size:calc(.75em + .375rem) calc(.75em + .375rem)}.form-control.is-invalid:focus,.was-validated .form-control:invalid:focus{border-color:#dc3545;box-shadow:0 0 0 .2rem rgba(220,53,69,.25)}.was-validated textarea.form-control:invalid,textarea.form-control.is-invalid{padding-right:calc(1.5em + .75rem);background-position:top calc(.375em + .1875rem) right calc(.375em + .1875rem)}.custom-select.is-invalid,.was-validated .custom-select:invalid{border-color:#dc3545;padding-right:calc(.75em + 2.3125rem);background:url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' width='4' height='5' viewBox='0 0 4 5'%3e%3cpath fill='%23343a40' d='M2 0L0 2h4zm0 5L0 3h4z'/%3e%3c/svg%3e") no-repeat right .75rem center/8px 10px,url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='none' stroke='%23dc3545' viewBox='0 0 12 12'%3e%3ccircle cx='6' cy='6' r='4.5'/%3e%3cpath stroke-linejoin='round' d='M5.8 3.6h.4L6 6.5z'/%3e%3ccircle cx='6' cy='8.2' r='.6' fill='%23dc3545' stroke='none'/%3e%3c/svg%3e") #fff no-repeat center right 1.75rem/calc(.75em + .375rem) calc(.75em + .375rem)}.custom-select.is-invalid:focus,.was-validated .custom-select:invalid:focus{border-color:#dc3545;box-shadow:0 0 0 .2rem rgba(220,53,69,.25)}.form-check-input.is-invalid~.form-check-label,.was-validated .form-check-input:invalid~.form-check-label{color:#dc3545}.form-check-input.is-invalid~.invalid-feedback,.form-check-input.is-invalid~.invalid-tooltip,.was-validated .form-check-input:invalid~.invalid-feedback,.was-validated .form-check-input:invalid~.invalid-tooltip{display:block}.custom-control-input.is-invalid~.custom-control-label,.was-validated .custom-control-input:invalid~.custom-control-label{color:#dc3545}.custom-control-input.is-invalid~.custom-control-label::before,.was-validated .custom-control-input:invalid~.custom-control-label::before{border-color:#dc3545}.custom-control-input.is-invalid:checked~.custom-control-label::before,.was-validated .custom-control-input:invalid:checked~.custom-control-label::before{border-color:#e4606d;background-color:#e4606d}.custom-control-input.is-invalid:focus~.custom-control-label::before,.was-validated .custom-control-input:invalid:focus~.custom-control-label::before{box-shadow:0 0 0 .2rem rgba(220,53,69,.25)}.custom-control-input.is-invalid:focus:not(:checked)~.custom-control-label::before,.was-validated .custom-control-input:invalid:focus:not(:checked)~.custom-control-label::before{border-color:#dc3545}.custom-file-input.is-invalid~.custom-file-label,.was-validated .custom-file-input:invalid~.custom-file-label{border-color:#dc3545}.custom-file-input.is-invalid:focus~.custom-file-label,.was-validated .custom-file-input:invalid:focus~.custom-file-label{border-color:#dc3545;box-shadow:0 0 0 .2rem rgba(220,53,69,.25)}.form-inline{display:-ms-flexbox;display:flex;-ms-flex-flow:row wrap;flex-flow:row wrap;-ms-flex-align:center;align-items:center}.form-inline .form-check{width:100%}@media (min-width:576px){.form-inline label{display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;-ms-flex-pack:center;justify-content:center;margin-bottom:0}.form-inline .form-group{display:-ms-flexbox;display:flex;-ms-flex:0 0 auto;flex:0 0 auto;-ms-flex-flow:row wrap;flex-flow:row wrap;-ms-flex-align:center;align-items:center;margin-bottom:0}.form-inline .form-control{display:inline-block;width:auto;vertical-align:middle}.form-inline .form-control-plaintext{display:inline-block}.form-inline .custom-select,.form-inline .input-group{width:auto}.form-inline .form-check{display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;-ms-flex-pack:center;justify-content:center;width:auto;padding-left:0}.form-inline .form-check-input{position:relative;-ms-flex-negative:0;flex-shrink:0;margin-top:0;margin-right:.25rem;margin-left:0}.form-inline .custom-control{-ms-flex-align:center;align-items:center;-ms-flex-pack:center;justify-content:center}.form-inline .custom-control-label{margin-bottom:0}}.btn{display:inline-block;font-weight:400;color:#212529;text-align:center;vertical-align:middle;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;background-color:transparent;border:1px solid transparent;padding:.375rem .75rem;font-size:1rem;line-height:1.5;border-radius:.25rem;transition:color .15s ease-in-out,background-color .15s ease-in-out,border-color .15s ease-in-out,box-shadow .15s ease-in-out}@media (prefers-reduced-motion:reduce){.btn{transition:none}}.btn:hover{color:#212529;text-decoration:none}.btn.focus,.btn:focus{outline:0;box-shadow:0 0 0 .2rem rgba(0,123,255,.25)}.btn.disabled,.btn:disabled{opacity:.65}.btn:not(:disabled):not(.disabled){cursor:pointer}a.btn.disabled,fieldset:disabled a.btn{pointer-events:none}.btn-primary{color:#fff;background-color:#007bff;border-color:#007bff}.btn-primary:hover{color:#fff;background-color:#0069d9;border-color:#0062cc}.btn-primary.focus,.btn-primary:focus{color:#fff;background-color:#0069d9;border-color:#0062cc;box-shadow:0 0 0 .2rem rgba(38,143,255,.5)}.btn-primary.disabled,.btn-primary:disabled{color:#fff;background-color:#007bff;border-color:#007bff}.btn-primary:not(:disabled):not(.disabled).active,.btn-primary:not(:disabled):not(.disabled):active,.show>.btn-primary.dropdown-toggle{color:#fff;background-color:#0062cc;border-color:#005cbf}.btn-primary:not(:disabled):not(.disabled).active:focus,.btn-primary:not(:disabled):not(.disabled):active:focus,.show>.btn-primary.dropdown-toggle:focus{box-shadow:0 0 0 .2rem rgba(38,143,255,.5)}.btn-secondary{color:#fff;background-color:#6c757d;border-color:#6c757d}.btn-secondary:hover{color:#fff;background-color:#5a6268;border-color:#545b62}.btn-secondary.focus,.btn-secondary:focus{color:#fff;background-color:#5a6268;border-color:#545b62;box-shadow:0 0 0 .2rem rgba(130,138,145,.5)}.btn-secondary.disabled,.btn-secondary:disabled{color:#fff;background-color:#6c757d;border-color:#6c757d}.btn-secondary:not(:disabled):not(.disabled).active,.btn-secondary:not(:disabled):not(.disabled):active,.show>.btn-secondary.dropdown-toggle{color:#fff;background-color:#545b62;border-color:#4e555b}.btn-secondary:not(:disabled):not(.disabled).active:focus,.btn-secondary:not(:disabled):not(.disabled):active:focus,.show>.btn-secondary.dropdown-toggle:focus{box-shadow:0 0 0 .2rem rgba(130,138,145,.5)}.btn-success{color:#fff;background-color:#28a745;border-color:#28a745}.btn-success:hover{color:#fff;background-color:#218838;border-color:#1e7e34}.btn-success.focus,.btn-success:focus{color:#fff;background-color:#218838;border-color:#1e7e34;box-shadow:0 0 0 .2rem rgba(72,180,97,.5)}.btn-success.disabled,.btn-success:disabled{color:#fff;background-color:#28a745;border-color:#28a745}.btn-success:not(:disabled):not(.disabled).active,.btn-success:not(:disabled):not(.disabled):active,.show>.btn-success.dropdown-toggle{color:#fff;background-color:#1e7e34;border-color:#1c7430}.btn-success:not(:disabled):not(.disabled).active:focus,.btn-success:not(:disabled):not(.disabled):active:focus,.show>.btn-success.dropdown-toggle:focus{box-shadow:0 0 0 .2rem rgba(72,180,97,.5)}.btn-info{color:#fff;background-color:#17a2b8;border-color:#17a2b8}.btn-info:hover{color:#fff;background-color:#138496;border-color:#117a8b}.btn-info.focus,.btn-info:focus{color:#fff;background-color:#138496;border-color:#117a8b;box-shadow:0 0 0 .2rem rgba(58,176,195,.5)}.btn-info.disabled,.btn-info:disabled{color:#fff;background-color:#17a2b8;border-color:#17a2b8}.btn-info:not(:disabled):not(.disabled).active,.btn-info:not(:disabled):not(.disabled):active,.show>.btn-info.dropdown-toggle{color:#fff;background-color:#117a8b;border-color:#10707f}.btn-info:not(:disabled):not(.disabled).active:focus,.btn-info:not(:disabled):not(.disabled):active:focus,.show>.btn-info.dropdown-toggle:focus{box-shadow:0 0 0 .2rem rgba(58,176,195,.5)}.btn-warning{color:#212529;background-color:#ffc107;border-color:#ffc107}.btn-warning:hover{color:#212529;background-color:#e0a800;border-color:#d39e00}.btn-warning.focus,.btn-warning:focus{color:#212529;background-color:#e0a800;border-color:#d39e00;box-shadow:0 0 0 .2rem rgba(222,170,12,.5)}.btn-warning.disabled,.btn-warning:disabled{color:#212529;background-color:#ffc107;border-color:#ffc107}.btn-warning:not(:disabled):not(.disabled).active,.btn-warning:not(:disabled):not(.disabled):active,.show>.btn-warning.dropdown-toggle{color:#212529;background-color:#d39e00;border-color:#c69500}.btn-warning:not(:disabled):not(.disabled).active:focus,.btn-warning:not(:disabled):not(.disabled):active:focus,.show>.btn-warning.dropdown-toggle:focus{box-shadow:0 0 0 .2rem rgba(222,170,12,.5)}.btn-danger{color:#fff;background-color:#dc3545;border-color:#dc3545}.btn-danger:hover{color:#fff;background-color:#c82333;border-color:#bd2130}.btn-danger.focus,.btn-danger:focus{color:#fff;background-color:#c82333;border-color:#bd2130;box-shadow:0 0 0 .2rem rgba(225,83,97,.5)}.btn-danger.disabled,.btn-danger:disabled{color:#fff;background-color:#dc3545;border-color:#dc3545}.btn-danger:not(:disabled):not(.disabled).active,.btn-danger:not(:disabled):not(.disabled):active,.show>.btn-danger.dropdown-toggle{color:#fff;background-color:#bd2130;border-color:#b21f2d}.btn-danger:not(:disabled):not(.disabled).active:focus,.btn-danger:not(:disabled):not(.disabled):active:focus,.show>.btn-danger.dropdown-toggle:focus{box-shadow:0 0 0 .2rem rgba(225,83,97,.5)}.btn-light{color:#212529;background-color:#f8f9fa;border-color:#f8f9fa}.btn-light:hover{color:#212529;background-color:#e2e6ea;border-color:#dae0e5}.btn-light.focus,.btn-light:focus{color:#212529;background-color:#e2e6ea;border-color:#dae0e5;box-shadow:0 0 0 .2rem rgba(216,217,219,.5)}.btn-light.disabled,.btn-light:disabled{color:#212529;background-color:#f8f9fa;border-color:#f8f9fa}.btn-light:not(:disabled):not(.disabled).active,.btn-light:not(:disabled):not(.disabled):active,.show>.btn-light.dropdown-toggle{color:#212529;background-color:#dae0e5;border-color:#d3d9df}.btn-light:not(:disabled):not(.disabled).active:focus,.btn-light:not(:disabled):not(.disabled):active:focus,.show>.btn-light.dropdown-toggle:focus{box-shadow:0 0 0 .2rem rgba(216,217,219,.5)}.btn-dark{color:#fff;background-color:#343a40;border-color:#343a40}.btn-dark:hover{color:#fff;background-color:#23272b;border-color:#1d2124}.btn-dark.focus,.btn-dark:focus{color:#fff;background-color:#23272b;border-color:#1d2124;box-shadow:0 0 0 .2rem rgba(82,88,93,.5)}.btn-dark.disabled,.btn-dark:disabled{color:#fff;background-color:#343a40;border-color:#343a40}.btn-dark:not(:disabled):not(.disabled).active,.btn-dark:not(:disabled):not(.disabled):active,.show>.btn-dark.dropdown-toggle{color:#fff;background-color:#1d2124;border-color:#171a1d}.btn-dark:not(:disabled):not(.disabled).active:focus,.btn-dark:not(:disabled):not(.disabled):active:focus,.show>.btn-dark.dropdown-toggle:focus{box-shadow:0 0 0 .2rem rgba(82,88,93,.5)}.btn-outline-primary{color:#007bff;border-color:#007bff}.btn-outline-primary:hover{color:#fff;background-color:#007bff;border-color:#007bff}.btn-outline-primary.focus,.btn-outline-primary:focus{box-shadow:0 0 0 .2rem rgba(0,123,255,.5)}.btn-outline-primary.disabled,.btn-outline-primary:disabled{color:#007bff;background-color:transparent}.btn-outline-primary:not(:disabled):not(.disabled).active,.btn-outline-primary:not(:disabled):not(.disabled):active,.show>.btn-outline-primary.dropdown-toggle{color:#fff;background-color:#007bff;border-color:#007bff}.btn-outline-primary:not(:disabled):not(.disabled).active:focus,.btn-outline-primary:not(:disabled):not(.disabled):active:focus,.show>.btn-outline-primary.dropdown-toggle:focus{box-shadow:0 0 0 .2rem rgba(0,123,255,.5)}.btn-outline-secondary{color:#6c757d;border-color:#6c757d}.btn-outline-secondary:hover{color:#fff;background-color:#6c757d;border-color:#6c757d}.btn-outline-secondary.focus,.btn-outline-secondary:focus{box-shadow:0 0 0 .2rem rgba(108,117,125,.5)}.btn-outline-secondary.disabled,.btn-outline-secondary:disabled{color:#6c757d;background-color:transparent}.btn-outline-secondary:not(:disabled):not(.disabled).active,.btn-outline-secondary:not(:disabled):not(.disabled):active,.show>.btn-outline-secondary.dropdown-toggle{color:#fff;background-color:#6c757d;border-color:#6c757d}.btn-outline-secondary:not(:disabled):not(.disabled).active:focus,.btn-outline-secondary:not(:disabled):not(.disabled):active:focus,.show>.btn-outline-secondary.dropdown-toggle:focus{box-shadow:0 0 0 .2rem rgba(108,117,125,.5)}.btn-outline-success{color:#28a745;border-color:#28a745}.btn-outline-success:hover{color:#fff;background-color:#28a745;border-color:#28a745}.btn-outline-success.focus,.btn-outline-success:focus{box-shadow:0 0 0 .2rem rgba(40,167,69,.5)}.btn-outline-success.disabled,.btn-outline-success:disabled{color:#28a745;background-color:transparent}.btn-outline-success:not(:disabled):not(.disabled).active,.btn-outline-success:not(:disabled):not(.disabled):active,.show>.btn-outline-success.dropdown-toggle{color:#fff;background-color:#28a745;border-color:#28a745}.btn-outline-success:not(:disabled):not(.disabled).active:focus,.btn-outline-success:not(:disabled):not(.disabled):active:focus,.show>.btn-outline-success.dropdown-toggle:focus{box-shadow:0 0 0 .2rem rgba(40,167,69,.5)}.btn-outline-info{color:#17a2b8;border-color:#17a2b8}.btn-outline-info:hover{color:#fff;background-color:#17a2b8;border-color:#17a2b8}.btn-outline-info.focus,.btn-outline-info:focus{box-shadow:0 0 0 .2rem rgba(23,162,184,.5)}.btn-outline-info.disabled,.btn-outline-info:disabled{color:#17a2b8;background-color:transparent}.btn-outline-info:not(:disabled):not(.disabled).active,.btn-outline-info:not(:disabled):not(.disabled):active,.show>.btn-outline-info.dropdown-toggle{color:#fff;background-color:#17a2b8;border-color:#17a2b8}.btn-outline-info:not(:disabled):not(.disabled).active:focus,.btn-outline-info:not(:disabled):not(.disabled):active:focus,.show>.btn-outline-info.dropdown-toggle:focus{box-shadow:0 0 0 .2rem rgba(23,162,184,.5)}.btn-outline-warning{color:#ffc107;border-color:#ffc107}.btn-outline-warning:hover{color:#212529;background-color:#ffc107;border-color:#ffc107}.btn-outline-warning.focus,.btn-outline-warning:focus{box-shadow:0 0 0 .2rem rgba(255,193,7,.5)}.btn-outline-warning.disabled,.btn-outline-warning:disabled{color:#ffc107;background-color:transparent}.btn-outline-warning:not(:disabled):not(.disabled).active,.btn-outline-warning:not(:disabled):not(.disabled):active,.show>.btn-outline-warning.dropdown-toggle{color:#212529;background-color:#ffc107;border-color:#ffc107}.btn-outline-warning:not(:disabled):not(.disabled).active:focus,.btn-outline-warning:not(:disabled):not(.disabled):active:focus,.show>.btn-outline-warning.dropdown-toggle:focus{box-shadow:0 0 0 .2rem rgba(255,193,7,.5)}.btn-outline-danger{color:#dc3545;border-color:#dc3545}.btn-outline-danger:hover{color:#fff;background-color:#dc3545;border-color:#dc3545}.btn-outline-danger.focus,.btn-outline-danger:focus{box-shadow:0 0 0 .2rem rgba(220,53,69,.5)}.btn-outline-danger.disabled,.btn-outline-danger:disabled{color:#dc3545;background-color:transparent}.btn-outline-danger:not(:disabled):not(.disabled).active,.btn-outline-danger:not(:disabled):not(.disabled):active,.show>.btn-outline-danger.dropdown-toggle{color:#fff;background-color:#dc3545;border-color:#dc3545}.btn-outline-danger:not(:disabled):not(.disabled).active:focus,.btn-outline-danger:not(:disabled):not(.disabled):active:focus,.show>.btn-outline-danger.dropdown-toggle:focus{box-shadow:0 0 0 .2rem rgba(220,53,69,.5)}.btn-outline-light{color:#f8f9fa;border-color:#f8f9fa}.btn-outline-light:hover{color:#212529;background-color:#f8f9fa;border-color:#f8f9fa}.btn-outline-light.focus,.btn-outline-light:focus{box-shadow:0 0 0 .2rem rgba(248,249,250,.5)}.btn-outline-light.disabled,.btn-outline-light:disabled{color:#f8f9fa;background-color:transparent}.btn-outline-light:not(:disabled):not(.disabled).active,.btn-outline-light:not(:disabled):not(.disabled):active,.show>.btn-outline-light.dropdown-toggle{color:#212529;background-color:#f8f9fa;border-color:#f8f9fa}.btn-outline-light:not(:disabled):not(.disabled).active:focus,.btn-outline-light:not(:disabled):not(.disabled):active:focus,.show>.btn-outline-light.dropdown-toggle:focus{box-shadow:0 0 0 .2rem rgba(248,249,250,.5)}.btn-outline-dark{color:#343a40;border-color:#343a40}.btn-outline-dark:hover{color:#fff;background-color:#343a40;border-color:#343a40}.btn-outline-dark.focus,.btn-outline-dark:focus{box-shadow:0 0 0 .2rem rgba(52,58,64,.5)}.btn-outline-dark.disabled,.btn-outline-dark:disabled{color:#343a40;background-color:transparent}.btn-outline-dark:not(:disabled):not(.disabled).active,.btn-outline-dark:not(:disabled):not(.disabled):active,.show>.btn-outline-dark.dropdown-toggle{color:#fff;background-color:#343a40;border-color:#343a40}.btn-outline-dark:not(:disabled):not(.disabled).active:focus,.btn-outline-dark:not(:disabled):not(.disabled):active:focus,.show>.btn-outline-dark.dropdown-toggle:focus{box-shadow:0 0 0 .2rem rgba(52,58,64,.5)}.btn-link{font-weight:400;color:#007bff;text-decoration:none}.btn-link:hover{color:#0056b3;text-decoration:underline}.btn-link.focus,.btn-link:focus{text-decoration:underline}.btn-link.disabled,.btn-link:disabled{color:#6c757d;pointer-events:none}.btn-group-lg>.btn,.btn-lg{padding:.5rem 1rem;font-size:1.25rem;line-height:1.5;border-radius:.3rem}.btn-group-sm>.btn,.btn-sm{padding:.25rem .5rem;font-size:.875rem;line-height:1.5;border-radius:.2rem}.btn-block{display:block;width:100%}.btn-block+.btn-block{margin-top:.5rem}input[type=button].btn-block,input[type=reset].btn-block,input[type=submit].btn-block{width:100%}.fade{transition:opacity .15s linear}@media (prefers-reduced-motion:reduce){.fade{transition:none}}.fade:not(.show){opacity:0}.collapse:not(.show){display:none}.collapsing{position:relative;height:0;overflow:hidden;transition:height .35s ease}@media (prefers-reduced-motion:reduce){.collapsing{transition:none}}.dropdown,.dropleft,.dropright,.dropup{position:relative}.dropdown-toggle{white-space:nowrap}.dropdown-toggle::after{display:inline-block;margin-left:.255em;vertical-align:.255em;content:"";border-top:.3em solid;border-right:.3em solid transparent;border-bottom:0;border-left:.3em solid transparent}.dropdown-toggle:empty::after{margin-left:0}.dropdown-menu{position:absolute;top:100%;left:0;z-index:1000;display:none;float:left;min-width:10rem;padding:.5rem 0;margin:.125rem 0 0;font-size:1rem;color:#212529;text-align:left;list-style:none;background-color:#fff;background-clip:padding-box;border:1px solid rgba(0,0,0,.15);border-radius:.25rem}.dropdown-menu-left{right:auto;left:0}.dropdown-menu-right{right:0;left:auto}@media (min-width:576px){.dropdown-menu-sm-left{right:auto;left:0}.dropdown-menu-sm-right{right:0;left:auto}}@media (min-width:768px){.dropdown-menu-md-left{right:auto;left:0}.dropdown-menu-md-right{right:0;left:auto}}@media (min-width:992px){.dropdown-menu-lg-left{right:auto;left:0}.dropdown-menu-lg-right{right:0;left:auto}}@media (min-width:1200px){.dropdown-menu-xl-left{right:auto;left:0}.dropdown-menu-xl-right{right:0;left:auto}}.dropup .dropdown-menu{top:auto;bottom:100%;margin-top:0;margin-bottom:.125rem}.dropup .dropdown-toggle::after{display:inline-block;margin-left:.255em;vertical-align:.255em;content:"";border-top:0;border-right:.3em solid transparent;border-bottom:.3em solid;border-left:.3em solid transparent}.dropup .dropdown-toggle:empty::after{margin-left:0}.dropright .dropdown-menu{top:0;right:auto;left:100%;margin-top:0;margin-left:.125rem}.dropright .dropdown-toggle::after{display:inline-block;margin-left:.255em;vertical-align:.255em;content:"";border-top:.3em solid transparent;border-right:0;border-bottom:.3em solid transparent;border-left:.3em solid}.dropright .dropdown-toggle:empty::after{margin-left:0}.dropright .dropdown-toggle::after{vertical-align:0}.dropleft .dropdown-menu{top:0;right:100%;left:auto;margin-top:0;margin-right:.125rem}.dropleft .dropdown-toggle::after{display:inline-block;margin-left:.255em;vertical-align:.255em;content:""}.dropleft .dropdown-toggle::after{display:none}.dropleft .dropdown-toggle::before{display:inline-block;margin-right:.255em;vertical-align:.255em;content:"";border-top:.3em solid transparent;border-right:.3em solid;border-bottom:.3em solid transparent}.dropleft .dropdown-toggle:empty::after{margin-left:0}.dropleft .dropdown-toggle::before{vertical-align:0}.dropdown-menu[x-placement^=bottom],.dropdown-menu[x-placement^=left],.dropdown-menu[x-placement^=right],.dropdown-menu[x-placement^=top]{right:auto;bottom:auto}.dropdown-divider{height:0;margin:.5rem 0;overflow:hidden;border-top:1px solid #e9ecef}.dropdown-item{display:block;width:100%;padding:.25rem 1.5rem;clear:both;font-weight:400;color:#212529;text-align:inherit;white-space:nowrap;background-color:transparent;border:0}.dropdown-item:focus,.dropdown-item:hover{color:#16181b;text-decoration:none;background-color:#f8f9fa}.dropdown-item.active,.dropdown-item:active{color:#fff;text-decoration:none;background-color:#007bff}.dropdown-item.disabled,.dropdown-item:disabled{color:#6c757d;pointer-events:none;background-color:transparent}.dropdown-menu.show{display:block}.dropdown-header{display:block;padding:.5rem 1.5rem;margin-bottom:0;font-size:.875rem;color:#6c757d;white-space:nowrap}.dropdown-item-text{display:block;padding:.25rem 1.5rem;color:#212529}.btn-group,.btn-group-vertical{position:relative;display:-ms-inline-flexbox;display:inline-flex;vertical-align:middle}.btn-group-vertical>.btn,.btn-group>.btn{position:relative;-ms-flex:1 1 auto;flex:1 1 auto}.btn-group-vertical>.btn:hover,.btn-group>.btn:hover{z-index:1}.btn-group-vertical>.btn.active,.btn-group-vertical>.btn:active,.btn-group-vertical>.btn:focus,.btn-group>.btn.active,.btn-group>.btn:active,.btn-group>.btn:focus{z-index:1}.btn-toolbar{display:-ms-flexbox;display:flex;-ms-flex-wrap:wrap;flex-wrap:wrap;-ms-flex-pack:start;justify-content:flex-start}.btn-toolbar .input-group{width:auto}.btn-group>.btn-group:not(:first-child),.btn-group>.btn:not(:first-child){margin-left:-1px}.btn-group>.btn-group:not(:last-child)>.btn,.btn-group>.btn:not(:last-child):not(.dropdown-toggle){border-top-right-radius:0;border-bottom-right-radius:0}.btn-group>.btn-group:not(:first-child)>.btn,.btn-group>.btn:not(:first-child){border-top-left-radius:0;border-bottom-left-radius:0}.dropdown-toggle-split{padding-right:.5625rem;padding-left:.5625rem}.dropdown-toggle-split::after,.dropright .dropdown-toggle-split::after,.dropup .dropdown-toggle-split::after{margin-left:0}.dropleft .dropdown-toggle-split::before{margin-right:0}.btn-group-sm>.btn+.dropdown-toggle-split,.btn-sm+.dropdown-toggle-split{padding-right:.375rem;padding-left:.375rem}.btn-group-lg>.btn+.dropdown-toggle-split,.btn-lg+.dropdown-toggle-split{padding-right:.75rem;padding-left:.75rem}.btn-group-vertical{-ms-flex-direction:column;flex-direction:column;-ms-flex-align:start;align-items:flex-start;-ms-flex-pack:center;justify-content:center}.btn-group-vertical>.btn,.btn-group-vertical>.btn-group{width:100%}.btn-group-vertical>.btn-group:not(:first-child),.btn-group-vertical>.btn:not(:first-child){margin-top:-1px}.btn-group-vertical>.btn-group:not(:last-child)>.btn,.btn-group-vertical>.btn:not(:last-child):not(.dropdown-toggle){border-bottom-right-radius:0;border-bottom-left-radius:0}.btn-group-vertical>.btn-group:not(:first-child)>.btn,.btn-group-vertical>.btn:not(:first-child){border-top-left-radius:0;border-top-right-radius:0}.btn-group-toggle>.btn,.btn-group-toggle>.btn-group>.btn{margin-bottom:0}.btn-group-toggle>.btn input[type=checkbox],.btn-group-toggle>.btn input[type=radio],.btn-group-toggle>.btn-group>.btn input[type=checkbox],.btn-group-toggle>.btn-group>.btn input[type=radio]{position:absolute;clip:rect(0,0,0,0);pointer-events:none}.input-group{position:relative;display:-ms-flexbox;display:flex;-ms-flex-wrap:wrap;flex-wrap:wrap;-ms-flex-align:stretch;align-items:stretch;width:100%}.input-group>.custom-file,.input-group>.custom-select,.input-group>.form-control,.input-group>.form-control-plaintext{position:relative;-ms-flex:1 1 auto;flex:1 1 auto;width:1%;min-width:0;margin-bottom:0}.input-group>.custom-file+.custom-file,.input-group>.custom-file+.custom-select,.input-group>.custom-file+.form-control,.input-group>.custom-select+.custom-file,.input-group>.custom-select+.custom-select,.input-group>.custom-select+.form-control,.input-group>.form-control+.custom-file,.input-group>.form-control+.custom-select,.input-group>.form-control+.form-control,.input-group>.form-control-plaintext+.custom-file,.input-group>.form-control-plaintext+.custom-select,.input-group>.form-control-plaintext+.form-control{margin-left:-1px}.input-group>.custom-file .custom-file-input:focus~.custom-file-label,.input-group>.custom-select:focus,.input-group>.form-control:focus{z-index:3}.input-group>.custom-file .custom-file-input:focus{z-index:4}.input-group>.custom-select:not(:last-child),.input-group>.form-control:not(:last-child){border-top-right-radius:0;border-bottom-right-radius:0}.input-group>.custom-select:not(:first-child),.input-group>.form-control:not(:first-child){border-top-left-radius:0;border-bottom-left-radius:0}.input-group>.custom-file{display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center}.input-group>.custom-file:not(:last-child) .custom-file-label,.input-group>.custom-file:not(:last-child) .custom-file-label::after{border-top-right-radius:0;border-bottom-right-radius:0}.input-group>.custom-file:not(:first-child) .custom-file-label{border-top-left-radius:0;border-bottom-left-radius:0}.input-group-append,.input-group-prepend{display:-ms-flexbox;display:flex}.input-group-append .btn,.input-group-prepend .btn{position:relative;z-index:2}.input-group-append .btn:focus,.input-group-prepend .btn:focus{z-index:3}.input-group-append .btn+.btn,.input-group-append .btn+.input-group-text,.input-group-append .input-group-text+.btn,.input-group-append .input-group-text+.input-group-text,.input-group-prepend .btn+.btn,.input-group-prepend .btn+.input-group-text,.input-group-prepend .input-group-text+.btn,.input-group-prepend .input-group-text+.input-group-text{margin-left:-1px}.input-group-prepend{margin-right:-1px}.input-group-append{margin-left:-1px}.input-group-text{display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;padding:.375rem .75rem;margin-bottom:0;font-size:1rem;font-weight:400;line-height:1.5;color:#495057;text-align:center;white-space:nowrap;background-color:#e9ecef;border:1px solid #ced4da;border-radius:.25rem}.input-group-text input[type=checkbox],.input-group-text input[type=radio]{margin-top:0}.input-group-lg>.custom-select,.input-group-lg>.form-control:not(textarea){height:calc(1.5em + 1rem + 2px)}.input-group-lg>.custom-select,.input-group-lg>.form-control,.input-group-lg>.input-group-append>.btn,.input-group-lg>.input-group-append>.input-group-text,.input-group-lg>.input-group-prepend>.btn,.input-group-lg>.input-group-prepend>.input-group-text{padding:.5rem 1rem;font-size:1.25rem;line-height:1.5;border-radius:.3rem}.input-group-sm>.custom-select,.input-group-sm>.form-control:not(textarea){height:calc(1.5em + .5rem + 2px)}.input-group-sm>.custom-select,.input-group-sm>.form-control,.input-group-sm>.input-group-append>.btn,.input-group-sm>.input-group-append>.input-group-text,.input-group-sm>.input-group-prepend>.btn,.input-group-sm>.input-group-prepend>.input-group-text{padding:.25rem .5rem;font-size:.875rem;line-height:1.5;border-radius:.2rem}.input-group-lg>.custom-select,.input-group-sm>.custom-select{padding-right:1.75rem}.input-group>.input-group-append:last-child>.btn:not(:last-child):not(.dropdown-toggle),.input-group>.input-group-append:last-child>.input-group-text:not(:last-child),.input-group>.input-group-append:not(:last-child)>.btn,.input-group>.input-group-append:not(:last-child)>.input-group-text,.input-group>.input-group-prepend>.btn,.input-group>.input-group-prepend>.input-group-text{border-top-right-radius:0;border-bottom-right-radius:0}.input-group>.input-group-append>.btn,.input-group>.input-group-append>.input-group-text,.input-group>.input-group-prepend:first-child>.btn:not(:first-child),.input-group>.input-group-prepend:first-child>.input-group-text:not(:first-child),.input-group>.input-group-prepend:not(:first-child)>.btn,.input-group>.input-group-prepend:not(:first-child)>.input-group-text{border-top-left-radius:0;border-bottom-left-radius:0}.custom-control{position:relative;display:block;min-height:1.5rem;padding-left:1.5rem}.custom-control-inline{display:-ms-inline-flexbox;display:inline-flex;margin-right:1rem}.custom-control-input{position:absolute;left:0;z-index:-1;width:1rem;height:1.25rem;opacity:0}.custom-control-input:checked~.custom-control-label::before{color:#fff;border-color:#007bff;background-color:#007bff}.custom-control-input:focus~.custom-control-label::before{box-shadow:0 0 0 .2rem rgba(0,123,255,.25)}.custom-control-input:focus:not(:checked)~.custom-control-label::before{border-color:#80bdff}.custom-control-input:not(:disabled):active~.custom-control-label::before{color:#fff;background-color:#b3d7ff;border-color:#b3d7ff}.custom-control-input:disabled~.custom-control-label,.custom-control-input[disabled]~.custom-control-label{color:#6c757d}.custom-control-input:disabled~.custom-control-label::before,.custom-control-input[disabled]~.custom-control-label::before{background-color:#e9ecef}.custom-control-label{position:relative;margin-bottom:0;vertical-align:top}.custom-control-label::before{position:absolute;top:.25rem;left:-1.5rem;display:block;width:1rem;height:1rem;pointer-events:none;content:"";background-color:#fff;border:#adb5bd solid 1px}.custom-control-label::after{position:absolute;top:.25rem;left:-1.5rem;display:block;width:1rem;height:1rem;content:"";background:no-repeat 50%/50% 50%}.custom-checkbox .custom-control-label::before{border-radius:.25rem}.custom-checkbox .custom-control-input:checked~.custom-control-label::after{background-image:url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' width='8' height='8' viewBox='0 0 8 8'%3e%3cpath fill='%23fff' d='M6.564.75l-3.59 3.612-1.538-1.55L0 4.26l2.974 2.99L8 2.193z'/%3e%3c/svg%3e")}.custom-checkbox .custom-control-input:indeterminate~.custom-control-label::before{border-color:#007bff;background-color:#007bff}.custom-checkbox .custom-control-input:indeterminate~.custom-control-label::after{background-image:url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' width='4' height='4' viewBox='0 0 4 4'%3e%3cpath stroke='%23fff' d='M0 2h4'/%3e%3c/svg%3e")}.custom-checkbox .custom-control-input:disabled:checked~.custom-control-label::before{background-color:rgba(0,123,255,.5)}.custom-checkbox .custom-control-input:disabled:indeterminate~.custom-control-label::before{background-color:rgba(0,123,255,.5)}.custom-radio .custom-control-label::before{border-radius:50%}.custom-radio .custom-control-input:checked~.custom-control-label::after{background-image:url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='-4 -4 8 8'%3e%3ccircle r='3' fill='%23fff'/%3e%3c/svg%3e")}.custom-radio .custom-control-input:disabled:checked~.custom-control-label::before{background-color:rgba(0,123,255,.5)}.custom-switch{padding-left:2.25rem}.custom-switch .custom-control-label::before{left:-2.25rem;width:1.75rem;pointer-events:all;border-radius:.5rem}.custom-switch .custom-control-label::after{top:calc(.25rem + 2px);left:calc(-2.25rem + 2px);width:calc(1rem - 4px);height:calc(1rem - 4px);background-color:#adb5bd;border-radius:.5rem;transition:background-color .15s ease-in-out,border-color .15s ease-in-out,box-shadow .15s ease-in-out,-webkit-transform .15s ease-in-out;transition:transform .15s ease-in-out,background-color .15s ease-in-out,border-color .15s ease-in-out,box-shadow .15s ease-in-out;transition:transform .15s ease-in-out,background-color .15s ease-in-out,border-color .15s ease-in-out,box-shadow .15s ease-in-out,-webkit-transform .15s ease-in-out}@media (prefers-reduced-motion:reduce){.custom-switch .custom-control-label::after{transition:none}}.custom-switch .custom-control-input:checked~.custom-control-label::after{background-color:#fff;-webkit-transform:translateX(.75rem);transform:translateX(.75rem)}.custom-switch .custom-control-input:disabled:checked~.custom-control-label::before{background-color:rgba(0,123,255,.5)}.custom-select{display:inline-block;width:100%;height:calc(1.5em + .75rem + 2px);padding:.375rem 1.75rem .375rem .75rem;font-size:1rem;font-weight:400;line-height:1.5;color:#495057;vertical-align:middle;background:#fff url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' width='4' height='5' viewBox='0 0 4 5'%3e%3cpath fill='%23343a40' d='M2 0L0 2h4zm0 5L0 3h4z'/%3e%3c/svg%3e") no-repeat right .75rem center/8px 10px;border:1px solid #ced4da;border-radius:.25rem;-webkit-appearance:none;-moz-appearance:none;appearance:none}.custom-select:focus{border-color:#80bdff;outline:0;box-shadow:0 0 0 .2rem rgba(0,123,255,.25)}.custom-select:focus::-ms-value{color:#495057;background-color:#fff}.custom-select[multiple],.custom-select[size]:not([size="1"]){height:auto;padding-right:.75rem;background-image:none}.custom-select:disabled{color:#6c757d;background-color:#e9ecef}.custom-select::-ms-expand{display:none}.custom-select:-moz-focusring{color:transparent;text-shadow:0 0 0 #495057}.custom-select-sm{height:calc(1.5em + .5rem + 2px);padding-top:.25rem;padding-bottom:.25rem;padding-left:.5rem;font-size:.875rem}.custom-select-lg{height:calc(1.5em + 1rem + 2px);padding-top:.5rem;padding-bottom:.5rem;padding-left:1rem;font-size:1.25rem}.custom-file{position:relative;display:inline-block;width:100%;height:calc(1.5em + .75rem + 2px);margin-bottom:0}.custom-file-input{position:relative;z-index:2;width:100%;height:calc(1.5em + .75rem + 2px);margin:0;opacity:0}.custom-file-input:focus~.custom-file-label{border-color:#80bdff;box-shadow:0 0 0 .2rem rgba(0,123,255,.25)}.custom-file-input:disabled~.custom-file-label,.custom-file-input[disabled]~.custom-file-label{background-color:#e9ecef}.custom-file-input:lang(en)~.custom-file-label::after{content:"Browse"}.custom-file-input~.custom-file-label[data-browse]::after{content:attr(data-browse)}.custom-file-label{position:absolute;top:0;right:0;left:0;z-index:1;height:calc(1.5em + .75rem + 2px);padding:.375rem .75rem;font-weight:400;line-height:1.5;color:#495057;background-color:#fff;border:1px solid #ced4da;border-radius:.25rem}.custom-file-label::after{position:absolute;top:0;right:0;bottom:0;z-index:3;display:block;height:calc(1.5em + .75rem);padding:.375rem .75rem;line-height:1.5;color:#495057;content:"Browse";background-color:#e9ecef;border-left:inherit;border-radius:0 .25rem .25rem 0}.custom-range{width:100%;height:1.4rem;padding:0;background-color:transparent;-webkit-appearance:none;-moz-appearance:none;appearance:none}.custom-range:focus{outline:0}.custom-range:focus::-webkit-slider-thumb{box-shadow:0 0 0 1px #fff,0 0 0 .2rem rgba(0,123,255,.25)}.custom-range:focus::-moz-range-thumb{box-shadow:0 0 0 1px #fff,0 0 0 .2rem rgba(0,123,255,.25)}.custom-range:focus::-ms-thumb{box-shadow:0 0 0 1px #fff,0 0 0 .2rem rgba(0,123,255,.25)}.custom-range::-moz-focus-outer{border:0}.custom-range::-webkit-slider-thumb{width:1rem;height:1rem;margin-top:-.25rem;background-color:#007bff;border:0;border-radius:1rem;-webkit-transition:background-color .15s ease-in-out,border-color .15s ease-in-out,box-shadow .15s ease-in-out;transition:background-color .15s ease-in-out,border-color .15s ease-in-out,box-shadow .15s ease-in-out;-webkit-appearance:none;appearance:none}@media (prefers-reduced-motion:reduce){.custom-range::-webkit-slider-thumb{-webkit-transition:none;transition:none}}.custom-range::-webkit-slider-thumb:active{background-color:#b3d7ff}.custom-range::-webkit-slider-runnable-track{width:100%;height:.5rem;color:transparent;cursor:pointer;background-color:#dee2e6;border-color:transparent;border-radius:1rem}.custom-range::-moz-range-thumb{width:1rem;height:1rem;background-color:#007bff;border:0;border-radius:1rem;-moz-transition:background-color .15s ease-in-out,border-color .15s ease-in-out,box-shadow .15s ease-in-out;transition:background-color .15s ease-in-out,border-color .15s ease-in-out,box-shadow .15s ease-in-out;-moz-appearance:none;appearance:none}@media (prefers-reduced-motion:reduce){.custom-range::-moz-range-thumb{-moz-transition:none;transition:none}}.custom-range::-moz-range-thumb:active{background-color:#b3d7ff}.custom-range::-moz-range-track{width:100%;height:.5rem;color:transparent;cursor:pointer;background-color:#dee2e6;border-color:transparent;border-radius:1rem}.custom-range::-ms-thumb{width:1rem;height:1rem;margin-top:0;margin-right:.2rem;margin-left:.2rem;background-color:#007bff;border:0;border-radius:1rem;-ms-transition:background-color .15s ease-in-out,border-color .15s ease-in-out,box-shadow .15s ease-in-out;transition:background-color .15s ease-in-out,border-color .15s ease-in-out,box-shadow .15s ease-in-out;appearance:none}@media (prefers-reduced-motion:reduce){.custom-range::-ms-thumb{-ms-transition:none;transition:none}}.custom-range::-ms-thumb:active{background-color:#b3d7ff}.custom-range::-ms-track{width:100%;height:.5rem;color:transparent;cursor:pointer;background-color:transparent;border-color:transparent;border-width:.5rem}.custom-range::-ms-fill-lower{background-color:#dee2e6;border-radius:1rem}.custom-range::-ms-fill-upper{margin-right:15px;background-color:#dee2e6;border-radius:1rem}.custom-range:disabled::-webkit-slider-thumb{background-color:#adb5bd}.custom-range:disabled::-webkit-slider-runnable-track{cursor:default}.custom-range:disabled::-moz-range-thumb{background-color:#adb5bd}.custom-range:disabled::-moz-range-track{cursor:default}.custom-range:disabled::-ms-thumb{background-color:#adb5bd}.custom-control-label::before,.custom-file-label,.custom-select{transition:background-color .15s ease-in-out,border-color .15s ease-in-out,box-shadow .15s ease-in-out}@media (prefers-reduced-motion:reduce){.custom-control-label::before,.custom-file-label,.custom-select{transition:none}}.nav{display:-ms-flexbox;display:flex;-ms-flex-wrap:wrap;flex-wrap:wrap;padding-left:0;margin-bottom:0;list-style:none}.nav-link{display:block;padding:.5rem 1rem}.nav-link:focus,.nav-link:hover{text-decoration:none}.nav-link.disabled{color:#6c757d;pointer-events:none;cursor:default}.nav-tabs{border-bottom:1px solid #dee2e6}.nav-tabs .nav-item{margin-bottom:-1px}.nav-tabs .nav-link{border:1px solid transparent;border-top-left-radius:.25rem;border-top-right-radius:.25rem}.nav-tabs .nav-link:focus,.nav-tabs .nav-link:hover{border-color:#e9ecef #e9ecef #dee2e6}.nav-tabs .nav-link.disabled{color:#6c757d;background-color:transparent;border-color:transparent}.nav-tabs .nav-item.show .nav-link,.nav-tabs .nav-link.active{color:#495057;background-color:#fff;border-color:#dee2e6 #dee2e6 #fff}.nav-tabs .dropdown-menu{margin-top:-1px;border-top-left-radius:0;border-top-right-radius:0}.nav-pills .nav-link{border-radius:.25rem}.nav-pills .nav-link.active,.nav-pills .show>.nav-link{color:#fff;background-color:#007bff}.nav-fill .nav-item{-ms-flex:1 1 auto;flex:1 1 auto;text-align:center}.nav-justified .nav-item{-ms-flex-preferred-size:0;flex-basis:0;-ms-flex-positive:1;flex-grow:1;text-align:center}.tab-content>.tab-pane{display:none}.tab-content>.active{display:block}.navbar{position:relative;display:-ms-flexbox;display:flex;-ms-flex-wrap:wrap;flex-wrap:wrap;-ms-flex-align:center;align-items:center;-ms-flex-pack:justify;justify-content:space-between;padding:.5rem 1rem}.navbar .container,.navbar .container-fluid,.navbar .container-lg,.navbar .container-md,.navbar .container-sm,.navbar .container-xl{display:-ms-flexbox;display:flex;-ms-flex-wrap:wrap;flex-wrap:wrap;-ms-flex-align:center;align-items:center;-ms-flex-pack:justify;justify-content:space-between}.navbar-brand{display:inline-block;padding-top:.3125rem;padding-bottom:.3125rem;margin-right:1rem;font-size:1.25rem;line-height:inherit;white-space:nowrap}.navbar-brand:focus,.navbar-brand:hover{text-decoration:none}.navbar-nav{display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;padding-left:0;margin-bottom:0;list-style:none}.navbar-nav .nav-link{padding-right:0;padding-left:0}.navbar-nav .dropdown-menu{position:static;float:none}.navbar-text{display:inline-block;padding-top:.5rem;padding-bottom:.5rem}.navbar-collapse{-ms-flex-preferred-size:100%;flex-basis:100%;-ms-flex-positive:1;flex-grow:1;-ms-flex-align:center;align-items:center}.navbar-toggler{padding:.25rem .75rem;font-size:1.25rem;line-height:1;background-color:transparent;border:1px solid transparent;border-radius:.25rem}.navbar-toggler:focus,.navbar-toggler:hover{text-decoration:none}.navbar-toggler-icon{display:inline-block;width:1.5em;height:1.5em;vertical-align:middle;content:"";background:no-repeat center center;background-size:100% 100%}@media (max-width:575.98px){.navbar-expand-sm>.container,.navbar-expand-sm>.container-fluid,.navbar-expand-sm>.container-lg,.navbar-expand-sm>.container-md,.navbar-expand-sm>.container-sm,.navbar-expand-sm>.container-xl{padding-right:0;padding-left:0}}@media (min-width:576px){.navbar-expand-sm{-ms-flex-flow:row nowrap;flex-flow:row nowrap;-ms-flex-pack:start;justify-content:flex-start}.navbar-expand-sm .navbar-nav{-ms-flex-direction:row;flex-direction:row}.navbar-expand-sm .navbar-nav .dropdown-menu{position:absolute}.navbar-expand-sm .navbar-nav .nav-link{padding-right:.5rem;padding-left:.5rem}.navbar-expand-sm>.container,.navbar-expand-sm>.container-fluid,.navbar-expand-sm>.container-lg,.navbar-expand-sm>.container-md,.navbar-expand-sm>.container-sm,.navbar-expand-sm>.container-xl{-ms-flex-wrap:nowrap;flex-wrap:nowrap}.navbar-expand-sm .navbar-collapse{display:-ms-flexbox!important;display:flex!important;-ms-flex-preferred-size:auto;flex-basis:auto}.navbar-expand-sm .navbar-toggler{display:none}}@media (max-width:767.98px){.navbar-expand-md>.container,.navbar-expand-md>.container-fluid,.navbar-expand-md>.container-lg,.navbar-expand-md>.container-md,.navbar-expand-md>.container-sm,.navbar-expand-md>.container-xl{padding-right:0;padding-left:0}}@media (min-width:768px){.navbar-expand-md{-ms-flex-flow:row nowrap;flex-flow:row nowrap;-ms-flex-pack:start;justify-content:flex-start}.navbar-expand-md .navbar-nav{-ms-flex-direction:row;flex-direction:row}.navbar-expand-md .navbar-nav .dropdown-menu{position:absolute}.navbar-expand-md .navbar-nav .nav-link{padding-right:.5rem;padding-left:.5rem}.navbar-expand-md>.container,.navbar-expand-md>.container-fluid,.navbar-expand-md>.container-lg,.navbar-expand-md>.container-md,.navbar-expand-md>.container-sm,.navbar-expand-md>.container-xl{-ms-flex-wrap:nowrap;flex-wrap:nowrap}.navbar-expand-md .navbar-collapse{display:-ms-flexbox!important;display:flex!important;-ms-flex-preferred-size:auto;flex-basis:auto}.navbar-expand-md .navbar-toggler{display:none}}@media (max-width:991.98px){.navbar-expand-lg>.container,.navbar-expand-lg>.container-fluid,.navbar-expand-lg>.container-lg,.navbar-expand-lg>.container-md,.navbar-expand-lg>.container-sm,.navbar-expand-lg>.container-xl{padding-right:0;padding-left:0}}@media (min-width:992px){.navbar-expand-lg{-ms-flex-flow:row nowrap;flex-flow:row nowrap;-ms-flex-pack:start;justify-content:flex-start}.navbar-expand-lg .navbar-nav{-ms-flex-direction:row;flex-direction:row}.navbar-expand-lg .navbar-nav .dropdown-menu{position:absolute}.navbar-expand-lg .navbar-nav .nav-link{padding-right:.5rem;padding-left:.5rem}.navbar-expand-lg>.container,.navbar-expand-lg>.container-fluid,.navbar-expand-lg>.container-lg,.navbar-expand-lg>.container-md,.navbar-expand-lg>.container-sm,.navbar-expand-lg>.container-xl{-ms-flex-wrap:nowrap;flex-wrap:nowrap}.navbar-expand-lg .navbar-collapse{display:-ms-flexbox!important;display:flex!important;-ms-flex-preferred-size:auto;flex-basis:auto}.navbar-expand-lg .navbar-toggler{display:none}}@media (max-width:1199.98px){.navbar-expand-xl>.container,.navbar-expand-xl>.container-fluid,.navbar-expand-xl>.container-lg,.navbar-expand-xl>.container-md,.navbar-expand-xl>.container-sm,.navbar-expand-xl>.container-xl{padding-right:0;padding-left:0}}@media (min-width:1200px){.navbar-expand-xl{-ms-flex-flow:row nowrap;flex-flow:row nowrap;-ms-flex-pack:start;justify-content:flex-start}.navbar-expand-xl .navbar-nav{-ms-flex-direction:row;flex-direction:row}.navbar-expand-xl .navbar-nav .dropdown-menu{position:absolute}.navbar-expand-xl .navbar-nav .nav-link{padding-right:.5rem;padding-left:.5rem}.navbar-expand-xl>.container,.navbar-expand-xl>.container-fluid,.navbar-expand-xl>.container-lg,.navbar-expand-xl>.container-md,.navbar-expand-xl>.container-sm,.navbar-expand-xl>.container-xl{-ms-flex-wrap:nowrap;flex-wrap:nowrap}.navbar-expand-xl .navbar-collapse{display:-ms-flexbox!important;display:flex!important;-ms-flex-preferred-size:auto;flex-basis:auto}.navbar-expand-xl .navbar-toggler{display:none}}.navbar-expand{-ms-flex-flow:row nowrap;flex-flow:row nowrap;-ms-flex-pack:start;justify-content:flex-start}.navbar-expand>.container,.navbar-expand>.container-fluid,.navbar-expand>.container-lg,.navbar-expand>.container-md,.navbar-expand>.container-sm,.navbar-expand>.container-xl{padding-right:0;padding-left:0}.navbar-expand .navbar-nav{-ms-flex-direction:row;flex-direction:row}.navbar-expand .navbar-nav .dropdown-menu{position:absolute}.navbar-expand .navbar-nav .nav-link{padding-right:.5rem;padding-left:.5rem}.navbar-expand>.container,.navbar-expand>.container-fluid,.navbar-expand>.container-lg,.navbar-expand>.container-md,.navbar-expand>.container-sm,.navbar-expand>.container-xl{-ms-flex-wrap:nowrap;flex-wrap:nowrap}.navbar-expand .navbar-collapse{display:-ms-flexbox!important;display:flex!important;-ms-flex-preferred-size:auto;flex-basis:auto}.navbar-expand .navbar-toggler{display:none}.navbar-light .navbar-brand{color:rgba(0,0,0,.9)}.navbar-light .navbar-brand:focus,.navbar-light .navbar-brand:hover{color:rgba(0,0,0,.9)}.navbar-light .navbar-nav .nav-link{color:rgba(0,0,0,.5)}.navbar-light .navbar-nav .nav-link:focus,.navbar-light .navbar-nav .nav-link:hover{color:rgba(0,0,0,.7)}.navbar-light .navbar-nav .nav-link.disabled{color:rgba(0,0,0,.3)}.navbar-light .navbar-nav .active>.nav-link,.navbar-light .navbar-nav .nav-link.active,.navbar-light .navbar-nav .nav-link.show,.navbar-light .navbar-nav .show>.nav-link{color:rgba(0,0,0,.9)}.navbar-light .navbar-toggler{color:rgba(0,0,0,.5);border-color:rgba(0,0,0,.1)}.navbar-light .navbar-toggler-icon{background-image:url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' width='30' height='30' viewBox='0 0 30 30'%3e%3cpath stroke='rgba%280, 0, 0, 0.5%29' stroke-linecap='round' stroke-miterlimit='10' stroke-width='2' d='M4 7h22M4 15h22M4 23h22'/%3e%3c/svg%3e")}.navbar-light .navbar-text{color:rgba(0,0,0,.5)}.navbar-light .navbar-text a{color:rgba(0,0,0,.9)}.navbar-light .navbar-text a:focus,.navbar-light .navbar-text a:hover{color:rgba(0,0,0,.9)}.navbar-dark .navbar-brand{color:#fff}.navbar-dark .navbar-brand:focus,.navbar-dark .navbar-brand:hover{color:#fff}.navbar-dark .navbar-nav .nav-link{color:rgba(255,255,255,.5)}.navbar-dark .navbar-nav .nav-link:focus,.navbar-dark .navbar-nav .nav-link:hover{color:rgba(255,255,255,.75)}.navbar-dark .navbar-nav .nav-link.disabled{color:rgba(255,255,255,.25)}.navbar-dark .navbar-nav .active>.nav-link,.navbar-dark .navbar-nav .nav-link.active,.navbar-dark .navbar-nav .nav-link.show,.navbar-dark .navbar-nav .show>.nav-link{color:#fff}.navbar-dark .navbar-toggler{color:rgba(255,255,255,.5);border-color:rgba(255,255,255,.1)}.navbar-dark .navbar-toggler-icon{background-image:url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' width='30' height='30' viewBox='0 0 30 30'%3e%3cpath stroke='rgba%28255, 255, 255, 0.5%29' stroke-linecap='round' stroke-miterlimit='10' stroke-width='2' d='M4 7h22M4 15h22M4 23h22'/%3e%3c/svg%3e")}.navbar-dark .navbar-text{color:rgba(255,255,255,.5)}.navbar-dark .navbar-text a{color:#fff}.navbar-dark .navbar-text a:focus,.navbar-dark .navbar-text a:hover{color:#fff}.card{position:relative;display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;min-width:0;word-wrap:break-word;background-color:#fff;background-clip:border-box;border:1px solid rgba(0,0,0,.125);border-radius:.25rem}.card>hr{margin-right:0;margin-left:0}.card>.list-group{border-top:inherit;border-bottom:inherit}.card>.list-group:first-child{border-top-width:0;border-top-left-radius:calc(.25rem - 1px);border-top-right-radius:calc(.25rem - 1px)}.card>.list-group:last-child{border-bottom-width:0;border-bottom-right-radius:calc(.25rem - 1px);border-bottom-left-radius:calc(.25rem - 1px)}.card-body{-ms-flex:1 1 auto;flex:1 1 auto;min-height:1px;padding:1.25rem}.card-title{margin-bottom:.75rem}.card-subtitle{margin-top:-.375rem;margin-bottom:0}.card-text:last-child{margin-bottom:0}.card-link:hover{text-decoration:none}.card-link+.card-link{margin-left:1.25rem}.card-header{padding:.75rem 1.25rem;margin-bottom:0;background-color:rgba(0,0,0,.03);border-bottom:1px solid rgba(0,0,0,.125)}.card-header:first-child{border-radius:calc(.25rem - 1px) calc(.25rem - 1px) 0 0}.card-header+.list-group .list-group-item:first-child{border-top:0}.card-footer{padding:.75rem 1.25rem;background-color:rgba(0,0,0,.03);border-top:1px solid rgba(0,0,0,.125)}.card-footer:last-child{border-radius:0 0 calc(.25rem - 1px) calc(.25rem - 1px)}.card-header-tabs{margin-right:-.625rem;margin-bottom:-.75rem;margin-left:-.625rem;border-bottom:0}.card-header-pills{margin-right:-.625rem;margin-left:-.625rem}.card-img-overlay{position:absolute;top:0;right:0;bottom:0;left:0;padding:1.25rem}.card-img,.card-img-bottom,.card-img-top{-ms-flex-negative:0;flex-shrink:0;width:100%}.card-img,.card-img-top{border-top-left-radius:calc(.25rem - 1px);border-top-right-radius:calc(.25rem - 1px)}.card-img,.card-img-bottom{border-bottom-right-radius:calc(.25rem - 1px);border-bottom-left-radius:calc(.25rem - 1px)}.card-deck .card{margin-bottom:15px}@media (min-width:576px){.card-deck{display:-ms-flexbox;display:flex;-ms-flex-flow:row wrap;flex-flow:row wrap;margin-right:-15px;margin-left:-15px}.card-deck .card{-ms-flex:1 0 0%;flex:1 0 0%;margin-right:15px;margin-bottom:0;margin-left:15px}}.card-group>.card{margin-bottom:15px}@media (min-width:576px){.card-group{display:-ms-flexbox;display:flex;-ms-flex-flow:row wrap;flex-flow:row wrap}.card-group>.card{-ms-flex:1 0 0%;flex:1 0 0%;margin-bottom:0}.card-group>.card+.card{margin-left:0;border-left:0}.card-group>.card:not(:last-child){border-top-right-radius:0;border-bottom-right-radius:0}.card-group>.card:not(:last-child) .card-header,.card-group>.card:not(:last-child) .card-img-top{border-top-right-radius:0}.card-group>.card:not(:last-child) .card-footer,.card-group>.card:not(:last-child) .card-img-bottom{border-bottom-right-radius:0}.card-group>.card:not(:first-child){border-top-left-radius:0;border-bottom-left-radius:0}.card-group>.card:not(:first-child) .card-header,.card-group>.card:not(:first-child) .card-img-top{border-top-left-radius:0}.card-group>.card:not(:first-child) .card-footer,.card-group>.card:not(:first-child) .card-img-bottom{border-bottom-left-radius:0}}.card-columns .card{margin-bottom:.75rem}@media (min-width:576px){.card-columns{-webkit-column-count:3;-moz-column-count:3;column-count:3;-webkit-column-gap:1.25rem;-moz-column-gap:1.25rem;column-gap:1.25rem;orphans:1;widows:1}.card-columns .card{display:inline-block;width:100%}}.accordion>.card{overflow:hidden}.accordion>.card:not(:last-of-type){border-bottom:0;border-bottom-right-radius:0;border-bottom-left-radius:0}.accordion>.card:not(:first-of-type){border-top-left-radius:0;border-top-right-radius:0}.accordion>.card>.card-header{border-radius:0;margin-bottom:-1px}.breadcrumb{display:-ms-flexbox;display:flex;-ms-flex-wrap:wrap;flex-wrap:wrap;padding:.75rem 1rem;margin-bottom:1rem;list-style:none;background-color:#e9ecef;border-radius:.25rem}.breadcrumb-item{display:-ms-flexbox;display:flex}.breadcrumb-item+.breadcrumb-item{padding-left:.5rem}.breadcrumb-item+.breadcrumb-item::before{display:inline-block;padding-right:.5rem;color:#6c757d;content:"/"}.breadcrumb-item+.breadcrumb-item:hover::before{text-decoration:underline}.breadcrumb-item+.breadcrumb-item:hover::before{text-decoration:none}.breadcrumb-item.active{color:#6c757d}.pagination{display:-ms-flexbox;display:flex;padding-left:0;list-style:none;border-radius:.25rem}.page-link{position:relative;display:block;padding:.5rem .75rem;margin-left:-1px;line-height:1.25;color:#007bff;background-color:#fff;border:1px solid #dee2e6}.page-link:hover{z-index:2;color:#0056b3;text-decoration:none;background-color:#e9ecef;border-color:#dee2e6}.page-link:focus{z-index:3;outline:0;box-shadow:0 0 0 .2rem rgba(0,123,255,.25)}.page-item:first-child .page-link{margin-left:0;border-top-left-radius:.25rem;border-bottom-left-radius:.25rem}.page-item:last-child .page-link{border-top-right-radius:.25rem;border-bottom-right-radius:.25rem}.page-item.active .page-link{z-index:3;color:#fff;background-color:#007bff;border-color:#007bff}.page-item.disabled .page-link{color:#6c757d;pointer-events:none;cursor:auto;background-color:#fff;border-color:#dee2e6}.pagination-lg .page-link{padding:.75rem 1.5rem;font-size:1.25rem;line-height:1.5}.pagination-lg .page-item:first-child .page-link{border-top-left-radius:.3rem;border-bottom-left-radius:.3rem}.pagination-lg .page-item:last-child .page-link{border-top-right-radius:.3rem;border-bottom-right-radius:.3rem}.pagination-sm .page-link{padding:.25rem .5rem;font-size:.875rem;line-height:1.5}.pagination-sm .page-item:first-child .page-link{border-top-left-radius:.2rem;border-bottom-left-radius:.2rem}.pagination-sm .page-item:last-child .page-link{border-top-right-radius:.2rem;border-bottom-right-radius:.2rem}.badge{display:inline-block;padding:.25em .4em;font-size:75%;font-weight:700;line-height:1;text-align:center;white-space:nowrap;vertical-align:baseline;border-radius:.25rem;transition:color .15s ease-in-out,background-color .15s ease-in-out,border-color .15s ease-in-out,box-shadow .15s ease-in-out}@media (prefers-reduced-motion:reduce){.badge{transition:none}}a.badge:focus,a.badge:hover{text-decoration:none}.badge:empty{display:none}.btn .badge{position:relative;top:-1px}.badge-pill{padding-right:.6em;padding-left:.6em;border-radius:10rem}.badge-primary{color:#fff;background-color:#007bff}a.badge-primary:focus,a.badge-primary:hover{color:#fff;background-color:#0062cc}a.badge-primary.focus,a.badge-primary:focus{outline:0;box-shadow:0 0 0 .2rem rgba(0,123,255,.5)}.badge-secondary{color:#fff;background-color:#6c757d}a.badge-secondary:focus,a.badge-secondary:hover{color:#fff;background-color:#545b62}a.badge-secondary.focus,a.badge-secondary:focus{outline:0;box-shadow:0 0 0 .2rem rgba(108,117,125,.5)}.badge-success{color:#fff;background-color:#28a745}a.badge-success:focus,a.badge-success:hover{color:#fff;background-color:#1e7e34}a.badge-success.focus,a.badge-success:focus{outline:0;box-shadow:0 0 0 .2rem rgba(40,167,69,.5)}.badge-info{color:#fff;background-color:#17a2b8}a.badge-info:focus,a.badge-info:hover{color:#fff;background-color:#117a8b}a.badge-info.focus,a.badge-info:focus{outline:0;box-shadow:0 0 0 .2rem rgba(23,162,184,.5)}.badge-warning{color:#212529;background-color:#ffc107}a.badge-warning:focus,a.badge-warning:hover{color:#212529;background-color:#d39e00}a.badge-warning.focus,a.badge-warning:focus{outline:0;box-shadow:0 0 0 .2rem rgba(255,193,7,.5)}.badge-danger{color:#fff;background-color:#dc3545}a.badge-danger:focus,a.badge-danger:hover{color:#fff;background-color:#bd2130}a.badge-danger.focus,a.badge-danger:focus{outline:0;box-shadow:0 0 0 .2rem rgba(220,53,69,.5)}.badge-light{color:#212529;background-color:#f8f9fa}a.badge-light:focus,a.badge-light:hover{color:#212529;background-color:#dae0e5}a.badge-light.focus,a.badge-light:focus{outline:0;box-shadow:0 0 0 .2rem rgba(248,249,250,.5)}.badge-dark{color:#fff;background-color:#343a40}a.badge-dark:focus,a.badge-dark:hover{color:#fff;background-color:#1d2124}a.badge-dark.focus,a.badge-dark:focus{outline:0;box-shadow:0 0 0 .2rem rgba(52,58,64,.5)}.jumbotron{padding:2rem 1rem;margin-bottom:2rem;background-color:#e9ecef;border-radius:.3rem}@media (min-width:576px){.jumbotron{padding:4rem 2rem}}.jumbotron-fluid{padding-right:0;padding-left:0;border-radius:0}.alert{position:relative;padding:.75rem 1.25rem;margin-bottom:1rem;border:1px solid transparent;border-radius:.25rem}.alert-heading{color:inherit}.alert-link{font-weight:700}.alert-dismissible{padding-right:4rem}.alert-dismissible .close{position:absolute;top:0;right:0;padding:.75rem 1.25rem;color:inherit}.alert-primary{color:#004085;background-color:#cce5ff;border-color:#b8daff}.alert-primary hr{border-top-color:#9fcdff}.alert-primary .alert-link{color:#002752}.alert-secondary{color:#383d41;background-color:#e2e3e5;border-color:#d6d8db}.alert-secondary hr{border-top-color:#c8cbcf}.alert-secondary .alert-link{color:#202326}.alert-success{color:#155724;background-color:#d4edda;border-color:#c3e6cb}.alert-success hr{border-top-color:#b1dfbb}.alert-success .alert-link{color:#0b2e13}.alert-info{color:#0c5460;background-color:#d1ecf1;border-color:#bee5eb}.alert-info hr{border-top-color:#abdde5}.alert-info .alert-link{color:#062c33}.alert-warning{color:#856404;background-color:#fff3cd;border-color:#ffeeba}.alert-warning hr{border-top-color:#ffe8a1}.alert-warning .alert-link{color:#533f03}.alert-danger{color:#721c24;background-color:#f8d7da;border-color:#f5c6cb}.alert-danger hr{border-top-color:#f1b0b7}.alert-danger .alert-link{color:#491217}.alert-light{color:#818182;background-color:#fefefe;border-color:#fdfdfe}.alert-light hr{border-top-color:#ececf6}.alert-light .alert-link{color:#686868}.alert-dark{color:#1b1e21;background-color:#d6d8d9;border-color:#c6c8ca}.alert-dark hr{border-top-color:#b9bbbe}.alert-dark .alert-link{color:#040505}@-webkit-keyframes progress-bar-stripes{from{background-position:1rem 0}to{background-position:0 0}}@keyframes progress-bar-stripes{from{background-position:1rem 0}to{background-position:0 0}}.progress{display:-ms-flexbox;display:flex;height:1rem;overflow:hidden;line-height:0;font-size:.75rem;background-color:#e9ecef;border-radius:.25rem}.progress-bar{display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;-ms-flex-pack:center;justify-content:center;overflow:hidden;color:#fff;text-align:center;white-space:nowrap;background-color:#007bff;transition:width .6s ease}@media (prefers-reduced-motion:reduce){.progress-bar{transition:none}}.progress-bar-striped{background-image:linear-gradient(45deg,rgba(255,255,255,.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,.15) 50%,rgba(255,255,255,.15) 75%,transparent 75%,transparent);background-size:1rem 1rem}.progress-bar-animated{-webkit-animation:progress-bar-stripes 1s linear infinite;animation:progress-bar-stripes 1s linear infinite}@media (prefers-reduced-motion:reduce){.progress-bar-animated{-webkit-animation:none;animation:none}}.media{display:-ms-flexbox;display:flex;-ms-flex-align:start;align-items:flex-start}.media-body{-ms-flex:1;flex:1}.list-group{display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;padding-left:0;margin-bottom:0;border-radius:.25rem}.list-group-item-action{width:100%;color:#495057;text-align:inherit}.list-group-item-action:focus,.list-group-item-action:hover{z-index:1;color:#495057;text-decoration:none;background-color:#f8f9fa}.list-group-item-action:active{color:#212529;background-color:#e9ecef}.list-group-item{position:relative;display:block;padding:.75rem 1.25rem;background-color:#fff;border:1px solid rgba(0,0,0,.125)}.list-group-item:first-child{border-top-left-radius:inherit;border-top-right-radius:inherit}.list-group-item:last-child{border-bottom-right-radius:inherit;border-bottom-left-radius:inherit}.list-group-item.disabled,.list-group-item:disabled{color:#6c757d;pointer-events:none;background-color:#fff}.list-group-item.active{z-index:2;color:#fff;background-color:#007bff;border-color:#007bff}.list-group-item+.list-group-item{border-top-width:0}.list-group-item+.list-group-item.active{margin-top:-1px;border-top-width:1px}.list-group-horizontal{-ms-flex-direction:row;flex-direction:row}.list-group-horizontal>.list-group-item:first-child{border-bottom-left-radius:.25rem;border-top-right-radius:0}.list-group-horizontal>.list-group-item:last-child{border-top-right-radius:.25rem;border-bottom-left-radius:0}.list-group-horizontal>.list-group-item.active{margin-top:0}.list-group-horizontal>.list-group-item+.list-group-item{border-top-width:1px;border-left-width:0}.list-group-horizontal>.list-group-item+.list-group-item.active{margin-left:-1px;border-left-width:1px}@media (min-width:576px){.list-group-horizontal-sm{-ms-flex-direction:row;flex-direction:row}.list-group-horizontal-sm>.list-group-item:first-child{border-bottom-left-radius:.25rem;border-top-right-radius:0}.list-group-horizontal-sm>.list-group-item:last-child{border-top-right-radius:.25rem;border-bottom-left-radius:0}.list-group-horizontal-sm>.list-group-item.active{margin-top:0}.list-group-horizontal-sm>.list-group-item+.list-group-item{border-top-width:1px;border-left-width:0}.list-group-horizontal-sm>.list-group-item+.list-group-item.active{margin-left:-1px;border-left-width:1px}}@media (min-width:768px){.list-group-horizontal-md{-ms-flex-direction:row;flex-direction:row}.list-group-horizontal-md>.list-group-item:first-child{border-bottom-left-radius:.25rem;border-top-right-radius:0}.list-group-horizontal-md>.list-group-item:last-child{border-top-right-radius:.25rem;border-bottom-left-radius:0}.list-group-horizontal-md>.list-group-item.active{margin-top:0}.list-group-horizontal-md>.list-group-item+.list-group-item{border-top-width:1px;border-left-width:0}.list-group-horizontal-md>.list-group-item+.list-group-item.active{margin-left:-1px;border-left-width:1px}}@media (min-width:992px){.list-group-horizontal-lg{-ms-flex-direction:row;flex-direction:row}.list-group-horizontal-lg>.list-group-item:first-child{border-bottom-left-radius:.25rem;border-top-right-radius:0}.list-group-horizontal-lg>.list-group-item:last-child{border-top-right-radius:.25rem;border-bottom-left-radius:0}.list-group-horizontal-lg>.list-group-item.active{margin-top:0}.list-group-horizontal-lg>.list-group-item+.list-group-item{border-top-width:1px;border-left-width:0}.list-group-horizontal-lg>.list-group-item+.list-group-item.active{margin-left:-1px;border-left-width:1px}}@media (min-width:1200px){.list-group-horizontal-xl{-ms-flex-direction:row;flex-direction:row}.list-group-horizontal-xl>.list-group-item:first-child{border-bottom-left-radius:.25rem;border-top-right-radius:0}.list-group-horizontal-xl>.list-group-item:last-child{border-top-right-radius:.25rem;border-bottom-left-radius:0}.list-group-horizontal-xl>.list-group-item.active{margin-top:0}.list-group-horizontal-xl>.list-group-item+.list-group-item{border-top-width:1px;border-left-width:0}.list-group-horizontal-xl>.list-group-item+.list-group-item.active{margin-left:-1px;border-left-width:1px}}.list-group-flush{border-radius:0}.list-group-flush>.list-group-item{border-width:0 0 1px}.list-group-flush>.list-group-item:last-child{border-bottom-width:0}.list-group-item-primary{color:#004085;background-color:#b8daff}.list-group-item-primary.list-group-item-action:focus,.list-group-item-primary.list-group-item-action:hover{color:#004085;background-color:#9fcdff}.list-group-item-primary.list-group-item-action.active{color:#fff;background-color:#004085;border-color:#004085}.list-group-item-secondary{color:#383d41;background-color:#d6d8db}.list-group-item-secondary.list-group-item-action:focus,.list-group-item-secondary.list-group-item-action:hover{color:#383d41;background-color:#c8cbcf}.list-group-item-secondary.list-group-item-action.active{color:#fff;background-color:#383d41;border-color:#383d41}.list-group-item-success{color:#155724;background-color:#c3e6cb}.list-group-item-success.list-group-item-action:focus,.list-group-item-success.list-group-item-action:hover{color:#155724;background-color:#b1dfbb}.list-group-item-success.list-group-item-action.active{color:#fff;background-color:#155724;border-color:#155724}.list-group-item-info{color:#0c5460;background-color:#bee5eb}.list-group-item-info.list-group-item-action:focus,.list-group-item-info.list-group-item-action:hover{color:#0c5460;background-color:#abdde5}.list-group-item-info.list-group-item-action.active{color:#fff;background-color:#0c5460;border-color:#0c5460}.list-group-item-warning{color:#856404;background-color:#ffeeba}.list-group-item-warning.list-group-item-action:focus,.list-group-item-warning.list-group-item-action:hover{color:#856404;background-color:#ffe8a1}.list-group-item-warning.list-group-item-action.active{color:#fff;background-color:#856404;border-color:#856404}.list-group-item-danger{color:#721c24;background-color:#f5c6cb}.list-group-item-danger.list-group-item-action:focus,.list-group-item-danger.list-group-item-action:hover{color:#721c24;background-color:#f1b0b7}.list-group-item-danger.list-group-item-action.active{color:#fff;background-color:#721c24;border-color:#721c24}.list-group-item-light{color:#818182;background-color:#fdfdfe}.list-group-item-light.list-group-item-action:focus,.list-group-item-light.list-group-item-action:hover{color:#818182;background-color:#ececf6}.list-group-item-light.list-group-item-action.active{color:#fff;background-color:#818182;border-color:#818182}.list-group-item-dark{color:#1b1e21;background-color:#c6c8ca}.list-group-item-dark.list-group-item-action:focus,.list-group-item-dark.list-group-item-action:hover{color:#1b1e21;background-color:#b9bbbe}.list-group-item-dark.list-group-item-action.active{color:#fff;background-color:#1b1e21;border-color:#1b1e21}.close{float:right;font-size:1.5rem;font-weight:700;line-height:1;color:#000;text-shadow:0 1px 0 #fff;opacity:.5}.close:hover{color:#000;text-decoration:none}.close:not(:disabled):not(.disabled):focus,.close:not(:disabled):not(.disabled):hover{opacity:.75}button.close{padding:0;background-color:transparent;border:0}a.close.disabled{pointer-events:none}.toast{max-width:350px;overflow:hidden;font-size:.875rem;background-color:rgba(255,255,255,.85);background-clip:padding-box;border:1px solid rgba(0,0,0,.1);box-shadow:0 .25rem .75rem rgba(0,0,0,.1);-webkit-backdrop-filter:blur(10px);backdrop-filter:blur(10px);opacity:0;border-radius:.25rem}.toast:not(:last-child){margin-bottom:.75rem}.toast.showing{opacity:1}.toast.show{display:block;opacity:1}.toast.hide{display:none}.toast-header{display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;padding:.25rem .75rem;color:#6c757d;background-color:rgba(255,255,255,.85);background-clip:padding-box;border-bottom:1px solid rgba(0,0,0,.05)}.toast-body{padding:.75rem}.modal-open{overflow:hidden}.modal-open .modal{overflow-x:hidden;overflow-y:auto}.modal{position:fixed;top:0;left:0;z-index:1050;display:none;width:100%;height:100%;overflow:hidden;outline:0}.modal-dialog{position:relative;width:auto;margin:.5rem;pointer-events:none}.modal.fade .modal-dialog{transition:-webkit-transform .3s ease-out;transition:transform .3s ease-out;transition:transform .3s ease-out,-webkit-transform .3s ease-out;-webkit-transform:translate(0,-50px);transform:translate(0,-50px)}@media (prefers-reduced-motion:reduce){.modal.fade .modal-dialog{transition:none}}.modal.show .modal-dialog{-webkit-transform:none;transform:none}.modal.modal-static .modal-dialog{-webkit-transform:scale(1.02);transform:scale(1.02)}.modal-dialog-scrollable{display:-ms-flexbox;display:flex;max-height:calc(100% - 1rem)}.modal-dialog-scrollable .modal-content{max-height:calc(100vh - 1rem);overflow:hidden}.modal-dialog-scrollable .modal-footer,.modal-dialog-scrollable .modal-header{-ms-flex-negative:0;flex-shrink:0}.modal-dialog-scrollable .modal-body{overflow-y:auto}.modal-dialog-centered{display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;min-height:calc(100% - 1rem)}.modal-dialog-centered::before{display:block;height:calc(100vh - 1rem);height:-webkit-min-content;height:-moz-min-content;height:min-content;content:""}.modal-dialog-centered.modal-dialog-scrollable{-ms-flex-direction:column;flex-direction:column;-ms-flex-pack:center;justify-content:center;height:100%}.modal-dialog-centered.modal-dialog-scrollable .modal-content{max-height:none}.modal-dialog-centered.modal-dialog-scrollable::before{content:none}.modal-content{position:relative;display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;width:100%;pointer-events:auto;background-color:#fff;background-clip:padding-box;border:1px solid rgba(0,0,0,.2);border-radius:.3rem;outline:0}.modal-backdrop{position:fixed;top:0;left:0;z-index:1040;width:100vw;height:100vh;background-color:#000}.modal-backdrop.fade{opacity:0}.modal-backdrop.show{opacity:.5}.modal-header{display:-ms-flexbox;display:flex;-ms-flex-align:start;align-items:flex-start;-ms-flex-pack:justify;justify-content:space-between;padding:1rem 1rem;border-bottom:1px solid #dee2e6;border-top-left-radius:calc(.3rem - 1px);border-top-right-radius:calc(.3rem - 1px)}.modal-header .close{padding:1rem 1rem;margin:-1rem -1rem -1rem auto}.modal-title{margin-bottom:0;line-height:1.5}.modal-body{position:relative;-ms-flex:1 1 auto;flex:1 1 auto;padding:1rem}.modal-footer{display:-ms-flexbox;display:flex;-ms-flex-wrap:wrap;flex-wrap:wrap;-ms-flex-align:center;align-items:center;-ms-flex-pack:end;justify-content:flex-end;padding:.75rem;border-top:1px solid #dee2e6;border-bottom-right-radius:calc(.3rem - 1px);border-bottom-left-radius:calc(.3rem - 1px)}.modal-footer>*{margin:.25rem}.modal-scrollbar-measure{position:absolute;top:-9999px;width:50px;height:50px;overflow:scroll}@media (min-width:576px){.modal-dialog{max-width:500px;margin:1.75rem auto}.modal-dialog-scrollable{max-height:calc(100% - 3.5rem)}.modal-dialog-scrollable .modal-content{max-height:calc(100vh - 3.5rem)}.modal-dialog-centered{min-height:calc(100% - 3.5rem)}.modal-dialog-centered::before{height:calc(100vh - 3.5rem);height:-webkit-min-content;height:-moz-min-content;height:min-content}.modal-sm{max-width:300px}}@media (min-width:992px){.modal-lg,.modal-xl{max-width:800px}}@media (min-width:1200px){.modal-xl{max-width:1140px}}.tooltip{position:absolute;z-index:1070;display:block;margin:0;font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,"Helvetica Neue",Arial,"Noto Sans",sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol","Noto Color Emoji";font-style:normal;font-weight:400;line-height:1.5;text-align:left;text-align:start;text-decoration:none;text-shadow:none;text-transform:none;letter-spacing:normal;word-break:normal;word-spacing:normal;white-space:normal;line-break:auto;font-size:.875rem;word-wrap:break-word;opacity:0}.tooltip.show{opacity:.9}.tooltip .arrow{position:absolute;display:block;width:.8rem;height:.4rem}.tooltip .arrow::before{position:absolute;content:"";border-color:transparent;border-style:solid}.bs-tooltip-auto[x-placement^=top],.bs-tooltip-top{padding:.4rem 0}.bs-tooltip-auto[x-placement^=top] .arrow,.bs-tooltip-top .arrow{bottom:0}.bs-tooltip-auto[x-placement^=top] .arrow::before,.bs-tooltip-top .arrow::before{top:0;border-width:.4rem .4rem 0;border-top-color:#000}.bs-tooltip-auto[x-placement^=right],.bs-tooltip-right{padding:0 .4rem}.bs-tooltip-auto[x-placement^=right] .arrow,.bs-tooltip-right .arrow{left:0;width:.4rem;height:.8rem}.bs-tooltip-auto[x-placement^=right] .arrow::before,.bs-tooltip-right .arrow::before{right:0;border-width:.4rem .4rem .4rem 0;border-right-color:#000}.bs-tooltip-auto[x-placement^=bottom],.bs-tooltip-bottom{padding:.4rem 0}.bs-tooltip-auto[x-placement^=bottom] .arrow,.bs-tooltip-bottom .arrow{top:0}.bs-tooltip-auto[x-placement^=bottom] .arrow::before,.bs-tooltip-bottom .arrow::before{bottom:0;border-width:0 .4rem .4rem;border-bottom-color:#000}.bs-tooltip-auto[x-placement^=left],.bs-tooltip-left{padding:0 .4rem}.bs-tooltip-auto[x-placement^=left] .arrow,.bs-tooltip-left .arrow{right:0;width:.4rem;height:.8rem}.bs-tooltip-auto[x-placement^=left] .arrow::before,.bs-tooltip-left .arrow::before{left:0;border-width:.4rem 0 .4rem .4rem;border-left-color:#000}.tooltip-inner{max-width:200px;padding:.25rem .5rem;color:#fff;text-align:center;background-color:#000;border-radius:.25rem}.popover{position:absolute;top:0;left:0;z-index:1060;display:block;max-width:276px;font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,"Helvetica Neue",Arial,"Noto Sans",sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol","Noto Color Emoji";font-style:normal;font-weight:400;line-height:1.5;text-align:left;text-align:start;text-decoration:none;text-shadow:none;text-transform:none;letter-spacing:normal;word-break:normal;word-spacing:normal;white-space:normal;line-break:auto;font-size:.875rem;word-wrap:break-word;background-color:#fff;background-clip:padding-box;border:1px solid rgba(0,0,0,.2);border-radius:.3rem}.popover .arrow{position:absolute;display:block;width:1rem;height:.5rem;margin:0 .3rem}.popover .arrow::after,.popover .arrow::before{position:absolute;display:block;content:"";border-color:transparent;border-style:solid}.bs-popover-auto[x-placement^=top],.bs-popover-top{margin-bottom:.5rem}.bs-popover-auto[x-placement^=top]>.arrow,.bs-popover-top>.arrow{bottom:calc(-.5rem - 1px)}.bs-popover-auto[x-placement^=top]>.arrow::before,.bs-popover-top>.arrow::before{bottom:0;border-width:.5rem .5rem 0;border-top-color:rgba(0,0,0,.25)}.bs-popover-auto[x-placement^=top]>.arrow::after,.bs-popover-top>.arrow::after{bottom:1px;border-width:.5rem .5rem 0;border-top-color:#fff}.bs-popover-auto[x-placement^=right],.bs-popover-right{margin-left:.5rem}.bs-popover-auto[x-placement^=right]>.arrow,.bs-popover-right>.arrow{left:calc(-.5rem - 1px);width:.5rem;height:1rem;margin:.3rem 0}.bs-popover-auto[x-placement^=right]>.arrow::before,.bs-popover-right>.arrow::before{left:0;border-width:.5rem .5rem .5rem 0;border-right-color:rgba(0,0,0,.25)}.bs-popover-auto[x-placement^=right]>.arrow::after,.bs-popover-right>.arrow::after{left:1px;border-width:.5rem .5rem .5rem 0;border-right-color:#fff}.bs-popover-auto[x-placement^=bottom],.bs-popover-bottom{margin-top:.5rem}.bs-popover-auto[x-placement^=bottom]>.arrow,.bs-popover-bottom>.arrow{top:calc(-.5rem - 1px)}.bs-popover-auto[x-placement^=bottom]>.arrow::before,.bs-popover-bottom>.arrow::before{top:0;border-width:0 .5rem .5rem .5rem;border-bottom-color:rgba(0,0,0,.25)}.bs-popover-auto[x-placement^=bottom]>.arrow::after,.bs-popover-bottom>.arrow::after{top:1px;border-width:0 .5rem .5rem .5rem;border-bottom-color:#fff}.bs-popover-auto[x-placement^=bottom] .popover-header::before,.bs-popover-bottom .popover-header::before{position:absolute;top:0;left:50%;display:block;width:1rem;margin-left:-.5rem;content:"";border-bottom:1px solid #f7f7f7}.bs-popover-auto[x-placement^=left],.bs-popover-left{margin-right:.5rem}.bs-popover-auto[x-placement^=left]>.arrow,.bs-popover-left>.arrow{right:calc(-.5rem - 1px);width:.5rem;height:1rem;margin:.3rem 0}.bs-popover-auto[x-placement^=left]>.arrow::before,.bs-popover-left>.arrow::before{right:0;border-width:.5rem 0 .5rem .5rem;border-left-color:rgba(0,0,0,.25)}.bs-popover-auto[x-placement^=left]>.arrow::after,.bs-popover-left>.arrow::after{right:1px;border-width:.5rem 0 .5rem .5rem;border-left-color:#fff}.popover-header{padding:.5rem .75rem;margin-bottom:0;font-size:1rem;background-color:#f7f7f7;border-bottom:1px solid #ebebeb;border-top-left-radius:calc(.3rem - 1px);border-top-right-radius:calc(.3rem - 1px)}.popover-header:empty{display:none}.popover-body{padding:.5rem .75rem;color:#212529}.carousel{position:relative}.carousel.pointer-event{-ms-touch-action:pan-y;touch-action:pan-y}.carousel-inner{position:relative;width:100%;overflow:hidden}.carousel-inner::after{display:block;clear:both;content:""}.carousel-item{position:relative;display:none;float:left;width:100%;margin-right:-100%;-webkit-backface-visibility:hidden;backface-visibility:hidden;transition:-webkit-transform .6s ease-in-out;transition:transform .6s ease-in-out;transition:transform .6s ease-in-out,-webkit-transform .6s ease-in-out}@media (prefers-reduced-motion:reduce){.carousel-item{transition:none}}.carousel-item-next,.carousel-item-prev,.carousel-item.active{display:block}.active.carousel-item-right,.carousel-item-next:not(.carousel-item-left){-webkit-transform:translateX(100%);transform:translateX(100%)}.active.carousel-item-left,.carousel-item-prev:not(.carousel-item-right){-webkit-transform:translateX(-100%);transform:translateX(-100%)}.carousel-fade .carousel-item{opacity:0;transition-property:opacity;-webkit-transform:none;transform:none}.carousel-fade .carousel-item-next.carousel-item-left,.carousel-fade .carousel-item-prev.carousel-item-right,.carousel-fade .carousel-item.active{z-index:1;opacity:1}.carousel-fade .active.carousel-item-left,.carousel-fade .active.carousel-item-right{z-index:0;opacity:0;transition:opacity 0s .6s}@media (prefers-reduced-motion:reduce){.carousel-fade .active.carousel-item-left,.carousel-fade .active.carousel-item-right{transition:none}}.carousel-control-next,.carousel-control-prev{position:absolute;top:0;bottom:0;z-index:1;display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;-ms-flex-pack:center;justify-content:center;width:15%;color:#fff;text-align:center;opacity:.5;transition:opacity .15s ease}@media (prefers-reduced-motion:reduce){.carousel-control-next,.carousel-control-prev{transition:none}}.carousel-control-next:focus,.carousel-control-next:hover,.carousel-control-prev:focus,.carousel-control-prev:hover{color:#fff;text-decoration:none;outline:0;opacity:.9}.carousel-control-prev{left:0}.carousel-control-next{right:0}.carousel-control-next-icon,.carousel-control-prev-icon{display:inline-block;width:20px;height:20px;background:no-repeat 50%/100% 100%}.carousel-control-prev-icon{background-image:url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='%23fff' width='8' height='8' viewBox='0 0 8 8'%3e%3cpath d='M5.25 0l-4 4 4 4 1.5-1.5L4.25 4l2.5-2.5L5.25 0z'/%3e%3c/svg%3e")}.carousel-control-next-icon{background-image:url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='%23fff' width='8' height='8' viewBox='0 0 8 8'%3e%3cpath d='M2.75 0l-1.5 1.5L3.75 4l-2.5 2.5L2.75 8l4-4-4-4z'/%3e%3c/svg%3e")}.carousel-indicators{position:absolute;right:0;bottom:0;left:0;z-index:15;display:-ms-flexbox;display:flex;-ms-flex-pack:center;justify-content:center;padding-left:0;margin-right:15%;margin-left:15%;list-style:none}.carousel-indicators li{box-sizing:content-box;-ms-flex:0 1 auto;flex:0 1 auto;width:30px;height:3px;margin-right:3px;margin-left:3px;text-indent:-999px;cursor:pointer;background-color:#fff;background-clip:padding-box;border-top:10px solid transparent;border-bottom:10px solid transparent;opacity:.5;transition:opacity .6s ease}@media (prefers-reduced-motion:reduce){.carousel-indicators li{transition:none}}.carousel-indicators .active{opacity:1}.carousel-caption{position:absolute;right:15%;bottom:20px;left:15%;z-index:10;padding-top:20px;padding-bottom:20px;color:#fff;text-align:center}@-webkit-keyframes spinner-border{to{-webkit-transform:rotate(360deg);transform:rotate(360deg)}}@keyframes spinner-border{to{-webkit-transform:rotate(360deg);transform:rotate(360deg)}}.spinner-border{display:inline-block;width:2rem;height:2rem;vertical-align:text-bottom;border:.25em solid currentColor;border-right-color:transparent;border-radius:50%;-webkit-animation:spinner-border .75s linear infinite;animation:spinner-border .75s linear infinite}.spinner-border-sm{width:1rem;height:1rem;border-width:.2em}@-webkit-keyframes spinner-grow{0%{-webkit-transform:scale(0);transform:scale(0)}50%{opacity:1;-webkit-transform:none;transform:none}}@keyframes spinner-grow{0%{-webkit-transform:scale(0);transform:scale(0)}50%{opacity:1;-webkit-transform:none;transform:none}}.spinner-grow{display:inline-block;width:2rem;height:2rem;vertical-align:text-bottom;background-color:currentColor;border-radius:50%;opacity:0;-webkit-animation:spinner-grow .75s linear infinite;animation:spinner-grow .75s linear infinite}.spinner-grow-sm{width:1rem;height:1rem}.align-baseline{vertical-align:baseline!important}.align-top{vertical-align:top!important}.align-middle{vertical-align:middle!important}.align-bottom{vertical-align:bottom!important}.align-text-bottom{vertical-align:text-bottom!important}.align-text-top{vertical-align:text-top!important}.bg-primary{background-color:#007bff!important}a.bg-primary:focus,a.bg-primary:hover,button.bg-primary:focus,button.bg-primary:hover{background-color:#0062cc!important}.bg-secondary{background-color:#6c757d!important}a.bg-secondary:focus,a.bg-secondary:hover,button.bg-secondary:focus,button.bg-secondary:hover{background-color:#545b62!important}.bg-success{background-color:#28a745!important}a.bg-success:focus,a.bg-success:hover,button.bg-success:focus,button.bg-success:hover{background-color:#1e7e34!important}.bg-info{background-color:#17a2b8!important}a.bg-info:focus,a.bg-info:hover,button.bg-info:focus,button.bg-info:hover{background-color:#117a8b!important}.bg-warning{background-color:#ffc107!important}a.bg-warning:focus,a.bg-warning:hover,button.bg-warning:focus,button.bg-warning:hover{background-color:#d39e00!important}.bg-danger{background-color:#dc3545!important}a.bg-danger:focus,a.bg-danger:hover,button.bg-danger:focus,button.bg-danger:hover{background-color:#bd2130!important}.bg-light{background-color:#f8f9fa!important}a.bg-light:focus,a.bg-light:hover,button.bg-light:focus,button.bg-light:hover{background-color:#dae0e5!important}.bg-dark{background-color:#343a40!important}a.bg-dark:focus,a.bg-dark:hover,button.bg-dark:focus,button.bg-dark:hover{background-color:#1d2124!important}.bg-white{background-color:#fff!important}.bg-transparent{background-color:transparent!important}.border{border:1px solid #dee2e6!important}.border-top{border-top:1px solid #dee2e6!important}.border-right{border-right:1px solid #dee2e6!important}.border-bottom{border-bottom:1px solid #dee2e6!important}.border-left{border-left:1px solid #dee2e6!important}.border-0{border:0!important}.border-top-0{border-top:0!important}.border-right-0{border-right:0!important}.border-bottom-0{border-bottom:0!important}.border-left-0{border-left:0!important}.border-primary{border-color:#007bff!important}.border-secondary{border-color:#6c757d!important}.border-success{border-color:#28a745!important}.border-info{border-color:#17a2b8!important}.border-warning{border-color:#ffc107!important}.border-danger{border-color:#dc3545!important}.border-light{border-color:#f8f9fa!important}.border-dark{border-color:#343a40!important}.border-white{border-color:#fff!important}.rounded-sm{border-radius:.2rem!important}.rounded{border-radius:.25rem!important}.rounded-top{border-top-left-radius:.25rem!important;border-top-right-radius:.25rem!important}.rounded-right{border-top-right-radius:.25rem!important;border-bottom-right-radius:.25rem!important}.rounded-bottom{border-bottom-right-radius:.25rem!important;border-bottom-left-radius:.25rem!important}.rounded-left{border-top-left-radius:.25rem!important;border-bottom-left-radius:.25rem!important}.rounded-lg{border-radius:.3rem!important}.rounded-circle{border-radius:50%!important}.rounded-pill{border-radius:50rem!important}.rounded-0{border-radius:0!important}.clearfix::after{display:block;clear:both;content:""}.d-none{display:none!important}.d-inline{display:inline!important}.d-inline-block{display:inline-block!important}.d-block{display:block!important}.d-table{display:table!important}.d-table-row{display:table-row!important}.d-table-cell{display:table-cell!important}.d-flex{display:-ms-flexbox!important;display:flex!important}.d-inline-flex{display:-ms-inline-flexbox!important;display:inline-flex!important}@media (min-width:576px){.d-sm-none{display:none!important}.d-sm-inline{display:inline!important}.d-sm-inline-block{display:inline-block!important}.d-sm-block{display:block!important}.d-sm-table{display:table!important}.d-sm-table-row{display:table-row!important}.d-sm-table-cell{display:table-cell!important}.d-sm-flex{display:-ms-flexbox!important;display:flex!important}.d-sm-inline-flex{display:-ms-inline-flexbox!important;display:inline-flex!important}}@media (min-width:768px){.d-md-none{display:none!important}.d-md-inline{display:inline!important}.d-md-inline-block{display:inline-block!important}.d-md-block{display:block!important}.d-md-table{display:table!important}.d-md-table-row{display:table-row!important}.d-md-table-cell{display:table-cell!important}.d-md-flex{display:-ms-flexbox!important;display:flex!important}.d-md-inline-flex{display:-ms-inline-flexbox!important;display:inline-flex!important}}@media (min-width:992px){.d-lg-none{display:none!important}.d-lg-inline{display:inline!important}.d-lg-inline-block{display:inline-block!important}.d-lg-block{display:block!important}.d-lg-table{display:table!important}.d-lg-table-row{display:table-row!important}.d-lg-table-cell{display:table-cell!important}.d-lg-flex{display:-ms-flexbox!important;display:flex!important}.d-lg-inline-flex{display:-ms-inline-flexbox!important;display:inline-flex!important}}@media (min-width:1200px){.d-xl-none{display:none!important}.d-xl-inline{display:inline!important}.d-xl-inline-block{display:inline-block!important}.d-xl-block{display:block!important}.d-xl-table{display:table!important}.d-xl-table-row{display:table-row!important}.d-xl-table-cell{display:table-cell!important}.d-xl-flex{display:-ms-flexbox!important;display:flex!important}.d-xl-inline-flex{display:-ms-inline-flexbox!important;display:inline-flex!important}}@media print{.d-print-none{display:none!important}.d-print-inline{display:inline!important}.d-print-inline-block{display:inline-block!important}.d-print-block{display:block!important}.d-print-table{display:table!important}.d-print-table-row{display:table-row!important}.d-print-table-cell{display:table-cell!important}.d-print-flex{display:-ms-flexbox!important;display:flex!important}.d-print-inline-flex{display:-ms-inline-flexbox!important;display:inline-flex!important}}.embed-responsive{position:relative;display:block;width:100%;padding:0;overflow:hidden}.embed-responsive::before{display:block;content:""}.embed-responsive .embed-responsive-item,.embed-responsive embed,.embed-responsive iframe,.embed-responsive object,.embed-responsive video{position:absolute;top:0;bottom:0;left:0;width:100%;height:100%;border:0}.embed-responsive-21by9::before{padding-top:42.857143%}.embed-responsive-16by9::before{padding-top:56.25%}.embed-responsive-4by3::before{padding-top:75%}.embed-responsive-1by1::before{padding-top:100%}.flex-row{-ms-flex-direction:row!important;flex-direction:row!important}.flex-column{-ms-flex-direction:column!important;flex-direction:column!important}.flex-row-reverse{-ms-flex-direction:row-reverse!important;flex-direction:row-reverse!important}.flex-column-reverse{-ms-flex-direction:column-reverse!important;flex-direction:column-reverse!important}.flex-wrap{-ms-flex-wrap:wrap!important;flex-wrap:wrap!important}.flex-nowrap{-ms-flex-wrap:nowrap!important;flex-wrap:nowrap!important}.flex-wrap-reverse{-ms-flex-wrap:wrap-reverse!important;flex-wrap:wrap-reverse!important}.flex-fill{-ms-flex:1 1 auto!important;flex:1 1 auto!important}.flex-grow-0{-ms-flex-positive:0!important;flex-grow:0!important}.flex-grow-1{-ms-flex-positive:1!important;flex-grow:1!important}.flex-shrink-0{-ms-flex-negative:0!important;flex-shrink:0!important}.flex-shrink-1{-ms-flex-negative:1!important;flex-shrink:1!important}.justify-content-start{-ms-flex-pack:start!important;justify-content:flex-start!important}.justify-content-end{-ms-flex-pack:end!important;justify-content:flex-end!important}.justify-content-center{-ms-flex-pack:center!important;justify-content:center!important}.justify-content-between{-ms-flex-pack:justify!important;justify-content:space-between!important}.justify-content-around{-ms-flex-pack:distribute!important;justify-content:space-around!important}.align-items-start{-ms-flex-align:start!important;align-items:flex-start!important}.align-items-end{-ms-flex-align:end!important;align-items:flex-end!important}.align-items-center{-ms-flex-align:center!important;align-items:center!important}.align-items-baseline{-ms-flex-align:baseline!important;align-items:baseline!important}.align-items-stretch{-ms-flex-align:stretch!important;align-items:stretch!important}.align-content-start{-ms-flex-line-pack:start!important;align-content:flex-start!important}.align-content-end{-ms-flex-line-pack:end!important;align-content:flex-end!important}.align-content-center{-ms-flex-line-pack:center!important;align-content:center!important}.align-content-between{-ms-flex-line-pack:justify!important;align-content:space-between!important}.align-content-around{-ms-flex-line-pack:distribute!important;align-content:space-around!important}.align-content-stretch{-ms-flex-line-pack:stretch!important;align-content:stretch!important}.align-self-auto{-ms-flex-item-align:auto!important;align-self:auto!important}.align-self-start{-ms-flex-item-align:start!important;align-self:flex-start!important}.align-self-end{-ms-flex-item-align:end!important;align-self:flex-end!important}.align-self-center{-ms-flex-item-align:center!important;align-self:center!important}.align-self-baseline{-ms-flex-item-align:baseline!important;align-self:baseline!important}.align-self-stretch{-ms-flex-item-align:stretch!important;align-self:stretch!important}@media (min-width:576px){.flex-sm-row{-ms-flex-direction:row!important;flex-direction:row!important}.flex-sm-column{-ms-flex-direction:column!important;flex-direction:column!important}.flex-sm-row-reverse{-ms-flex-direction:row-reverse!important;flex-direction:row-reverse!important}.flex-sm-column-reverse{-ms-flex-direction:column-reverse!important;flex-direction:column-reverse!important}.flex-sm-wrap{-ms-flex-wrap:wrap!important;flex-wrap:wrap!important}.flex-sm-nowrap{-ms-flex-wrap:nowrap!important;flex-wrap:nowrap!important}.flex-sm-wrap-reverse{-ms-flex-wrap:wrap-reverse!important;flex-wrap:wrap-reverse!important}.flex-sm-fill{-ms-flex:1 1 auto!important;flex:1 1 auto!important}.flex-sm-grow-0{-ms-flex-positive:0!important;flex-grow:0!important}.flex-sm-grow-1{-ms-flex-positive:1!important;flex-grow:1!important}.flex-sm-shrink-0{-ms-flex-negative:0!important;flex-shrink:0!important}.flex-sm-shrink-1{-ms-flex-negative:1!important;flex-shrink:1!important}.justify-content-sm-start{-ms-flex-pack:start!important;justify-content:flex-start!important}.justify-content-sm-end{-ms-flex-pack:end!important;justify-content:flex-end!important}.justify-content-sm-center{-ms-flex-pack:center!important;justify-content:center!important}.justify-content-sm-between{-ms-flex-pack:justify!important;justify-content:space-between!important}.justify-content-sm-around{-ms-flex-pack:distribute!important;justify-content:space-around!important}.align-items-sm-start{-ms-flex-align:start!important;align-items:flex-start!important}.align-items-sm-end{-ms-flex-align:end!important;align-items:flex-end!important}.align-items-sm-center{-ms-flex-align:center!important;align-items:center!important}.align-items-sm-baseline{-ms-flex-align:baseline!important;align-items:baseline!important}.align-items-sm-stretch{-ms-flex-align:stretch!important;align-items:stretch!important}.align-content-sm-start{-ms-flex-line-pack:start!important;align-content:flex-start!important}.align-content-sm-end{-ms-flex-line-pack:end!important;align-content:flex-end!important}.align-content-sm-center{-ms-flex-line-pack:center!important;align-content:center!important}.align-content-sm-between{-ms-flex-line-pack:justify!important;align-content:space-between!important}.align-content-sm-around{-ms-flex-line-pack:distribute!important;align-content:space-around!important}.align-content-sm-stretch{-ms-flex-line-pack:stretch!important;align-content:stretch!important}.align-self-sm-auto{-ms-flex-item-align:auto!important;align-self:auto!important}.align-self-sm-start{-ms-flex-item-align:start!important;align-self:flex-start!important}.align-self-sm-end{-ms-flex-item-align:end!important;align-self:flex-end!important}.align-self-sm-center{-ms-flex-item-align:center!important;align-self:center!important}.align-self-sm-baseline{-ms-flex-item-align:baseline!important;align-self:baseline!important}.align-self-sm-stretch{-ms-flex-item-align:stretch!important;align-self:stretch!important}}@media (min-width:768px){.flex-md-row{-ms-flex-direction:row!important;flex-direction:row!important}.flex-md-column{-ms-flex-direction:column!important;flex-direction:column!important}.flex-md-row-reverse{-ms-flex-direction:row-reverse!important;flex-direction:row-reverse!important}.flex-md-column-reverse{-ms-flex-direction:column-reverse!important;flex-direction:column-reverse!important}.flex-md-wrap{-ms-flex-wrap:wrap!important;flex-wrap:wrap!important}.flex-md-nowrap{-ms-flex-wrap:nowrap!important;flex-wrap:nowrap!important}.flex-md-wrap-reverse{-ms-flex-wrap:wrap-reverse!important;flex-wrap:wrap-reverse!important}.flex-md-fill{-ms-flex:1 1 auto!important;flex:1 1 auto!important}.flex-md-grow-0{-ms-flex-positive:0!important;flex-grow:0!important}.flex-md-grow-1{-ms-flex-positive:1!important;flex-grow:1!important}.flex-md-shrink-0{-ms-flex-negative:0!important;flex-shrink:0!important}.flex-md-shrink-1{-ms-flex-negative:1!important;flex-shrink:1!important}.justify-content-md-start{-ms-flex-pack:start!important;justify-content:flex-start!important}.justify-content-md-end{-ms-flex-pack:end!important;justify-content:flex-end!important}.justify-content-md-center{-ms-flex-pack:center!important;justify-content:center!important}.justify-content-md-between{-ms-flex-pack:justify!important;justify-content:space-between!important}.justify-content-md-around{-ms-flex-pack:distribute!important;justify-content:space-around!important}.align-items-md-start{-ms-flex-align:start!important;align-items:flex-start!important}.align-items-md-end{-ms-flex-align:end!important;align-items:flex-end!important}.align-items-md-center{-ms-flex-align:center!important;align-items:center!important}.align-items-md-baseline{-ms-flex-align:baseline!important;align-items:baseline!important}.align-items-md-stretch{-ms-flex-align:stretch!important;align-items:stretch!important}.align-content-md-start{-ms-flex-line-pack:start!important;align-content:flex-start!important}.align-content-md-end{-ms-flex-line-pack:end!important;align-content:flex-end!important}.align-content-md-center{-ms-flex-line-pack:center!important;align-content:center!important}.align-content-md-between{-ms-flex-line-pack:justify!important;align-content:space-between!important}.align-content-md-around{-ms-flex-line-pack:distribute!important;align-content:space-around!important}.align-content-md-stretch{-ms-flex-line-pack:stretch!important;align-content:stretch!important}.align-self-md-auto{-ms-flex-item-align:auto!important;align-self:auto!important}.align-self-md-start{-ms-flex-item-align:start!important;align-self:flex-start!important}.align-self-md-end{-ms-flex-item-align:end!important;align-self:flex-end!important}.align-self-md-center{-ms-flex-item-align:center!important;align-self:center!important}.align-self-md-baseline{-ms-flex-item-align:baseline!important;align-self:baseline!important}.align-self-md-stretch{-ms-flex-item-align:stretch!important;align-self:stretch!important}}@media (min-width:992px){.flex-lg-row{-ms-flex-direction:row!important;flex-direction:row!important}.flex-lg-column{-ms-flex-direction:column!important;flex-direction:column!important}.flex-lg-row-reverse{-ms-flex-direction:row-reverse!important;flex-direction:row-reverse!important}.flex-lg-column-reverse{-ms-flex-direction:column-reverse!important;flex-direction:column-reverse!important}.flex-lg-wrap{-ms-flex-wrap:wrap!important;flex-wrap:wrap!important}.flex-lg-nowrap{-ms-flex-wrap:nowrap!important;flex-wrap:nowrap!important}.flex-lg-wrap-reverse{-ms-flex-wrap:wrap-reverse!important;flex-wrap:wrap-reverse!important}.flex-lg-fill{-ms-flex:1 1 auto!important;flex:1 1 auto!important}.flex-lg-grow-0{-ms-flex-positive:0!important;flex-grow:0!important}.flex-lg-grow-1{-ms-flex-positive:1!important;flex-grow:1!important}.flex-lg-shrink-0{-ms-flex-negative:0!important;flex-shrink:0!important}.flex-lg-shrink-1{-ms-flex-negative:1!important;flex-shrink:1!important}.justify-content-lg-start{-ms-flex-pack:start!important;justify-content:flex-start!important}.justify-content-lg-end{-ms-flex-pack:end!important;justify-content:flex-end!important}.justify-content-lg-center{-ms-flex-pack:center!important;justify-content:center!important}.justify-content-lg-between{-ms-flex-pack:justify!important;justify-content:space-between!important}.justify-content-lg-around{-ms-flex-pack:distribute!important;justify-content:space-around!important}.align-items-lg-start{-ms-flex-align:start!important;align-items:flex-start!important}.align-items-lg-end{-ms-flex-align:end!important;align-items:flex-end!important}.align-items-lg-center{-ms-flex-align:center!important;align-items:center!important}.align-items-lg-baseline{-ms-flex-align:baseline!important;align-items:baseline!important}.align-items-lg-stretch{-ms-flex-align:stretch!important;align-items:stretch!important}.align-content-lg-start{-ms-flex-line-pack:start!important;align-content:flex-start!important}.align-content-lg-end{-ms-flex-line-pack:end!important;align-content:flex-end!important}.align-content-lg-center{-ms-flex-line-pack:center!important;align-content:center!important}.align-content-lg-between{-ms-flex-line-pack:justify!important;align-content:space-between!important}.align-content-lg-around{-ms-flex-line-pack:distribute!important;align-content:space-around!important}.align-content-lg-stretch{-ms-flex-line-pack:stretch!important;align-content:stretch!important}.align-self-lg-auto{-ms-flex-item-align:auto!important;align-self:auto!important}.align-self-lg-start{-ms-flex-item-align:start!important;align-self:flex-start!important}.align-self-lg-end{-ms-flex-item-align:end!important;align-self:flex-end!important}.align-self-lg-center{-ms-flex-item-align:center!important;align-self:center!important}.align-self-lg-baseline{-ms-flex-item-align:baseline!important;align-self:baseline!important}.align-self-lg-stretch{-ms-flex-item-align:stretch!important;align-self:stretch!important}}@media (min-width:1200px){.flex-xl-row{-ms-flex-direction:row!important;flex-direction:row!important}.flex-xl-column{-ms-flex-direction:column!important;flex-direction:column!important}.flex-xl-row-reverse{-ms-flex-direction:row-reverse!important;flex-direction:row-reverse!important}.flex-xl-column-reverse{-ms-flex-direction:column-reverse!important;flex-direction:column-reverse!important}.flex-xl-wrap{-ms-flex-wrap:wrap!important;flex-wrap:wrap!important}.flex-xl-nowrap{-ms-flex-wrap:nowrap!important;flex-wrap:nowrap!important}.flex-xl-wrap-reverse{-ms-flex-wrap:wrap-reverse!important;flex-wrap:wrap-reverse!important}.flex-xl-fill{-ms-flex:1 1 auto!important;flex:1 1 auto!important}.flex-xl-grow-0{-ms-flex-positive:0!important;flex-grow:0!important}.flex-xl-grow-1{-ms-flex-positive:1!important;flex-grow:1!important}.flex-xl-shrink-0{-ms-flex-negative:0!important;flex-shrink:0!important}.flex-xl-shrink-1{-ms-flex-negative:1!important;flex-shrink:1!important}.justify-content-xl-start{-ms-flex-pack:start!important;justify-content:flex-start!important}.justify-content-xl-end{-ms-flex-pack:end!important;justify-content:flex-end!important}.justify-content-xl-center{-ms-flex-pack:center!important;justify-content:center!important}.justify-content-xl-between{-ms-flex-pack:justify!important;justify-content:space-between!important}.justify-content-xl-around{-ms-flex-pack:distribute!important;justify-content:space-around!important}.align-items-xl-start{-ms-flex-align:start!important;align-items:flex-start!important}.align-items-xl-end{-ms-flex-align:end!important;align-items:flex-end!important}.align-items-xl-center{-ms-flex-align:center!important;align-items:center!important}.align-items-xl-baseline{-ms-flex-align:baseline!important;align-items:baseline!important}.align-items-xl-stretch{-ms-flex-align:stretch!important;align-items:stretch!important}.align-content-xl-start{-ms-flex-line-pack:start!important;align-content:flex-start!important}.align-content-xl-end{-ms-flex-line-pack:end!important;align-content:flex-end!important}.align-content-xl-center{-ms-flex-line-pack:center!important;align-content:center!important}.align-content-xl-between{-ms-flex-line-pack:justify!important;align-content:space-between!important}.align-content-xl-around{-ms-flex-line-pack:distribute!important;align-content:space-around!important}.align-content-xl-stretch{-ms-flex-line-pack:stretch!important;align-content:stretch!important}.align-self-xl-auto{-ms-flex-item-align:auto!important;align-self:auto!important}.align-self-xl-start{-ms-flex-item-align:start!important;align-self:flex-start!important}.align-self-xl-end{-ms-flex-item-align:end!important;align-self:flex-end!important}.align-self-xl-center{-ms-flex-item-align:center!important;align-self:center!important}.align-self-xl-baseline{-ms-flex-item-align:baseline!important;align-self:baseline!important}.align-self-xl-stretch{-ms-flex-item-align:stretch!important;align-self:stretch!important}}.float-left{float:left!important}.float-right{float:right!important}.float-none{float:none!important}@media (min-width:576px){.float-sm-left{float:left!important}.float-sm-right{float:right!important}.float-sm-none{float:none!important}}@media (min-width:768px){.float-md-left{float:left!important}.float-md-right{float:right!important}.float-md-none{float:none!important}}@media (min-width:992px){.float-lg-left{float:left!important}.float-lg-right{float:right!important}.float-lg-none{float:none!important}}@media (min-width:1200px){.float-xl-left{float:left!important}.float-xl-right{float:right!important}.float-xl-none{float:none!important}}.user-select-all{-webkit-user-select:all!important;-moz-user-select:all!important;-ms-user-select:all!important;user-select:all!important}.user-select-auto{-webkit-user-select:auto!important;-moz-user-select:auto!important;-ms-user-select:auto!important;user-select:auto!important}.user-select-none{-webkit-user-select:none!important;-moz-user-select:none!important;-ms-user-select:none!important;user-select:none!important}.overflow-auto{overflow:auto!important}.overflow-hidden{overflow:hidden!important}.position-static{position:static!important}.position-relative{position:relative!important}.position-absolute{position:absolute!important}.position-fixed{position:fixed!important}.position-sticky{position:-webkit-sticky!important;position:sticky!important}.fixed-top{position:fixed;top:0;right:0;left:0;z-index:1030}.fixed-bottom{position:fixed;right:0;bottom:0;left:0;z-index:1030}@supports ((position:-webkit-sticky) or (position:sticky)){.sticky-top{position:-webkit-sticky;position:sticky;top:0;z-index:1020}}.sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0}.sr-only-focusable:active,.sr-only-focusable:focus{position:static;width:auto;height:auto;overflow:visible;clip:auto;white-space:normal}.shadow-sm{box-shadow:0 .125rem .25rem rgba(0,0,0,.075)!important}.shadow{box-shadow:0 .5rem 1rem rgba(0,0,0,.15)!important}.shadow-lg{box-shadow:0 1rem 3rem rgba(0,0,0,.175)!important}.shadow-none{box-shadow:none!important}.w-25{width:25%!important}.w-50{width:50%!important}.w-75{width:75%!important}.w-100{width:100%!important}.w-auto{width:auto!important}.h-25{height:25%!important}.h-50{height:50%!important}.h-75{height:75%!important}.h-100{height:100%!important}.h-auto{height:auto!important}.mw-100{max-width:100%!important}.mh-100{max-height:100%!important}.min-vw-100{min-width:100vw!important}.min-vh-100{min-height:100vh!important}.vw-100{width:100vw!important}.vh-100{height:100vh!important}.m-0{margin:0!important}.mt-0,.my-0{margin-top:0!important}.mr-0,.mx-0{margin-right:0!important}.mb-0,.my-0{margin-bottom:0!important}.ml-0,.mx-0{margin-left:0!important}.m-1{margin:.25rem!important}.mt-1,.my-1{margin-top:.25rem!important}.mr-1,.mx-1{margin-right:.25rem!important}.mb-1,.my-1{margin-bottom:.25rem!important}.ml-1,.mx-1{margin-left:.25rem!important}.m-2{margin:.5rem!important}.mt-2,.my-2{margin-top:.5rem!important}.mr-2,.mx-2{margin-right:.5rem!important}.mb-2,.my-2{margin-bottom:.5rem!important}.ml-2,.mx-2{margin-left:.5rem!important}.m-3{margin:1rem!important}.mt-3,.my-3{margin-top:1rem!important}.mr-3,.mx-3{margin-right:1rem!important}.mb-3,.my-3{margin-bottom:1rem!important}.ml-3,.mx-3{margin-left:1rem!important}.m-4{margin:1.5rem!important}.mt-4,.my-4{margin-top:1.5rem!important}.mr-4,.mx-4{margin-right:1.5rem!important}.mb-4,.my-4{margin-bottom:1.5rem!important}.ml-4,.mx-4{margin-left:1.5rem!important}.m-5{margin:3rem!important}.mt-5,.my-5{margin-top:3rem!important}.mr-5,.mx-5{margin-right:3rem!important}.mb-5,.my-5{margin-bottom:3rem!important}.ml-5,.mx-5{margin-left:3rem!important}.p-0{padding:0!important}.pt-0,.py-0{padding-top:0!important}.pr-0,.px-0{padding-right:0!important}.pb-0,.py-0{padding-bottom:0!important}.pl-0,.px-0{padding-left:0!important}.p-1{padding:.25rem!important}.pt-1,.py-1{padding-top:.25rem!important}.pr-1,.px-1{padding-right:.25rem!important}.pb-1,.py-1{padding-bottom:.25rem!important}.pl-1,.px-1{padding-left:.25rem!important}.p-2{padding:.5rem!important}.pt-2,.py-2{padding-top:.5rem!important}.pr-2,.px-2{padding-right:.5rem!important}.pb-2,.py-2{padding-bottom:.5rem!important}.pl-2,.px-2{padding-left:.5rem!important}.p-3{padding:1rem!important}.pt-3,.py-3{padding-top:1rem!important}.pr-3,.px-3{padding-right:1rem!important}.pb-3,.py-3{padding-bottom:1rem!important}.pl-3,.px-3{padding-left:1rem!important}.p-4{padding:1.5rem!important}.pt-4,.py-4{padding-top:1.5rem!important}.pr-4,.px-4{padding-right:1.5rem!important}.pb-4,.py-4{padding-bottom:1.5rem!important}.pl-4,.px-4{padding-left:1.5rem!important}.p-5{padding:3rem!important}.pt-5,.py-5{padding-top:3rem!important}.pr-5,.px-5{padding-right:3rem!important}.pb-5,.py-5{padding-bottom:3rem!important}.pl-5,.px-5{padding-left:3rem!important}.m-n1{margin:-.25rem!important}.mt-n1,.my-n1{margin-top:-.25rem!important}.mr-n1,.mx-n1{margin-right:-.25rem!important}.mb-n1,.my-n1{margin-bottom:-.25rem!important}.ml-n1,.mx-n1{margin-left:-.25rem!important}.m-n2{margin:-.5rem!important}.mt-n2,.my-n2{margin-top:-.5rem!important}.mr-n2,.mx-n2{margin-right:-.5rem!important}.mb-n2,.my-n2{margin-bottom:-.5rem!important}.ml-n2,.mx-n2{margin-left:-.5rem!important}.m-n3{margin:-1rem!important}.mt-n3,.my-n3{margin-top:-1rem!important}.mr-n3,.mx-n3{margin-right:-1rem!important}.mb-n3,.my-n3{margin-bottom:-1rem!important}.ml-n3,.mx-n3{margin-left:-1rem!important}.m-n4{margin:-1.5rem!important}.mt-n4,.my-n4{margin-top:-1.5rem!important}.mr-n4,.mx-n4{margin-right:-1.5rem!important}.mb-n4,.my-n4{margin-bottom:-1.5rem!important}.ml-n4,.mx-n4{margin-left:-1.5rem!important}.m-n5{margin:-3rem!important}.mt-n5,.my-n5{margin-top:-3rem!important}.mr-n5,.mx-n5{margin-right:-3rem!important}.mb-n5,.my-n5{margin-bottom:-3rem!important}.ml-n5,.mx-n5{margin-left:-3rem!important}.m-auto{margin:auto!important}.mt-auto,.my-auto{margin-top:auto!important}.mr-auto,.mx-auto{margin-right:auto!important}.mb-auto,.my-auto{margin-bottom:auto!important}.ml-auto,.mx-auto{margin-left:auto!important}@media (min-width:576px){.m-sm-0{margin:0!important}.mt-sm-0,.my-sm-0{margin-top:0!important}.mr-sm-0,.mx-sm-0{margin-right:0!important}.mb-sm-0,.my-sm-0{margin-bottom:0!important}.ml-sm-0,.mx-sm-0{margin-left:0!important}.m-sm-1{margin:.25rem!important}.mt-sm-1,.my-sm-1{margin-top:.25rem!important}.mr-sm-1,.mx-sm-1{margin-right:.25rem!important}.mb-sm-1,.my-sm-1{margin-bottom:.25rem!important}.ml-sm-1,.mx-sm-1{margin-left:.25rem!important}.m-sm-2{margin:.5rem!important}.mt-sm-2,.my-sm-2{margin-top:.5rem!important}.mr-sm-2,.mx-sm-2{margin-right:.5rem!important}.mb-sm-2,.my-sm-2{margin-bottom:.5rem!important}.ml-sm-2,.mx-sm-2{margin-left:.5rem!important}.m-sm-3{margin:1rem!important}.mt-sm-3,.my-sm-3{margin-top:1rem!important}.mr-sm-3,.mx-sm-3{margin-right:1rem!important}.mb-sm-3,.my-sm-3{margin-bottom:1rem!important}.ml-sm-3,.mx-sm-3{margin-left:1rem!important}.m-sm-4{margin:1.5rem!important}.mt-sm-4,.my-sm-4{margin-top:1.5rem!important}.mr-sm-4,.mx-sm-4{margin-right:1.5rem!important}.mb-sm-4,.my-sm-4{margin-bottom:1.5rem!important}.ml-sm-4,.mx-sm-4{margin-left:1.5rem!important}.m-sm-5{margin:3rem!important}.mt-sm-5,.my-sm-5{margin-top:3rem!important}.mr-sm-5,.mx-sm-5{margin-right:3rem!important}.mb-sm-5,.my-sm-5{margin-bottom:3rem!important}.ml-sm-5,.mx-sm-5{margin-left:3rem!important}.p-sm-0{padding:0!important}.pt-sm-0,.py-sm-0{padding-top:0!important}.pr-sm-0,.px-sm-0{padding-right:0!important}.pb-sm-0,.py-sm-0{padding-bottom:0!important}.pl-sm-0,.px-sm-0{padding-left:0!important}.p-sm-1{padding:.25rem!important}.pt-sm-1,.py-sm-1{padding-top:.25rem!important}.pr-sm-1,.px-sm-1{padding-right:.25rem!important}.pb-sm-1,.py-sm-1{padding-bottom:.25rem!important}.pl-sm-1,.px-sm-1{padding-left:.25rem!important}.p-sm-2{padding:.5rem!important}.pt-sm-2,.py-sm-2{padding-top:.5rem!important}.pr-sm-2,.px-sm-2{padding-right:.5rem!important}.pb-sm-2,.py-sm-2{padding-bottom:.5rem!important}.pl-sm-2,.px-sm-2{padding-left:.5rem!important}.p-sm-3{padding:1rem!important}.pt-sm-3,.py-sm-3{padding-top:1rem!important}.pr-sm-3,.px-sm-3{padding-right:1rem!important}.pb-sm-3,.py-sm-3{padding-bottom:1rem!important}.pl-sm-3,.px-sm-3{padding-left:1rem!important}.p-sm-4{padding:1.5rem!important}.pt-sm-4,.py-sm-4{padding-top:1.5rem!important}.pr-sm-4,.px-sm-4{padding-right:1.5rem!important}.pb-sm-4,.py-sm-4{padding-bottom:1.5rem!important}.pl-sm-4,.px-sm-4{padding-left:1.5rem!important}.p-sm-5{padding:3rem!important}.pt-sm-5,.py-sm-5{padding-top:3rem!important}.pr-sm-5,.px-sm-5{padding-right:3rem!important}.pb-sm-5,.py-sm-5{padding-bottom:3rem!important}.pl-sm-5,.px-sm-5{padding-left:3rem!important}.m-sm-n1{margin:-.25rem!important}.mt-sm-n1,.my-sm-n1{margin-top:-.25rem!important}.mr-sm-n1,.mx-sm-n1{margin-right:-.25rem!important}.mb-sm-n1,.my-sm-n1{margin-bottom:-.25rem!important}.ml-sm-n1,.mx-sm-n1{margin-left:-.25rem!important}.m-sm-n2{margin:-.5rem!important}.mt-sm-n2,.my-sm-n2{margin-top:-.5rem!important}.mr-sm-n2,.mx-sm-n2{margin-right:-.5rem!important}.mb-sm-n2,.my-sm-n2{margin-bottom:-.5rem!important}.ml-sm-n2,.mx-sm-n2{margin-left:-.5rem!important}.m-sm-n3{margin:-1rem!important}.mt-sm-n3,.my-sm-n3{margin-top:-1rem!important}.mr-sm-n3,.mx-sm-n3{margin-right:-1rem!important}.mb-sm-n3,.my-sm-n3{margin-bottom:-1rem!important}.ml-sm-n3,.mx-sm-n3{margin-left:-1rem!important}.m-sm-n4{margin:-1.5rem!important}.mt-sm-n4,.my-sm-n4{margin-top:-1.5rem!important}.mr-sm-n4,.mx-sm-n4{margin-right:-1.5rem!important}.mb-sm-n4,.my-sm-n4{margin-bottom:-1.5rem!important}.ml-sm-n4,.mx-sm-n4{margin-left:-1.5rem!important}.m-sm-n5{margin:-3rem!important}.mt-sm-n5,.my-sm-n5{margin-top:-3rem!important}.mr-sm-n5,.mx-sm-n5{margin-right:-3rem!important}.mb-sm-n5,.my-sm-n5{margin-bottom:-3rem!important}.ml-sm-n5,.mx-sm-n5{margin-left:-3rem!important}.m-sm-auto{margin:auto!important}.mt-sm-auto,.my-sm-auto{margin-top:auto!important}.mr-sm-auto,.mx-sm-auto{margin-right:auto!important}.mb-sm-auto,.my-sm-auto{margin-bottom:auto!important}.ml-sm-auto,.mx-sm-auto{margin-left:auto!important}}@media (min-width:768px){.m-md-0{margin:0!important}.mt-md-0,.my-md-0{margin-top:0!important}.mr-md-0,.mx-md-0{margin-right:0!important}.mb-md-0,.my-md-0{margin-bottom:0!important}.ml-md-0,.mx-md-0{margin-left:0!important}.m-md-1{margin:.25rem!important}.mt-md-1,.my-md-1{margin-top:.25rem!important}.mr-md-1,.mx-md-1{margin-right:.25rem!important}.mb-md-1,.my-md-1{margin-bottom:.25rem!important}.ml-md-1,.mx-md-1{margin-left:.25rem!important}.m-md-2{margin:.5rem!important}.mt-md-2,.my-md-2{margin-top:.5rem!important}.mr-md-2,.mx-md-2{margin-right:.5rem!important}.mb-md-2,.my-md-2{margin-bottom:.5rem!important}.ml-md-2,.mx-md-2{margin-left:.5rem!important}.m-md-3{margin:1rem!important}.mt-md-3,.my-md-3{margin-top:1rem!important}.mr-md-3,.mx-md-3{margin-right:1rem!important}.mb-md-3,.my-md-3{margin-bottom:1rem!important}.ml-md-3,.mx-md-3{margin-left:1rem!important}.m-md-4{margin:1.5rem!important}.mt-md-4,.my-md-4{margin-top:1.5rem!important}.mr-md-4,.mx-md-4{margin-right:1.5rem!important}.mb-md-4,.my-md-4{margin-bottom:1.5rem!important}.ml-md-4,.mx-md-4{margin-left:1.5rem!important}.m-md-5{margin:3rem!important}.mt-md-5,.my-md-5{margin-top:3rem!important}.mr-md-5,.mx-md-5{margin-right:3rem!important}.mb-md-5,.my-md-5{margin-bottom:3rem!important}.ml-md-5,.mx-md-5{margin-left:3rem!important}.p-md-0{padding:0!important}.pt-md-0,.py-md-0{padding-top:0!important}.pr-md-0,.px-md-0{padding-right:0!important}.pb-md-0,.py-md-0{padding-bottom:0!important}.pl-md-0,.px-md-0{padding-left:0!important}.p-md-1{padding:.25rem!important}.pt-md-1,.py-md-1{padding-top:.25rem!important}.pr-md-1,.px-md-1{padding-right:.25rem!important}.pb-md-1,.py-md-1{padding-bottom:.25rem!important}.pl-md-1,.px-md-1{padding-left:.25rem!important}.p-md-2{padding:.5rem!important}.pt-md-2,.py-md-2{padding-top:.5rem!important}.pr-md-2,.px-md-2{padding-right:.5rem!important}.pb-md-2,.py-md-2{padding-bottom:.5rem!important}.pl-md-2,.px-md-2{padding-left:.5rem!important}.p-md-3{padding:1rem!important}.pt-md-3,.py-md-3{padding-top:1rem!important}.pr-md-3,.px-md-3{padding-right:1rem!important}.pb-md-3,.py-md-3{padding-bottom:1rem!important}.pl-md-3,.px-md-3{padding-left:1rem!important}.p-md-4{padding:1.5rem!important}.pt-md-4,.py-md-4{padding-top:1.5rem!important}.pr-md-4,.px-md-4{padding-right:1.5rem!important}.pb-md-4,.py-md-4{padding-bottom:1.5rem!important}.pl-md-4,.px-md-4{padding-left:1.5rem!important}.p-md-5{padding:3rem!important}.pt-md-5,.py-md-5{padding-top:3rem!important}.pr-md-5,.px-md-5{padding-right:3rem!important}.pb-md-5,.py-md-5{padding-bottom:3rem!important}.pl-md-5,.px-md-5{padding-left:3rem!important}.m-md-n1{margin:-.25rem!important}.mt-md-n1,.my-md-n1{margin-top:-.25rem!important}.mr-md-n1,.mx-md-n1{margin-right:-.25rem!important}.mb-md-n1,.my-md-n1{margin-bottom:-.25rem!important}.ml-md-n1,.mx-md-n1{margin-left:-.25rem!important}.m-md-n2{margin:-.5rem!important}.mt-md-n2,.my-md-n2{margin-top:-.5rem!important}.mr-md-n2,.mx-md-n2{margin-right:-.5rem!important}.mb-md-n2,.my-md-n2{margin-bottom:-.5rem!important}.ml-md-n2,.mx-md-n2{margin-left:-.5rem!important}.m-md-n3{margin:-1rem!important}.mt-md-n3,.my-md-n3{margin-top:-1rem!important}.mr-md-n3,.mx-md-n3{margin-right:-1rem!important}.mb-md-n3,.my-md-n3{margin-bottom:-1rem!important}.ml-md-n3,.mx-md-n3{margin-left:-1rem!important}.m-md-n4{margin:-1.5rem!important}.mt-md-n4,.my-md-n4{margin-top:-1.5rem!important}.mr-md-n4,.mx-md-n4{margin-right:-1.5rem!important}.mb-md-n4,.my-md-n4{margin-bottom:-1.5rem!important}.ml-md-n4,.mx-md-n4{margin-left:-1.5rem!important}.m-md-n5{margin:-3rem!important}.mt-md-n5,.my-md-n5{margin-top:-3rem!important}.mr-md-n5,.mx-md-n5{margin-right:-3rem!important}.mb-md-n5,.my-md-n5{margin-bottom:-3rem!important}.ml-md-n5,.mx-md-n5{margin-left:-3rem!important}.m-md-auto{margin:auto!important}.mt-md-auto,.my-md-auto{margin-top:auto!important}.mr-md-auto,.mx-md-auto{margin-right:auto!important}.mb-md-auto,.my-md-auto{margin-bottom:auto!important}.ml-md-auto,.mx-md-auto{margin-left:auto!important}}@media (min-width:992px){.m-lg-0{margin:0!important}.mt-lg-0,.my-lg-0{margin-top:0!important}.mr-lg-0,.mx-lg-0{margin-right:0!important}.mb-lg-0,.my-lg-0{margin-bottom:0!important}.ml-lg-0,.mx-lg-0{margin-left:0!important}.m-lg-1{margin:.25rem!important}.mt-lg-1,.my-lg-1{margin-top:.25rem!important}.mr-lg-1,.mx-lg-1{margin-right:.25rem!important}.mb-lg-1,.my-lg-1{margin-bottom:.25rem!important}.ml-lg-1,.mx-lg-1{margin-left:.25rem!important}.m-lg-2{margin:.5rem!important}.mt-lg-2,.my-lg-2{margin-top:.5rem!important}.mr-lg-2,.mx-lg-2{margin-right:.5rem!important}.mb-lg-2,.my-lg-2{margin-bottom:.5rem!important}.ml-lg-2,.mx-lg-2{margin-left:.5rem!important}.m-lg-3{margin:1rem!important}.mt-lg-3,.my-lg-3{margin-top:1rem!important}.mr-lg-3,.mx-lg-3{margin-right:1rem!important}.mb-lg-3,.my-lg-3{margin-bottom:1rem!important}.ml-lg-3,.mx-lg-3{margin-left:1rem!important}.m-lg-4{margin:1.5rem!important}.mt-lg-4,.my-lg-4{margin-top:1.5rem!important}.mr-lg-4,.mx-lg-4{margin-right:1.5rem!important}.mb-lg-4,.my-lg-4{margin-bottom:1.5rem!important}.ml-lg-4,.mx-lg-4{margin-left:1.5rem!important}.m-lg-5{margin:3rem!important}.mt-lg-5,.my-lg-5{margin-top:3rem!important}.mr-lg-5,.mx-lg-5{margin-right:3rem!important}.mb-lg-5,.my-lg-5{margin-bottom:3rem!important}.ml-lg-5,.mx-lg-5{margin-left:3rem!important}.p-lg-0{padding:0!important}.pt-lg-0,.py-lg-0{padding-top:0!important}.pr-lg-0,.px-lg-0{padding-right:0!important}.pb-lg-0,.py-lg-0{padding-bottom:0!important}.pl-lg-0,.px-lg-0{padding-left:0!important}.p-lg-1{padding:.25rem!important}.pt-lg-1,.py-lg-1{padding-top:.25rem!important}.pr-lg-1,.px-lg-1{padding-right:.25rem!important}.pb-lg-1,.py-lg-1{padding-bottom:.25rem!important}.pl-lg-1,.px-lg-1{padding-left:.25rem!important}.p-lg-2{padding:.5rem!important}.pt-lg-2,.py-lg-2{padding-top:.5rem!important}.pr-lg-2,.px-lg-2{padding-right:.5rem!important}.pb-lg-2,.py-lg-2{padding-bottom:.5rem!important}.pl-lg-2,.px-lg-2{padding-left:.5rem!important}.p-lg-3{padding:1rem!important}.pt-lg-3,.py-lg-3{padding-top:1rem!important}.pr-lg-3,.px-lg-3{padding-right:1rem!important}.pb-lg-3,.py-lg-3{padding-bottom:1rem!important}.pl-lg-3,.px-lg-3{padding-left:1rem!important}.p-lg-4{padding:1.5rem!important}.pt-lg-4,.py-lg-4{padding-top:1.5rem!important}.pr-lg-4,.px-lg-4{padding-right:1.5rem!important}.pb-lg-4,.py-lg-4{padding-bottom:1.5rem!important}.pl-lg-4,.px-lg-4{padding-left:1.5rem!important}.p-lg-5{padding:3rem!important}.pt-lg-5,.py-lg-5{padding-top:3rem!important}.pr-lg-5,.px-lg-5{padding-right:3rem!important}.pb-lg-5,.py-lg-5{padding-bottom:3rem!important}.pl-lg-5,.px-lg-5{padding-left:3rem!important}.m-lg-n1{margin:-.25rem!important}.mt-lg-n1,.my-lg-n1{margin-top:-.25rem!important}.mr-lg-n1,.mx-lg-n1{margin-right:-.25rem!important}.mb-lg-n1,.my-lg-n1{margin-bottom:-.25rem!important}.ml-lg-n1,.mx-lg-n1{margin-left:-.25rem!important}.m-lg-n2{margin:-.5rem!important}.mt-lg-n2,.my-lg-n2{margin-top:-.5rem!important}.mr-lg-n2,.mx-lg-n2{margin-right:-.5rem!important}.mb-lg-n2,.my-lg-n2{margin-bottom:-.5rem!important}.ml-lg-n2,.mx-lg-n2{margin-left:-.5rem!important}.m-lg-n3{margin:-1rem!important}.mt-lg-n3,.my-lg-n3{margin-top:-1rem!important}.mr-lg-n3,.mx-lg-n3{margin-right:-1rem!important}.mb-lg-n3,.my-lg-n3{margin-bottom:-1rem!important}.ml-lg-n3,.mx-lg-n3{margin-left:-1rem!important}.m-lg-n4{margin:-1.5rem!important}.mt-lg-n4,.my-lg-n4{margin-top:-1.5rem!important}.mr-lg-n4,.mx-lg-n4{margin-right:-1.5rem!important}.mb-lg-n4,.my-lg-n4{margin-bottom:-1.5rem!important}.ml-lg-n4,.mx-lg-n4{margin-left:-1.5rem!important}.m-lg-n5{margin:-3rem!important}.mt-lg-n5,.my-lg-n5{margin-top:-3rem!important}.mr-lg-n5,.mx-lg-n5{margin-right:-3rem!important}.mb-lg-n5,.my-lg-n5{margin-bottom:-3rem!important}.ml-lg-n5,.mx-lg-n5{margin-left:-3rem!important}.m-lg-auto{margin:auto!important}.mt-lg-auto,.my-lg-auto{margin-top:auto!important}.mr-lg-auto,.mx-lg-auto{margin-right:auto!important}.mb-lg-auto,.my-lg-auto{margin-bottom:auto!important}.ml-lg-auto,.mx-lg-auto{margin-left:auto!important}}@media (min-width:1200px){.m-xl-0{margin:0!important}.mt-xl-0,.my-xl-0{margin-top:0!important}.mr-xl-0,.mx-xl-0{margin-right:0!important}.mb-xl-0,.my-xl-0{margin-bottom:0!important}.ml-xl-0,.mx-xl-0{margin-left:0!important}.m-xl-1{margin:.25rem!important}.mt-xl-1,.my-xl-1{margin-top:.25rem!important}.mr-xl-1,.mx-xl-1{margin-right:.25rem!important}.mb-xl-1,.my-xl-1{margin-bottom:.25rem!important}.ml-xl-1,.mx-xl-1{margin-left:.25rem!important}.m-xl-2{margin:.5rem!important}.mt-xl-2,.my-xl-2{margin-top:.5rem!important}.mr-xl-2,.mx-xl-2{margin-right:.5rem!important}.mb-xl-2,.my-xl-2{margin-bottom:.5rem!important}.ml-xl-2,.mx-xl-2{margin-left:.5rem!important}.m-xl-3{margin:1rem!important}.mt-xl-3,.my-xl-3{margin-top:1rem!important}.mr-xl-3,.mx-xl-3{margin-right:1rem!important}.mb-xl-3,.my-xl-3{margin-bottom:1rem!important}.ml-xl-3,.mx-xl-3{margin-left:1rem!important}.m-xl-4{margin:1.5rem!important}.mt-xl-4,.my-xl-4{margin-top:1.5rem!important}.mr-xl-4,.mx-xl-4{margin-right:1.5rem!important}.mb-xl-4,.my-xl-4{margin-bottom:1.5rem!important}.ml-xl-4,.mx-xl-4{margin-left:1.5rem!important}.m-xl-5{margin:3rem!important}.mt-xl-5,.my-xl-5{margin-top:3rem!important}.mr-xl-5,.mx-xl-5{margin-right:3rem!important}.mb-xl-5,.my-xl-5{margin-bottom:3rem!important}.ml-xl-5,.mx-xl-5{margin-left:3rem!important}.p-xl-0{padding:0!important}.pt-xl-0,.py-xl-0{padding-top:0!important}.pr-xl-0,.px-xl-0{padding-right:0!important}.pb-xl-0,.py-xl-0{padding-bottom:0!important}.pl-xl-0,.px-xl-0{padding-left:0!important}.p-xl-1{padding:.25rem!important}.pt-xl-1,.py-xl-1{padding-top:.25rem!important}.pr-xl-1,.px-xl-1{padding-right:.25rem!important}.pb-xl-1,.py-xl-1{padding-bottom:.25rem!important}.pl-xl-1,.px-xl-1{padding-left:.25rem!important}.p-xl-2{padding:.5rem!important}.pt-xl-2,.py-xl-2{padding-top:.5rem!important}.pr-xl-2,.px-xl-2{padding-right:.5rem!important}.pb-xl-2,.py-xl-2{padding-bottom:.5rem!important}.pl-xl-2,.px-xl-2{padding-left:.5rem!important}.p-xl-3{padding:1rem!important}.pt-xl-3,.py-xl-3{padding-top:1rem!important}.pr-xl-3,.px-xl-3{padding-right:1rem!important}.pb-xl-3,.py-xl-3{padding-bottom:1rem!important}.pl-xl-3,.px-xl-3{padding-left:1rem!important}.p-xl-4{padding:1.5rem!important}.pt-xl-4,.py-xl-4{padding-top:1.5rem!important}.pr-xl-4,.px-xl-4{padding-right:1.5rem!important}.pb-xl-4,.py-xl-4{padding-bottom:1.5rem!important}.pl-xl-4,.px-xl-4{padding-left:1.5rem!important}.p-xl-5{padding:3rem!important}.pt-xl-5,.py-xl-5{padding-top:3rem!important}.pr-xl-5,.px-xl-5{padding-right:3rem!important}.pb-xl-5,.py-xl-5{padding-bottom:3rem!important}.pl-xl-5,.px-xl-5{padding-left:3rem!important}.m-xl-n1{margin:-.25rem!important}.mt-xl-n1,.my-xl-n1{margin-top:-.25rem!important}.mr-xl-n1,.mx-xl-n1{margin-right:-.25rem!important}.mb-xl-n1,.my-xl-n1{margin-bottom:-.25rem!important}.ml-xl-n1,.mx-xl-n1{margin-left:-.25rem!important}.m-xl-n2{margin:-.5rem!important}.mt-xl-n2,.my-xl-n2{margin-top:-.5rem!important}.mr-xl-n2,.mx-xl-n2{margin-right:-.5rem!important}.mb-xl-n2,.my-xl-n2{margin-bottom:-.5rem!important}.ml-xl-n2,.mx-xl-n2{margin-left:-.5rem!important}.m-xl-n3{margin:-1rem!important}.mt-xl-n3,.my-xl-n3{margin-top:-1rem!important}.mr-xl-n3,.mx-xl-n3{margin-right:-1rem!important}.mb-xl-n3,.my-xl-n3{margin-bottom:-1rem!important}.ml-xl-n3,.mx-xl-n3{margin-left:-1rem!important}.m-xl-n4{margin:-1.5rem!important}.mt-xl-n4,.my-xl-n4{margin-top:-1.5rem!important}.mr-xl-n4,.mx-xl-n4{margin-right:-1.5rem!important}.mb-xl-n4,.my-xl-n4{margin-bottom:-1.5rem!important}.ml-xl-n4,.mx-xl-n4{margin-left:-1.5rem!important}.m-xl-n5{margin:-3rem!important}.mt-xl-n5,.my-xl-n5{margin-top:-3rem!important}.mr-xl-n5,.mx-xl-n5{margin-right:-3rem!important}.mb-xl-n5,.my-xl-n5{margin-bottom:-3rem!important}.ml-xl-n5,.mx-xl-n5{margin-left:-3rem!important}.m-xl-auto{margin:auto!important}.mt-xl-auto,.my-xl-auto{margin-top:auto!important}.mr-xl-auto,.mx-xl-auto{margin-right:auto!important}.mb-xl-auto,.my-xl-auto{margin-bottom:auto!important}.ml-xl-auto,.mx-xl-auto{margin-left:auto!important}}.stretched-link::after{position:absolute;top:0;right:0;bottom:0;left:0;z-index:1;pointer-events:auto;content:"";background-color:rgba(0,0,0,0)}.text-monospace{font-family:SFMono-Regular,Menlo,Monaco,Consolas,"Liberation Mono","Courier New",monospace!important}.text-justify{text-align:justify!important}.text-wrap{white-space:normal!important}.text-nowrap{white-space:nowrap!important}.text-truncate{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.text-left{text-align:left!important}.text-right{text-align:right!important}.text-center{text-align:center!important}@media (min-width:576px){.text-sm-left{text-align:left!important}.text-sm-right{text-align:right!important}.text-sm-center{text-align:center!important}}@media (min-width:768px){.text-md-left{text-align:left!important}.text-md-right{text-align:right!important}.text-md-center{text-align:center!important}}@media (min-width:992px){.text-lg-left{text-align:left!important}.text-lg-right{text-align:right!important}.text-lg-center{text-align:center!important}}@media (min-width:1200px){.text-xl-left{text-align:left!important}.text-xl-right{text-align:right!important}.text-xl-center{text-align:center!important}}.text-lowercase{text-transform:lowercase!important}.text-uppercase{text-transform:uppercase!important}.text-capitalize{text-transform:capitalize!important}.font-weight-light{font-weight:300!important}.font-weight-lighter{font-weight:lighter!important}.font-weight-normal{font-weight:400!important}.font-weight-bold{font-weight:700!important}.font-weight-bolder{font-weight:bolder!important}.font-italic{font-style:italic!important}.text-white{color:#fff!important}.text-primary{color:#007bff!important}a.text-primary:focus,a.text-primary:hover{color:#0056b3!important}.text-secondary{color:#6c757d!important}a.text-secondary:focus,a.text-secondary:hover{color:#494f54!important}.text-success{color:#28a745!important}a.text-success:focus,a.text-success:hover{color:#19692c!important}.text-info{color:#17a2b8!important}a.text-info:focus,a.text-info:hover{color:#0f6674!important}.text-warning{color:#ffc107!important}a.text-warning:focus,a.text-warning:hover{color:#ba8b00!important}.text-danger{color:#dc3545!important}a.text-danger:focus,a.text-danger:hover{color:#a71d2a!important}.text-light{color:#f8f9fa!important}a.text-light:focus,a.text-light:hover{color:#cbd3da!important}.text-dark{color:#343a40!important}a.text-dark:focus,a.text-dark:hover{color:#121416!important}.text-body{color:#212529!important}.text-muted{color:#6c757d!important}.text-black-50{color:rgba(0,0,0,.5)!important}.text-white-50{color:rgba(255,255,255,.5)!important}.text-hide{font:0/0 a;color:transparent;text-shadow:none;background-color:transparent;border:0}.text-decoration-none{text-decoration:none!important}.text-break{word-wrap:break-word!important}.text-reset{color:inherit!important}.visible{visibility:visible!important}.invisible{visibility:hidden!important}@media print{*,::after,::before{text-shadow:none!important;box-shadow:none!important}a:not(.btn){text-decoration:underline}abbr[title]::after{content:" (" attr(title) ")"}pre{white-space:pre-wrap!important}blockquote,pre{border:1px solid #adb5bd;page-break-inside:avoid}thead{display:table-header-group}img,tr{page-break-inside:avoid}h2,h3,p{orphans:3;widows:3}h2,h3{page-break-after:avoid}@page{size:a3}body{min-width:992px!important}.container{min-width:992px!important}.navbar{display:none}.badge{border:1px solid #000}.table{border-collapse:collapse!important}.table td,.table th{background-color:#fff!important}.table-bordered td,.table-bordered th{border:1px solid #dee2e6!important}.table-dark{color:inherit}.table-dark tbody+tbody,.table-dark td,.table-dark th,.table-dark thead th{border-color:#dee2e6}.table .thead-dark th{color:inherit;border-color:#dee2e6}} diff --git a/data/www/bootstrap.min.js b/data/www/bootstrap.min.js new file mode 100644 index 0000000000..c3fb738094 --- /dev/null +++ b/data/www/bootstrap.min.js @@ -0,0 +1,6 @@ +/*! + * Bootstrap v4.5.0 (https://getbootstrap.com/) + * Copyright 2011-2020 The Bootstrap Authors (https://github.com/twbs/bootstrap/graphs/contributors) + * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE) + */ +!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports,require("jquery"),require("popper.js")):"function"==typeof define&&define.amd?define(["exports","jquery","popper.js"],e):e((t=t||self).bootstrap={},t.jQuery,t.Popper)}(this,(function(t,e,n){"use strict";function i(t,e){for(var n=0;n=4)throw new Error("Bootstrap's JavaScript requires at least jQuery v1.9.1 but less than v4.0.0")}};c.jQueryDetection(),e.fn.emulateTransitionEnd=l,e.event.special[c.TRANSITION_END]={bindType:"transitionend",delegateType:"transitionend",handle:function(t){if(e(t.target).is(this))return t.handleObj.handler.apply(this,arguments)}};var h="alert",u=e.fn[h],d=function(){function t(t){this._element=t}var n=t.prototype;return n.close=function(t){var e=this._element;t&&(e=this._getRootElement(t)),this._triggerCloseEvent(e).isDefaultPrevented()||this._removeElement(e)},n.dispose=function(){e.removeData(this._element,"bs.alert"),this._element=null},n._getRootElement=function(t){var n=c.getSelectorFromElement(t),i=!1;return n&&(i=document.querySelector(n)),i||(i=e(t).closest(".alert")[0]),i},n._triggerCloseEvent=function(t){var n=e.Event("close.bs.alert");return e(t).trigger(n),n},n._removeElement=function(t){var n=this;if(e(t).removeClass("show"),e(t).hasClass("fade")){var i=c.getTransitionDurationFromElement(t);e(t).one(c.TRANSITION_END,(function(e){return n._destroyElement(t,e)})).emulateTransitionEnd(i)}else this._destroyElement(t)},n._destroyElement=function(t){e(t).detach().trigger("closed.bs.alert").remove()},t._jQueryInterface=function(n){return this.each((function(){var i=e(this),o=i.data("bs.alert");o||(o=new t(this),i.data("bs.alert",o)),"close"===n&&o[n](this)}))},t._handleDismiss=function(t){return function(e){e&&e.preventDefault(),t.close(this)}},o(t,null,[{key:"VERSION",get:function(){return"4.5.0"}}]),t}();e(document).on("click.bs.alert.data-api",'[data-dismiss="alert"]',d._handleDismiss(new d)),e.fn[h]=d._jQueryInterface,e.fn[h].Constructor=d,e.fn[h].noConflict=function(){return e.fn[h]=u,d._jQueryInterface};var f=e.fn.button,g=function(){function t(t){this._element=t}var n=t.prototype;return n.toggle=function(){var t=!0,n=!0,i=e(this._element).closest('[data-toggle="buttons"]')[0];if(i){var o=this._element.querySelector('input:not([type="hidden"])');if(o){if("radio"===o.type)if(o.checked&&this._element.classList.contains("active"))t=!1;else{var s=i.querySelector(".active");s&&e(s).removeClass("active")}t&&("checkbox"!==o.type&&"radio"!==o.type||(o.checked=!this._element.classList.contains("active")),e(o).trigger("change")),o.focus(),n=!1}}this._element.hasAttribute("disabled")||this._element.classList.contains("disabled")||(n&&this._element.setAttribute("aria-pressed",!this._element.classList.contains("active")),t&&e(this._element).toggleClass("active"))},n.dispose=function(){e.removeData(this._element,"bs.button"),this._element=null},t._jQueryInterface=function(n){return this.each((function(){var i=e(this).data("bs.button");i||(i=new t(this),e(this).data("bs.button",i)),"toggle"===n&&i[n]()}))},o(t,null,[{key:"VERSION",get:function(){return"4.5.0"}}]),t}();e(document).on("click.bs.button.data-api",'[data-toggle^="button"]',(function(t){var n=t.target,i=n;if(e(n).hasClass("btn")||(n=e(n).closest(".btn")[0]),!n||n.hasAttribute("disabled")||n.classList.contains("disabled"))t.preventDefault();else{var o=n.querySelector('input:not([type="hidden"])');if(o&&(o.hasAttribute("disabled")||o.classList.contains("disabled")))return void t.preventDefault();"LABEL"===i.tagName&&o&&"checkbox"===o.type&&t.preventDefault(),g._jQueryInterface.call(e(n),"toggle")}})).on("focus.bs.button.data-api blur.bs.button.data-api",'[data-toggle^="button"]',(function(t){var n=e(t.target).closest(".btn")[0];e(n).toggleClass("focus",/^focus(in)?$/.test(t.type))})),e(window).on("load.bs.button.data-api",(function(){for(var t=[].slice.call(document.querySelectorAll('[data-toggle="buttons"] .btn')),e=0,n=t.length;e0,this._pointerEvent=Boolean(window.PointerEvent||window.MSPointerEvent),this._addEventListeners()}var n=t.prototype;return n.next=function(){this._isSliding||this._slide("next")},n.nextWhenVisible=function(){!document.hidden&&e(this._element).is(":visible")&&"hidden"!==e(this._element).css("visibility")&&this.next()},n.prev=function(){this._isSliding||this._slide("prev")},n.pause=function(t){t||(this._isPaused=!0),this._element.querySelector(".carousel-item-next, .carousel-item-prev")&&(c.triggerTransitionEnd(this._element),this.cycle(!0)),clearInterval(this._interval),this._interval=null},n.cycle=function(t){t||(this._isPaused=!1),this._interval&&(clearInterval(this._interval),this._interval=null),this._config.interval&&!this._isPaused&&(this._interval=setInterval((document.visibilityState?this.nextWhenVisible:this.next).bind(this),this._config.interval))},n.to=function(t){var n=this;this._activeElement=this._element.querySelector(".active.carousel-item");var i=this._getItemIndex(this._activeElement);if(!(t>this._items.length-1||t<0))if(this._isSliding)e(this._element).one("slid.bs.carousel",(function(){return n.to(t)}));else{if(i===t)return this.pause(),void this.cycle();var o=t>i?"next":"prev";this._slide(o,this._items[t])}},n.dispose=function(){e(this._element).off(p),e.removeData(this._element,"bs.carousel"),this._items=null,this._config=null,this._element=null,this._interval=null,this._isPaused=null,this._isSliding=null,this._activeElement=null,this._indicatorsElement=null},n._getConfig=function(t){return t=a(a({},v),t),c.typeCheckConfig(m,t,b),t},n._handleSwipe=function(){var t=Math.abs(this.touchDeltaX);if(!(t<=40)){var e=t/this.touchDeltaX;this.touchDeltaX=0,e>0&&this.prev(),e<0&&this.next()}},n._addEventListeners=function(){var t=this;this._config.keyboard&&e(this._element).on("keydown.bs.carousel",(function(e){return t._keydown(e)})),"hover"===this._config.pause&&e(this._element).on("mouseenter.bs.carousel",(function(e){return t.pause(e)})).on("mouseleave.bs.carousel",(function(e){return t.cycle(e)})),this._config.touch&&this._addTouchEventListeners()},n._addTouchEventListeners=function(){var t=this;if(this._touchSupported){var n=function(e){t._pointerEvent&&y[e.originalEvent.pointerType.toUpperCase()]?t.touchStartX=e.originalEvent.clientX:t._pointerEvent||(t.touchStartX=e.originalEvent.touches[0].clientX)},i=function(e){t._pointerEvent&&y[e.originalEvent.pointerType.toUpperCase()]&&(t.touchDeltaX=e.originalEvent.clientX-t.touchStartX),t._handleSwipe(),"hover"===t._config.pause&&(t.pause(),t.touchTimeout&&clearTimeout(t.touchTimeout),t.touchTimeout=setTimeout((function(e){return t.cycle(e)}),500+t._config.interval))};e(this._element.querySelectorAll(".carousel-item img")).on("dragstart.bs.carousel",(function(t){return t.preventDefault()})),this._pointerEvent?(e(this._element).on("pointerdown.bs.carousel",(function(t){return n(t)})),e(this._element).on("pointerup.bs.carousel",(function(t){return i(t)})),this._element.classList.add("pointer-event")):(e(this._element).on("touchstart.bs.carousel",(function(t){return n(t)})),e(this._element).on("touchmove.bs.carousel",(function(e){return function(e){e.originalEvent.touches&&e.originalEvent.touches.length>1?t.touchDeltaX=0:t.touchDeltaX=e.originalEvent.touches[0].clientX-t.touchStartX}(e)})),e(this._element).on("touchend.bs.carousel",(function(t){return i(t)})))}},n._keydown=function(t){if(!/input|textarea/i.test(t.target.tagName))switch(t.which){case 37:t.preventDefault(),this.prev();break;case 39:t.preventDefault(),this.next()}},n._getItemIndex=function(t){return this._items=t&&t.parentNode?[].slice.call(t.parentNode.querySelectorAll(".carousel-item")):[],this._items.indexOf(t)},n._getItemByDirection=function(t,e){var n="next"===t,i="prev"===t,o=this._getItemIndex(e),s=this._items.length-1;if((i&&0===o||n&&o===s)&&!this._config.wrap)return e;var r=(o+("prev"===t?-1:1))%this._items.length;return-1===r?this._items[this._items.length-1]:this._items[r]},n._triggerSlideEvent=function(t,n){var i=this._getItemIndex(t),o=this._getItemIndex(this._element.querySelector(".active.carousel-item")),s=e.Event("slide.bs.carousel",{relatedTarget:t,direction:n,from:o,to:i});return e(this._element).trigger(s),s},n._setActiveIndicatorElement=function(t){if(this._indicatorsElement){var n=[].slice.call(this._indicatorsElement.querySelectorAll(".active"));e(n).removeClass("active");var i=this._indicatorsElement.children[this._getItemIndex(t)];i&&e(i).addClass("active")}},n._slide=function(t,n){var i,o,s,r=this,a=this._element.querySelector(".active.carousel-item"),l=this._getItemIndex(a),h=n||a&&this._getItemByDirection(t,a),u=this._getItemIndex(h),d=Boolean(this._interval);if("next"===t?(i="carousel-item-left",o="carousel-item-next",s="left"):(i="carousel-item-right",o="carousel-item-prev",s="right"),h&&e(h).hasClass("active"))this._isSliding=!1;else if(!this._triggerSlideEvent(h,s).isDefaultPrevented()&&a&&h){this._isSliding=!0,d&&this.pause(),this._setActiveIndicatorElement(h);var f=e.Event("slid.bs.carousel",{relatedTarget:h,direction:s,from:l,to:u});if(e(this._element).hasClass("slide")){e(h).addClass(o),c.reflow(h),e(a).addClass(i),e(h).addClass(i);var g=parseInt(h.getAttribute("data-interval"),10);g?(this._config.defaultInterval=this._config.defaultInterval||this._config.interval,this._config.interval=g):this._config.interval=this._config.defaultInterval||this._config.interval;var m=c.getTransitionDurationFromElement(a);e(a).one(c.TRANSITION_END,(function(){e(h).removeClass(i+" "+o).addClass("active"),e(a).removeClass("active "+o+" "+i),r._isSliding=!1,setTimeout((function(){return e(r._element).trigger(f)}),0)})).emulateTransitionEnd(m)}else e(a).removeClass("active"),e(h).addClass("active"),this._isSliding=!1,e(this._element).trigger(f);d&&this.cycle()}},t._jQueryInterface=function(n){return this.each((function(){var i=e(this).data("bs.carousel"),o=a(a({},v),e(this).data());"object"==typeof n&&(o=a(a({},o),n));var s="string"==typeof n?n:o.slide;if(i||(i=new t(this,o),e(this).data("bs.carousel",i)),"number"==typeof n)i.to(n);else if("string"==typeof s){if("undefined"==typeof i[s])throw new TypeError('No method named "'+s+'"');i[s]()}else o.interval&&o.ride&&(i.pause(),i.cycle())}))},t._dataApiClickHandler=function(n){var i=c.getSelectorFromElement(this);if(i){var o=e(i)[0];if(o&&e(o).hasClass("carousel")){var s=a(a({},e(o).data()),e(this).data()),r=this.getAttribute("data-slide-to");r&&(s.interval=!1),t._jQueryInterface.call(e(o),s),r&&e(o).data("bs.carousel").to(r),n.preventDefault()}}},o(t,null,[{key:"VERSION",get:function(){return"4.5.0"}},{key:"Default",get:function(){return v}}]),t}();e(document).on("click.bs.carousel.data-api","[data-slide], [data-slide-to]",E._dataApiClickHandler),e(window).on("load.bs.carousel.data-api",(function(){for(var t=[].slice.call(document.querySelectorAll('[data-ride="carousel"]')),n=0,i=t.length;n0&&(this._selector=r,this._triggerArray.push(s))}this._parent=this._config.parent?this._getParent():null,this._config.parent||this._addAriaAndCollapsedClass(this._element,this._triggerArray),this._config.toggle&&this.toggle()}var n=t.prototype;return n.toggle=function(){e(this._element).hasClass("show")?this.hide():this.show()},n.show=function(){var n,i,o=this;if(!this._isTransitioning&&!e(this._element).hasClass("show")&&(this._parent&&0===(n=[].slice.call(this._parent.querySelectorAll(".show, .collapsing")).filter((function(t){return"string"==typeof o._config.parent?t.getAttribute("data-parent")===o._config.parent:t.classList.contains("collapse")}))).length&&(n=null),!(n&&(i=e(n).not(this._selector).data("bs.collapse"))&&i._isTransitioning))){var s=e.Event("show.bs.collapse");if(e(this._element).trigger(s),!s.isDefaultPrevented()){n&&(t._jQueryInterface.call(e(n).not(this._selector),"hide"),i||e(n).data("bs.collapse",null));var r=this._getDimension();e(this._element).removeClass("collapse").addClass("collapsing"),this._element.style[r]=0,this._triggerArray.length&&e(this._triggerArray).removeClass("collapsed").attr("aria-expanded",!0),this.setTransitioning(!0);var a="scroll"+(r[0].toUpperCase()+r.slice(1)),l=c.getTransitionDurationFromElement(this._element);e(this._element).one(c.TRANSITION_END,(function(){e(o._element).removeClass("collapsing").addClass("collapse show"),o._element.style[r]="",o.setTransitioning(!1),e(o._element).trigger("shown.bs.collapse")})).emulateTransitionEnd(l),this._element.style[r]=this._element[a]+"px"}}},n.hide=function(){var t=this;if(!this._isTransitioning&&e(this._element).hasClass("show")){var n=e.Event("hide.bs.collapse");if(e(this._element).trigger(n),!n.isDefaultPrevented()){var i=this._getDimension();this._element.style[i]=this._element.getBoundingClientRect()[i]+"px",c.reflow(this._element),e(this._element).addClass("collapsing").removeClass("collapse show");var o=this._triggerArray.length;if(o>0)for(var s=0;s0},i._getOffset=function(){var t=this,e={};return"function"==typeof this._config.offset?e.fn=function(e){return e.offsets=a(a({},e.offsets),t._config.offset(e.offsets,t._element)||{}),e}:e.offset=this._config.offset,e},i._getPopperConfig=function(){var t={placement:this._getPlacement(),modifiers:{offset:this._getOffset(),flip:{enabled:this._config.flip},preventOverflow:{boundariesElement:this._config.boundary}}};return"static"===this._config.display&&(t.modifiers.applyStyle={enabled:!1}),a(a({},t),this._config.popperConfig)},t._jQueryInterface=function(n){return this.each((function(){var i=e(this).data("bs.dropdown");if(i||(i=new t(this,"object"==typeof n?n:null),e(this).data("bs.dropdown",i)),"string"==typeof n){if("undefined"==typeof i[n])throw new TypeError('No method named "'+n+'"');i[n]()}}))},t._clearMenus=function(n){if(!n||3!==n.which&&("keyup"!==n.type||9===n.which))for(var i=[].slice.call(document.querySelectorAll('[data-toggle="dropdown"]')),o=0,s=i.length;o0&&r--,40===n.which&&rdocument.documentElement.clientHeight;!this._isBodyOverflowing&&t&&(this._element.style.paddingLeft=this._scrollbarWidth+"px"),this._isBodyOverflowing&&!t&&(this._element.style.paddingRight=this._scrollbarWidth+"px")},n._resetAdjustments=function(){this._element.style.paddingLeft="",this._element.style.paddingRight=""},n._checkScrollbar=function(){var t=document.body.getBoundingClientRect();this._isBodyOverflowing=Math.round(t.left+t.right)
',trigger:"hover focus",title:"",delay:0,html:!1,selector:!1,placement:"top",offset:0,container:!1,fallbackPlacement:"flip",boundary:"scrollParent",sanitize:!0,sanitizeFn:null,whiteList:F,popperConfig:null},Y={HIDE:"hide.bs.tooltip",HIDDEN:"hidden.bs.tooltip",SHOW:"show.bs.tooltip",SHOWN:"shown.bs.tooltip",INSERTED:"inserted.bs.tooltip",CLICK:"click.bs.tooltip",FOCUSIN:"focusin.bs.tooltip",FOCUSOUT:"focusout.bs.tooltip",MOUSEENTER:"mouseenter.bs.tooltip",MOUSELEAVE:"mouseleave.bs.tooltip"},$=function(){function t(t,e){if("undefined"==typeof n)throw new TypeError("Bootstrap's tooltips require Popper.js (https://popper.js.org/)");this._isEnabled=!0,this._timeout=0,this._hoverState="",this._activeTrigger={},this._popper=null,this.element=t,this.config=this._getConfig(e),this.tip=null,this._setListeners()}var i=t.prototype;return i.enable=function(){this._isEnabled=!0},i.disable=function(){this._isEnabled=!1},i.toggleEnabled=function(){this._isEnabled=!this._isEnabled},i.toggle=function(t){if(this._isEnabled)if(t){var n=this.constructor.DATA_KEY,i=e(t.currentTarget).data(n);i||(i=new this.constructor(t.currentTarget,this._getDelegateConfig()),e(t.currentTarget).data(n,i)),i._activeTrigger.click=!i._activeTrigger.click,i._isWithActiveTrigger()?i._enter(null,i):i._leave(null,i)}else{if(e(this.getTipElement()).hasClass("show"))return void this._leave(null,this);this._enter(null,this)}},i.dispose=function(){clearTimeout(this._timeout),e.removeData(this.element,this.constructor.DATA_KEY),e(this.element).off(this.constructor.EVENT_KEY),e(this.element).closest(".modal").off("hide.bs.modal",this._hideModalHandler),this.tip&&e(this.tip).remove(),this._isEnabled=null,this._timeout=null,this._hoverState=null,this._activeTrigger=null,this._popper&&this._popper.destroy(),this._popper=null,this.element=null,this.config=null,this.tip=null},i.show=function(){var t=this;if("none"===e(this.element).css("display"))throw new Error("Please use show on visible elements");var i=e.Event(this.constructor.Event.SHOW);if(this.isWithContent()&&this._isEnabled){e(this.element).trigger(i);var o=c.findShadowRoot(this.element),s=e.contains(null!==o?o:this.element.ownerDocument.documentElement,this.element);if(i.isDefaultPrevented()||!s)return;var r=this.getTipElement(),a=c.getUID(this.constructor.NAME);r.setAttribute("id",a),this.element.setAttribute("aria-describedby",a),this.setContent(),this.config.animation&&e(r).addClass("fade");var l="function"==typeof this.config.placement?this.config.placement.call(this,r,this.element):this.config.placement,h=this._getAttachment(l);this.addAttachmentClass(h);var u=this._getContainer();e(r).data(this.constructor.DATA_KEY,this),e.contains(this.element.ownerDocument.documentElement,this.tip)||e(r).appendTo(u),e(this.element).trigger(this.constructor.Event.INSERTED),this._popper=new n(this.element,r,this._getPopperConfig(h)),e(r).addClass("show"),"ontouchstart"in document.documentElement&&e(document.body).children().on("mouseover",null,e.noop);var d=function(){t.config.animation&&t._fixTransition();var n=t._hoverState;t._hoverState=null,e(t.element).trigger(t.constructor.Event.SHOWN),"out"===n&&t._leave(null,t)};if(e(this.tip).hasClass("fade")){var f=c.getTransitionDurationFromElement(this.tip);e(this.tip).one(c.TRANSITION_END,d).emulateTransitionEnd(f)}else d()}},i.hide=function(t){var n=this,i=this.getTipElement(),o=e.Event(this.constructor.Event.HIDE),s=function(){"show"!==n._hoverState&&i.parentNode&&i.parentNode.removeChild(i),n._cleanTipClass(),n.element.removeAttribute("aria-describedby"),e(n.element).trigger(n.constructor.Event.HIDDEN),null!==n._popper&&n._popper.destroy(),t&&t()};if(e(this.element).trigger(o),!o.isDefaultPrevented()){if(e(i).removeClass("show"),"ontouchstart"in document.documentElement&&e(document.body).children().off("mouseover",null,e.noop),this._activeTrigger.click=!1,this._activeTrigger.focus=!1,this._activeTrigger.hover=!1,e(this.tip).hasClass("fade")){var r=c.getTransitionDurationFromElement(i);e(i).one(c.TRANSITION_END,s).emulateTransitionEnd(r)}else s();this._hoverState=""}},i.update=function(){null!==this._popper&&this._popper.scheduleUpdate()},i.isWithContent=function(){return Boolean(this.getTitle())},i.addAttachmentClass=function(t){e(this.getTipElement()).addClass("bs-tooltip-"+t)},i.getTipElement=function(){return this.tip=this.tip||e(this.config.template)[0],this.tip},i.setContent=function(){var t=this.getTipElement();this.setElementContent(e(t.querySelectorAll(".tooltip-inner")),this.getTitle()),e(t).removeClass("fade show")},i.setElementContent=function(t,n){"object"!=typeof n||!n.nodeType&&!n.jquery?this.config.html?(this.config.sanitize&&(n=H(n,this.config.whiteList,this.config.sanitizeFn)),t.html(n)):t.text(n):this.config.html?e(n).parent().is(t)||t.empty().append(n):t.text(e(n).text())},i.getTitle=function(){var t=this.element.getAttribute("data-original-title");return t||(t="function"==typeof this.config.title?this.config.title.call(this.element):this.config.title),t},i._getPopperConfig=function(t){var e=this;return a(a({},{placement:t,modifiers:{offset:this._getOffset(),flip:{behavior:this.config.fallbackPlacement},arrow:{element:".arrow"},preventOverflow:{boundariesElement:this.config.boundary}},onCreate:function(t){t.originalPlacement!==t.placement&&e._handlePopperPlacementChange(t)},onUpdate:function(t){return e._handlePopperPlacementChange(t)}}),this.config.popperConfig)},i._getOffset=function(){var t=this,e={};return"function"==typeof this.config.offset?e.fn=function(e){return e.offsets=a(a({},e.offsets),t.config.offset(e.offsets,t.element)||{}),e}:e.offset=this.config.offset,e},i._getContainer=function(){return!1===this.config.container?document.body:c.isElement(this.config.container)?e(this.config.container):e(document).find(this.config.container)},i._getAttachment=function(t){return K[t.toUpperCase()]},i._setListeners=function(){var t=this;this.config.trigger.split(" ").forEach((function(n){if("click"===n)e(t.element).on(t.constructor.Event.CLICK,t.config.selector,(function(e){return t.toggle(e)}));else if("manual"!==n){var i="hover"===n?t.constructor.Event.MOUSEENTER:t.constructor.Event.FOCUSIN,o="hover"===n?t.constructor.Event.MOUSELEAVE:t.constructor.Event.FOCUSOUT;e(t.element).on(i,t.config.selector,(function(e){return t._enter(e)})).on(o,t.config.selector,(function(e){return t._leave(e)}))}})),this._hideModalHandler=function(){t.element&&t.hide()},e(this.element).closest(".modal").on("hide.bs.modal",this._hideModalHandler),this.config.selector?this.config=a(a({},this.config),{},{trigger:"manual",selector:""}):this._fixTitle()},i._fixTitle=function(){var t=typeof this.element.getAttribute("data-original-title");(this.element.getAttribute("title")||"string"!==t)&&(this.element.setAttribute("data-original-title",this.element.getAttribute("title")||""),this.element.setAttribute("title",""))},i._enter=function(t,n){var i=this.constructor.DATA_KEY;(n=n||e(t.currentTarget).data(i))||(n=new this.constructor(t.currentTarget,this._getDelegateConfig()),e(t.currentTarget).data(i,n)),t&&(n._activeTrigger["focusin"===t.type?"focus":"hover"]=!0),e(n.getTipElement()).hasClass("show")||"show"===n._hoverState?n._hoverState="show":(clearTimeout(n._timeout),n._hoverState="show",n.config.delay&&n.config.delay.show?n._timeout=setTimeout((function(){"show"===n._hoverState&&n.show()}),n.config.delay.show):n.show())},i._leave=function(t,n){var i=this.constructor.DATA_KEY;(n=n||e(t.currentTarget).data(i))||(n=new this.constructor(t.currentTarget,this._getDelegateConfig()),e(t.currentTarget).data(i,n)),t&&(n._activeTrigger["focusout"===t.type?"focus":"hover"]=!1),n._isWithActiveTrigger()||(clearTimeout(n._timeout),n._hoverState="out",n.config.delay&&n.config.delay.hide?n._timeout=setTimeout((function(){"out"===n._hoverState&&n.hide()}),n.config.delay.hide):n.hide())},i._isWithActiveTrigger=function(){for(var t in this._activeTrigger)if(this._activeTrigger[t])return!0;return!1},i._getConfig=function(t){var n=e(this.element).data();return Object.keys(n).forEach((function(t){-1!==V.indexOf(t)&&delete n[t]})),"number"==typeof(t=a(a(a({},this.constructor.Default),n),"object"==typeof t&&t?t:{})).delay&&(t.delay={show:t.delay,hide:t.delay}),"number"==typeof t.title&&(t.title=t.title.toString()),"number"==typeof t.content&&(t.content=t.content.toString()),c.typeCheckConfig(U,t,this.constructor.DefaultType),t.sanitize&&(t.template=H(t.template,t.whiteList,t.sanitizeFn)),t},i._getDelegateConfig=function(){var t={};if(this.config)for(var e in this.config)this.constructor.Default[e]!==this.config[e]&&(t[e]=this.config[e]);return t},i._cleanTipClass=function(){var t=e(this.getTipElement()),n=t.attr("class").match(W);null!==n&&n.length&&t.removeClass(n.join(""))},i._handlePopperPlacementChange=function(t){this.tip=t.instance.popper,this._cleanTipClass(),this.addAttachmentClass(this._getAttachment(t.placement))},i._fixTransition=function(){var t=this.getTipElement(),n=this.config.animation;null===t.getAttribute("x-placement")&&(e(t).removeClass("fade"),this.config.animation=!1,this.hide(),this.show(),this.config.animation=n)},t._jQueryInterface=function(n){return this.each((function(){var i=e(this).data("bs.tooltip"),o="object"==typeof n&&n;if((i||!/dispose|hide/.test(n))&&(i||(i=new t(this,o),e(this).data("bs.tooltip",i)),"string"==typeof n)){if("undefined"==typeof i[n])throw new TypeError('No method named "'+n+'"');i[n]()}}))},o(t,null,[{key:"VERSION",get:function(){return"4.5.0"}},{key:"Default",get:function(){return X}},{key:"NAME",get:function(){return U}},{key:"DATA_KEY",get:function(){return"bs.tooltip"}},{key:"Event",get:function(){return Y}},{key:"EVENT_KEY",get:function(){return".bs.tooltip"}},{key:"DefaultType",get:function(){return z}}]),t}();e.fn[U]=$._jQueryInterface,e.fn[U].Constructor=$,e.fn[U].noConflict=function(){return e.fn[U]=M,$._jQueryInterface};var J="popover",G=e.fn[J],Z=new RegExp("(^|\\s)bs-popover\\S+","g"),tt=a(a({},$.Default),{},{placement:"right",trigger:"click",content:"",template:''}),et=a(a({},$.DefaultType),{},{content:"(string|element|function)"}),nt={HIDE:"hide.bs.popover",HIDDEN:"hidden.bs.popover",SHOW:"show.bs.popover",SHOWN:"shown.bs.popover",INSERTED:"inserted.bs.popover",CLICK:"click.bs.popover",FOCUSIN:"focusin.bs.popover",FOCUSOUT:"focusout.bs.popover",MOUSEENTER:"mouseenter.bs.popover",MOUSELEAVE:"mouseleave.bs.popover"},it=function(t){var n,i;function s(){return t.apply(this,arguments)||this}i=t,(n=s).prototype=Object.create(i.prototype),n.prototype.constructor=n,n.__proto__=i;var r=s.prototype;return r.isWithContent=function(){return this.getTitle()||this._getContent()},r.addAttachmentClass=function(t){e(this.getTipElement()).addClass("bs-popover-"+t)},r.getTipElement=function(){return this.tip=this.tip||e(this.config.template)[0],this.tip},r.setContent=function(){var t=e(this.getTipElement());this.setElementContent(t.find(".popover-header"),this.getTitle());var n=this._getContent();"function"==typeof n&&(n=n.call(this.element)),this.setElementContent(t.find(".popover-body"),n),t.removeClass("fade show")},r._getContent=function(){return this.element.getAttribute("data-content")||this.config.content},r._cleanTipClass=function(){var t=e(this.getTipElement()),n=t.attr("class").match(Z);null!==n&&n.length>0&&t.removeClass(n.join(""))},s._jQueryInterface=function(t){return this.each((function(){var n=e(this).data("bs.popover"),i="object"==typeof t?t:null;if((n||!/dispose|hide/.test(t))&&(n||(n=new s(this,i),e(this).data("bs.popover",n)),"string"==typeof t)){if("undefined"==typeof n[t])throw new TypeError('No method named "'+t+'"');n[t]()}}))},o(s,null,[{key:"VERSION",get:function(){return"4.5.0"}},{key:"Default",get:function(){return tt}},{key:"NAME",get:function(){return J}},{key:"DATA_KEY",get:function(){return"bs.popover"}},{key:"Event",get:function(){return nt}},{key:"EVENT_KEY",get:function(){return".bs.popover"}},{key:"DefaultType",get:function(){return et}}]),s}($);e.fn[J]=it._jQueryInterface,e.fn[J].Constructor=it,e.fn[J].noConflict=function(){return e.fn[J]=G,it._jQueryInterface};var ot="scrollspy",st=e.fn[ot],rt={offset:10,method:"auto",target:""},at={offset:"number",method:"string",target:"(string|element)"},lt=function(){function t(t,n){var i=this;this._element=t,this._scrollElement="BODY"===t.tagName?window:t,this._config=this._getConfig(n),this._selector=this._config.target+" .nav-link,"+this._config.target+" .list-group-item,"+this._config.target+" .dropdown-item",this._offsets=[],this._targets=[],this._activeTarget=null,this._scrollHeight=0,e(this._scrollElement).on("scroll.bs.scrollspy",(function(t){return i._process(t)})),this.refresh(),this._process()}var n=t.prototype;return n.refresh=function(){var t=this,n=this._scrollElement===this._scrollElement.window?"offset":"position",i="auto"===this._config.method?n:this._config.method,o="position"===i?this._getScrollTop():0;this._offsets=[],this._targets=[],this._scrollHeight=this._getScrollHeight(),[].slice.call(document.querySelectorAll(this._selector)).map((function(t){var n,s=c.getSelectorFromElement(t);if(s&&(n=document.querySelector(s)),n){var r=n.getBoundingClientRect();if(r.width||r.height)return[e(n)[i]().top+o,s]}return null})).filter((function(t){return t})).sort((function(t,e){return t[0]-e[0]})).forEach((function(e){t._offsets.push(e[0]),t._targets.push(e[1])}))},n.dispose=function(){e.removeData(this._element,"bs.scrollspy"),e(this._scrollElement).off(".bs.scrollspy"),this._element=null,this._scrollElement=null,this._config=null,this._selector=null,this._offsets=null,this._targets=null,this._activeTarget=null,this._scrollHeight=null},n._getConfig=function(t){if("string"!=typeof(t=a(a({},rt),"object"==typeof t&&t?t:{})).target&&c.isElement(t.target)){var n=e(t.target).attr("id");n||(n=c.getUID(ot),e(t.target).attr("id",n)),t.target="#"+n}return c.typeCheckConfig(ot,t,at),t},n._getScrollTop=function(){return this._scrollElement===window?this._scrollElement.pageYOffset:this._scrollElement.scrollTop},n._getScrollHeight=function(){return this._scrollElement.scrollHeight||Math.max(document.body.scrollHeight,document.documentElement.scrollHeight)},n._getOffsetHeight=function(){return this._scrollElement===window?window.innerHeight:this._scrollElement.getBoundingClientRect().height},n._process=function(){var t=this._getScrollTop()+this._config.offset,e=this._getScrollHeight(),n=this._config.offset+e-this._getOffsetHeight();if(this._scrollHeight!==e&&this.refresh(),t>=n){var i=this._targets[this._targets.length-1];this._activeTarget!==i&&this._activate(i)}else{if(this._activeTarget&&t0)return this._activeTarget=null,void this._clear();for(var o=this._offsets.length;o--;){this._activeTarget!==this._targets[o]&&t>=this._offsets[o]&&("undefined"==typeof this._offsets[o+1]||t li > .active":".active";i=(i=e.makeArray(e(o).find(r)))[i.length-1]}var a=e.Event("hide.bs.tab",{relatedTarget:this._element}),l=e.Event("show.bs.tab",{relatedTarget:i});if(i&&e(i).trigger(a),e(this._element).trigger(l),!l.isDefaultPrevented()&&!a.isDefaultPrevented()){s&&(n=document.querySelector(s)),this._activate(this._element,o);var h=function(){var n=e.Event("hidden.bs.tab",{relatedTarget:t._element}),o=e.Event("shown.bs.tab",{relatedTarget:i});e(i).trigger(n),e(t._element).trigger(o)};n?this._activate(n,n.parentNode,h):h()}}},n.dispose=function(){e.removeData(this._element,"bs.tab"),this._element=null},n._activate=function(t,n,i){var o=this,s=(!n||"UL"!==n.nodeName&&"OL"!==n.nodeName?e(n).children(".active"):e(n).find("> li > .active"))[0],r=i&&s&&e(s).hasClass("fade"),a=function(){return o._transitionComplete(t,s,i)};if(s&&r){var l=c.getTransitionDurationFromElement(s);e(s).removeClass("show").one(c.TRANSITION_END,a).emulateTransitionEnd(l)}else a()},n._transitionComplete=function(t,n,i){if(n){e(n).removeClass("active");var o=e(n.parentNode).find("> .dropdown-menu .active")[0];o&&e(o).removeClass("active"),"tab"===n.getAttribute("role")&&n.setAttribute("aria-selected",!1)}if(e(t).addClass("active"),"tab"===t.getAttribute("role")&&t.setAttribute("aria-selected",!0),c.reflow(t),t.classList.contains("fade")&&t.classList.add("show"),t.parentNode&&e(t.parentNode).hasClass("dropdown-menu")){var s=e(t).closest(".dropdown")[0];if(s){var r=[].slice.call(s.querySelectorAll(".dropdown-toggle"));e(r).addClass("active")}t.setAttribute("aria-expanded",!0)}i&&i()},t._jQueryInterface=function(n){return this.each((function(){var i=e(this),o=i.data("bs.tab");if(o||(o=new t(this),i.data("bs.tab",o)),"string"==typeof n){if("undefined"==typeof o[n])throw new TypeError('No method named "'+n+'"');o[n]()}}))},o(t,null,[{key:"VERSION",get:function(){return"4.5.0"}}]),t}();e(document).on("click.bs.tab.data-api",'[data-toggle="tab"], [data-toggle="pill"], [data-toggle="list"]',(function(t){t.preventDefault(),ht._jQueryInterface.call(e(this),"show")})),e.fn.tab=ht._jQueryInterface,e.fn.tab.Constructor=ht,e.fn.tab.noConflict=function(){return e.fn.tab=ct,ht._jQueryInterface};var ut=e.fn.toast,dt={animation:"boolean",autohide:"boolean",delay:"number"},ft={animation:!0,autohide:!0,delay:500},gt=function(){function t(t,e){this._element=t,this._config=this._getConfig(e),this._timeout=null,this._setListeners()}var n=t.prototype;return n.show=function(){var t=this,n=e.Event("show.bs.toast");if(e(this._element).trigger(n),!n.isDefaultPrevented()){this._config.animation&&this._element.classList.add("fade");var i=function(){t._element.classList.remove("showing"),t._element.classList.add("show"),e(t._element).trigger("shown.bs.toast"),t._config.autohide&&(t._timeout=setTimeout((function(){t.hide()}),t._config.delay))};if(this._element.classList.remove("hide"),c.reflow(this._element),this._element.classList.add("showing"),this._config.animation){var o=c.getTransitionDurationFromElement(this._element);e(this._element).one(c.TRANSITION_END,i).emulateTransitionEnd(o)}else i()}},n.hide=function(){if(this._element.classList.contains("show")){var t=e.Event("hide.bs.toast");e(this._element).trigger(t),t.isDefaultPrevented()||this._close()}},n.dispose=function(){clearTimeout(this._timeout),this._timeout=null,this._element.classList.contains("show")&&this._element.classList.remove("show"),e(this._element).off("click.dismiss.bs.toast"),e.removeData(this._element,"bs.toast"),this._element=null,this._config=null},n._getConfig=function(t){return t=a(a(a({},ft),e(this._element).data()),"object"==typeof t&&t?t:{}),c.typeCheckConfig("toast",t,this.constructor.DefaultType),t},n._setListeners=function(){var t=this;e(this._element).on("click.dismiss.bs.toast",'[data-dismiss="toast"]',(function(){return t.hide()}))},n._close=function(){var t=this,n=function(){t._element.classList.add("hide"),e(t._element).trigger("hidden.bs.toast")};if(this._element.classList.remove("show"),this._config.animation){var i=c.getTransitionDurationFromElement(this._element);e(this._element).one(c.TRANSITION_END,n).emulateTransitionEnd(i)}else n()},t._jQueryInterface=function(n){return this.each((function(){var i=e(this),o=i.data("bs.toast");if(o||(o=new t(this,"object"==typeof n&&n),i.data("bs.toast",o)),"string"==typeof n){if("undefined"==typeof o[n])throw new TypeError('No method named "'+n+'"');o[n](this)}}))},o(t,null,[{key:"VERSION",get:function(){return"4.5.0"}},{key:"DefaultType",get:function(){return dt}},{key:"Default",get:function(){return ft}}]),t}();e.fn.toast=gt._jQueryInterface,e.fn.toast.Constructor=gt,e.fn.toast.noConflict=function(){return e.fn.toast=ut,gt._jQueryInterface},t.Alert=d,t.Button=g,t.Carousel=E,t.Collapse=D,t.Dropdown=j,t.Modal=R,t.Popover=it,t.Scrollspy=lt,t.Tab=ht,t.Toast=gt,t.Tooltip=$,t.Util=c,Object.defineProperty(t,"__esModule",{value:!0})})); diff --git a/data/www/bootstrap4-toggle.min.js b/data/www/bootstrap4-toggle.min.js new file mode 100644 index 0000000000..8e67abcdeb --- /dev/null +++ b/data/www/bootstrap4-toggle.min.js @@ -0,0 +1,10 @@ +/*\ +|*| ======================================================================== +|*| Bootstrap Toggle: bootstrap4-toggle.js v3.6.1 +|*| https://gitbrent.github.io/bootstrap4-toggle/ +|*| ======================================================================== +|*| Copyright 2018-2019 Brent Ely +|*| Licensed under MIT +|*| ======================================================================== +\*/ +!function(a){"use strict";function l(t,e){this.$element=a(t),this.options=a.extend({},this.defaults(),e),this.render()}l.VERSION="3.6.0",l.DEFAULTS={on:"On",off:"Off",onstyle:"primary",offstyle:"light",size:"normal",style:"",width:null,height:null},l.prototype.defaults=function(){return{on:this.$element.attr("data-on")||l.DEFAULTS.on,off:this.$element.attr("data-off")||l.DEFAULTS.off,onstyle:this.$element.attr("data-onstyle")||l.DEFAULTS.onstyle,offstyle:this.$element.attr("data-offstyle")||l.DEFAULTS.offstyle,size:this.$element.attr("data-size")||l.DEFAULTS.size,style:this.$element.attr("data-style")||l.DEFAULTS.style,width:this.$element.attr("data-width")||l.DEFAULTS.width,height:this.$element.attr("data-height")||l.DEFAULTS.height}},l.prototype.render=function(){this._onstyle="btn-"+this.options.onstyle,this._offstyle="btn-"+this.options.offstyle;var t="large"===this.options.size||"lg"===this.options.size?"btn-lg":"small"===this.options.size||"sm"===this.options.size?"btn-sm":"mini"===this.options.size||"xs"===this.options.size?"btn-xs":"",e=a('