Compare commits

..

11 Commits

Author SHA1 Message Date
Scott Lahteine 8e027304c8 fix inits 2022-10-20 17:04:22 -05:00
InsanityAutomation 79dcfe5455 Init values to FAN_OFF_PWM, compare for greater than instead of not equal to in order to catch edge cases 2022-10-17 18:39:02 -04:00
Scott Lahteine 834025e486 part cooling too 2022-10-17 15:03:41 -05:00
Scott Lahteine 05d51f9c7f Fan kickstart power option 2022-10-17 14:58:45 -05:00
Scott Lahteine 44589a964d account for FAN_OFF_PWM 2022-10-17 14:43:39 -05:00
Scott Lahteine b3e3a58e8b millis_t is not an array 2022-10-17 14:38:15 -05:00
Scott Lahteine 16106e3961 remove unused wrapper (no 'break') 2022-10-17 14:38:15 -05:00
Scott Lahteine 6dad386de9 just because 2022-10-17 14:30:10 -05:00
InsanityAutomation 8df0cca036 Update controllerfan.cpp 2022-10-15 15:28:26 -04:00
InsanityAutomation 62c280a60f Update controllerfan.cpp
Update controllerfan.cpp
2022-10-15 10:15:06 -04:00
InsanityAutomation 2087a1330d Update controllerfan.cpp 2022-10-13 16:01:35 -04:00
264 changed files with 4317 additions and 8434 deletions
+2 -2
View File
@@ -27,7 +27,7 @@ tests-single-ci:
tests-single-local: tests-single-local:
@if ! test -n "$(TEST_TARGET)" ; then echo "***ERROR*** Set TEST_TARGET=<your-module> or use make tests-all-local" ; return 1; fi @if ! test -n "$(TEST_TARGET)" ; then echo "***ERROR*** Set TEST_TARGET=<your-module> or use make tests-all-local" ; return 1; fi
export PATH="./buildroot/bin/:./buildroot/tests/:${PATH}" \ export PATH=./buildroot/bin/:./buildroot/tests/:${PATH} \
&& export VERBOSE_PLATFORMIO=$(VERBOSE_PLATFORMIO) \ && export VERBOSE_PLATFORMIO=$(VERBOSE_PLATFORMIO) \
&& run_tests . $(TEST_TARGET) "$(ONLY_TEST)" && run_tests . $(TEST_TARGET) "$(ONLY_TEST)"
.PHONY: tests-single-local .PHONY: tests-single-local
@@ -38,7 +38,7 @@ tests-single-local-docker:
.PHONY: tests-single-local-docker .PHONY: tests-single-local-docker
tests-all-local: tests-all-local:
export PATH="./buildroot/bin/:./buildroot/tests/:${PATH}" \ export PATH=./buildroot/bin/:./buildroot/tests/:${PATH} \
&& export VERBOSE_PLATFORMIO=$(VERBOSE_PLATFORMIO) \ && export VERBOSE_PLATFORMIO=$(VERBOSE_PLATFORMIO) \
&& for TEST_TARGET in $$(./get_test_targets.py) ; do echo "Running tests for $$TEST_TARGET" ; run_tests . $$TEST_TARGET ; done && for TEST_TARGET in $$(./get_test_targets.py) ; do echo "Running tests for $$TEST_TARGET" ; run_tests . $$TEST_TARGET ; done
.PHONY: tests-all-local .PHONY: tests-all-local
+50 -40
View File
@@ -564,10 +564,6 @@
#define MAX31865_SENSOR_OHMS_1 100 #define MAX31865_SENSOR_OHMS_1 100
#define MAX31865_CALIBRATION_OHMS_1 430 #define MAX31865_CALIBRATION_OHMS_1 430
#endif #endif
#if TEMP_SENSOR_IS_MAX_TC(2)
#define MAX31865_SENSOR_OHMS_2 100
#define MAX31865_CALIBRATION_OHMS_2 430
#endif
#if HAS_E_TEMP_SENSOR #if HAS_E_TEMP_SENSOR
#define TEMP_RESIDENCY_TIME 10 // (seconds) Time to wait for hotend to "settle" in M109 #define TEMP_RESIDENCY_TIME 10 // (seconds) Time to wait for hotend to "settle" in M109
@@ -879,7 +875,7 @@
//#define POLARGRAPH //#define POLARGRAPH
#if ENABLED(POLARGRAPH) #if ENABLED(POLARGRAPH)
#define POLARGRAPH_MAX_BELT_LEN 1035.0 #define POLARGRAPH_MAX_BELT_LEN 1035.0
#define DEFAULT_SEGMENTS_PER_SECOND 5 #define POLAR_SEGMENTS_PER_SECOND 5
#endif #endif
// @section delta // @section delta
@@ -891,28 +887,28 @@
// Make delta curves from many straight lines (linear interpolation). // Make delta curves from many straight lines (linear interpolation).
// This is a trade-off between visible corners (not enough segments) // This is a trade-off between visible corners (not enough segments)
// and processor overload (too many expensive sqrt calls). // and processor overload (too many expensive sqrt calls).
#define DEFAULT_SEGMENTS_PER_SECOND 200 #define DELTA_SEGMENTS_PER_SECOND 200
// After homing move down to a height where XY movement is unconstrained // After homing move down to a height where XY movement is unconstrained
//#define DELTA_HOME_TO_SAFE_ZONE //#define DELTA_HOME_TO_SAFE_ZONE
// Delta calibration menu // Delta calibration menu
// Add three-point calibration to the MarlinUI menu. // uncomment to add three points calibration menu option.
// See http://minow.blogspot.com/index.html#4918805519571907051 // See http://minow.blogspot.com/index.html#4918805519571907051
//#define DELTA_CALIBRATION_MENU //#define DELTA_CALIBRATION_MENU
// G33 Delta Auto-Calibration. Enable EEPROM_SETTINGS to store results. // uncomment to add G33 Delta Auto-Calibration (Enable EEPROM_SETTINGS to store results)
//#define DELTA_AUTO_CALIBRATION //#define DELTA_AUTO_CALIBRATION
// NOTE NB all values for DELTA_* values MUST be floating point, so always have a decimal point in them
#if ENABLED(DELTA_AUTO_CALIBRATION) #if ENABLED(DELTA_AUTO_CALIBRATION)
// Default number of probe points : n*n (1 -> 7) // set the default number of probe points : n*n (1 -> 7)
#define DELTA_CALIBRATION_DEFAULT_POINTS 4 #define DELTA_CALIBRATION_DEFAULT_POINTS 4
#endif #endif
// NOTE: All values for DELTA_* values MUST be floating point, so always have a decimal point in them
#if EITHER(DELTA_AUTO_CALIBRATION, DELTA_CALIBRATION_MENU) #if EITHER(DELTA_AUTO_CALIBRATION, DELTA_CALIBRATION_MENU)
// Step size for paper-test probing // Set the steprate for papertest probing
#define PROBE_MANUALLY_STEP 0.05 // (mm) #define PROBE_MANUALLY_STEP 0.05 // (mm)
#endif #endif
@@ -957,7 +953,7 @@
//#define MP_SCARA //#define MP_SCARA
#if EITHER(MORGAN_SCARA, MP_SCARA) #if EITHER(MORGAN_SCARA, MP_SCARA)
// If movement is choppy try lowering this value // If movement is choppy try lowering this value
#define DEFAULT_SEGMENTS_PER_SECOND 200 #define SCARA_SEGMENTS_PER_SECOND 200
// Length of inner and outer support arms. Measure arm lengths precisely. // Length of inner and outer support arms. Measure arm lengths precisely.
#define SCARA_LINKAGE_1 150 // (mm) #define SCARA_LINKAGE_1 150 // (mm)
@@ -993,18 +989,18 @@
// Enable for TPARA kinematics and configure below // Enable for TPARA kinematics and configure below
//#define AXEL_TPARA //#define AXEL_TPARA
#if ENABLED(AXEL_TPARA) #if ENABLED(AXEL_TPARA)
#define DEBUG_TPARA_KINEMATICS #define DEBUG_ROBOT_KINEMATICS
#define DEFAULT_SEGMENTS_PER_SECOND 200 #define ROBOT_SEGMENTS_PER_SECOND 200
// Length of inner and outer support arms. Measure arm lengths precisely. // Length of inner and outer support arms. Measure arm lengths precisely.
#define TPARA_LINKAGE_1 120 // (mm) #define ROBOT_LINKAGE_1 120 // (mm)
#define TPARA_LINKAGE_2 120 // (mm) #define ROBOT_LINKAGE_2 120 // (mm)
// SCARA tower offset (position of Tower relative to bed zero position) // SCARA tower offset (position of Tower relative to bed zero position)
// This needs to be reasonably accurate as it defines the printbed position in the SCARA space. // This needs to be reasonably accurate as it defines the printbed position in the SCARA space.
#define TPARA_OFFSET_X 0 // (mm) #define ROBOT_OFFSET_X 0 // (mm)
#define TPARA_OFFSET_Y 0 // (mm) #define ROBOT_OFFSET_Y 0 // (mm)
#define TPARA_OFFSET_Z 0 // (mm) #define ROBOT_OFFSET_Z 0 // (mm)
#define SCARA_FEEDRATE_SCALING // Convert XY feedrate from mm/s to degrees/s on the fly #define SCARA_FEEDRATE_SCALING // Convert XY feedrate from mm/s to degrees/s on the fly
@@ -1768,57 +1764,71 @@
* Marlin knows a print job is running when: * Marlin knows a print job is running when:
* 1. Running a print job from media started with M24. * 1. Running a print job from media started with M24.
* 2. The Print Job Timer has been started with M75. * 2. The Print Job Timer has been started with M75.
* 3. The heaters were turned on with a wait command (M109) and PRINTJOB_TIMER_AUTOSTART is enabled. * 3. The heaters were turned on and PRINTJOB_TIMER_AUTOSTART is enabled.
* *
* RAMPS-based boards use SERVO3_PIN for the first runout sensor. * RAMPS-based boards use SERVO3_PIN for the first runout sensor.
* For other boards you may need to define FIL_RUNOUT_PIN, FIL_RUNOUT2_PIN, etc. * For other boards you may need to define FIL_RUNOUT_PIN, FIL_RUNOUT2_PIN, etc.
*/ */
//#define FILAMENT_RUNOUT_SENSOR //#define FILAMENT_RUNOUT_SENSOR
#if ENABLED(FILAMENT_RUNOUT_SENSOR) #if ENABLED(FILAMENT_RUNOUT_SENSOR)
//#define NUM_RUNOUT_SENSORS 1 // Number of sensors, up to one per extruder. Define a FIL_RUNOUT#_PIN for each. #define FIL_RUNOUT_ENABLED_DEFAULT true // Enable the sensor on startup. Override with M412 followed by M500.
#define FIL_RUNOUT_ENABLED { true } // Default enabled state for sensors E0[, E1[, E2[, E3...]]]. Override with M591EnnSn followed by M500. #define NUM_RUNOUT_SENSORS 1 // Number of sensors, up to one per extruder. Define a FIL_RUNOUT#_PIN for each.
#define FIL_RUNOUT_MODE { 1 } // Default mode for sensors E0[, E1[, E2[, E3...]]]. 0:NONE 1:Switch NO 2:Switch NC 7:Motion Sensor Override with M591EnPnn
//#define WATCH_ALL_RUNOUT_SENSORS // Execute runout script on any triggering sensor, not only for the active extruder.
// This is automatically enabled for MIXING_EXTRUDERs.
// Commands to execute on filament runout. #define FIL_RUNOUT_STATE LOW // Pin state indicating that filament is NOT present.
// With multiple runout sensors use the %c placeholder for the current tool in commands (e.g., "M600 T%c") #define FIL_RUNOUT_PULLUP // Use internal pullup for filament runout pins.
// NOTE: After 'M591 H1' the host handles filament runout and this script does not apply. //#define FIL_RUNOUT_PULLDOWN // Use internal pulldown for filament runout pins.
#define FILAMENT_RUNOUT_SCRIPT "M600" //#define WATCH_ALL_RUNOUT_SENSORS // Execute runout script on any triggering sensor, not only for the active extruder.
// This is automatically enabled for MIXING_EXTRUDERs.
// In Mode 1 or 2, continue printing this length of filament after a run out occurs before executing the
// runout script. Useful for a sensor at the end of a feed tube or debounce on a flakey sensor.
// In Mode 7, extrusion distance to expect a change of state.
// Override with M591EnLnn
#define FIL_RUNOUT_DISTANCE_MM { 15 }
#define FIL_RUNOUT_PULLUP // Use internal pullup for filament runout pins.
//#define FIL_RUNOUT_PULLDOWN // Use internal pulldown for filament runout pins.
// Override individually if the runout sensors vary // Override individually if the runout sensors vary
//#define FIL_RUNOUT1_STATE LOW
//#define FIL_RUNOUT1_PULLUP //#define FIL_RUNOUT1_PULLUP
//#define FIL_RUNOUT1_PULLDOWN //#define FIL_RUNOUT1_PULLDOWN
//#define FIL_RUNOUT2_STATE LOW
//#define FIL_RUNOUT2_PULLUP //#define FIL_RUNOUT2_PULLUP
//#define FIL_RUNOUT2_PULLDOWN //#define FIL_RUNOUT2_PULLDOWN
//#define FIL_RUNOUT3_STATE LOW
//#define FIL_RUNOUT3_PULLUP //#define FIL_RUNOUT3_PULLUP
//#define FIL_RUNOUT3_PULLDOWN //#define FIL_RUNOUT3_PULLDOWN
//#define FIL_RUNOUT4_STATE LOW
//#define FIL_RUNOUT4_PULLUP //#define FIL_RUNOUT4_PULLUP
//#define FIL_RUNOUT4_PULLDOWN //#define FIL_RUNOUT4_PULLDOWN
//#define FIL_RUNOUT5_STATE LOW
//#define FIL_RUNOUT5_PULLUP //#define FIL_RUNOUT5_PULLUP
//#define FIL_RUNOUT5_PULLDOWN //#define FIL_RUNOUT5_PULLDOWN
//#define FIL_RUNOUT6_STATE LOW
//#define FIL_RUNOUT6_PULLUP //#define FIL_RUNOUT6_PULLUP
//#define FIL_RUNOUT6_PULLDOWN //#define FIL_RUNOUT6_PULLDOWN
//#define FIL_RUNOUT7_STATE LOW
//#define FIL_RUNOUT7_PULLUP //#define FIL_RUNOUT7_PULLUP
//#define FIL_RUNOUT7_PULLDOWN //#define FIL_RUNOUT7_PULLDOWN
//#define FIL_RUNOUT8_STATE LOW
//#define FIL_RUNOUT8_PULLUP //#define FIL_RUNOUT8_PULLUP
//#define FIL_RUNOUT8_PULLDOWN //#define FIL_RUNOUT8_PULLDOWN
// Commands to execute on filament runout.
// With multiple runout sensors use the %c placeholder for the current tool in commands (e.g., "M600 T%c")
// NOTE: After 'M412 H1' the host handles filament runout and this script does not apply.
#define FILAMENT_RUNOUT_SCRIPT "M600"
// After a runout is detected, continue printing this length of filament
// before executing the runout script. Useful for a sensor at the end of
// a feed tube. Requires 4 bytes SRAM per sensor, plus 4 bytes overhead.
//#define FILAMENT_RUNOUT_DISTANCE_MM 25
#ifdef FILAMENT_RUNOUT_DISTANCE_MM
// Enable this option to use an encoder disc that toggles the runout pin
// as the filament moves. (Be sure to set FILAMENT_RUNOUT_DISTANCE_MM
// large enough to avoid false positives.)
//#define FILAMENT_MOTION_SENSOR
#endif
#endif #endif
//=========================================================================== //===========================================================================
@@ -3049,7 +3059,7 @@
//#define MKS_ROBIN_TFT_V1_1R //#define MKS_ROBIN_TFT_V1_1R
// //
// 480x320, 3.5", FSMC Stock Display from Tronxy // 480x320, 3.5", FSMC Stock Display from TronxXY
// //
//#define TFT_TRONXY_X5SA //#define TFT_TRONXY_X5SA
+189 -95
View File
@@ -175,7 +175,6 @@
//#define TEMP_SENSOR_FORCE_HW_SPI // Ignore SCK/MOSI/MISO pins; use CS and the default SPI bus. //#define TEMP_SENSOR_FORCE_HW_SPI // Ignore SCK/MOSI/MISO pins; use CS and the default SPI bus.
//#define MAX31865_SENSOR_WIRES_0 2 // (2-4) Number of wires for the probe connected to a MAX31865 board. //#define MAX31865_SENSOR_WIRES_0 2 // (2-4) Number of wires for the probe connected to a MAX31865 board.
//#define MAX31865_SENSOR_WIRES_1 2 //#define MAX31865_SENSOR_WIRES_1 2
//#define MAX31865_SENSOR_WIRES_2 2
//#define MAX31865_50HZ_FILTER // Use a 50Hz filter instead of the default 60Hz. //#define MAX31865_50HZ_FILTER // Use a 50Hz filter instead of the default 60Hz.
//#define MAX31865_USE_READ_ERROR_DETECTION // Treat value spikes (20°C delta in under 1s) as read errors. //#define MAX31865_USE_READ_ERROR_DETECTION // Treat value spikes (20°C delta in under 1s) as read errors.
@@ -186,7 +185,6 @@
//#define MAX31865_WIRE_OHMS_0 0.95f // For 2-wire, set the wire resistances for more accurate readings. //#define MAX31865_WIRE_OHMS_0 0.95f // For 2-wire, set the wire resistances for more accurate readings.
//#define MAX31865_WIRE_OHMS_1 0.0f //#define MAX31865_WIRE_OHMS_1 0.0f
//#define MAX31865_WIRE_OHMS_2 0.0f
/** /**
* Hephestos 2 24V heated bed upgrade kit. * Hephestos 2 24V heated bed upgrade kit.
@@ -1057,42 +1055,6 @@
// @section motion // @section motion
/**
* Input Shaping -- EXPERIMENTAL
*
* Zero Vibration (ZV) Input Shaping for X and/or Y movements.
*
* This option uses a lot of SRAM for the step buffer, which is related to the
* largest step rate possible for the shaped axes. If the build fails due to
* low SRAM the buffer size may be reduced by setting smaller values for
* DEFAULT_AXIS_STEPS_PER_UNIT and/or DEFAULT_MAX_FEEDRATE. Disabling
* ADAPTIVE_STEP_SMOOTHING and reducing the step rate for non-shaped axes may
* also reduce the buffer sizes. Runtime editing of max feedrate (M203) or
* resonant frequency (M593) may result in input shaping losing effectiveness
* during high speed movements to prevent buffer overruns.
*
* Tune with M593 D<factor> F<frequency>:
*
* D<factor> Set the zeta/damping factor. If axes (X, Y, etc.) are not specified, set for all axes.
* F<frequency> Set the frequency. If axes (X, Y, etc.) are not specified, set for all axes.
* T[map] Input Shaping type, 0:ZV, 1:EI, 2:2H EI (not implemented yet)
* X<1> Set the given parameters only for the X axis.
* Y<1> Set the given parameters only for the Y axis.
*/
//#define INPUT_SHAPING_X
//#define INPUT_SHAPING_Y
#if EITHER(INPUT_SHAPING_X, INPUT_SHAPING_Y)
#if ENABLED(INPUT_SHAPING_X)
#define SHAPING_FREQ_X 40 // (Hz) The default dominant resonant frequency on the X axis.
#define SHAPING_ZETA_X 0.15f // Damping ratio of the X axis (range: 0.0 = no damping to 1.0 = critical damping).
#endif
#if ENABLED(INPUT_SHAPING_Y)
#define SHAPING_FREQ_Y 40 // (Hz) The default dominant resonant frequency on the Y axis.
#define SHAPING_ZETA_Y 0.15f // Damping ratio of the Y axis (range: 0.0 = no damping to 1.0 = critical damping).
#endif
//#define SHAPING_MENU // Add a menu to the LCD to set shaping parameters.
#endif
#define AXIS_RELATIVE_MODES { false, false, false, false } #define AXIS_RELATIVE_MODES { false, false, false, false }
// Add a Duplicate option for well-separated conjoined nozzles // Add a Duplicate option for well-separated conjoined nozzles
@@ -1194,7 +1156,7 @@
#endif #endif
/** /**
* Automatic backlash, position, and hotend offset calibration * Automatic backlash, position and hotend offset calibration
* *
* Enable G425 to run automatic calibration using an electrically- * Enable G425 to run automatic calibration using an electrically-
* conductive cube, bolt, or washer mounted on the bed. * conductive cube, bolt, or washer mounted on the bed.
@@ -2676,33 +2638,167 @@
//#define FILAMENT_UNLOAD_ALL_EXTRUDERS // Allow M702 to unload all extruders above a minimum target temp (as set by M302) //#define FILAMENT_UNLOAD_ALL_EXTRUDERS // Allow M702 to unload all extruders above a minimum target temp (as set by M302)
#endif #endif
// @section tmc_smart /**
* TMC26X Stepper Driver options
*
* The TMC26XStepper library is required for this stepper driver.
* https://github.com/trinamic/TMC26XStepper
* @section tmc/tmc26x
*/
#if HAS_DRIVER(TMC26X)
#if AXIS_DRIVER_TYPE_X(TMC26X)
#define X_MAX_CURRENT 1000 // (mA)
#define X_SENSE_RESISTOR 91 // (mOhms)
#define X_MICROSTEPS 16 // Number of microsteps
#endif
#if AXIS_DRIVER_TYPE_X2(TMC26X)
#define X2_MAX_CURRENT 1000
#define X2_SENSE_RESISTOR 91
#define X2_MICROSTEPS X_MICROSTEPS
#endif
#if AXIS_DRIVER_TYPE_Y(TMC26X)
#define Y_MAX_CURRENT 1000
#define Y_SENSE_RESISTOR 91
#define Y_MICROSTEPS 16
#endif
#if AXIS_DRIVER_TYPE_Y2(TMC26X)
#define Y2_MAX_CURRENT 1000
#define Y2_SENSE_RESISTOR 91
#define Y2_MICROSTEPS Y_MICROSTEPS
#endif
#if AXIS_DRIVER_TYPE_Z(TMC26X)
#define Z_MAX_CURRENT 1000
#define Z_SENSE_RESISTOR 91
#define Z_MICROSTEPS 16
#endif
#if AXIS_DRIVER_TYPE_Z2(TMC26X)
#define Z2_MAX_CURRENT 1000
#define Z2_SENSE_RESISTOR 91
#define Z2_MICROSTEPS Z_MICROSTEPS
#endif
#if AXIS_DRIVER_TYPE_Z3(TMC26X)
#define Z3_MAX_CURRENT 1000
#define Z3_SENSE_RESISTOR 91
#define Z3_MICROSTEPS Z_MICROSTEPS
#endif
#if AXIS_DRIVER_TYPE_Z4(TMC26X)
#define Z4_MAX_CURRENT 1000
#define Z4_SENSE_RESISTOR 91
#define Z4_MICROSTEPS Z_MICROSTEPS
#endif
#if AXIS_DRIVER_TYPE_I(TMC26X)
#define I_MAX_CURRENT 1000
#define I_SENSE_RESISTOR 91
#define I_MICROSTEPS 16
#endif
#if AXIS_DRIVER_TYPE_J(TMC26X)
#define J_MAX_CURRENT 1000
#define J_SENSE_RESISTOR 91
#define J_MICROSTEPS 16
#endif
#if AXIS_DRIVER_TYPE_K(TMC26X)
#define K_MAX_CURRENT 1000
#define K_SENSE_RESISTOR 91
#define K_MICROSTEPS 16
#endif
#if AXIS_DRIVER_TYPE_U(TMC26X)
#define U_MAX_CURRENT 1000
#define U_SENSE_RESISTOR 91
#define U_MICROSTEPS 16
#endif
#if AXIS_DRIVER_TYPE_V(TMC26X)
#define V_MAX_CURRENT 1000
#define V_SENSE_RESISTOR 91
#define V_MICROSTEPS 16
#endif
#if AXIS_DRIVER_TYPE_W(TMC26X)
#define W_MAX_CURRENT 1000
#define W_SENSE_RESISTOR 91
#define W_MICROSTEPS 16
#endif
#if AXIS_DRIVER_TYPE_E0(TMC26X)
#define E0_MAX_CURRENT 1000
#define E0_SENSE_RESISTOR 91
#define E0_MICROSTEPS 16
#endif
#if AXIS_DRIVER_TYPE_E1(TMC26X)
#define E1_MAX_CURRENT 1000
#define E1_SENSE_RESISTOR 91
#define E1_MICROSTEPS E0_MICROSTEPS
#endif
#if AXIS_DRIVER_TYPE_E2(TMC26X)
#define E2_MAX_CURRENT 1000
#define E2_SENSE_RESISTOR 91
#define E2_MICROSTEPS E0_MICROSTEPS
#endif
#if AXIS_DRIVER_TYPE_E3(TMC26X)
#define E3_MAX_CURRENT 1000
#define E3_SENSE_RESISTOR 91
#define E3_MICROSTEPS E0_MICROSTEPS
#endif
#if AXIS_DRIVER_TYPE_E4(TMC26X)
#define E4_MAX_CURRENT 1000
#define E4_SENSE_RESISTOR 91
#define E4_MICROSTEPS E0_MICROSTEPS
#endif
#if AXIS_DRIVER_TYPE_E5(TMC26X)
#define E5_MAX_CURRENT 1000
#define E5_SENSE_RESISTOR 91
#define E5_MICROSTEPS E0_MICROSTEPS
#endif
#if AXIS_DRIVER_TYPE_E6(TMC26X)
#define E6_MAX_CURRENT 1000
#define E6_SENSE_RESISTOR 91
#define E6_MICROSTEPS E0_MICROSTEPS
#endif
#if AXIS_DRIVER_TYPE_E7(TMC26X)
#define E7_MAX_CURRENT 1000
#define E7_SENSE_RESISTOR 91
#define E7_MICROSTEPS E0_MICROSTEPS
#endif
#endif // TMC26X
/** /**
* Trinamic Smart Drivers * To use TMC2130, TMC2160, TMC2660, TMC5130, TMC5160 stepper drivers in SPI mode
* connect your SPI pins to the hardware SPI interface on your board and define
* the required CS pins in your `pins_MYBOARD.h` file. (e.g., RAMPS 1.4 uses AUX3
* pins `X_CS_PIN 53`, `Y_CS_PIN 49`, etc.).
* You may also use software SPI if you wish to use general purpose IO pins.
* *
* To use TMC2130, TMC2160, TMC2660, TMC5130, TMC5160 stepper drivers in SPI mode: * To use TMC2208 stepper UART-configurable stepper drivers connect #_SERIAL_TX_PIN
* - Connect your SPI pins to the Hardware SPI interface on the board. * to the driver side PDN_UART pin with a 1K resistor.
* Some boards have simple jumper connections! See your board's documentation. * To use the reading capabilities, also connect #_SERIAL_RX_PIN to PDN_UART without
* - Define the required Stepper CS pins in your `pins_MYBOARD.h` file. * a resistor.
* (See the RAMPS pins, for example.) * The drivers can also be used with hardware serial.
* - You can also use Software SPI with GPIO pins instead of Hardware SPI.
*
* To use TMC220x stepper drivers with Serial UART:
* - Connect PDN_UART to the #_SERIAL_TX_PIN through a 1K resistor.
* For reading capabilities also connect PDN_UART to #_SERIAL_RX_PIN with no resistor.
* Some boards have simple jumper connections! See your board's documentation.
* - These drivers can also be used with Hardware Serial.
*
* The TMC26XStepper library is required for TMC26X stepper drivers.
* https://github.com/MarlinFirmware/TMC26XStepper
*
* The TMCStepper library is required for other TMC stepper drivers.
* https://github.com/teemuatlut/TMCStepper
* *
* TMCStepper library is required to use TMC stepper drivers.
* https://github.com/teemuatlut/TMCStepper
* @section tmc/config * @section tmc/config
*/ */
#if HAS_TRINAMIC_CONFIG || HAS_TMC26X #if HAS_TRINAMIC_CONFIG
#define HOLD_MULTIPLIER 0.5 // Scales down the holding current from run current #define HOLD_MULTIPLIER 0.5 // Scales down the holding current from run current
@@ -2712,17 +2808,17 @@
*/ */
#define INTERPOLATE true #define INTERPOLATE true
#if AXIS_IS_TMC_CONFIG(X) #if AXIS_IS_TMC(X)
#define X_CURRENT 800 // (mA) RMS current. Multiply by 1.414 for peak current. #define X_CURRENT 800 // (mA) RMS current. Multiply by 1.414 for peak current.
#define X_CURRENT_HOME X_CURRENT // (mA) RMS current for sensorless homing #define X_CURRENT_HOME X_CURRENT // (mA) RMS current for sensorless homing
#define X_MICROSTEPS 16 // 0..256 #define X_MICROSTEPS 16 // 0..256
#define X_RSENSE 0.11 // Multiplied x1000 for TMC26X #define X_RSENSE 0.11
#define X_CHAIN_POS -1 // -1..0: Not chained. 1: MCU MOSI connected. 2: Next in chain, ... #define X_CHAIN_POS -1 // -1..0: Not chained. 1: MCU MOSI connected. 2: Next in chain, ...
//#define X_INTERPOLATE true // Enable to override 'INTERPOLATE' for the X axis //#define X_INTERPOLATE true // Enable to override 'INTERPOLATE' for the X axis
//#define X_HOLD_MULTIPLIER 0.5 // Enable to override 'HOLD_MULTIPLIER' for the X axis //#define X_HOLD_MULTIPLIER 0.5 // Enable to override 'HOLD_MULTIPLIER' for the X axis
#endif #endif
#if AXIS_IS_TMC_CONFIG(X2) #if AXIS_IS_TMC(X2)
#define X2_CURRENT 800 #define X2_CURRENT 800
#define X2_CURRENT_HOME X2_CURRENT #define X2_CURRENT_HOME X2_CURRENT
#define X2_MICROSTEPS X_MICROSTEPS #define X2_MICROSTEPS X_MICROSTEPS
@@ -2732,7 +2828,7 @@
//#define X2_HOLD_MULTIPLIER 0.5 //#define X2_HOLD_MULTIPLIER 0.5
#endif #endif
#if AXIS_IS_TMC_CONFIG(Y) #if AXIS_IS_TMC(Y)
#define Y_CURRENT 800 #define Y_CURRENT 800
#define Y_CURRENT_HOME Y_CURRENT #define Y_CURRENT_HOME Y_CURRENT
#define Y_MICROSTEPS 16 #define Y_MICROSTEPS 16
@@ -2742,7 +2838,7 @@
//#define Y_HOLD_MULTIPLIER 0.5 //#define Y_HOLD_MULTIPLIER 0.5
#endif #endif
#if AXIS_IS_TMC_CONFIG(Y2) #if AXIS_IS_TMC(Y2)
#define Y2_CURRENT 800 #define Y2_CURRENT 800
#define Y2_CURRENT_HOME Y2_CURRENT #define Y2_CURRENT_HOME Y2_CURRENT
#define Y2_MICROSTEPS Y_MICROSTEPS #define Y2_MICROSTEPS Y_MICROSTEPS
@@ -2752,7 +2848,7 @@
//#define Y2_HOLD_MULTIPLIER 0.5 //#define Y2_HOLD_MULTIPLIER 0.5
#endif #endif
#if AXIS_IS_TMC_CONFIG(Z) #if AXIS_IS_TMC(Z)
#define Z_CURRENT 800 #define Z_CURRENT 800
#define Z_CURRENT_HOME Z_CURRENT #define Z_CURRENT_HOME Z_CURRENT
#define Z_MICROSTEPS 16 #define Z_MICROSTEPS 16
@@ -2762,7 +2858,7 @@
//#define Z_HOLD_MULTIPLIER 0.5 //#define Z_HOLD_MULTIPLIER 0.5
#endif #endif
#if AXIS_IS_TMC_CONFIG(Z2) #if AXIS_IS_TMC(Z2)
#define Z2_CURRENT 800 #define Z2_CURRENT 800
#define Z2_CURRENT_HOME Z2_CURRENT #define Z2_CURRENT_HOME Z2_CURRENT
#define Z2_MICROSTEPS Z_MICROSTEPS #define Z2_MICROSTEPS Z_MICROSTEPS
@@ -2772,7 +2868,7 @@
//#define Z2_HOLD_MULTIPLIER 0.5 //#define Z2_HOLD_MULTIPLIER 0.5
#endif #endif
#if AXIS_IS_TMC_CONFIG(Z3) #if AXIS_IS_TMC(Z3)
#define Z3_CURRENT 800 #define Z3_CURRENT 800
#define Z3_CURRENT_HOME Z3_CURRENT #define Z3_CURRENT_HOME Z3_CURRENT
#define Z3_MICROSTEPS Z_MICROSTEPS #define Z3_MICROSTEPS Z_MICROSTEPS
@@ -2782,7 +2878,7 @@
//#define Z3_HOLD_MULTIPLIER 0.5 //#define Z3_HOLD_MULTIPLIER 0.5
#endif #endif
#if AXIS_IS_TMC_CONFIG(Z4) #if AXIS_IS_TMC(Z4)
#define Z4_CURRENT 800 #define Z4_CURRENT 800
#define Z4_CURRENT_HOME Z4_CURRENT #define Z4_CURRENT_HOME Z4_CURRENT
#define Z4_MICROSTEPS Z_MICROSTEPS #define Z4_MICROSTEPS Z_MICROSTEPS
@@ -2792,7 +2888,7 @@
//#define Z4_HOLD_MULTIPLIER 0.5 //#define Z4_HOLD_MULTIPLIER 0.5
#endif #endif
#if AXIS_IS_TMC_CONFIG(I) #if AXIS_IS_TMC(I)
#define I_CURRENT 800 #define I_CURRENT 800
#define I_CURRENT_HOME I_CURRENT #define I_CURRENT_HOME I_CURRENT
#define I_MICROSTEPS 16 #define I_MICROSTEPS 16
@@ -2802,7 +2898,7 @@
//#define I_HOLD_MULTIPLIER 0.5 //#define I_HOLD_MULTIPLIER 0.5
#endif #endif
#if AXIS_IS_TMC_CONFIG(J) #if AXIS_IS_TMC(J)
#define J_CURRENT 800 #define J_CURRENT 800
#define J_CURRENT_HOME J_CURRENT #define J_CURRENT_HOME J_CURRENT
#define J_MICROSTEPS 16 #define J_MICROSTEPS 16
@@ -2812,7 +2908,7 @@
//#define J_HOLD_MULTIPLIER 0.5 //#define J_HOLD_MULTIPLIER 0.5
#endif #endif
#if AXIS_IS_TMC_CONFIG(K) #if AXIS_IS_TMC(K)
#define K_CURRENT 800 #define K_CURRENT 800
#define K_CURRENT_HOME K_CURRENT #define K_CURRENT_HOME K_CURRENT
#define K_MICROSTEPS 16 #define K_MICROSTEPS 16
@@ -2822,7 +2918,7 @@
//#define K_HOLD_MULTIPLIER 0.5 //#define K_HOLD_MULTIPLIER 0.5
#endif #endif
#if AXIS_IS_TMC_CONFIG(U) #if AXIS_IS_TMC(U)
#define U_CURRENT 800 #define U_CURRENT 800
#define U_CURRENT_HOME U_CURRENT #define U_CURRENT_HOME U_CURRENT
#define U_MICROSTEPS 8 #define U_MICROSTEPS 8
@@ -2832,7 +2928,7 @@
//#define U_HOLD_MULTIPLIER 0.5 //#define U_HOLD_MULTIPLIER 0.5
#endif #endif
#if AXIS_IS_TMC_CONFIG(V) #if AXIS_IS_TMC(V)
#define V_CURRENT 800 #define V_CURRENT 800
#define V_CURRENT_HOME V_CURRENT #define V_CURRENT_HOME V_CURRENT
#define V_MICROSTEPS 8 #define V_MICROSTEPS 8
@@ -2842,7 +2938,7 @@
//#define V_HOLD_MULTIPLIER 0.5 //#define V_HOLD_MULTIPLIER 0.5
#endif #endif
#if AXIS_IS_TMC_CONFIG(W) #if AXIS_IS_TMC(W)
#define W_CURRENT 800 #define W_CURRENT 800
#define W_CURRENT_HOME W_CURRENT #define W_CURRENT_HOME W_CURRENT
#define W_MICROSTEPS 8 #define W_MICROSTEPS 8
@@ -2852,7 +2948,7 @@
//#define W_HOLD_MULTIPLIER 0.5 //#define W_HOLD_MULTIPLIER 0.5
#endif #endif
#if AXIS_IS_TMC_CONFIG(E0) #if AXIS_IS_TMC(E0)
#define E0_CURRENT 800 #define E0_CURRENT 800
#define E0_MICROSTEPS 16 #define E0_MICROSTEPS 16
#define E0_RSENSE 0.11 #define E0_RSENSE 0.11
@@ -2861,7 +2957,7 @@
//#define E0_HOLD_MULTIPLIER 0.5 //#define E0_HOLD_MULTIPLIER 0.5
#endif #endif
#if AXIS_IS_TMC_CONFIG(E1) #if AXIS_IS_TMC(E1)
#define E1_CURRENT 800 #define E1_CURRENT 800
#define E1_MICROSTEPS E0_MICROSTEPS #define E1_MICROSTEPS E0_MICROSTEPS
#define E1_RSENSE 0.11 #define E1_RSENSE 0.11
@@ -2870,7 +2966,7 @@
//#define E1_HOLD_MULTIPLIER 0.5 //#define E1_HOLD_MULTIPLIER 0.5
#endif #endif
#if AXIS_IS_TMC_CONFIG(E2) #if AXIS_IS_TMC(E2)
#define E2_CURRENT 800 #define E2_CURRENT 800
#define E2_MICROSTEPS E0_MICROSTEPS #define E2_MICROSTEPS E0_MICROSTEPS
#define E2_RSENSE 0.11 #define E2_RSENSE 0.11
@@ -2879,7 +2975,7 @@
//#define E2_HOLD_MULTIPLIER 0.5 //#define E2_HOLD_MULTIPLIER 0.5
#endif #endif
#if AXIS_IS_TMC_CONFIG(E3) #if AXIS_IS_TMC(E3)
#define E3_CURRENT 800 #define E3_CURRENT 800
#define E3_MICROSTEPS E0_MICROSTEPS #define E3_MICROSTEPS E0_MICROSTEPS
#define E3_RSENSE 0.11 #define E3_RSENSE 0.11
@@ -2888,7 +2984,7 @@
//#define E3_HOLD_MULTIPLIER 0.5 //#define E3_HOLD_MULTIPLIER 0.5
#endif #endif
#if AXIS_IS_TMC_CONFIG(E4) #if AXIS_IS_TMC(E4)
#define E4_CURRENT 800 #define E4_CURRENT 800
#define E4_MICROSTEPS E0_MICROSTEPS #define E4_MICROSTEPS E0_MICROSTEPS
#define E4_RSENSE 0.11 #define E4_RSENSE 0.11
@@ -2897,7 +2993,7 @@
//#define E4_HOLD_MULTIPLIER 0.5 //#define E4_HOLD_MULTIPLIER 0.5
#endif #endif
#if AXIS_IS_TMC_CONFIG(E5) #if AXIS_IS_TMC(E5)
#define E5_CURRENT 800 #define E5_CURRENT 800
#define E5_MICROSTEPS E0_MICROSTEPS #define E5_MICROSTEPS E0_MICROSTEPS
#define E5_RSENSE 0.11 #define E5_RSENSE 0.11
@@ -2906,7 +3002,7 @@
//#define E5_HOLD_MULTIPLIER 0.5 //#define E5_HOLD_MULTIPLIER 0.5
#endif #endif
#if AXIS_IS_TMC_CONFIG(E6) #if AXIS_IS_TMC(E6)
#define E6_CURRENT 800 #define E6_CURRENT 800
#define E6_MICROSTEPS E0_MICROSTEPS #define E6_MICROSTEPS E0_MICROSTEPS
#define E6_RSENSE 0.11 #define E6_RSENSE 0.11
@@ -2915,7 +3011,7 @@
//#define E6_HOLD_MULTIPLIER 0.5 //#define E6_HOLD_MULTIPLIER 0.5
#endif #endif
#if AXIS_IS_TMC_CONFIG(E7) #if AXIS_IS_TMC(E7)
#define E7_CURRENT 800 #define E7_CURRENT 800
#define E7_MICROSTEPS E0_MICROSTEPS #define E7_MICROSTEPS E0_MICROSTEPS
#define E7_RSENSE 0.11 #define E7_RSENSE 0.11
@@ -3017,17 +3113,15 @@
* Use Trinamic's ultra quiet stepping mode. * Use Trinamic's ultra quiet stepping mode.
* When disabled, Marlin will use spreadCycle stepping mode. * When disabled, Marlin will use spreadCycle stepping mode.
*/ */
#if HAS_STEALTHCHOP #define STEALTHCHOP_XY
#define STEALTHCHOP_XY #define STEALTHCHOP_Z
#define STEALTHCHOP_Z #define STEALTHCHOP_I
#define STEALTHCHOP_I #define STEALTHCHOP_J
#define STEALTHCHOP_J #define STEALTHCHOP_K
#define STEALTHCHOP_K #define STEALTHCHOP_U
#define STEALTHCHOP_U #define STEALTHCHOP_V
#define STEALTHCHOP_V #define STEALTHCHOP_W
#define STEALTHCHOP_W #define STEALTHCHOP_E
#define STEALTHCHOP_E
#endif
/** /**
* Optimize spreadCycle chopper parameters by using predefined parameter sets * Optimize spreadCycle chopper parameters by using predefined parameter sets
@@ -3210,7 +3304,7 @@
*/ */
#define TMC_ADV() { } #define TMC_ADV() { }
#endif // HAS_TRINAMIC_CONFIG || HAS_TMC26X #endif // HAS_TRINAMIC_CONFIG
// @section i2cbus // @section i2cbus
+7 -9
View File
@@ -307,22 +307,20 @@ else ifeq ($(HARDWARE_MOTHERBOARD),1154)
else ifeq ($(HARDWARE_MOTHERBOARD),1155) else ifeq ($(HARDWARE_MOTHERBOARD),1155)
# Tenlog D3 Hero IDEX printer # Tenlog D3 Hero IDEX printer
else ifeq ($(HARDWARE_MOTHERBOARD),1156) else ifeq ($(HARDWARE_MOTHERBOARD),1156)
# Tenlog D3,5,6 Pro IDEX printers
else ifeq ($(HARDWARE_MOTHERBOARD),1157)
# Ramps S 1.2 by Sakul.cz (Power outputs: Hotend0, Hotend1, Fan, Bed) # Ramps S 1.2 by Sakul.cz (Power outputs: Hotend0, Hotend1, Fan, Bed)
else ifeq ($(HARDWARE_MOTHERBOARD),1158) else ifeq ($(HARDWARE_MOTHERBOARD),1157)
# Ramps S 1.2 by Sakul.cz (Power outputs: Hotend0, Hotend1, Hotend2, Bed) # Ramps S 1.2 by Sakul.cz (Power outputs: Hotend0, Hotend1, Hotend2, Bed)
else ifeq ($(HARDWARE_MOTHERBOARD),1159) else ifeq ($(HARDWARE_MOTHERBOARD),1158)
# Ramps S 1.2 by Sakul.cz (Power outputs: Hotend, Fan0, Fan1, Bed) # Ramps S 1.2 by Sakul.cz (Power outputs: Hotend, Fan0, Fan1, Bed)
else ifeq ($(HARDWARE_MOTHERBOARD),1160) else ifeq ($(HARDWARE_MOTHERBOARD),1159)
# Longer LK1 PRO / Alfawise U20 Pro (PRO version) # Longer LK1 PRO / Alfawise U20 Pro (PRO version)
else ifeq ($(HARDWARE_MOTHERBOARD),1161) else ifeq ($(HARDWARE_MOTHERBOARD),1160)
# Longer LKx PRO / Alfawise Uxx Pro (PRO version) # Longer LKx PRO / Alfawise Uxx Pro (PRO version)
else ifeq ($(HARDWARE_MOTHERBOARD),1162) else ifeq ($(HARDWARE_MOTHERBOARD),1161)
# Zonestar zrib V5.3 (Chinese RAMPS replica) # Zonestar zrib V5.3 (Chinese RAMPS replica)
else ifeq ($(HARDWARE_MOTHERBOARD),1163) else ifeq ($(HARDWARE_MOTHERBOARD),1162)
# Pxmalion Core I3 # Pxmalion Core I3
else ifeq ($(HARDWARE_MOTHERBOARD),1164) else ifeq ($(HARDWARE_MOTHERBOARD),1163)
# #
# RAMBo and derivatives # RAMBo and derivatives
+1 -1
View File
@@ -41,7 +41,7 @@
* here we define this default string as the date where the latest release * here we define this default string as the date where the latest release
* version was tagged. * version was tagged.
*/ */
//#define STRING_DISTRIBUTION_DATE "2022-12-05" //#define STRING_DISTRIBUTION_DATE "2022-10-12"
/** /**
* Defines a generic printer name to be output to the LCD after booting Marlin. * Defines a generic printer name to be output to the LCD after booting Marlin.
+10 -11
View File
@@ -32,7 +32,6 @@
#include <HardwareSerial.h> #include <HardwareSerial.h>
#else #else
#include "MarlinSerial.h" #include "MarlinSerial.h"
#define BOARD_NO_NATIVE_USB
#endif #endif
#include <stdint.h> #include <stdint.h>
@@ -107,36 +106,36 @@ typedef Servo hal_servo_t;
#define MYSERIAL1 TERN(BLUETOOTH, btSerial, MSerial0) #define MYSERIAL1 TERN(BLUETOOTH, btSerial, MSerial0)
#else #else
#if !WITHIN(SERIAL_PORT, 0, 3) #if !WITHIN(SERIAL_PORT, -1, 3)
#error "SERIAL_PORT must be from 0 to 3." #error "SERIAL_PORT must be from 0 to 3, or -1 for USB Serial."
#endif #endif
#define MYSERIAL1 customizedSerial1 #define MYSERIAL1 customizedSerial1
#ifdef SERIAL_PORT_2 #ifdef SERIAL_PORT_2
#if !WITHIN(SERIAL_PORT_2, 0, 3) #if !WITHIN(SERIAL_PORT_2, -1, 3)
#error "SERIAL_PORT_2 must be from 0 to 3." #error "SERIAL_PORT_2 must be from 0 to 3, or -1 for USB Serial."
#endif #endif
#define MYSERIAL2 customizedSerial2 #define MYSERIAL2 customizedSerial2
#endif #endif
#ifdef SERIAL_PORT_3 #ifdef SERIAL_PORT_3
#if !WITHIN(SERIAL_PORT_3, 0, 3) #if !WITHIN(SERIAL_PORT_3, -1, 3)
#error "SERIAL_PORT_3 must be from 0 to 3." #error "SERIAL_PORT_3 must be from 0 to 3, or -1 for USB Serial."
#endif #endif
#define MYSERIAL3 customizedSerial3 #define MYSERIAL3 customizedSerial3
#endif #endif
#endif #endif
#ifdef MMU2_SERIAL_PORT #ifdef MMU2_SERIAL_PORT
#if !WITHIN(MMU2_SERIAL_PORT, 0, 3) #if !WITHIN(MMU2_SERIAL_PORT, -1, 3)
#error "MMU2_SERIAL_PORT must be from 0 to 3" #error "MMU2_SERIAL_PORT must be from 0 to 3, or -1 for USB Serial."
#endif #endif
#define MMU2_SERIAL mmuSerial #define MMU2_SERIAL mmuSerial
#endif #endif
#ifdef LCD_SERIAL_PORT #ifdef LCD_SERIAL_PORT
#if !WITHIN(LCD_SERIAL_PORT, 0, 3) #if !WITHIN(LCD_SERIAL_PORT, -1, 3)
#error "LCD_SERIAL_PORT must be from 0 to 3." #error "LCD_SERIAL_PORT must be from 0 to 3, or -1 for USB Serial."
#endif #endif
#define LCD_SERIAL lcdSerial #define LCD_SERIAL lcdSerial
#if HAS_DGUS_LCD #if HAS_DGUS_LCD
+3 -3
View File
@@ -146,10 +146,10 @@ void MarlinHAL::set_pwm_frequency(const pin_t pin, const uint16_t f_desired) {
LIMIT(res_pc_temp, 1U, maxtop); LIMIT(res_pc_temp, 1U, maxtop);
// Calculate frequencies of test prescaler and resolution values // Calculate frequencies of test prescaler and resolution values
const uint16_t f_fast_temp = (F_CPU) / (p * (1 + res_fast_temp)), const uint32_t f_diff = _MAX(f, f_desired) - _MIN(f, f_desired),
f_pc_temp = (F_CPU) / (2 * p * res_pc_temp); f_fast_temp = (F_CPU) / (p * (1 + res_fast_temp)),
const int f_diff = _MAX(f, f_desired) - _MIN(f, f_desired),
f_fast_diff = _MAX(f_fast_temp, f_desired) - _MIN(f_fast_temp, f_desired), f_fast_diff = _MAX(f_fast_temp, f_desired) - _MIN(f_fast_temp, f_desired),
f_pc_temp = (F_CPU) / (2 * p * res_pc_temp),
f_pc_diff = _MAX(f_pc_temp, f_desired) - _MIN(f_pc_temp, f_desired); f_pc_diff = _MAX(f_pc_temp, f_desired) - _MIN(f_pc_temp, f_desired);
if (f_fast_diff < f_diff && f_fast_diff <= f_pc_diff) { // FAST values are closest to desired f if (f_fast_diff < f_diff && f_fast_diff <= f_pc_diff) { // FAST values are closest to desired f
+3 -3
View File
@@ -293,11 +293,11 @@ enum ClockSource2 : uint8_t {
#if HAS_MOTOR_CURRENT_PWM #if HAS_MOTOR_CURRENT_PWM
#if PIN_EXISTS(MOTOR_CURRENT_PWM_XY) #if PIN_EXISTS(MOTOR_CURRENT_PWM_XY)
#define PWM_CHK_MOTOR_CURRENT(P) (P == MOTOR_CURRENT_PWM_E || P == MOTOR_CURRENT_PWM_E0 || P == MOTOR_CURRENT_PWM_E1 || P == MOTOR_CURRENT_PWM_Z || P == MOTOR_CURRENT_PWM_XY) #define PWM_CHK_MOTOR_CURRENT(P) (P == MOTOR_CURRENT_PWM_E || P == MOTOR_CURRENT_PWM_Z || P == MOTOR_CURRENT_PWM_XY)
#elif PIN_EXISTS(MOTOR_CURRENT_PWM_Z) #elif PIN_EXISTS(MOTOR_CURRENT_PWM_Z)
#define PWM_CHK_MOTOR_CURRENT(P) (P == MOTOR_CURRENT_PWM_E || P == MOTOR_CURRENT_PWM_E0 || P == MOTOR_CURRENT_PWM_E1 || P == MOTOR_CURRENT_PWM_Z) #define PWM_CHK_MOTOR_CURRENT(P) (P == MOTOR_CURRENT_PWM_E || P == MOTOR_CURRENT_PWM_Z)
#else #else
#define PWM_CHK_MOTOR_CURRENT(P) (P == MOTOR_CURRENT_PWM_E || P == MOTOR_CURRENT_PWM_E0 || P == MOTOR_CURRENT_PWM_E1) #define PWM_CHK_MOTOR_CURRENT(P) (P == MOTOR_CURRENT_PWM_E)
#endif #endif
#else #else
#define PWM_CHK_MOTOR_CURRENT(P) false #define PWM_CHK_MOTOR_CURRENT(P) false
+10 -12
View File
@@ -37,24 +37,22 @@
|| X_ENA_PIN == N || Y_ENA_PIN == N || Z_ENA_PIN == N \ || X_ENA_PIN == N || Y_ENA_PIN == N || Z_ENA_PIN == N \
|| BTN_EN1 == N || BTN_EN2 == N \ || BTN_EN1 == N || BTN_EN2 == N \
) )
#if SERIAL_IN_USE(0) #if CONF_SERIAL_IS(0)
// D0-D1. No known conflicts. // D0-D1. No known conflicts.
#endif #endif
#if SERIAL_IN_USE(1) #if NOT_TARGET(__AVR_ATmega644P__, __AVR_ATmega1284P__)
#if NOT_TARGET(__AVR_ATmega644P__, __AVR_ATmega1284P__) #if CONF_SERIAL_IS(1) && (CHECK_SERIAL_PIN(18) || CHECK_SERIAL_PIN(19))
#if CHECK_SERIAL_PIN(18) || CHECK_SERIAL_PIN(19) #error "Serial Port 1 pin D18 and/or D19 conflicts with another pin on the board."
#error "Serial Port 1 pin D18 and/or D19 conflicts with another pin on the board." #endif
#endif #else
#else #if CONF_SERIAL_IS(1) && (CHECK_SERIAL_PIN(10) || CHECK_SERIAL_PIN(11))
#if CHECK_SERIAL_PIN(10) || CHECK_SERIAL_PIN(11) #error "Serial Port 1 pin D10 and/or D11 conflicts with another pin on the board."
#error "Serial Port 1 pin D10 and/or D11 conflicts with another pin on the board."
#endif
#endif #endif
#endif #endif
#if SERIAL_IN_USE(2) && (CHECK_SERIAL_PIN(16) || CHECK_SERIAL_PIN(17)) #if CONF_SERIAL_IS(2) && (CHECK_SERIAL_PIN(16) || CHECK_SERIAL_PIN(17))
#error "Serial Port 2 pin D16 and/or D17 conflicts with another pin on the board." #error "Serial Port 2 pin D16 and/or D17 conflicts with another pin on the board."
#endif #endif
#if SERIAL_IN_USE(3) && (CHECK_SERIAL_PIN(14) || CHECK_SERIAL_PIN(15)) #if CONF_SERIAL_IS(3) && (CHECK_SERIAL_PIN(14) || CHECK_SERIAL_PIN(15))
#error "Serial Port 3 pin D14 and/or D15 conflicts with another pin on the board." #error "Serial Port 3 pin D14 and/or D15 conflicts with another pin on the board."
#endif #endif
#undef CHECK_SERIAL_PIN #undef CHECK_SERIAL_PIN
+4 -4
View File
@@ -36,15 +36,15 @@
|| X_DIR_PIN == N || Y_DIR_PIN == N || Z_DIR_PIN == N \ || X_DIR_PIN == N || Y_DIR_PIN == N || Z_DIR_PIN == N \
|| X_ENA_PIN == N || Y_ENA_PIN == N || Z_ENA_PIN == N \ || X_ENA_PIN == N || Y_ENA_PIN == N || Z_ENA_PIN == N \
) )
#if SERIAL_IN_USE(0) // D0-D1. No known conflicts. #if CONF_SERIAL_IS(0) // D0-D1. No known conflicts.
#endif #endif
#if SERIAL_IN_USE(1) && (CHECK_SERIAL_PIN(18) || CHECK_SERIAL_PIN(19)) #if CONF_SERIAL_IS(1) && (CHECK_SERIAL_PIN(18) || CHECK_SERIAL_PIN(19))
#error "Serial Port 1 pin D18 and/or D19 conflicts with another pin on the board." #error "Serial Port 1 pin D18 and/or D19 conflicts with another pin on the board."
#endif #endif
#if SERIAL_IN_USE(2) && (CHECK_SERIAL_PIN(16) || CHECK_SERIAL_PIN(17)) #if CONF_SERIAL_IS(2) && (CHECK_SERIAL_PIN(16) || CHECK_SERIAL_PIN(17))
#error "Serial Port 2 pin D16 and/or D17 conflicts with another pin on the board." #error "Serial Port 2 pin D16 and/or D17 conflicts with another pin on the board."
#endif #endif
#if SERIAL_IN_USE(3) && (CHECK_SERIAL_PIN(14) || CHECK_SERIAL_PIN(15)) #if CONF_SERIAL_IS(3) && (CHECK_SERIAL_PIN(14) || CHECK_SERIAL_PIN(15))
#error "Serial Port 3 pin D14 and/or D15 conflicts with another pin on the board." #error "Serial Port 3 pin D14 and/or D15 conflicts with another pin on the board."
#endif #endif
#undef CHECK_SERIAL_PIN #undef CHECK_SERIAL_PIN
+8 -8
View File
@@ -6,14 +6,14 @@
# #
import pioutil import pioutil
if pioutil.is_pio_build(): if pioutil.is_pio_build():
import platform import platform
current_OS = platform.system() current_OS = platform.system()
if current_OS == 'Windows': if current_OS == 'Windows':
Import("env") Import("env")
# Use bossac.exe on Windows # Use bossac.exe on Windows
env.Replace( env.Replace(
UPLOADCMD="bossac --info --unlock --write --verify --reset --erase -U false --boot $SOURCE" UPLOADCMD="bossac --info --unlock --write --verify --reset --erase -U false --boot $SOURCE"
) )
+2 -7
View File
@@ -1,9 +1,8 @@
/** /**
* Marlin 3D Printer Firmware * Marlin 3D Printer Firmware
* Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
* *
* Based on Sprinter and grbl. * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
* Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm * SAMD51 HAL developed by Giuliano Zaro (AKA GMagician)
* *
* This program is free software: you can redistribute it and/or modify * 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 * it under the terms of the GNU General Public License as published by
@@ -19,10 +18,6 @@
* along with this program. If not, see <https://www.gnu.org/licenses/>. * along with this program. If not, see <https://www.gnu.org/licenses/>.
* *
*/ */
/**
* SAMD51 HAL developed by Giuliano Zaro (AKA GMagician)
*/
#ifdef __SAMD51__ #ifdef __SAMD51__
#include "../../inc/MarlinConfig.h" #include "../../inc/MarlinConfig.h"
+2 -7
View File
@@ -1,9 +1,8 @@
/** /**
* Marlin 3D Printer Firmware * Marlin 3D Printer Firmware
* Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
* *
* Based on Sprinter and grbl. * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
* Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm * SAMD51 HAL developed by Giuliano Zaro (AKA GMagician)
* *
* This program is free software: you can redistribute it and/or modify * 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 * it under the terms of the GNU General Public License as published by
@@ -21,10 +20,6 @@
*/ */
#pragma once #pragma once
/**
* SAMD51 HAL developed by Giuliano Zaro (AKA GMagician)
*/
#define CPU_32_BIT #define CPU_32_BIT
#include "../shared/Marduino.h" #include "../shared/Marduino.h"
+2 -7
View File
@@ -1,9 +1,8 @@
/** /**
* Marlin 3D Printer Firmware * Marlin 3D Printer Firmware
* Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
* *
* Based on Sprinter and grbl. * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
* Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm * SAMD51 HAL developed by Giuliano Zaro (AKA GMagician)
* *
* This program is free software: you can redistribute it and/or modify * 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 * it under the terms of the GNU General Public License as published by
@@ -20,10 +19,6 @@
* *
*/ */
/**
* SAMD51 HAL developed by Giuliano Zaro (AKA GMagician)
*/
/** /**
* Hardware and software SPI implementations are included in this file. * Hardware and software SPI implementations are included in this file.
* *
+2 -7
View File
@@ -1,9 +1,8 @@
/** /**
* Marlin 3D Printer Firmware * Marlin 3D Printer Firmware
* Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
* *
* Based on Sprinter and grbl. * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
* Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm * SAMD51 HAL developed by Giuliano Zaro (AKA GMagician)
* *
* This program is free software: you can redistribute it and/or modify * 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 * it under the terms of the GNU General Public License as published by
@@ -19,10 +18,6 @@
* along with this program. If not, see <https://www.gnu.org/licenses/>. * along with this program. If not, see <https://www.gnu.org/licenses/>.
* *
*/ */
/**
* SAMD51 HAL developed by Giuliano Zaro (AKA GMagician)
*/
#ifdef ADAFRUIT_GRAND_CENTRAL_M4 #ifdef ADAFRUIT_GRAND_CENTRAL_M4
/** /**
+2 -7
View File
@@ -1,9 +1,8 @@
/** /**
* Marlin 3D Printer Firmware * Marlin 3D Printer Firmware
* Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
* *
* Based on Sprinter and grbl. * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
* Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm * SAMD51 HAL developed by Giuliano Zaro (AKA GMagician)
* *
* This program is free software: you can redistribute it and/or modify * 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 * it under the terms of the GNU General Public License as published by
@@ -21,10 +20,6 @@
*/ */
#pragma once #pragma once
/**
* SAMD51 HAL developed by Giuliano Zaro (AKA GMagician)
*/
#include "../../core/serial_hook.h" #include "../../core/serial_hook.h"
typedef Serial1Class<Uart> UartT; typedef Serial1Class<Uart> UartT;
+2 -7
View File
@@ -1,9 +1,8 @@
/** /**
* Marlin 3D Printer Firmware * Marlin 3D Printer Firmware
* Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
* *
* Based on Sprinter and grbl. * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
* Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm * SAMD51 HAL developed by Giuliano Zaro (AKA GMagician)
* *
* This program is free software: you can redistribute it and/or modify * 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 * it under the terms of the GNU General Public License as published by
@@ -21,10 +20,6 @@
*/ */
#pragma once #pragma once
/**
* SAMD51 HAL developed by Giuliano Zaro (AKA GMagician)
*/
#define SYNC(sc) while (sc) { \ #define SYNC(sc) while (sc) { \
asm(""); \ asm(""); \
} }
+2 -7
View File
@@ -1,9 +1,8 @@
/** /**
* Marlin 3D Printer Firmware * Marlin 3D Printer Firmware
* Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
* *
* Based on Sprinter and grbl. * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
* Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm * SAMD51 HAL developed by Giuliano Zaro (AKA GMagician)
* *
* This program is free software: you can redistribute it and/or modify * 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 * it under the terms of the GNU General Public License as published by
@@ -20,10 +19,6 @@
* *
*/ */
/**
* SAMD51 HAL developed by Giuliano Zaro (AKA GMagician)
*/
/** /**
* This comes from Arduino library which at the moment is buggy and uncompilable * This comes from Arduino library which at the moment is buggy and uncompilable
*/ */
+2 -7
View File
@@ -1,9 +1,8 @@
/** /**
* Marlin 3D Printer Firmware * Marlin 3D Printer Firmware
* Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
* *
* Based on Sprinter and grbl. * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
* Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm * SAMD51 HAL developed by Giuliano Zaro (AKA GMagician)
* *
* This program is free software: you can redistribute it and/or modify * 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 * it under the terms of the GNU General Public License as published by
@@ -21,10 +20,6 @@
*/ */
#pragma once #pragma once
/**
* SAMD51 HAL developed by Giuliano Zaro (AKA GMagician)
*/
#define _useTimer1 #define _useTimer1
#define _useTimer2 #define _useTimer2
+2 -7
View File
@@ -1,9 +1,8 @@
/** /**
* Marlin 3D Printer Firmware * Marlin 3D Printer Firmware
* Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
* *
* Based on Sprinter and grbl. * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
* Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm * SAMD51 HAL developed by Giuliano Zaro (AKA GMagician)
* *
* This program is free software: you can redistribute it and/or modify * 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 * it under the terms of the GNU General Public License as published by
@@ -19,10 +18,6 @@
* along with this program. If not, see <https://www.gnu.org/licenses/>. * along with this program. If not, see <https://www.gnu.org/licenses/>.
* *
*/ */
/**
* SAMD51 HAL developed by Giuliano Zaro (AKA GMagician)
*/
#ifdef __SAMD51__ #ifdef __SAMD51__
#include "../../inc/MarlinConfig.h" #include "../../inc/MarlinConfig.h"
+2 -7
View File
@@ -1,9 +1,8 @@
/** /**
* Marlin 3D Printer Firmware * Marlin 3D Printer Firmware
* Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
* *
* Based on Sprinter and grbl. * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
* Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm * SAMD51 HAL developed by Giuliano Zaro (AKA GMagician)
* *
* This program is free software: you can redistribute it and/or modify * 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 * it under the terms of the GNU General Public License as published by
@@ -19,10 +18,6 @@
* along with this program. If not, see <https://www.gnu.org/licenses/>. * along with this program. If not, see <https://www.gnu.org/licenses/>.
* *
*/ */
/**
* SAMD51 HAL developed by Giuliano Zaro (AKA GMagician)
*/
#ifdef __SAMD51__ #ifdef __SAMD51__
#include "../../inc/MarlinConfig.h" #include "../../inc/MarlinConfig.h"
+2 -7
View File
@@ -1,9 +1,8 @@
/** /**
* Marlin 3D Printer Firmware * Marlin 3D Printer Firmware
* Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
* *
* Based on Sprinter and grbl. * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
* Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm * SAMD51 HAL developed by Giuliano Zaro (AKA GMagician)
* *
* This program is free software: you can redistribute it and/or modify * 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 * it under the terms of the GNU General Public License as published by
@@ -19,10 +18,6 @@
* along with this program. If not, see <https://www.gnu.org/licenses/>. * along with this program. If not, see <https://www.gnu.org/licenses/>.
* *
*/ */
/**
* SAMD51 HAL developed by Giuliano Zaro (AKA GMagician)
*/
#ifdef __SAMD51__ #ifdef __SAMD51__
#include "../../inc/MarlinConfig.h" #include "../../inc/MarlinConfig.h"
+2 -7
View File
@@ -1,9 +1,8 @@
/** /**
* Marlin 3D Printer Firmware * Marlin 3D Printer Firmware
* Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
* *
* Based on Sprinter and grbl. * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
* Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm * SAMD51 HAL developed by Giuliano Zaro (AKA GMagician)
* *
* This program is free software: you can redistribute it and/or modify * 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 * it under the terms of the GNU General Public License as published by
@@ -21,10 +20,6 @@
*/ */
#pragma once #pragma once
/**
* SAMD51 HAL developed by Giuliano Zaro (AKA GMagician)
*/
/** /**
* Endstop interrupts for ATMEL SAMD51 based targets. * Endstop interrupts for ATMEL SAMD51 based targets.
* *
+2 -7
View File
@@ -1,9 +1,8 @@
/** /**
* Marlin 3D Printer Firmware * Marlin 3D Printer Firmware
* Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
* *
* Based on Sprinter and grbl. * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
* Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm * SAMD51 HAL developed by Giuliano Zaro (AKA GMagician)
* *
* This program is free software: you can redistribute it and/or modify * 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 * it under the terms of the GNU General Public License as published by
@@ -21,10 +20,6 @@
*/ */
#pragma once #pragma once
/**
* SAMD51 HAL developed by Giuliano Zaro (AKA GMagician)
*/
/** /**
* Fast IO functions for SAMD51 * Fast IO functions for SAMD51
*/ */
+2 -8
View File
@@ -1,9 +1,8 @@
/** /**
* Marlin 3D Printer Firmware * Marlin 3D Printer Firmware
* Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
* *
* Based on Sprinter and grbl. * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
* Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm * SAMD51 HAL developed by Giuliano Zaro (AKA GMagician)
* *
* This program is free software: you can redistribute it and/or modify * 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 * it under the terms of the GNU General Public License as published by
@@ -19,11 +18,6 @@
* along with this program. If not, see <https://www.gnu.org/licenses/>. * along with this program. If not, see <https://www.gnu.org/licenses/>.
* *
*/ */
#pragma once
/**
* SAMD51 HAL developed by Giuliano Zaro (AKA GMagician)
*/
/** /**
* Test SAMD51 specific configuration values for errors at compile-time. * Test SAMD51 specific configuration values for errors at compile-time.
+2 -7
View File
@@ -1,9 +1,8 @@
/** /**
* Marlin 3D Printer Firmware * Marlin 3D Printer Firmware
* Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
* *
* Based on Sprinter and grbl. * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
* Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm * SAMD51 HAL developed by Giuliano Zaro (AKA GMagician)
* *
* This program is free software: you can redistribute it and/or modify * 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 * it under the terms of the GNU General Public License as published by
@@ -21,10 +20,6 @@
*/ */
#pragma once #pragma once
/**
* SAMD51 HAL developed by Giuliano Zaro (AKA GMagician)
*/
#define NUMBER_PINS_TOTAL PINS_COUNT #define NUMBER_PINS_TOTAL PINS_COUNT
#define digitalRead_mod(p) extDigitalRead(p) #define digitalRead_mod(p) extDigitalRead(p)
+2 -7
View File
@@ -1,9 +1,8 @@
/** /**
* Marlin 3D Printer Firmware * Marlin 3D Printer Firmware
* Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
* *
* Based on Sprinter and grbl. * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
* Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm * SAMD51 HAL developed by Giuliano Zaro (AKA GMagician)
* *
* This program is free software: you can redistribute it and/or modify * 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 * it under the terms of the GNU General Public License as published by
@@ -21,10 +20,6 @@
*/ */
#pragma once #pragma once
/**
* SAMD51 HAL developed by Giuliano Zaro (AKA GMagician)
*/
#ifdef ADAFRUIT_GRAND_CENTRAL_M4 #ifdef ADAFRUIT_GRAND_CENTRAL_M4
/* /*
+2 -7
View File
@@ -1,9 +1,8 @@
/** /**
* Marlin 3D Printer Firmware * Marlin 3D Printer Firmware
* Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
* *
* Based on Sprinter and grbl. * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
* Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm * SAMD51 HAL developed by Giuliano Zaro (AKA GMagician)
* *
* This program is free software: you can redistribute it and/or modify * 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 * it under the terms of the GNU General Public License as published by
@@ -19,10 +18,6 @@
* along with this program. If not, see <https://www.gnu.org/licenses/>. * along with this program. If not, see <https://www.gnu.org/licenses/>.
* *
*/ */
/**
* SAMD51 HAL developed by Giuliano Zaro (AKA GMagician)
*/
#ifdef __SAMD51__ #ifdef __SAMD51__
// -------------------------------------------------------------------------- // --------------------------------------------------------------------------
+2 -7
View File
@@ -1,9 +1,8 @@
/** /**
* Marlin 3D Printer Firmware * Marlin 3D Printer Firmware
* Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
* *
* Based on Sprinter and grbl. * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
* Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm * SAMD51 HAL developed by Giuliano Zaro (AKA GMagician)
* *
* This program is free software: you can redistribute it and/or modify * 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 * it under the terms of the GNU General Public License as published by
@@ -21,10 +20,6 @@
*/ */
#pragma once #pragma once
/**
* SAMD51 HAL developed by Giuliano Zaro (AKA GMagician)
*/
#include <stdint.h> #include <stdint.h>
// -------------------------------------------------------------------------- // --------------------------------------------------------------------------
+8 -10
View File
@@ -95,7 +95,7 @@
static_assert(IS_FLASH_SECTOR(FLASH_SECTOR), "FLASH_SECTOR is invalid"); static_assert(IS_FLASH_SECTOR(FLASH_SECTOR), "FLASH_SECTOR is invalid");
static_assert(IS_POWER_OF_2(FLASH_UNIT_SIZE), "FLASH_UNIT_SIZE should be a power of 2, please check your chip's spec sheet"); static_assert(IS_POWER_OF_2(FLASH_UNIT_SIZE), "FLASH_UNIT_SIZE should be a power of 2, please check your chip's spec sheet");
#endif // FLASH_EEPROM_LEVELING #endif
static bool eeprom_data_written = false; static bool eeprom_data_written = false;
@@ -189,15 +189,15 @@ bool PersistentStore::access_finish() {
UNLOCK_FLASH(); UNLOCK_FLASH();
uint32_t offset = 0, uint32_t offset = 0;
address = SLOT_ADDRESS(current_slot), uint32_t address = SLOT_ADDRESS(current_slot);
address_end = address + MARLIN_EEPROM_SIZE, uint32_t address_end = address + MARLIN_EEPROM_SIZE;
data = 0; uint32_t data = 0;
bool success = true; bool success = true;
while (address < address_end) { while (address < address_end) {
memcpy(&data, ram_eeprom + offset, sizeof(data)); memcpy(&data, ram_eeprom + offset, sizeof(uint32_t));
status = HAL_FLASH_Program(FLASH_TYPEPROGRAM_WORD, address, data); status = HAL_FLASH_Program(FLASH_TYPEPROGRAM_WORD, address, data);
if (status == HAL_OK) { if (status == HAL_OK) {
address += sizeof(uint32_t); address += sizeof(uint32_t);
@@ -221,8 +221,7 @@ bool PersistentStore::access_finish() {
return success; return success;
#else // !FLASH_EEPROM_LEVELING #else
// The following was written for the STM32F4 but may work with other MCUs as well. // The following was written for the STM32F4 but may work with other MCUs as well.
// Most STM32F4 flash does not allow reading from flash during erase operations. // Most STM32F4 flash does not allow reading from flash during erase operations.
// This takes about a second on a STM32F407 with a 128kB sector used as EEPROM. // This takes about a second on a STM32F407 with a 128kB sector used as EEPROM.
@@ -236,8 +235,7 @@ bool PersistentStore::access_finish() {
TERN_(HAS_PAUSE_SERVO_OUTPUT, RESUME_SERVO_OUTPUT()); TERN_(HAS_PAUSE_SERVO_OUTPUT, RESUME_SERVO_OUTPUT());
eeprom_data_written = false; eeprom_data_written = false;
#endif
#endif // !FLASH_EEPROM_LEVELING
} }
return true; return true;
-59
View File
@@ -50,62 +50,3 @@
#if ANY(TFT_COLOR_UI, TFT_LVGL_UI, TFT_CLASSIC_UI) && NOT_TARGET(STM32H7xx, STM32F4xx, STM32F1xx) #if ANY(TFT_COLOR_UI, TFT_LVGL_UI, TFT_CLASSIC_UI) && NOT_TARGET(STM32H7xx, STM32F4xx, STM32F1xx)
#error "TFT_COLOR_UI, TFT_LVGL_UI and TFT_CLASSIC_UI are currently only supported on STM32H7, STM32F4 and STM32F1 hardware." #error "TFT_COLOR_UI, TFT_LVGL_UI and TFT_CLASSIC_UI are currently only supported on STM32H7, STM32F4 and STM32F1 hardware."
#endif #endif
/**
* Check for common serial pin conflicts
*/
#define _CHECK_SERIAL_PIN(N) (( \
BTN_EN1 == N || DOGLCD_CS == N || HEATER_BED_PIN == N || FAN_PIN == N || \
SDIO_D2_PIN == N || SDIO_D3_PIN == N || SDIO_CK_PIN == N || SDIO_CMD_PIN == N \
))
#define CHECK_SERIAL_PIN(T,N) defined(UART##N##_##T##_PIN) && _CHECK_SERIAL_PIN(UART##N##_##T##_PIN)
#if SERIAL_IN_USE(1)
#if CHECK_SERIAL_PIN(TX,1)
#error "Serial Port 1 TX IO pins conflict with another pin on the board."
#endif
#if CHECK_SERIAL_PIN(RX,1)
#error "Serial Port 1 RX IO pins conflict with another pin on the board."
#endif
#endif
#if SERIAL_IN_USE(2)
#if CHECK_SERIAL_PIN(TX,2)
#error "Serial Port 2 TX IO pins conflict with another pin on the board."
#endif
#if CHECK_SERIAL_PIN(RX,2)
#error "Serial Port 2 RX IO pins conflict with another pin on the board."
#endif
#endif
#if SERIAL_IN_USE(3)
#if CHECK_SERIAL_PIN(TX,3)
#error "Serial Port 3 TX IO pins conflict with another pin on the board."
#endif
#if CHECK_SERIAL_PIN(RX,3)
#error "Serial Port 3 RX IO pins conflict with another pin on the board."
#endif
#endif
#if SERIAL_IN_USE(4)
#if CHECK_SERIAL_PIN(TX,4)
#error "Serial Port 4 TX IO pins conflict with another pin on the board."
#endif
#if CHECK_SERIAL_PIN(RX,4)
#error "Serial Port 4 RX IO pins conflict with another pin on the board."
#endif
#endif
#if SERIAL_IN_USE(5)
#if CHECK_SERIAL_PIN(TX,5)
#error "Serial Port 5 TX IO pins conflict with another pin on the board."
#endif
#if CHECK_SERIAL_PIN(RX,5)
#error "Serial Port 5 RX IO pins conflict with another pin on the board."
#endif
#endif
#if SERIAL_IN_USE(6)
#if CHECK_SERIAL_PIN(TX,6)
#error "Serial Port 6 TX IO pins conflict with another pin on the board."
#endif
#if CHECK_SERIAL_PIN(RX,6)
#error "Serial Port 6 RX IO pins conflict with another pin on the board."
#endif
#endif
#undef CHECK_SERIAL_PIN
#undef _CHECK_SERIAL_PIN
+2 -3
View File
@@ -33,9 +33,8 @@
void UnwPrintf(const char *format, ...) { void UnwPrintf(const char *format, ...) {
va_list args; va_list args;
va_start(args, format); va_start( args, format );
vprintf(format, args); vprintf(format, args );
va_end(args);
} }
#endif #endif
+7 -9
View File
@@ -110,14 +110,13 @@
#define BOARD_COPYMASTER_3D 1154 // Copymaster 3D #define BOARD_COPYMASTER_3D 1154 // Copymaster 3D
#define BOARD_ORTUR_4 1155 // Ortur 4 #define BOARD_ORTUR_4 1155 // Ortur 4
#define BOARD_TENLOG_D3_HERO 1156 // Tenlog D3 Hero IDEX printer #define BOARD_TENLOG_D3_HERO 1156 // Tenlog D3 Hero IDEX printer
#define BOARD_TENLOG_MB1_V23 1157 // Tenlog D3, D5, D6 IDEX Printer #define BOARD_RAMPS_S_12_EEFB 1157 // Ramps S 1.2 by Sakul.cz (Power outputs: Hotend0, Hotend1, Fan, Bed)
#define BOARD_RAMPS_S_12_EEFB 1158 // Ramps S 1.2 by Sakul.cz (Power outputs: Hotend0, Hotend1, Fan, Bed) #define BOARD_RAMPS_S_12_EEEB 1158 // Ramps S 1.2 by Sakul.cz (Power outputs: Hotend0, Hotend1, Hotend2, Bed)
#define BOARD_RAMPS_S_12_EEEB 1159 // Ramps S 1.2 by Sakul.cz (Power outputs: Hotend0, Hotend1, Hotend2, Bed) #define BOARD_RAMPS_S_12_EFFB 1159 // Ramps S 1.2 by Sakul.cz (Power outputs: Hotend, Fan0, Fan1, Bed)
#define BOARD_RAMPS_S_12_EFFB 1160 // Ramps S 1.2 by Sakul.cz (Power outputs: Hotend, Fan0, Fan1, Bed) #define BOARD_LONGER3D_LK1_PRO 1160 // Longer LK1 PRO / Alfawise U20 Pro (PRO version)
#define BOARD_LONGER3D_LK1_PRO 1161 // Longer LK1 PRO / Alfawise U20 Pro (PRO version) #define BOARD_LONGER3D_LKx_PRO 1161 // Longer LKx PRO / Alfawise Uxx Pro (PRO version)
#define BOARD_LONGER3D_LKx_PRO 1162 // Longer LKx PRO / Alfawise Uxx Pro (PRO version) #define BOARD_ZRIB_V53 1162 // Zonestar zrib V5.3 (Chinese RAMPS replica)
#define BOARD_ZRIB_V53 1163 // Zonestar zrib V5.3 (Chinese RAMPS replica) #define BOARD_PXMALION_CORE_I3 1163 // Pxmalion Core I3
#define BOARD_PXMALION_CORE_I3 1164 // Pxmalion Core I3
// //
// RAMBo and derivatives // RAMBo and derivatives
@@ -427,7 +426,6 @@
#define BOARD_OPULO_LUMEN_REV4 4241 // Opulo Lumen PnP Controller REV4 (STM32F407VE / STM32F407VG) #define BOARD_OPULO_LUMEN_REV4 4241 // Opulo Lumen PnP Controller REV4 (STM32F407VE / STM32F407VG)
#define BOARD_FYSETC_SPIDER_KING407 4242 // FYSETC Spider King407 (STM32F407ZG) #define BOARD_FYSETC_SPIDER_KING407 4242 // FYSETC Spider King407 (STM32F407ZG)
#define BOARD_MKS_SKIPR_V1 4243 // MKS SKIPR v1.0 all-in-one board (STM32F407VE) #define BOARD_MKS_SKIPR_V1 4243 // MKS SKIPR v1.0 all-in-one board (STM32F407VE)
#define BOARD_TRONXY_V10 4244 // TRONXY V10 (STM32F446ZE)
// //
// ARM Cortex M7 // ARM Cortex M7
-2
View File
@@ -125,8 +125,6 @@
|| AXIS_DRIVER_TYPE(A,TMC2660) \ || AXIS_DRIVER_TYPE(A,TMC2660) \
|| AXIS_DRIVER_TYPE(A,TMC5130) || AXIS_DRIVER_TYPE(A,TMC5160) ) || AXIS_DRIVER_TYPE(A,TMC5130) || AXIS_DRIVER_TYPE(A,TMC5160) )
#define AXIS_IS_TMC_CONFIG(A) ( AXIS_IS_TMC(A) || AXIS_DRIVER_TYPE(A,TMC26X) )
// Test for a driver that uses SPI - this allows checking whether a _CS_ pin // Test for a driver that uses SPI - this allows checking whether a _CS_ pin
// is considered sensitive // is considered sensitive
#define AXIS_HAS_SPI(A) ( AXIS_DRIVER_TYPE(A,TMC2130) || AXIS_DRIVER_TYPE(A,TMC2160) \ #define AXIS_HAS_SPI(A) ( AXIS_DRIVER_TYPE(A,TMC2130) || AXIS_DRIVER_TYPE(A,TMC2160) \
+108 -110
View File
@@ -36,8 +36,6 @@ struct IF { typedef R type; };
template <class L, class R> template <class L, class R>
struct IF<true, L, R> { typedef L type; }; struct IF<true, L, R> { typedef L type; };
#define ALL_AXIS_NAMES X, X2, Y, Y2, Z, Z2, Z3, Z4, I, J, K, U, V, W, E0, E1, E2, E3, E4, E5, E6, E7
#define NUM_AXIS_GANG(V...) GANG_N(NUM_AXES, V) #define NUM_AXIS_GANG(V...) GANG_N(NUM_AXES, V)
#define NUM_AXIS_CODE(V...) CODE_N(NUM_AXES, V) #define NUM_AXIS_CODE(V...) CODE_N(NUM_AXES, V)
#define NUM_AXIS_LIST(V...) LIST_N(NUM_AXES, V) #define NUM_AXIS_LIST(V...) LIST_N(NUM_AXES, V)
@@ -228,8 +226,8 @@ typedef const_float_t const_celsius_float_t;
// Helpers // Helpers
#define _RECIP(N) ((N) ? 1.0f / static_cast<float>(N) : 0.0f) #define _RECIP(N) ((N) ? 1.0f / static_cast<float>(N) : 0.0f)
#define _ABS(N) ((N) < 0 ? -(N) : (N)) #define _ABS(N) ((N) < 0 ? -(N) : (N))
#define _LS(N) (N = (T)(uint32_t(N) << p)) #define _LS(N) (N = (T)(uint32_t(N) << v))
#define _RS(N) (N = (T)(uint32_t(N) >> p)) #define _RS(N) (N = (T)(uint32_t(N) >> v))
#define FI FORCE_INLINE #define FI FORCE_INLINE
// Forward declarations // Forward declarations
@@ -309,9 +307,9 @@ typedef abce_float_t abce_pos_t;
void toLogical(xy_pos_t &raw); void toLogical(xy_pos_t &raw);
void toLogical(xyz_pos_t &raw); void toLogical(xyz_pos_t &raw);
void toLogical(xyze_pos_t &raw); void toLogical(xyze_pos_t &raw);
void toNative(xy_pos_t &lpos); void toNative(xy_pos_t &raw);
void toNative(xyz_pos_t &lpos); void toNative(xyz_pos_t &raw);
void toNative(xyze_pos_t &lpos); void toNative(xyze_pos_t &raw);
// //
// Paired XY coordinates, counters, flags, etc. // Paired XY coordinates, counters, flags, etc.
@@ -350,9 +348,9 @@ struct XYval {
// If any element is true then it's true // If any element is true then it's true
FI operator bool() { return x || y; } FI operator bool() { return x || y; }
// Smallest element // Smallest element
FI T small() const { return _MIN(x, y); } FI T _min() const { return _MIN(x, y); }
// Largest element // Largest element
FI T large() const { return _MAX(x, y); } FI T _max() const { return _MAX(x, y); }
// Explicit copy and copies with conversion // Explicit copy and copies with conversion
FI XYval<T> copy() const { return *this; } FI XYval<T> copy() const { return *this; }
@@ -411,18 +409,18 @@ struct XYval {
FI XYval<T> operator* (const XYZEval<T> &rs) { XYval<T> ls = *this; ls.x *= rs.x; ls.y *= rs.y; return ls; } FI XYval<T> operator* (const XYZEval<T> &rs) { XYval<T> ls = *this; ls.x *= rs.x; ls.y *= rs.y; return ls; }
FI XYval<T> operator/ (const XYZEval<T> &rs) const { XYval<T> ls = *this; ls.x /= rs.x; ls.y /= rs.y; return ls; } FI XYval<T> operator/ (const XYZEval<T> &rs) const { XYval<T> ls = *this; ls.x /= rs.x; ls.y /= rs.y; return ls; }
FI XYval<T> operator/ (const XYZEval<T> &rs) { XYval<T> ls = *this; ls.x /= rs.x; ls.y /= rs.y; return ls; } FI XYval<T> operator/ (const XYZEval<T> &rs) { XYval<T> ls = *this; ls.x /= rs.x; ls.y /= rs.y; return ls; }
FI XYval<T> operator* (const float &p) const { XYval<T> ls = *this; ls.x *= p; ls.y *= p; return ls; } FI XYval<T> operator* (const float &v) const { XYval<T> ls = *this; ls.x *= v; ls.y *= v; return ls; }
FI XYval<T> operator* (const float &p) { XYval<T> ls = *this; ls.x *= p; ls.y *= p; return ls; } FI XYval<T> operator* (const float &v) { XYval<T> ls = *this; ls.x *= v; ls.y *= v; return ls; }
FI XYval<T> operator* (const int &p) const { XYval<T> ls = *this; ls.x *= p; ls.y *= p; return ls; } FI XYval<T> operator* (const int &v) const { XYval<T> ls = *this; ls.x *= v; ls.y *= v; return ls; }
FI XYval<T> operator* (const int &p) { XYval<T> ls = *this; ls.x *= p; ls.y *= p; return ls; } FI XYval<T> operator* (const int &v) { XYval<T> ls = *this; ls.x *= v; ls.y *= v; return ls; }
FI XYval<T> operator/ (const float &p) const { XYval<T> ls = *this; ls.x /= p; ls.y /= p; return ls; } FI XYval<T> operator/ (const float &v) const { XYval<T> ls = *this; ls.x /= v; ls.y /= v; return ls; }
FI XYval<T> operator/ (const float &p) { XYval<T> ls = *this; ls.x /= p; ls.y /= p; return ls; } FI XYval<T> operator/ (const float &v) { XYval<T> ls = *this; ls.x /= v; ls.y /= v; return ls; }
FI XYval<T> operator/ (const int &p) const { XYval<T> ls = *this; ls.x /= p; ls.y /= p; return ls; } FI XYval<T> operator/ (const int &v) const { XYval<T> ls = *this; ls.x /= v; ls.y /= v; return ls; }
FI XYval<T> operator/ (const int &p) { XYval<T> ls = *this; ls.x /= p; ls.y /= p; return ls; } FI XYval<T> operator/ (const int &v) { XYval<T> ls = *this; ls.x /= v; ls.y /= v; return ls; }
FI XYval<T> operator>>(const int &p) const { XYval<T> ls = *this; _RS(ls.x); _RS(ls.y); return ls; } FI XYval<T> operator>>(const int &v) const { XYval<T> ls = *this; _RS(ls.x); _RS(ls.y); return ls; }
FI XYval<T> operator>>(const int &p) { XYval<T> ls = *this; _RS(ls.x); _RS(ls.y); return ls; } FI XYval<T> operator>>(const int &v) { XYval<T> ls = *this; _RS(ls.x); _RS(ls.y); return ls; }
FI XYval<T> operator<<(const int &p) const { XYval<T> ls = *this; _LS(ls.x); _LS(ls.y); return ls; } FI XYval<T> operator<<(const int &v) const { XYval<T> ls = *this; _LS(ls.x); _LS(ls.y); return ls; }
FI XYval<T> operator<<(const int &p) { XYval<T> ls = *this; _LS(ls.x); _LS(ls.y); return ls; } FI XYval<T> operator<<(const int &v) { XYval<T> ls = *this; _LS(ls.x); _LS(ls.y); return ls; }
FI const XYval<T> operator-() const { XYval<T> o = *this; o.x = -x; o.y = -y; return o; } FI const XYval<T> operator-() const { XYval<T> o = *this; o.x = -x; o.y = -y; return o; }
FI XYval<T> operator-() { XYval<T> o = *this; o.x = -x; o.y = -y; return o; } FI XYval<T> operator-() { XYval<T> o = *this; o.x = -x; o.y = -y; return o; }
@@ -436,10 +434,10 @@ struct XYval {
FI XYval<T>& operator+=(const XYZEval<T> &rs) { x += rs.x; y += rs.y; return *this; } FI XYval<T>& operator+=(const XYZEval<T> &rs) { x += rs.x; y += rs.y; return *this; }
FI XYval<T>& operator-=(const XYZEval<T> &rs) { x -= rs.x; y -= rs.y; return *this; } FI XYval<T>& operator-=(const XYZEval<T> &rs) { x -= rs.x; y -= rs.y; return *this; }
FI XYval<T>& operator*=(const XYZEval<T> &rs) { x *= rs.x; y *= rs.y; return *this; } FI XYval<T>& operator*=(const XYZEval<T> &rs) { x *= rs.x; y *= rs.y; return *this; }
FI XYval<T>& operator*=(const float &p) { x *= p; y *= p; return *this; } FI XYval<T>& operator*=(const float &v) { x *= v; y *= v; return *this; }
FI XYval<T>& operator*=(const int &p) { x *= p; y *= p; return *this; } FI XYval<T>& operator*=(const int &v) { x *= v; y *= v; return *this; }
FI XYval<T>& operator>>=(const int &p) { _RS(x); _RS(y); return *this; } FI XYval<T>& operator>>=(const int &v) { _RS(x); _RS(y); return *this; }
FI XYval<T>& operator<<=(const int &p) { _LS(x); _LS(y); return *this; } FI XYval<T>& operator<<=(const int &v) { _LS(x); _LS(y); return *this; }
// Exact comparisons. For floats a "NEAR" operation may be better. // Exact comparisons. For floats a "NEAR" operation may be better.
FI bool operator==(const XYval<T> &rs) const { return x == rs.x && y == rs.y; } FI bool operator==(const XYval<T> &rs) const { return x == rs.x && y == rs.y; }
@@ -507,9 +505,9 @@ struct XYZval {
// If any element is true then it's true // If any element is true then it's true
FI operator bool() { return NUM_AXIS_GANG(x, || y, || z, || i, || j, || k, || u, || v, || w); } FI operator bool() { return NUM_AXIS_GANG(x, || y, || z, || i, || j, || k, || u, || v, || w); }
// Smallest element // Smallest element
FI T small() const { return _MIN(NUM_AXIS_LIST(x, y, z, i, j, k, u, v, w)); } FI T _min() const { return _MIN(NUM_AXIS_LIST(x, y, z, i, j, k, u, v, w)); }
// Largest element // Largest element
FI T large() const { return _MAX(NUM_AXIS_LIST(x, y, z, i, j, k, u, v, w)); } FI T _max() const { return _MAX(NUM_AXIS_LIST(x, y, z, i, j, k, u, v, w)); }
// Explicit copy and copies with conversion // Explicit copy and copies with conversion
FI XYZval<T> copy() const { XYZval<T> o = *this; return o; } FI XYZval<T> copy() const { XYZval<T> o = *this; return o; }
@@ -569,18 +567,18 @@ struct XYZval {
FI XYZval<T> operator* (const XYZEval<T> &rs) { XYZval<T> ls = *this; NUM_AXIS_CODE(ls.x *= rs.x, ls.y *= rs.y, ls.z *= rs.z, ls.i *= rs.i, ls.j *= rs.j, ls.k *= rs.k, ls.u *= rs.u, ls.v *= rs.v, ls.w *= rs.w); return ls; } FI XYZval<T> operator* (const XYZEval<T> &rs) { XYZval<T> ls = *this; NUM_AXIS_CODE(ls.x *= rs.x, ls.y *= rs.y, ls.z *= rs.z, ls.i *= rs.i, ls.j *= rs.j, ls.k *= rs.k, ls.u *= rs.u, ls.v *= rs.v, ls.w *= rs.w); return ls; }
FI XYZval<T> operator/ (const XYZEval<T> &rs) const { XYZval<T> ls = *this; NUM_AXIS_CODE(ls.x /= rs.x, ls.y /= rs.y, ls.z /= rs.z, ls.i /= rs.i, ls.j /= rs.j, ls.k /= rs.k, ls.u /= rs.u, ls.v /= rs.v, ls.w /= rs.w); return ls; } FI XYZval<T> operator/ (const XYZEval<T> &rs) const { XYZval<T> ls = *this; NUM_AXIS_CODE(ls.x /= rs.x, ls.y /= rs.y, ls.z /= rs.z, ls.i /= rs.i, ls.j /= rs.j, ls.k /= rs.k, ls.u /= rs.u, ls.v /= rs.v, ls.w /= rs.w); return ls; }
FI XYZval<T> operator/ (const XYZEval<T> &rs) { XYZval<T> ls = *this; NUM_AXIS_CODE(ls.x /= rs.x, ls.y /= rs.y, ls.z /= rs.z, ls.i /= rs.i, ls.j /= rs.j, ls.k /= rs.k, ls.u /= rs.u, ls.v /= rs.v, ls.w /= rs.w); return ls; } FI XYZval<T> operator/ (const XYZEval<T> &rs) { XYZval<T> ls = *this; NUM_AXIS_CODE(ls.x /= rs.x, ls.y /= rs.y, ls.z /= rs.z, ls.i /= rs.i, ls.j /= rs.j, ls.k /= rs.k, ls.u /= rs.u, ls.v /= rs.v, ls.w /= rs.w); return ls; }
FI XYZval<T> operator* (const float &p) const { XYZval<T> ls = *this; NUM_AXIS_CODE(ls.x *= p, ls.y *= p, ls.z *= p, ls.i *= p, ls.j *= p, ls.k *= p, ls.u *= p, ls.v *= p, ls.w *= p ); return ls; } FI XYZval<T> operator* (const float &v) const { XYZval<T> ls = *this; NUM_AXIS_CODE(ls.x *= v, ls.y *= v, ls.z *= v, ls.i *= v, ls.j *= v, ls.k *= v, ls.u *= v, ls.v *= v, ls.w *= v ); return ls; }
FI XYZval<T> operator* (const float &p) { XYZval<T> ls = *this; NUM_AXIS_CODE(ls.x *= p, ls.y *= p, ls.z *= p, ls.i *= p, ls.j *= p, ls.k *= p, ls.u *= p, ls.v *= p, ls.w *= p ); return ls; } FI XYZval<T> operator* (const float &v) { XYZval<T> ls = *this; NUM_AXIS_CODE(ls.x *= v, ls.y *= v, ls.z *= v, ls.i *= v, ls.j *= v, ls.k *= v, ls.u *= v, ls.v *= v, ls.w *= v ); return ls; }
FI XYZval<T> operator* (const int &p) const { XYZval<T> ls = *this; NUM_AXIS_CODE(ls.x *= p, ls.y *= p, ls.z *= p, ls.i *= p, ls.j *= p, ls.k *= p, ls.u *= p, ls.v *= p, ls.w *= p ); return ls; } FI XYZval<T> operator* (const int &v) const { XYZval<T> ls = *this; NUM_AXIS_CODE(ls.x *= v, ls.y *= v, ls.z *= v, ls.i *= v, ls.j *= v, ls.k *= v, ls.u *= v, ls.v *= v, ls.w *= v ); return ls; }
FI XYZval<T> operator* (const int &p) { XYZval<T> ls = *this; NUM_AXIS_CODE(ls.x *= p, ls.y *= p, ls.z *= p, ls.i *= p, ls.j *= p, ls.k *= p, ls.u *= p, ls.v *= p, ls.w *= p ); return ls; } FI XYZval<T> operator* (const int &v) { XYZval<T> ls = *this; NUM_AXIS_CODE(ls.x *= v, ls.y *= v, ls.z *= v, ls.i *= v, ls.j *= v, ls.k *= v, ls.u *= v, ls.v *= v, ls.w *= v ); return ls; }
FI XYZval<T> operator/ (const float &p) const { XYZval<T> ls = *this; NUM_AXIS_CODE(ls.x /= p, ls.y /= p, ls.z /= p, ls.i /= p, ls.j /= p, ls.k /= p, ls.u /= p, ls.v /= p, ls.w /= p ); return ls; } FI XYZval<T> operator/ (const float &v) const { XYZval<T> ls = *this; NUM_AXIS_CODE(ls.x /= v, ls.y /= v, ls.z /= v, ls.i /= v, ls.j /= v, ls.k /= v, ls.u /= v, ls.v /= v, ls.w /= v ); return ls; }
FI XYZval<T> operator/ (const float &p) { XYZval<T> ls = *this; NUM_AXIS_CODE(ls.x /= p, ls.y /= p, ls.z /= p, ls.i /= p, ls.j /= p, ls.k /= p, ls.u /= p, ls.v /= p, ls.w /= p ); return ls; } FI XYZval<T> operator/ (const float &v) { XYZval<T> ls = *this; NUM_AXIS_CODE(ls.x /= v, ls.y /= v, ls.z /= v, ls.i /= v, ls.j /= v, ls.k /= v, ls.u /= v, ls.v /= v, ls.w /= v ); return ls; }
FI XYZval<T> operator/ (const int &p) const { XYZval<T> ls = *this; NUM_AXIS_CODE(ls.x /= p, ls.y /= p, ls.z /= p, ls.i /= p, ls.j /= p, ls.k /= p, ls.u /= p, ls.v /= p, ls.w /= p ); return ls; } FI XYZval<T> operator/ (const int &v) const { XYZval<T> ls = *this; NUM_AXIS_CODE(ls.x /= v, ls.y /= v, ls.z /= v, ls.i /= v, ls.j /= v, ls.k /= v, ls.u /= v, ls.v /= v, ls.w /= v ); return ls; }
FI XYZval<T> operator/ (const int &p) { XYZval<T> ls = *this; NUM_AXIS_CODE(ls.x /= p, ls.y /= p, ls.z /= p, ls.i /= p, ls.j /= p, ls.k /= p, ls.u /= p, ls.v /= p, ls.w /= p ); return ls; } FI XYZval<T> operator/ (const int &v) { XYZval<T> ls = *this; NUM_AXIS_CODE(ls.x /= v, ls.y /= v, ls.z /= v, ls.i /= v, ls.j /= v, ls.k /= v, ls.u /= v, ls.v /= v, ls.w /= v ); return ls; }
FI XYZval<T> operator>>(const int &p) const { XYZval<T> ls = *this; NUM_AXIS_CODE(_RS(ls.x), _RS(ls.y), _RS(ls.z), _RS(ls.i), _RS(ls.j), _RS(ls.k), _RS(ls.u), _RS(ls.v), _RS(ls.w) ); return ls; } FI XYZval<T> operator>>(const int &v) const { XYZval<T> ls = *this; NUM_AXIS_CODE(_RS(ls.x), _RS(ls.y), _RS(ls.z), _RS(ls.i), _RS(ls.j), _RS(ls.k), _RS(ls.u), _RS(ls.v), _RS(ls.w) ); return ls; }
FI XYZval<T> operator>>(const int &p) { XYZval<T> ls = *this; NUM_AXIS_CODE(_RS(ls.x), _RS(ls.y), _RS(ls.z), _RS(ls.i), _RS(ls.j), _RS(ls.k), _RS(ls.u), _RS(ls.v), _RS(ls.w) ); return ls; } FI XYZval<T> operator>>(const int &v) { XYZval<T> ls = *this; NUM_AXIS_CODE(_RS(ls.x), _RS(ls.y), _RS(ls.z), _RS(ls.i), _RS(ls.j), _RS(ls.k), _RS(ls.u), _RS(ls.v), _RS(ls.w) ); return ls; }
FI XYZval<T> operator<<(const int &p) const { XYZval<T> ls = *this; NUM_AXIS_CODE(_LS(ls.x), _LS(ls.y), _LS(ls.z), _LS(ls.i), _LS(ls.j), _LS(ls.k), _LS(ls.u), _LS(ls.v), _LS(ls.w) ); return ls; } FI XYZval<T> operator<<(const int &v) const { XYZval<T> ls = *this; NUM_AXIS_CODE(_LS(ls.x), _LS(ls.y), _LS(ls.z), _LS(ls.i), _LS(ls.j), _LS(ls.k), _LS(ls.u), _LS(ls.v), _LS(ls.w) ); return ls; }
FI XYZval<T> operator<<(const int &p) { XYZval<T> ls = *this; NUM_AXIS_CODE(_LS(ls.x), _LS(ls.y), _LS(ls.z), _LS(ls.i), _LS(ls.j), _LS(ls.k), _LS(ls.u), _LS(ls.v), _LS(ls.w) ); return ls; } FI XYZval<T> operator<<(const int &v) { XYZval<T> ls = *this; NUM_AXIS_CODE(_LS(ls.x), _LS(ls.y), _LS(ls.z), _LS(ls.i), _LS(ls.j), _LS(ls.k), _LS(ls.u), _LS(ls.v), _LS(ls.w) ); return ls; }
FI const XYZval<T> operator-() const { XYZval<T> o = *this; NUM_AXIS_CODE(o.x = -x, o.y = -y, o.z = -z, o.i = -i, o.j = -j, o.k = -k, o.u = -u, o.v = -v, o.w = -w); return o; } FI const XYZval<T> operator-() const { XYZval<T> o = *this; NUM_AXIS_CODE(o.x = -x, o.y = -y, o.z = -z, o.i = -i, o.j = -j, o.k = -k, o.u = -u, o.v = -v, o.w = -w); return o; }
FI XYZval<T> operator-() { XYZval<T> o = *this; NUM_AXIS_CODE(o.x = -x, o.y = -y, o.z = -z, o.i = -i, o.j = -j, o.k = -k, o.u = -u, o.v = -v, o.w = -w); return o; } FI XYZval<T> operator-() { XYZval<T> o = *this; NUM_AXIS_CODE(o.x = -x, o.y = -y, o.z = -z, o.i = -i, o.j = -j, o.k = -k, o.u = -u, o.v = -v, o.w = -w); return o; }
@@ -597,10 +595,10 @@ struct XYZval {
FI XYZval<T>& operator-=(const XYZEval<T> &rs) { NUM_AXIS_CODE(x -= rs.x, y -= rs.y, z -= rs.z, i -= rs.i, j -= rs.j, k -= rs.k, u -= rs.u, v -= rs.v, w -= rs.w); return *this; } FI XYZval<T>& operator-=(const XYZEval<T> &rs) { NUM_AXIS_CODE(x -= rs.x, y -= rs.y, z -= rs.z, i -= rs.i, j -= rs.j, k -= rs.k, u -= rs.u, v -= rs.v, w -= rs.w); return *this; }
FI XYZval<T>& operator*=(const XYZEval<T> &rs) { NUM_AXIS_CODE(x *= rs.x, y *= rs.y, z *= rs.z, i *= rs.i, j *= rs.j, k *= rs.k, u *= rs.u, v *= rs.v, w *= rs.w); return *this; } FI XYZval<T>& operator*=(const XYZEval<T> &rs) { NUM_AXIS_CODE(x *= rs.x, y *= rs.y, z *= rs.z, i *= rs.i, j *= rs.j, k *= rs.k, u *= rs.u, v *= rs.v, w *= rs.w); return *this; }
FI XYZval<T>& operator/=(const XYZEval<T> &rs) { NUM_AXIS_CODE(x /= rs.x, y /= rs.y, z /= rs.z, i /= rs.i, j /= rs.j, k /= rs.k, u /= rs.u, v /= rs.v, w /= rs.w); return *this; } FI XYZval<T>& operator/=(const XYZEval<T> &rs) { NUM_AXIS_CODE(x /= rs.x, y /= rs.y, z /= rs.z, i /= rs.i, j /= rs.j, k /= rs.k, u /= rs.u, v /= rs.v, w /= rs.w); return *this; }
FI XYZval<T>& operator*=(const float &p) { NUM_AXIS_CODE(x *= p, y *= p, z *= p, i *= p, j *= p, k *= p, u *= p, v *= p, w *= p); return *this; } FI XYZval<T>& operator*=(const float &v) { NUM_AXIS_CODE(x *= v, y *= v, z *= v, i *= v, j *= v, k *= v, u *= v, v *= v, w *= v); return *this; }
FI XYZval<T>& operator*=(const int &p) { NUM_AXIS_CODE(x *= p, y *= p, z *= p, i *= p, j *= p, k *= p, u *= p, v *= p, w *= p); return *this; } FI XYZval<T>& operator*=(const int &v) { NUM_AXIS_CODE(x *= v, y *= v, z *= v, i *= v, j *= v, k *= v, u *= v, v *= v, w *= v); return *this; }
FI XYZval<T>& operator>>=(const int &p) { NUM_AXIS_CODE(_RS(x), _RS(y), _RS(z), _RS(i), _RS(j), _RS(k), _RS(u), _RS(v), _RS(w)); return *this; } FI XYZval<T>& operator>>=(const int &v) { NUM_AXIS_CODE(_RS(x), _RS(y), _RS(z), _RS(i), _RS(j), _RS(k), _RS(u), _RS(v), _RS(w)); return *this; }
FI XYZval<T>& operator<<=(const int &p) { NUM_AXIS_CODE(_LS(x), _LS(y), _LS(z), _LS(i), _LS(j), _LS(k), _LS(u), _LS(v), _LS(w)); return *this; } FI XYZval<T>& operator<<=(const int &v) { NUM_AXIS_CODE(_LS(x), _LS(y), _LS(z), _LS(i), _LS(j), _LS(k), _LS(u), _LS(v), _LS(w)); return *this; }
// Exact comparisons. For floats a "NEAR" operation may be better. // Exact comparisons. For floats a "NEAR" operation may be better.
FI bool operator==(const XYZEval<T> &rs) const { return true NUM_AXIS_GANG(&& x == rs.x, && y == rs.y, && z == rs.z, && i == rs.i, && j == rs.j, && k == rs.k, && u == rs.u, && v == rs.v, && w == rs.w); } FI bool operator==(const XYZEval<T> &rs) const { return true NUM_AXIS_GANG(&& x == rs.x, && y == rs.y, && z == rs.z, && i == rs.i, && j == rs.j, && k == rs.k, && u == rs.u, && v == rs.v, && w == rs.w); }
@@ -656,15 +654,15 @@ struct XYZEval {
#endif #endif
// Length reduced to one dimension // Length reduced to one dimension
FI T magnitude() const { return (T)sqrtf(LOGICAL_AXIS_GANG(+ e*e, + x*x, + y*y, + z*z, + i*i, + j*j, + k*k, + u*u, + v*v, + w*w)); } FI T magnitude() const { return (T)sqrtf(LOGICAL_AXIS_GANG(+ e*e, + x*x, + y*y, + z*z, + i*i, + j*j, + k*k, + u*u, + v*v, + w*w)); }
// Pointer to the data as a simple array // Pointer to the data as a simple array
FI operator T* () { return pos; } FI operator T* () { return pos; }
// If any element is true then it's true // If any element is true then it's true
FI operator bool() { return 0 LOGICAL_AXIS_GANG(|| e, || x, || y, || z, || i, || j, || k, || u, || v, || w); } FI operator bool() { return 0 LOGICAL_AXIS_GANG(|| e, || x, || y, || z, || i, || j, || k, || u, || v, || w); }
// Smallest element // Smallest element
FI T small() const { return _MIN(LOGICAL_AXIS_LIST(e, x, y, z, i, j, k, u, v, w)); } FI T _min() const { return _MIN(LOGICAL_AXIS_LIST(e, x, y, z, i, j, k, u, v, w)); }
// Largest element // Largest element
FI T large() const { return _MAX(LOGICAL_AXIS_LIST(e, x, y, z, i, j, k, u, v, w)); } FI T _max() const { return _MAX(LOGICAL_AXIS_LIST(e, x, y, z, i, j, k, u, v, w)); }
// Explicit copy and copies with conversion // Explicit copy and copies with conversion
FI XYZEval<T> copy() const { XYZEval<T> v = *this; return v; } FI XYZEval<T> copy() const { XYZEval<T> v = *this; return v; }
@@ -690,76 +688,76 @@ struct XYZEval {
FI operator const XYZval<T>&() const { return *(const XYZval<T>*)this; } FI operator const XYZval<T>&() const { return *(const XYZval<T>*)this; }
// Accessor via an AxisEnum (or any integer) [index] // Accessor via an AxisEnum (or any integer) [index]
FI T& operator[](const int n) { return pos[n]; } FI T& operator[](const int n) { return pos[n]; }
FI const T& operator[](const int n) const { return pos[n]; } FI const T& operator[](const int n) const { return pos[n]; }
// Assignment operator overrides do the expected thing // Assignment operator overrides do the expected thing
FI XYZEval<T>& operator= (const T v) { set(LOGICAL_AXIS_LIST_1(v)); return *this; } FI XYZEval<T>& operator= (const T v) { set(LOGICAL_AXIS_LIST_1(v)); return *this; }
FI XYZEval<T>& operator= (const XYval<T> &rs) { set(rs.x, rs.y); return *this; } FI XYZEval<T>& operator= (const XYval<T> &rs) { set(rs.x, rs.y); return *this; }
FI XYZEval<T>& operator= (const XYZval<T> &rs) { set(NUM_AXIS_ELEM(rs)); return *this; } FI XYZEval<T>& operator= (const XYZval<T> &rs) { set(NUM_AXIS_ELEM(rs)); return *this; }
// Override other operators to get intuitive behaviors // Override other operators to get intuitive behaviors
FI XYZEval<T> operator+ (const XYval<T> &rs) const { XYZEval<T> ls = *this; ls.x += rs.x; ls.y += rs.y; return ls; } FI XYZEval<T> operator+ (const XYval<T> &rs) const { XYZEval<T> ls = *this; ls.x += rs.x; ls.y += rs.y; return ls; }
FI XYZEval<T> operator+ (const XYval<T> &rs) { XYZEval<T> ls = *this; ls.x += rs.x; ls.y += rs.y; return ls; } FI XYZEval<T> operator+ (const XYval<T> &rs) { XYZEval<T> ls = *this; ls.x += rs.x; ls.y += rs.y; return ls; }
FI XYZEval<T> operator- (const XYval<T> &rs) const { XYZEval<T> ls = *this; ls.x -= rs.x; ls.y -= rs.y; return ls; } FI XYZEval<T> operator- (const XYval<T> &rs) const { XYZEval<T> ls = *this; ls.x -= rs.x; ls.y -= rs.y; return ls; }
FI XYZEval<T> operator- (const XYval<T> &rs) { XYZEval<T> ls = *this; ls.x -= rs.x; ls.y -= rs.y; return ls; } FI XYZEval<T> operator- (const XYval<T> &rs) { XYZEval<T> ls = *this; ls.x -= rs.x; ls.y -= rs.y; return ls; }
FI XYZEval<T> operator* (const XYval<T> &rs) const { XYZEval<T> ls = *this; ls.x *= rs.x; ls.y *= rs.y; return ls; } FI XYZEval<T> operator* (const XYval<T> &rs) const { XYZEval<T> ls = *this; ls.x *= rs.x; ls.y *= rs.y; return ls; }
FI XYZEval<T> operator* (const XYval<T> &rs) { XYZEval<T> ls = *this; ls.x *= rs.x; ls.y *= rs.y; return ls; } FI XYZEval<T> operator* (const XYval<T> &rs) { XYZEval<T> ls = *this; ls.x *= rs.x; ls.y *= rs.y; return ls; }
FI XYZEval<T> operator/ (const XYval<T> &rs) const { XYZEval<T> ls = *this; ls.x /= rs.x; ls.y /= rs.y; return ls; } FI XYZEval<T> operator/ (const XYval<T> &rs) const { XYZEval<T> ls = *this; ls.x /= rs.x; ls.y /= rs.y; return ls; }
FI XYZEval<T> operator/ (const XYval<T> &rs) { XYZEval<T> ls = *this; ls.x /= rs.x; ls.y /= rs.y; return ls; } FI XYZEval<T> operator/ (const XYval<T> &rs) { XYZEval<T> ls = *this; ls.x /= rs.x; ls.y /= rs.y; return ls; }
FI XYZEval<T> operator+ (const XYZval<T> &rs) const { XYZval<T> ls = *this; NUM_AXIS_CODE(ls.x += rs.x, ls.y += rs.y, ls.z += rs.z, ls.i += rs.i, ls.j += rs.j, ls.k += rs.k, ls.u += rs.u, ls.v += rs.v, ls.w += rs.w); return ls; } FI XYZEval<T> operator+ (const XYZval<T> &rs) const { XYZval<T> ls = *this; NUM_AXIS_CODE(ls.x += rs.x, ls.y += rs.y, ls.z += rs.z, ls.i += rs.i, ls.j += rs.j, ls.k += rs.k, ls.u += rs.u, ls.v += rs.v, ls.w += rs.w); return ls; }
FI XYZEval<T> operator+ (const XYZval<T> &rs) { XYZval<T> ls = *this; NUM_AXIS_CODE(ls.x += rs.x, ls.y += rs.y, ls.z += rs.z, ls.i += rs.i, ls.j += rs.j, ls.k += rs.k, ls.u += rs.u, ls.v += rs.v, ls.w += rs.w); return ls; } FI XYZEval<T> operator+ (const XYZval<T> &rs) { XYZval<T> ls = *this; NUM_AXIS_CODE(ls.x += rs.x, ls.y += rs.y, ls.z += rs.z, ls.i += rs.i, ls.j += rs.j, ls.k += rs.k, ls.u += rs.u, ls.v += rs.v, ls.w += rs.w); return ls; }
FI XYZEval<T> operator- (const XYZval<T> &rs) const { XYZval<T> ls = *this; NUM_AXIS_CODE(ls.x -= rs.x, ls.y -= rs.y, ls.z -= rs.z, ls.i -= rs.i, ls.j -= rs.j, ls.k -= rs.k, ls.u -= rs.u, ls.v -= rs.v, ls.w -= rs.w); return ls; } FI XYZEval<T> operator- (const XYZval<T> &rs) const { XYZval<T> ls = *this; NUM_AXIS_CODE(ls.x -= rs.x, ls.y -= rs.y, ls.z -= rs.z, ls.i -= rs.i, ls.j -= rs.j, ls.k -= rs.k, ls.u -= rs.u, ls.v -= rs.v, ls.w -= rs.w); return ls; }
FI XYZEval<T> operator- (const XYZval<T> &rs) { XYZval<T> ls = *this; NUM_AXIS_CODE(ls.x -= rs.x, ls.y -= rs.y, ls.z -= rs.z, ls.i -= rs.i, ls.j -= rs.j, ls.k -= rs.k, ls.u -= rs.u, ls.v -= rs.v, ls.w -= rs.w); return ls; } FI XYZEval<T> operator- (const XYZval<T> &rs) { XYZval<T> ls = *this; NUM_AXIS_CODE(ls.x -= rs.x, ls.y -= rs.y, ls.z -= rs.z, ls.i -= rs.i, ls.j -= rs.j, ls.k -= rs.k, ls.u -= rs.u, ls.v -= rs.v, ls.w -= rs.w); return ls; }
FI XYZEval<T> operator* (const XYZval<T> &rs) const { XYZval<T> ls = *this; NUM_AXIS_CODE(ls.x *= rs.x, ls.y *= rs.y, ls.z *= rs.z, ls.i *= rs.i, ls.j *= rs.j, ls.k *= rs.k, ls.u *= rs.u, ls.v *= rs.v, ls.w *= rs.w); return ls; } FI XYZEval<T> operator* (const XYZval<T> &rs) const { XYZval<T> ls = *this; NUM_AXIS_CODE(ls.x *= rs.x, ls.y *= rs.y, ls.z *= rs.z, ls.i *= rs.i, ls.j *= rs.j, ls.k *= rs.k, ls.u *= rs.u, ls.v *= rs.v, ls.w *= rs.w); return ls; }
FI XYZEval<T> operator* (const XYZval<T> &rs) { XYZval<T> ls = *this; NUM_AXIS_CODE(ls.x *= rs.x, ls.y *= rs.y, ls.z *= rs.z, ls.i *= rs.i, ls.j *= rs.j, ls.k *= rs.k, ls.u *= rs.u, ls.v *= rs.v, ls.w *= rs.w); return ls; } FI XYZEval<T> operator* (const XYZval<T> &rs) { XYZval<T> ls = *this; NUM_AXIS_CODE(ls.x *= rs.x, ls.y *= rs.y, ls.z *= rs.z, ls.i *= rs.i, ls.j *= rs.j, ls.k *= rs.k, ls.u *= rs.u, ls.v *= rs.v, ls.w *= rs.w); return ls; }
FI XYZEval<T> operator/ (const XYZval<T> &rs) const { XYZval<T> ls = *this; NUM_AXIS_CODE(ls.x /= rs.x, ls.y /= rs.y, ls.z /= rs.z, ls.i /= rs.i, ls.j /= rs.j, ls.k /= rs.k, ls.u /= rs.u, ls.v /= rs.v, ls.w /= rs.w); return ls; } FI XYZEval<T> operator/ (const XYZval<T> &rs) const { XYZval<T> ls = *this; NUM_AXIS_CODE(ls.x /= rs.x, ls.y /= rs.y, ls.z /= rs.z, ls.i /= rs.i, ls.j /= rs.j, ls.k /= rs.k, ls.u /= rs.u, ls.v /= rs.v, ls.w /= rs.w); return ls; }
FI XYZEval<T> operator/ (const XYZval<T> &rs) { XYZval<T> ls = *this; NUM_AXIS_CODE(ls.x /= rs.x, ls.y /= rs.y, ls.z /= rs.z, ls.i /= rs.i, ls.j /= rs.j, ls.k /= rs.k, ls.u /= rs.u, ls.v /= rs.v, ls.w /= rs.w); return ls; } FI XYZEval<T> operator/ (const XYZval<T> &rs) { XYZval<T> ls = *this; NUM_AXIS_CODE(ls.x /= rs.x, ls.y /= rs.y, ls.z /= rs.z, ls.i /= rs.i, ls.j /= rs.j, ls.k /= rs.k, ls.u /= rs.u, ls.v /= rs.v, ls.w /= rs.w); return ls; }
FI XYZEval<T> operator+ (const XYZEval<T> &rs) const { XYZEval<T> ls = *this; LOGICAL_AXIS_CODE(ls.e += rs.e, ls.x += rs.x, ls.y += rs.y, ls.z += rs.z, ls.i += rs.i, ls.j += rs.j, ls.k += rs.k, ls.u += rs.u, ls.v += rs.v, ls.w += rs.w); return ls; } FI XYZEval<T> operator+ (const XYZEval<T> &rs) const { XYZEval<T> ls = *this; LOGICAL_AXIS_CODE(ls.e += rs.e, ls.x += rs.x, ls.y += rs.y, ls.z += rs.z, ls.i += rs.i, ls.j += rs.j, ls.k += rs.k, ls.u += rs.u, ls.v += rs.v, ls.w += rs.w); return ls; }
FI XYZEval<T> operator+ (const XYZEval<T> &rs) { XYZEval<T> ls = *this; LOGICAL_AXIS_CODE(ls.e += rs.e, ls.x += rs.x, ls.y += rs.y, ls.z += rs.z, ls.i += rs.i, ls.j += rs.j, ls.k += rs.k, ls.u += rs.u, ls.v += rs.v, ls.w += rs.w); return ls; } FI XYZEval<T> operator+ (const XYZEval<T> &rs) { XYZEval<T> ls = *this; LOGICAL_AXIS_CODE(ls.e += rs.e, ls.x += rs.x, ls.y += rs.y, ls.z += rs.z, ls.i += rs.i, ls.j += rs.j, ls.k += rs.k, ls.u += rs.u, ls.v += rs.v, ls.w += rs.w); return ls; }
FI XYZEval<T> operator- (const XYZEval<T> &rs) const { XYZEval<T> ls = *this; LOGICAL_AXIS_CODE(ls.e -= rs.e, ls.x -= rs.x, ls.y -= rs.y, ls.z -= rs.z, ls.i -= rs.i, ls.j -= rs.j, ls.k -= rs.k, ls.u -= rs.u, ls.v -= rs.v, ls.w -= rs.w); return ls; } FI XYZEval<T> operator- (const XYZEval<T> &rs) const { XYZEval<T> ls = *this; LOGICAL_AXIS_CODE(ls.e -= rs.e, ls.x -= rs.x, ls.y -= rs.y, ls.z -= rs.z, ls.i -= rs.i, ls.j -= rs.j, ls.k -= rs.k, ls.u -= rs.u, ls.v -= rs.v, ls.w -= rs.w); return ls; }
FI XYZEval<T> operator- (const XYZEval<T> &rs) { XYZEval<T> ls = *this; LOGICAL_AXIS_CODE(ls.e -= rs.e, ls.x -= rs.x, ls.y -= rs.y, ls.z -= rs.z, ls.i -= rs.i, ls.j -= rs.j, ls.k -= rs.k, ls.u -= rs.u, ls.v -= rs.v, ls.w -= rs.w); return ls; } FI XYZEval<T> operator- (const XYZEval<T> &rs) { XYZEval<T> ls = *this; LOGICAL_AXIS_CODE(ls.e -= rs.e, ls.x -= rs.x, ls.y -= rs.y, ls.z -= rs.z, ls.i -= rs.i, ls.j -= rs.j, ls.k -= rs.k, ls.u -= rs.u, ls.v -= rs.v, ls.w -= rs.w); return ls; }
FI XYZEval<T> operator* (const XYZEval<T> &rs) const { XYZEval<T> ls = *this; LOGICAL_AXIS_CODE(ls.e *= rs.e, ls.x *= rs.x, ls.y *= rs.y, ls.z *= rs.z, ls.i *= rs.i, ls.j *= rs.j, ls.k *= rs.k, ls.u *= rs.u, ls.v *= rs.v, ls.w *= rs.w); return ls; } FI XYZEval<T> operator* (const XYZEval<T> &rs) const { XYZEval<T> ls = *this; LOGICAL_AXIS_CODE(ls.e *= rs.e, ls.x *= rs.x, ls.y *= rs.y, ls.z *= rs.z, ls.i *= rs.i, ls.j *= rs.j, ls.k *= rs.k, ls.u *= rs.u, ls.v *= rs.v, ls.w *= rs.w); return ls; }
FI XYZEval<T> operator* (const XYZEval<T> &rs) { XYZEval<T> ls = *this; LOGICAL_AXIS_CODE(ls.e *= rs.e, ls.x *= rs.x, ls.y *= rs.y, ls.z *= rs.z, ls.i *= rs.i, ls.j *= rs.j, ls.k *= rs.k, ls.u *= rs.u, ls.v *= rs.v, ls.w *= rs.w); return ls; } FI XYZEval<T> operator* (const XYZEval<T> &rs) { XYZEval<T> ls = *this; LOGICAL_AXIS_CODE(ls.e *= rs.e, ls.x *= rs.x, ls.y *= rs.y, ls.z *= rs.z, ls.i *= rs.i, ls.j *= rs.j, ls.k *= rs.k, ls.u *= rs.u, ls.v *= rs.v, ls.w *= rs.w); return ls; }
FI XYZEval<T> operator/ (const XYZEval<T> &rs) const { XYZEval<T> ls = *this; LOGICAL_AXIS_CODE(ls.e /= rs.e, ls.x /= rs.x, ls.y /= rs.y, ls.z /= rs.z, ls.i /= rs.i, ls.j /= rs.j, ls.k /= rs.k, ls.u /= rs.u, ls.v /= rs.v, ls.w /= rs.w); return ls; } FI XYZEval<T> operator/ (const XYZEval<T> &rs) const { XYZEval<T> ls = *this; LOGICAL_AXIS_CODE(ls.e /= rs.e, ls.x /= rs.x, ls.y /= rs.y, ls.z /= rs.z, ls.i /= rs.i, ls.j /= rs.j, ls.k /= rs.k, ls.u /= rs.u, ls.v /= rs.v, ls.w /= rs.w); return ls; }
FI XYZEval<T> operator/ (const XYZEval<T> &rs) { XYZEval<T> ls = *this; LOGICAL_AXIS_CODE(ls.e /= rs.e, ls.x /= rs.x, ls.y /= rs.y, ls.z /= rs.z, ls.i /= rs.i, ls.j /= rs.j, ls.k /= rs.k, ls.u /= rs.u, ls.v /= rs.v, ls.w /= rs.w); return ls; } FI XYZEval<T> operator/ (const XYZEval<T> &rs) { XYZEval<T> ls = *this; LOGICAL_AXIS_CODE(ls.e /= rs.e, ls.x /= rs.x, ls.y /= rs.y, ls.z /= rs.z, ls.i /= rs.i, ls.j /= rs.j, ls.k /= rs.k, ls.u /= rs.u, ls.v /= rs.v, ls.w /= rs.w); return ls; }
FI XYZEval<T> operator* (const float &p) const { XYZEval<T> ls = *this; LOGICAL_AXIS_CODE(ls.e *= p, ls.x *= p, ls.y *= p, ls.z *= p, ls.i *= p, ls.j *= p, ls.k *= p, ls.u *= p, ls.v *= p, ls.w *= p ); return ls; } FI XYZEval<T> operator* (const float &v) const { XYZEval<T> ls = *this; LOGICAL_AXIS_CODE(ls.e *= v, ls.x *= v, ls.y *= v, ls.z *= v, ls.i *= v, ls.j *= v, ls.k *= v, ls.u *= v, ls.v *= v, ls.w *= v ); return ls; }
FI XYZEval<T> operator* (const float &p) { XYZEval<T> ls = *this; LOGICAL_AXIS_CODE(ls.e *= p, ls.x *= p, ls.y *= p, ls.z *= p, ls.i *= p, ls.j *= p, ls.k *= p, ls.u *= p, ls.v *= p, ls.w *= p ); return ls; } FI XYZEval<T> operator* (const float &v) { XYZEval<T> ls = *this; LOGICAL_AXIS_CODE(ls.e *= v, ls.x *= v, ls.y *= v, ls.z *= v, ls.i *= v, ls.j *= v, ls.k *= v, ls.u *= v, ls.v *= v, ls.w *= v ); return ls; }
FI XYZEval<T> operator* (const int &p) const { XYZEval<T> ls = *this; LOGICAL_AXIS_CODE(ls.e *= p, ls.x *= p, ls.y *= p, ls.z *= p, ls.i *= p, ls.j *= p, ls.k *= p, ls.u *= p, ls.v *= p, ls.w *= p ); return ls; } FI XYZEval<T> operator* (const int &v) const { XYZEval<T> ls = *this; LOGICAL_AXIS_CODE(ls.e *= v, ls.x *= v, ls.y *= v, ls.z *= v, ls.i *= v, ls.j *= v, ls.k *= v, ls.u *= v, ls.v *= v, ls.w *= v ); return ls; }
FI XYZEval<T> operator* (const int &p) { XYZEval<T> ls = *this; LOGICAL_AXIS_CODE(ls.e *= p, ls.x *= p, ls.y *= p, ls.z *= p, ls.i *= p, ls.j *= p, ls.k *= p, ls.u *= p, ls.v *= p, ls.w *= p ); return ls; } FI XYZEval<T> operator* (const int &v) { XYZEval<T> ls = *this; LOGICAL_AXIS_CODE(ls.e *= v, ls.x *= v, ls.y *= v, ls.z *= v, ls.i *= v, ls.j *= v, ls.k *= v, ls.u *= v, ls.v *= v, ls.w *= v ); return ls; }
FI XYZEval<T> operator/ (const float &p) const { XYZEval<T> ls = *this; LOGICAL_AXIS_CODE(ls.e /= p, ls.x /= p, ls.y /= p, ls.z /= p, ls.i /= p, ls.j /= p, ls.k /= p, ls.u /= p, ls.v /= p, ls.w /= p ); return ls; } FI XYZEval<T> operator/ (const float &v) const { XYZEval<T> ls = *this; LOGICAL_AXIS_CODE(ls.e /= v, ls.x /= v, ls.y /= v, ls.z /= v, ls.i /= v, ls.j /= v, ls.k /= v, ls.u /= v, ls.v /= v, ls.w /= v ); return ls; }
FI XYZEval<T> operator/ (const float &p) { XYZEval<T> ls = *this; LOGICAL_AXIS_CODE(ls.e /= p, ls.x /= p, ls.y /= p, ls.z /= p, ls.i /= p, ls.j /= p, ls.k /= p, ls.u /= p, ls.v /= p, ls.w /= p ); return ls; } FI XYZEval<T> operator/ (const float &v) { XYZEval<T> ls = *this; LOGICAL_AXIS_CODE(ls.e /= v, ls.x /= v, ls.y /= v, ls.z /= v, ls.i /= v, ls.j /= v, ls.k /= v, ls.u /= v, ls.v /= v, ls.w /= v ); return ls; }
FI XYZEval<T> operator/ (const int &p) const { XYZEval<T> ls = *this; LOGICAL_AXIS_CODE(ls.e /= p, ls.x /= p, ls.y /= p, ls.z /= p, ls.i /= p, ls.j /= p, ls.k /= p, ls.u /= p, ls.v /= p, ls.w /= p ); return ls; } FI XYZEval<T> operator/ (const int &v) const { XYZEval<T> ls = *this; LOGICAL_AXIS_CODE(ls.e /= v, ls.x /= v, ls.y /= v, ls.z /= v, ls.i /= v, ls.j /= v, ls.k /= v, ls.u /= v, ls.v /= v, ls.w /= v ); return ls; }
FI XYZEval<T> operator/ (const int &p) { XYZEval<T> ls = *this; LOGICAL_AXIS_CODE(ls.e /= p, ls.x /= p, ls.y /= p, ls.z /= p, ls.i /= p, ls.j /= p, ls.k /= p, ls.u /= p, ls.v /= p, ls.w /= p ); return ls; } FI XYZEval<T> operator/ (const int &v) { XYZEval<T> ls = *this; LOGICAL_AXIS_CODE(ls.e /= v, ls.x /= v, ls.y /= v, ls.z /= v, ls.i /= v, ls.j /= v, ls.k /= v, ls.u /= v, ls.v /= v, ls.w /= v ); return ls; }
FI XYZEval<T> operator>>(const int &p) const { XYZEval<T> ls = *this; LOGICAL_AXIS_CODE(_RS(ls.e), _RS(ls.x), _RS(ls.y), _RS(ls.z), _RS(ls.i), _RS(ls.j), _RS(ls.k), _RS(ls.u), _RS(ls.v), _RS(ls.w) ); return ls; } FI XYZEval<T> operator>>(const int &v) const { XYZEval<T> ls = *this; LOGICAL_AXIS_CODE(_RS(ls.e), _RS(ls.x), _RS(ls.y), _RS(ls.z), _RS(ls.i), _RS(ls.j), _RS(ls.k), _RS(ls.u), _RS(ls.v), _RS(ls.w) ); return ls; }
FI XYZEval<T> operator>>(const int &p) { XYZEval<T> ls = *this; LOGICAL_AXIS_CODE(_RS(ls.e), _RS(ls.x), _RS(ls.y), _RS(ls.z), _RS(ls.i), _RS(ls.j), _RS(ls.k), _RS(ls.u), _RS(ls.v), _RS(ls.w) ); return ls; } FI XYZEval<T> operator>>(const int &v) { XYZEval<T> ls = *this; LOGICAL_AXIS_CODE(_RS(ls.e), _RS(ls.x), _RS(ls.y), _RS(ls.z), _RS(ls.i), _RS(ls.j), _RS(ls.k), _RS(ls.u), _RS(ls.v), _RS(ls.w) ); return ls; }
FI XYZEval<T> operator<<(const int &p) const { XYZEval<T> ls = *this; LOGICAL_AXIS_CODE(_LS(ls.e), _LS(ls.x), _LS(ls.y), _LS(ls.z), _LS(ls.i), _LS(ls.j), _LS(ls.k), _LS(ls.u), _LS(ls.v), _LS(ls.w) ); return ls; } FI XYZEval<T> operator<<(const int &v) const { XYZEval<T> ls = *this; LOGICAL_AXIS_CODE(_LS(ls.e), _LS(ls.x), _LS(ls.y), _LS(ls.z), _LS(ls.i), _LS(ls.j), _LS(ls.k), _LS(ls.u), _LS(ls.v), _LS(ls.w) ); return ls; }
FI XYZEval<T> operator<<(const int &p) { XYZEval<T> ls = *this; LOGICAL_AXIS_CODE(_LS(ls.e), _LS(ls.x), _LS(ls.y), _LS(ls.z), _LS(ls.i), _LS(ls.j), _LS(ls.k), _LS(ls.u), _LS(ls.v), _LS(ls.w) ); return ls; } FI XYZEval<T> operator<<(const int &v) { XYZEval<T> ls = *this; LOGICAL_AXIS_CODE(_LS(ls.e), _LS(ls.x), _LS(ls.y), _LS(ls.z), _LS(ls.i), _LS(ls.j), _LS(ls.k), _LS(ls.u), _LS(ls.v), _LS(ls.w) ); return ls; }
FI const XYZEval<T> operator-() const { return LOGICAL_AXIS_ARRAY(-e, -x, -y, -z, -i, -j, -k, -u, -v, -w); } FI const XYZEval<T> operator-() const { return LOGICAL_AXIS_ARRAY(-e, -x, -y, -z, -i, -j, -k, -u, -v, -w); }
FI XYZEval<T> operator-() { return LOGICAL_AXIS_ARRAY(-e, -x, -y, -z, -i, -j, -k, -u, -v, -w); } FI XYZEval<T> operator-() { return LOGICAL_AXIS_ARRAY(-e, -x, -y, -z, -i, -j, -k, -u, -v, -w); }
// Modifier operators // Modifier operators
FI XYZEval<T>& operator+=(const XYval<T> &rs) { x += rs.x; y += rs.y; return *this; } FI XYZEval<T>& operator+=(const XYval<T> &rs) { x += rs.x; y += rs.y; return *this; }
FI XYZEval<T>& operator-=(const XYval<T> &rs) { x -= rs.x; y -= rs.y; return *this; } FI XYZEval<T>& operator-=(const XYval<T> &rs) { x -= rs.x; y -= rs.y; return *this; }
FI XYZEval<T>& operator*=(const XYval<T> &rs) { x *= rs.x; y *= rs.y; return *this; } FI XYZEval<T>& operator*=(const XYval<T> &rs) { x *= rs.x; y *= rs.y; return *this; }
FI XYZEval<T>& operator/=(const XYval<T> &rs) { x /= rs.x; y /= rs.y; return *this; } FI XYZEval<T>& operator/=(const XYval<T> &rs) { x /= rs.x; y /= rs.y; return *this; }
FI XYZEval<T>& operator+=(const XYZval<T> &rs) { NUM_AXIS_CODE(x += rs.x, y += rs.y, z += rs.z, i += rs.i, j += rs.j, k += rs.k, u += rs.u, v += rs.v, w += rs.w); return *this; } FI XYZEval<T>& operator+=(const XYZval<T> &rs) { NUM_AXIS_CODE(x += rs.x, y += rs.y, z += rs.z, i += rs.i, j += rs.j, k += rs.k, u += rs.u, v += rs.v, w += rs.w); return *this; }
FI XYZEval<T>& operator-=(const XYZval<T> &rs) { NUM_AXIS_CODE(x -= rs.x, y -= rs.y, z -= rs.z, i -= rs.i, j -= rs.j, k -= rs.k, u -= rs.u, v -= rs.v, w -= rs.w); return *this; } FI XYZEval<T>& operator-=(const XYZval<T> &rs) { NUM_AXIS_CODE(x -= rs.x, y -= rs.y, z -= rs.z, i -= rs.i, j -= rs.j, k -= rs.k, u -= rs.u, v -= rs.v, w -= rs.w); return *this; }
FI XYZEval<T>& operator*=(const XYZval<T> &rs) { NUM_AXIS_CODE(x *= rs.x, y *= rs.y, z *= rs.z, i *= rs.i, j *= rs.j, k *= rs.k, u *= rs.u, v *= rs.v, w *= rs.w); return *this; } FI XYZEval<T>& operator*=(const XYZval<T> &rs) { NUM_AXIS_CODE(x *= rs.x, y *= rs.y, z *= rs.z, i *= rs.i, j *= rs.j, k *= rs.k, u *= rs.u, v *= rs.v, w *= rs.w); return *this; }
FI XYZEval<T>& operator/=(const XYZval<T> &rs) { NUM_AXIS_CODE(x /= rs.x, y /= rs.y, z /= rs.z, i /= rs.i, j /= rs.j, k /= rs.k, u /= rs.u, v /= rs.v, w /= rs.w); return *this; } FI XYZEval<T>& operator/=(const XYZval<T> &rs) { NUM_AXIS_CODE(x /= rs.x, y /= rs.y, z /= rs.z, i /= rs.i, j /= rs.j, k /= rs.k, u /= rs.u, v /= rs.v, w /= rs.w); return *this; }
FI XYZEval<T>& operator+=(const XYZEval<T> &rs) { LOGICAL_AXIS_CODE(e += rs.e, x += rs.x, y += rs.y, z += rs.z, i += rs.i, j += rs.j, k += rs.k, u += rs.u, v += rs.v, w += rs.w); return *this; } FI XYZEval<T>& operator+=(const XYZEval<T> &rs) { LOGICAL_AXIS_CODE(e += rs.e, x += rs.x, y += rs.y, z += rs.z, i += rs.i, j += rs.j, k += rs.k, u += rs.u, v += rs.v, w += rs.w); return *this; }
FI XYZEval<T>& operator-=(const XYZEval<T> &rs) { LOGICAL_AXIS_CODE(e -= rs.e, x -= rs.x, y -= rs.y, z -= rs.z, i -= rs.i, j -= rs.j, k -= rs.k, u -= rs.u, v -= rs.v, w -= rs.w); return *this; } FI XYZEval<T>& operator-=(const XYZEval<T> &rs) { LOGICAL_AXIS_CODE(e -= rs.e, x -= rs.x, y -= rs.y, z -= rs.z, i -= rs.i, j -= rs.j, k -= rs.k, u -= rs.u, v -= rs.v, w -= rs.w); return *this; }
FI XYZEval<T>& operator*=(const XYZEval<T> &rs) { LOGICAL_AXIS_CODE(e *= rs.e, x *= rs.x, y *= rs.y, z *= rs.z, i *= rs.i, j *= rs.j, k *= rs.k, u *= rs.u, v *= rs.v, w *= rs.w); return *this; } FI XYZEval<T>& operator*=(const XYZEval<T> &rs) { LOGICAL_AXIS_CODE(e *= rs.e, x *= rs.x, y *= rs.y, z *= rs.z, i *= rs.i, j *= rs.j, k *= rs.k, u *= rs.u, v *= rs.v, w *= rs.w); return *this; }
FI XYZEval<T>& operator/=(const XYZEval<T> &rs) { LOGICAL_AXIS_CODE(e /= rs.e, x /= rs.x, y /= rs.y, z /= rs.z, i /= rs.i, j /= rs.j, k /= rs.k, u /= rs.u, v /= rs.v, w /= rs.w); return *this; } FI XYZEval<T>& operator/=(const XYZEval<T> &rs) { LOGICAL_AXIS_CODE(e /= rs.e, x /= rs.x, y /= rs.y, z /= rs.z, i /= rs.i, j /= rs.j, k /= rs.k, u /= rs.u, v /= rs.v, w /= rs.w); return *this; }
FI XYZEval<T>& operator*=(const T &p) { LOGICAL_AXIS_CODE(e *= p, x *= p, y *= p, z *= p, i *= p, j *= p, k *= p, u *= p, v *= p, w *= p); return *this; } FI XYZEval<T>& operator*=(const T &v) { LOGICAL_AXIS_CODE(e *= v, x *= v, y *= v, z *= v, i *= v, j *= v, k *= v, u *= v, v *= v, w *= v); return *this; }
FI XYZEval<T>& operator>>=(const int &p) { LOGICAL_AXIS_CODE(_RS(e), _RS(x), _RS(y), _RS(z), _RS(i), _RS(j), _RS(k), _RS(u), _RS(v), _RS(w)); return *this; } FI XYZEval<T>& operator>>=(const int &v) { LOGICAL_AXIS_CODE(_RS(e), _RS(x), _RS(y), _RS(z), _RS(i), _RS(j), _RS(k), _RS(u), _RS(v), _RS(w)); return *this; }
FI XYZEval<T>& operator<<=(const int &p) { LOGICAL_AXIS_CODE(_LS(e), _LS(x), _LS(y), _LS(z), _LS(i), _LS(j), _LS(k), _LS(u), _LS(v), _LS(w)); return *this; } FI XYZEval<T>& operator<<=(const int &v) { LOGICAL_AXIS_CODE(_LS(e), _LS(x), _LS(y), _LS(z), _LS(i), _LS(j), _LS(k), _LS(u), _LS(v), _LS(w)); return *this; }
// Exact comparisons. For floats a "NEAR" operation may be better. // Exact comparisons. For floats a "NEAR" operation may be better.
FI bool operator==(const XYZval<T> &rs) const { return true NUM_AXIS_GANG(&& x == rs.x, && y == rs.y, && z == rs.z, && i == rs.i, && j == rs.j, && k == rs.k, && u == rs.u, && v == rs.v, && w == rs.w); } FI bool operator==(const XYZval<T> &rs) const { return true NUM_AXIS_GANG(&& x == rs.x, && y == rs.y, && z == rs.z, && i == rs.i, && j == rs.j, && k == rs.k, && u == rs.u, && v == rs.v, && w == rs.w); }
FI bool operator==(const XYZEval<T> &rs) const { return true LOGICAL_AXIS_GANG(&& e == rs.e, && x == rs.x, && y == rs.y, && z == rs.z, && i == rs.i, && j == rs.j, && k == rs.k, && u == rs.u, && v == rs.v, && w == rs.w); } FI bool operator==(const XYZEval<T> &rs) const { return true LOGICAL_AXIS_GANG(&& e == rs.e, && x == rs.x, && y == rs.y, && z == rs.z, && i == rs.i, && j == rs.j, && k == rs.k, && u == rs.u, && v == rs.v, && w == rs.w); }
FI bool operator!=(const XYZval<T> &rs) const { return !operator==(rs); } FI bool operator!=(const XYZval<T> &rs) const { return !operator==(rs); }
FI bool operator!=(const XYZEval<T> &rs) const { return !operator==(rs); } FI bool operator!=(const XYZEval<T> &rs) const { return !operator==(rs); }
}; };
#undef _RECIP #undef _RECIP
-1
View File
@@ -57,7 +57,6 @@ bool leveling_is_valid() {
* Enable: Current position = "unleveled" physical position * Enable: Current position = "unleveled" physical position
*/ */
void set_bed_leveling_enabled(const bool enable/*=true*/) { void set_bed_leveling_enabled(const bool enable/*=true*/) {
DEBUG_SECTION(log_sble, "set_bed_leveling_enabled", DEBUGGING(LEVELING));
const bool can_change = TERN1(AUTO_BED_LEVELING_BILINEAR, !enable || leveling_is_valid()); const bool can_change = TERN1(AUTO_BED_LEVELING_BILINEAR, !enable || leveling_is_valid());
+2 -2
View File
@@ -260,7 +260,7 @@ bool unified_bed_leveling::sanity_check() {
*/ */
void GcodeSuite::M1004() { void GcodeSuite::M1004() {
#define ALIGN_GCODE TERN(Z_STEPPER_AUTO_ALIGN, "G34\n", "") #define ALIGN_GCODE TERN(Z_STEPPER_AUTO_ALIGN, "G34", "")
#define PROBE_GCODE TERN(HAS_BED_PROBE, "G29P1\nG29P3", "G29P4R") #define PROBE_GCODE TERN(HAS_BED_PROBE, "G29P1\nG29P3", "G29P4R")
#if HAS_HOTEND #if HAS_HOTEND
@@ -280,7 +280,7 @@ bool unified_bed_leveling::sanity_check() {
#endif #endif
process_subcommands_now(FPSTR(G28_STR)); // Home process_subcommands_now(FPSTR(G28_STR)); // Home
process_subcommands_now(F(ALIGN_GCODE // Align multi z axis if available process_subcommands_now(F(ALIGN_GCODE "\n" // Align multi z axis if available
PROBE_GCODE "\n" // Build mesh with available hardware PROBE_GCODE "\n" // Build mesh with available hardware
"G29P3\nG29P3")); // Ensure mesh is complete by running smart fill twice "G29P3\nG29P3")); // Ensure mesh is complete by running smart fill twice
@@ -336,9 +336,9 @@
#if IS_SCARA #if IS_SCARA
#define DELTA_SEGMENT_MIN_LENGTH 0.25 // SCARA minimum segment size is 0.25mm #define DELTA_SEGMENT_MIN_LENGTH 0.25 // SCARA minimum segment size is 0.25mm
#elif ENABLED(DELTA) #elif ENABLED(DELTA)
#define DELTA_SEGMENT_MIN_LENGTH 0.10 // mm (still subject to DEFAULT_SEGMENTS_PER_SECOND) #define DELTA_SEGMENT_MIN_LENGTH 0.10 // mm (still subject to DELTA_SEGMENTS_PER_SECOND)
#elif ENABLED(POLARGRAPH) #elif ENABLED(POLARGRAPH)
#define DELTA_SEGMENT_MIN_LENGTH 0.10 // mm (still subject to DEFAULT_SEGMENTS_PER_SECOND) #define DELTA_SEGMENT_MIN_LENGTH 0.10 // mm (still subject to DELTA_SEGMENTS_PER_SECOND)
#else // CARTESIAN #else // CARTESIAN
#ifdef LEVELED_SEGMENT_LENGTH #ifdef LEVELED_SEGMENT_LENGTH
#define DELTA_SEGMENT_MIN_LENGTH LEVELED_SEGMENT_LENGTH #define DELTA_SEGMENT_MIN_LENGTH LEVELED_SEGMENT_LENGTH
+2
View File
@@ -38,6 +38,8 @@ bool BLTouch::od_5v_mode; // Initialized by settings.load, 0 = Open Drai
#include "../module/servo.h" #include "../module/servo.h"
#include "../module/probe.h" #include "../module/probe.h"
void stop();
#define DEBUG_OUT ENABLED(DEBUG_LEVELING_FEATURE) #define DEBUG_OUT ENABLED(DEBUG_LEVELING_FEATURE)
#include "../core/debug_out.h" #include "../core/debug_out.h"
+4 -25
View File
@@ -111,29 +111,20 @@ void HostUI::action(FSTR_P const fstr, const bool eol) {
if (eol) SERIAL_EOL(); if (eol) SERIAL_EOL();
} }
void HostUI::prompt_plus(const bool pgm, FSTR_P const ptype, const char * const str, const char extra_char/*='\0'*/) { void HostUI::prompt_plus(FSTR_P const ptype, FSTR_P const fstr, const char extra_char/*='\0'*/) {
prompt(ptype, false); prompt(ptype, false);
PORT_REDIRECT(SerialMask::All); PORT_REDIRECT(SerialMask::All);
SERIAL_CHAR(' '); SERIAL_CHAR(' ');
if (pgm) SERIAL_ECHOF(fstr);
SERIAL_ECHOPGM_P(str);
else
SERIAL_ECHO(str);
if (extra_char != '\0') SERIAL_CHAR(extra_char); if (extra_char != '\0') SERIAL_CHAR(extra_char);
SERIAL_EOL(); SERIAL_EOL();
} }
void HostUI::prompt_begin(const PromptReason reason, FSTR_P const fstr, const char extra_char/*='\0'*/) { void HostUI::prompt_begin(const PromptReason reason, FSTR_P const fstr, const char extra_char/*='\0'*/) {
prompt_end(); prompt_end();
host_prompt_reason = reason; host_prompt_reason = reason;
prompt_plus(F("begin"), fstr, extra_char); prompt_plus(F("begin"), fstr, extra_char);
} }
void HostUI::prompt_begin(const PromptReason reason, const char * const cstr, const char extra_char/*='\0'*/) { void HostUI::prompt_button(FSTR_P const fstr) { prompt_plus(F("button"), fstr); }
prompt_end();
host_prompt_reason = reason;
prompt_plus(F("begin"), cstr, extra_char);
}
void HostUI::prompt_end() { prompt(F("end")); } void HostUI::prompt_end() { prompt(F("end")); }
void HostUI::prompt_show() { prompt(F("show")); } void HostUI::prompt_show() { prompt(F("show")); }
@@ -142,26 +133,14 @@ void HostUI::action(FSTR_P const fstr, const bool eol) {
if (btn2) prompt_button(btn2); if (btn2) prompt_button(btn2);
prompt_show(); prompt_show();
} }
void HostUI::prompt_button(FSTR_P const fstr) { prompt_plus(F("button"), fstr); }
void HostUI::prompt_button(const char * const cstr) { prompt_plus(F("button"), cstr); }
void HostUI::prompt_do(const PromptReason reason, FSTR_P const fstr, FSTR_P const btn1/*=nullptr*/, FSTR_P const btn2/*=nullptr*/) { void HostUI::prompt_do(const PromptReason reason, FSTR_P const fstr, FSTR_P const btn1/*=nullptr*/, FSTR_P const btn2/*=nullptr*/) {
prompt_begin(reason, fstr); prompt_begin(reason, fstr);
_prompt_show(btn1, btn2); _prompt_show(btn1, btn2);
} }
void HostUI::prompt_do(const PromptReason reason, const char * const cstr, FSTR_P const btn1/*=nullptr*/, FSTR_P const btn2/*=nullptr*/) {
prompt_begin(reason, cstr);
_prompt_show(btn1, btn2);
}
void HostUI::prompt_do(const PromptReason reason, FSTR_P const fstr, const char extra_char, FSTR_P const btn1/*=nullptr*/, FSTR_P const btn2/*=nullptr*/) { void HostUI::prompt_do(const PromptReason reason, FSTR_P const fstr, const char extra_char, FSTR_P const btn1/*=nullptr*/, FSTR_P const btn2/*=nullptr*/) {
prompt_begin(reason, fstr, extra_char); prompt_begin(reason, fstr, extra_char);
_prompt_show(btn1, btn2); _prompt_show(btn1, btn2);
} }
void HostUI::prompt_do(const PromptReason reason, const char * const cstr, const char extra_char, FSTR_P const btn1/*=nullptr*/, FSTR_P const btn2/*=nullptr*/) {
prompt_begin(reason, cstr, extra_char);
_prompt_show(btn1, btn2);
}
#if ENABLED(ADVANCED_PAUSE_FEATURE) #if ENABLED(ADVANCED_PAUSE_FEATURE)
void HostUI::filament_load_prompt() { void HostUI::filament_load_prompt() {
@@ -198,7 +177,7 @@ void HostUI::action(FSTR_P const fstr, const bool eol) {
#endif #endif
#if HAS_FILAMENT_SENSOR #if HAS_FILAMENT_SENSOR
if (runout.filament_ran_out) { // Disable a triggered sensor if (runout.filament_ran_out) { // Disable a triggered sensor
runout.enabled[active_extruder] = false; runout.enabled = false;
runout.reset(); runout.reset();
} }
#endif #endif
+2 -16
View File
@@ -79,14 +79,7 @@ class HostUI {
#if ENABLED(HOST_PROMPT_SUPPORT) #if ENABLED(HOST_PROMPT_SUPPORT)
private: private:
static void prompt(FSTR_P const ptype, const bool eol=true); static void prompt(FSTR_P const ptype, const bool eol=true);
static void prompt_plus(const bool pgm, FSTR_P const ptype, const char * const str, const char extra_char='\0'); static void prompt_plus(FSTR_P const ptype, FSTR_P const fstr, const char extra_char='\0');
static void prompt_plus(FSTR_P const ptype, FSTR_P const fstr, const char extra_char='\0') {
prompt_plus(true, ptype, FTOP(fstr), extra_char);
}
static void prompt_plus(FSTR_P const ptype, const char * const cstr, const char extra_char='\0') {
prompt_plus(false, ptype, cstr, extra_char);
}
static void prompt_show(); static void prompt_show();
static void _prompt_show(FSTR_P const btn1, FSTR_P const btn2); static void _prompt_show(FSTR_P const btn1, FSTR_P const btn2);
@@ -100,17 +93,10 @@ class HostUI {
static void notify(const char * const message); static void notify(const char * const message);
static void prompt_begin(const PromptReason reason, FSTR_P const fstr, const char extra_char='\0'); static void prompt_begin(const PromptReason reason, FSTR_P const fstr, const char extra_char='\0');
static void prompt_begin(const PromptReason reason, const char * const cstr, const char extra_char='\0');
static void prompt_end();
static void prompt_button(FSTR_P const fstr); static void prompt_button(FSTR_P const fstr);
static void prompt_button(const char * const cstr); static void prompt_end();
static void prompt_do(const PromptReason reason, FSTR_P const pstr, FSTR_P const btn1=nullptr, FSTR_P const btn2=nullptr); static void prompt_do(const PromptReason reason, FSTR_P const pstr, FSTR_P const btn1=nullptr, FSTR_P const btn2=nullptr);
static void prompt_do(const PromptReason reason, const char * const cstr, FSTR_P const btn1=nullptr, FSTR_P const btn2=nullptr);
static void prompt_do(const PromptReason reason, FSTR_P const pstr, const char extra_char, FSTR_P const btn1=nullptr, FSTR_P const btn2=nullptr); static void prompt_do(const PromptReason reason, FSTR_P const pstr, const char extra_char, FSTR_P const btn1=nullptr, FSTR_P const btn2=nullptr);
static void prompt_do(const PromptReason reason, const char * const cstr, const char extra_char, FSTR_P const btn1=nullptr, FSTR_P const btn2=nullptr);
static void prompt_open(const PromptReason reason, FSTR_P const pstr, FSTR_P const btn1=nullptr, FSTR_P const btn2=nullptr) { static void prompt_open(const PromptReason reason, FSTR_P const pstr, FSTR_P const btn1=nullptr, FSTR_P const btn2=nullptr) {
if (host_prompt_reason == PROMPT_NOT_DEFINED) prompt_do(reason, pstr, btn1, btn2); if (host_prompt_reason == PROMPT_NOT_DEFINED) prompt_do(reason, pstr, btn1, btn2);
} }
+12
View File
@@ -30,6 +30,18 @@
#include "leds.h" #include "leds.h"
#if ENABLED(BLINKM)
#include "blinkm.h"
#endif
#if ENABLED(PCA9632)
#include "pca9632.h"
#endif
#if ENABLED(PCA9533)
#include "pca9533.h"
#endif
#if EITHER(CASE_LIGHT_USE_RGB_LED, CASE_LIGHT_USE_NEOPIXEL) #if EITHER(CASE_LIGHT_USE_RGB_LED, CASE_LIGHT_USE_NEOPIXEL)
#include "../../feature/caselight.h" #include "../../feature/caselight.h"
#endif #endif
+6 -20
View File
@@ -40,18 +40,6 @@
#undef _NEOPIXEL_INCLUDE_ #undef _NEOPIXEL_INCLUDE_
#endif #endif
#if ENABLED(BLINKM)
#include "blinkm.h"
#endif
#if ENABLED(PCA9533)
#include "pca9533.h"
#endif
#if ENABLED(PCA9632)
#include "pca9632.h"
#endif
/** /**
* LEDcolor type for use with leds.set_color * LEDcolor type for use with leds.set_color
*/ */
@@ -119,13 +107,6 @@ typedef struct LEDColor {
class LEDLights { class LEDLights {
public: public:
#if ANY(LED_CONTROL_MENU, PRINTER_EVENT_LEDS, CASE_LIGHT_IS_COLOR_LED)
static LEDColor color; // last non-off color
static bool lights_on; // the last set color was "on"
#else
static constexpr bool lights_on = true;
#endif
LEDLights() {} // ctor LEDLights() {} // ctor
static void setup(); // init() static void setup(); // init()
@@ -161,10 +142,15 @@ public:
static LEDColor get_color() { return lights_on ? color : LEDColorOff(); } static LEDColor get_color() { return lights_on ? color : LEDColorOff(); }
#endif #endif
#if ANY(LED_CONTROL_MENU, PRINTER_EVENT_LEDS, CASE_LIGHT_IS_COLOR_LED)
static LEDColor color; // last non-off color
static bool lights_on; // the last set color was "on"
#endif
#if ENABLED(LED_CONTROL_MENU) #if ENABLED(LED_CONTROL_MENU)
static void toggle(); // swap "off" with color static void toggle(); // swap "off" with color
#endif #endif
#if EITHER(LED_CONTROL_MENU, CASE_LIGHT_USE_RGB_LED) || LED_POWEROFF_TIMEOUT > 0 #if EITHER(LED_CONTROL_MENU, CASE_LIGHT_USE_RGB_LED)
static void update() { set_color(color); } static void update() { set_color(color); }
#endif #endif
+28 -20
View File
@@ -54,8 +54,7 @@ MMU2 mmu2;
#define MMU_CMD_TIMEOUT 45000UL // 45s timeout for mmu commands (except P0) #define MMU_CMD_TIMEOUT 45000UL // 45s timeout for mmu commands (except P0)
#define MMU_P0_TIMEOUT 3000UL // Timeout for P0 command: 3seconds #define MMU_P0_TIMEOUT 3000UL // Timeout for P0 command: 3seconds
#define MMU2_SEND(S) tx_str(F(S "\n")) #define MMU2_COMMAND(S) tx_str(F(S "\n"))
#define MMU2_RECV(S) rx_str(F(S "\n"))
#if ENABLED(MMU_EXTRUDER_SENSOR) #if ENABLED(MMU_EXTRUDER_SENSOR)
uint8_t mmu_idl_sens = 0; uint8_t mmu_idl_sens = 0;
@@ -132,7 +131,7 @@ void MMU2::reset() {
safe_delay(20); safe_delay(20);
WRITE(MMU2_RST_PIN, HIGH); WRITE(MMU2_RST_PIN, HIGH);
#else #else
MMU2_SEND("X0"); // Send soft reset MMU2_COMMAND("X0"); // Send soft reset
#endif #endif
} }
@@ -141,7 +140,7 @@ uint8_t MMU2::get_current_tool() {
} }
#if EITHER(HAS_PRUSA_MMU2S, MMU_EXTRUDER_SENSOR) #if EITHER(HAS_PRUSA_MMU2S, MMU_EXTRUDER_SENSOR)
#define FILAMENT_PRESENT() (READ(FIL_RUNOUT1_PIN) != runout.out_state()) #define FILAMENT_PRESENT() (READ(FIL_RUNOUT1_PIN) != FIL_RUNOUT1_STATE)
#endif #endif
void mmu2_attn_buzz(const bool two=false) { void mmu2_attn_buzz(const bool two=false) {
@@ -158,9 +157,11 @@ void MMU2::mmu_loop() {
case -1: case -1:
if (rx_start()) { if (rx_start()) {
prev_P0_request = millis(); // Initialize finda sensor timeout prev_P0_request = millis(); // Initialize finda sensor timeout
DEBUG_ECHOLNPGM("MMU => 'start'"); DEBUG_ECHOLNPGM("MMU => 'start'");
DEBUG_ECHOLNPGM("MMU <= 'S1'"); DEBUG_ECHOLNPGM("MMU <= 'S1'");
MMU2_SEND("S1"); // Read Version
MMU2_COMMAND("S1"); // Read Version
state = -2; state = -2;
} }
else if (millis() > 30000) { // 30sec after reset disable MMU else if (millis() > 30000) { // 30sec after reset disable MMU
@@ -172,8 +173,10 @@ void MMU2::mmu_loop() {
case -2: case -2:
if (rx_ok()) { if (rx_ok()) {
sscanf(rx_buffer, "%huok\n", &version); sscanf(rx_buffer, "%huok\n", &version);
DEBUG_ECHOLNPGM("MMU => ", version, "\nMMU <= 'S2'"); DEBUG_ECHOLNPGM("MMU => ", version, "\nMMU <= 'S2'");
MMU2_SEND("S2"); // Read Build Number
MMU2_COMMAND("S2"); // Read Build Number
state = -3; state = -3;
} }
break; break;
@@ -188,12 +191,14 @@ void MMU2::mmu_loop() {
#if ENABLED(MMU2_MODE_12V) #if ENABLED(MMU2_MODE_12V)
DEBUG_ECHOLNPGM("MMU <= 'M1'"); DEBUG_ECHOLNPGM("MMU <= 'M1'");
MMU2_SEND("M1"); // Stealth Mode
MMU2_COMMAND("M1"); // Stealth Mode
state = -5; state = -5;
#else #else
DEBUG_ECHOLNPGM("MMU <= 'P0'"); DEBUG_ECHOLNPGM("MMU <= 'P0'");
MMU2_SEND("P0"); // Read FINDA
MMU2_COMMAND("P0"); // Read FINDA
state = -4; state = -4;
#endif #endif
} }
@@ -204,8 +209,10 @@ void MMU2::mmu_loop() {
// response to M1 // response to M1
if (rx_ok()) { if (rx_ok()) {
DEBUG_ECHOLNPGM("MMU => ok"); DEBUG_ECHOLNPGM("MMU => ok");
DEBUG_ECHOLNPGM("MMU <= 'P0'"); DEBUG_ECHOLNPGM("MMU <= 'P0'");
MMU2_SEND("P0"); // Read FINDA
MMU2_COMMAND("P0"); // Read FINDA
state = -4; state = -4;
} }
break; break;
@@ -243,13 +250,14 @@ void MMU2::mmu_loop() {
else if (cmd == MMU_CMD_C0) { else if (cmd == MMU_CMD_C0) {
// continue loading // continue loading
DEBUG_ECHOLNPGM("MMU <= 'C0'"); DEBUG_ECHOLNPGM("MMU <= 'C0'");
MMU2_SEND("C0"); MMU2_COMMAND("C0");
state = 3; // wait for response state = 3; // wait for response
} }
else if (cmd == MMU_CMD_U0) { else if (cmd == MMU_CMD_U0) {
// unload current // unload current
DEBUG_ECHOLNPGM("MMU <= 'U0'"); DEBUG_ECHOLNPGM("MMU <= 'U0'");
MMU2_SEND("U0");
MMU2_COMMAND("U0");
state = 3; // wait for response state = 3; // wait for response
} }
else if (WITHIN(cmd, MMU_CMD_E0, MMU_CMD_E0 + EXTRUDERS - 1)) { else if (WITHIN(cmd, MMU_CMD_E0, MMU_CMD_E0 + EXTRUDERS - 1)) {
@@ -262,7 +270,7 @@ void MMU2::mmu_loop() {
else if (cmd == MMU_CMD_R0) { else if (cmd == MMU_CMD_R0) {
// recover after eject // recover after eject
DEBUG_ECHOLNPGM("MMU <= 'R0'"); DEBUG_ECHOLNPGM("MMU <= 'R0'");
MMU2_SEND("R0"); MMU2_COMMAND("R0");
state = 3; // wait for response state = 3; // wait for response
} }
else if (WITHIN(cmd, MMU_CMD_F0, MMU_CMD_F0 + EXTRUDERS - 1)) { else if (WITHIN(cmd, MMU_CMD_F0, MMU_CMD_F0 + EXTRUDERS - 1)) {
@@ -277,7 +285,7 @@ void MMU2::mmu_loop() {
cmd = MMU_CMD_NONE; cmd = MMU_CMD_NONE;
} }
else if (ELAPSED(millis(), prev_P0_request + 300)) { else if (ELAPSED(millis(), prev_P0_request + 300)) {
MMU2_SEND("P0"); // Read FINDA MMU2_COMMAND("P0"); // Read FINDA
state = 2; // wait for response state = 2; // wait for response
} }
@@ -306,7 +314,7 @@ void MMU2::mmu_loop() {
if (mmu_idl_sens) { if (mmu_idl_sens) {
if (FILAMENT_PRESENT() && mmu_loading_flag) { if (FILAMENT_PRESENT() && mmu_loading_flag) {
DEBUG_ECHOLNPGM("MMU <= 'A'"); DEBUG_ECHOLNPGM("MMU <= 'A'");
MMU2_SEND("A"); // send 'abort' request MMU2_COMMAND("A"); // send 'abort' request
mmu_idl_sens = 0; mmu_idl_sens = 0;
DEBUG_ECHOLNPGM("MMU IDLER_SENSOR = 0 - ABORT"); DEBUG_ECHOLNPGM("MMU IDLER_SENSOR = 0 - ABORT");
} }
@@ -319,9 +327,9 @@ void MMU2::mmu_loop() {
const bool keep_trying = !mmu2s_triggered && last_cmd == MMU_CMD_C0; const bool keep_trying = !mmu2s_triggered && last_cmd == MMU_CMD_C0;
if (keep_trying) { if (keep_trying) {
// MMU ok received but filament sensor not triggered, retrying... // MMU ok received but filament sensor not triggered, retrying...
DEBUG_ECHOLNPGM("MMU => 'ok' (no filament in gears)"); DEBUG_ECHOLNPGM("MMU => 'ok' (filament not present in gears)");
DEBUG_ECHOLNPGM("MMU <= 'C0' (keep trying)"); DEBUG_ECHOLNPGM("MMU <= 'C0' (keep trying)");
MMU2_SEND("C0"); MMU2_COMMAND("C0");
} }
#else #else
constexpr bool keep_trying = false; constexpr bool keep_trying = false;
@@ -353,7 +361,7 @@ void MMU2::mmu_loop() {
*/ */
bool MMU2::rx_start() { bool MMU2::rx_start() {
// check for start message // check for start message
return MMU2_RECV("start"); return rx_str(F("start\n"));
} }
/** /**
@@ -432,7 +440,7 @@ void MMU2::clear_rx_buffer() {
* Check if we received 'ok' from MMU * Check if we received 'ok' from MMU
*/ */
bool MMU2::rx_ok() { bool MMU2::rx_ok() {
if (MMU2_RECV("ok")) { if (rx_str(F("ok\n"))) {
prev_P0_request = millis(); prev_P0_request = millis();
return true; return true;
} }
@@ -665,7 +673,7 @@ static void mmu2_not_responding() {
// When (T0 rx->ok) load is ready, but in fact it did not load // When (T0 rx->ok) load is ready, but in fact it did not load
// successfully or an overload created pressure in the extruder. // successfully or an overload created pressure in the extruder.
// Send (C0) to load more and move E_AXIS a little to release pressure. // Send (C0) to load more and move E_AXIS a little to release pressure.
if ((fil_present = FILAMENT_PRESENT())) MMU2_SEND("A"); if ((fil_present = FILAMENT_PRESENT())) MMU2_COMMAND("A");
} while (!fil_present && PENDING(millis(), expire_ms)); } while (!fil_present && PENDING(millis(), expire_ms));
stepper.disable_extruder(); stepper.disable_extruder();
manage_response(true, true); manage_response(true, true);
@@ -874,7 +882,7 @@ void MMU2::filament_runout() {
if (cmd == MMU_CMD_NONE && last_cmd == MMU_CMD_C0) { if (cmd == MMU_CMD_NONE && last_cmd == MMU_CMD_C0) {
if (present && !mmu2s_triggered) { if (present && !mmu2s_triggered) {
DEBUG_ECHOLNPGM("MMU <= 'A'"); DEBUG_ECHOLNPGM("MMU <= 'A'");
MMU2_SEND("A"); tx_str(F("A\n"));
} }
// Slowly spin the extruder during C0 // Slowly spin the extruder during C0
else { else {
+11 -16
View File
@@ -211,22 +211,13 @@ bool load_filament(const_float_t slow_load_length/*=0*/, const_float_t fast_load
while (wait_for_user) { while (wait_for_user) {
impatient_beep(max_beep_count); impatient_beep(max_beep_count);
#if BOTH(FILAMENT_CHANGE_RESUME_ON_INSERT, FILAMENT_RUNOUT_SENSOR) #if BOTH(FILAMENT_CHANGE_RESUME_ON_INSERT, FILAMENT_RUNOUT_SENSOR)
#if MULTI_FILAMENT_SENSOR #if ENABLED(MULTI_FILAMENT_SENSOR)
LOOP_S_LE_N(i, 1, NUM_RUNOUT_SENSORS) { #define _CASE_INSERTED(N) case N-1: if (READ(FIL_RUNOUT##N##_PIN) != FIL_RUNOUT##N##_STATE) wait_for_user = false; break;
pin_t pin; switch (active_extruder) {
switch (i) { REPEAT_1(NUM_RUNOUT_SENSORS, _CASE_INSERTED)
default: continue;
#define _CASE_RUNOUT(N) case N: pin = FIL_RUNOUT##N##_PIN; break;
REPEAT_1(NUM_RUNOUT_SENSORS, _CASE_RUNOUT)
#undef _CASE_RUNOUT
}
const RunoutMode rm = runout.mode[i - 1];
if (rm != RM_NONE && rm != RM_MOTION_SENSOR && extDigitalRead(pin) != runout.out_state(i - 1))
wait_for_user = false;
} }
#else #else
if (READ(FIL_RUNOUT_PIN) != runout.out_state(active_extruder)) if (READ(FIL_RUNOUT_PIN) != FIL_RUNOUT_STATE) wait_for_user = false;
wait_for_user = false;
#endif #endif
#endif #endif
idle_no_sleep(); idle_no_sleep();
@@ -481,7 +472,9 @@ bool pause_print(const_float_t retract, const xyz_pos_t &park_point, const bool
if (unload_length) if (unload_length)
unload_filament(unload_length, show_lcd, PAUSE_MODE_CHANGE_FILAMENT); unload_filament(unload_length, show_lcd, PAUSE_MODE_CHANGE_FILAMENT);
TERN_(DUAL_X_CARRIAGE, set_duplication_enabled(saved_ext_dup_mode, saved_ext)); #if ENABLED(DUAL_X_CARRIAGE)
set_duplication_enabled(saved_ext_dup_mode, saved_ext);
#endif
// Disable the Extruder for manual change // Disable the Extruder for manual change
disable_active_extruder(); disable_active_extruder();
@@ -587,7 +580,9 @@ void wait_for_confirmation(const bool is_reload/*=false*/, const int8_t max_beep
} }
idle_no_sleep(); idle_no_sleep();
} }
TERN_(DUAL_X_CARRIAGE, set_duplication_enabled(saved_ext_dup_mode, saved_ext)); #if ENABLED(DUAL_X_CARRIAGE)
set_duplication_enabled(saved_ext_dup_mode, saved_ext);
#endif
} }
/** /**
+3 -3
View File
@@ -53,7 +53,7 @@ PowerMonitor power_monitor; // Single instance - this calls the constructor
void PowerMonitor::draw_current() { void PowerMonitor::draw_current() {
const float amps = getAmps(); const float amps = getAmps();
lcd_put_u8str(amps < 100 ? ftostr31ns(amps) : ui16tostr4rj((uint16_t)amps)); lcd_put_u8str(amps < 100 ? ftostr31ns(amps) : ui16tostr4rj((uint16_t)amps));
lcd_put_u8str(F("A")); lcd_put_lchar('A');
} }
#endif #endif
@@ -61,7 +61,7 @@ PowerMonitor power_monitor; // Single instance - this calls the constructor
void PowerMonitor::draw_voltage() { void PowerMonitor::draw_voltage() {
const float volts = getVolts(); const float volts = getVolts();
lcd_put_u8str(volts < 100 ? ftostr31ns(volts) : ui16tostr4rj((uint16_t)volts)); lcd_put_u8str(volts < 100 ? ftostr31ns(volts) : ui16tostr4rj((uint16_t)volts));
lcd_put_u8str(F("V")); lcd_put_lchar('V');
} }
#endif #endif
@@ -69,7 +69,7 @@ PowerMonitor power_monitor; // Single instance - this calls the constructor
void PowerMonitor::draw_power() { void PowerMonitor::draw_power() {
const float power = getPower(); const float power = getPower();
lcd_put_u8str(power < 100 ? ftostr31ns(power) : ui16tostr4rj((uint16_t)power)); lcd_put_u8str(power < 100 ? ftostr31ns(power) : ui16tostr4rj((uint16_t)power));
lcd_put_u8str(F("W")); lcd_put_lchar('W');
} }
#endif #endif
-3
View File
@@ -153,9 +153,6 @@ class PrintJobRecovery {
static void prepare(); static void prepare();
static void setup() { static void setup() {
#if PIN_EXISTS(OUTAGECON)
OUT_WRITE(OUTAGECON_PIN, HIGH);
#endif
#if PIN_EXISTS(POWER_LOSS) #if PIN_EXISTS(POWER_LOSS)
#if ENABLED(POWER_LOSS_PULLUP) #if ENABLED(POWER_LOSS_PULLUP)
SET_INPUT_PULLUP(POWER_LOSS_PIN); SET_INPUT_PULLUP(POWER_LOSS_PIN);
+1 -1
View File
@@ -42,7 +42,7 @@ void Repeat::add_marker(const uint32_t sdpos, const uint16_t count) {
SERIAL_ECHO_MSG("!Too many markers."); SERIAL_ECHO_MSG("!Too many markers.");
else { else {
marker[index].sdpos = sdpos; marker[index].sdpos = sdpos;
marker[index].counter = count ? count - 1 : -1; marker[index].counter = count ?: -1;
index++; index++;
DEBUG_ECHOLNPGM("Add Marker ", index, " at ", sdpos, " (", count, ")"); DEBUG_ECHOLNPGM("Add Marker ", index, " at ", sdpos, " (", count, ")");
} }
+12 -6
View File
@@ -32,9 +32,9 @@
FilamentMonitor runout; FilamentMonitor runout;
bool FilamentMonitorBase::enabled[NUM_RUNOUT_SENSORS], // Initialized by settings.load bool FilamentMonitorBase::enabled = true,
FilamentMonitorBase::filament_ran_out; // = false FilamentMonitorBase::filament_ran_out; // = false
RunoutMode FilamentMonitorBase::mode[NUM_RUNOUT_SENSORS]; // Initialized by settings.load
#if ENABLED(HOST_ACTION_COMMANDS) #if ENABLED(HOST_ACTION_COMMANDS)
bool FilamentMonitorBase::host_handling; // = false bool FilamentMonitorBase::host_handling; // = false
#endif #endif
@@ -45,9 +45,15 @@ RunoutMode FilamentMonitorBase::mode[NUM_RUNOUT_SENSORS]; // Initialized by sett
#include "../core/debug_out.h" #include "../core/debug_out.h"
#endif #endif
float RunoutResponseDelayed::runout_distance_mm[NUM_RUNOUT_SENSORS]; // Initialized by settings.load #if HAS_FILAMENT_RUNOUT_DISTANCE
volatile float RunoutResponseDelayed::runout_mm_countdown[NUM_RUNOUT_SENSORS]; float RunoutResponseDelayed::runout_distance_mm = FILAMENT_RUNOUT_DISTANCE_MM;
uint8_t FilamentSensorCore::motion_detected; volatile float RunoutResponseDelayed::runout_mm_countdown[NUM_RUNOUT_SENSORS];
#if ENABLED(FILAMENT_MOTION_SENSOR)
uint8_t FilamentSensorEncoder::motion_detected;
#endif
#else
int8_t RunoutResponseDebounced::runout_count[NUM_RUNOUT_SENSORS]; // = 0
#endif
// //
// Filament Runout event handler // Filament Runout event handler
+188 -119
View File
@@ -47,37 +47,25 @@ void event_filament_runout(const uint8_t extruder);
template<class RESPONSE_T, class SENSOR_T> template<class RESPONSE_T, class SENSOR_T>
class TFilamentMonitor; class TFilamentMonitor;
class FilamentSensorCore; class FilamentSensorEncoder;
class FilamentSensorSwitch;
class RunoutResponseDelayed; class RunoutResponseDelayed;
class RunoutResponseDebounced;
/********************************* TEMPLATE SPECIALIZATION *********************************/ /********************************* TEMPLATE SPECIALIZATION *********************************/
typedef TFilamentMonitor< typedef TFilamentMonitor<
RunoutResponseDelayed, TERN(HAS_FILAMENT_RUNOUT_DISTANCE, RunoutResponseDelayed, RunoutResponseDebounced),
FilamentSensorCore TERN(FILAMENT_MOTION_SENSOR, FilamentSensorEncoder, FilamentSensorSwitch)
> FilamentMonitor; > FilamentMonitor;
extern FilamentMonitor runout; extern FilamentMonitor runout;
/*******************************************************************************************/ /*******************************************************************************************/
enum RunoutMode : uint8_t {
RM_NONE,
RM_OUT_ON_LOW,
RM_OUT_ON_HIGH,
RM_RESERVED3,
RM_RESERVED4,
RM_RESERVED5,
RM_RESERVED6,
RM_MOTION_SENSOR
};
class FilamentMonitorBase { class FilamentMonitorBase {
public: public:
static bool enabled[NUM_RUNOUT_SENSORS], filament_ran_out; static bool enabled, filament_ran_out;
static RunoutMode mode[NUM_RUNOUT_SENSORS];
static uint8_t out_state(const uint8_t e=0) { return mode[e] == RM_OUT_ON_HIGH ? HIGH : LOW; }
#if ENABLED(HOST_ACTION_COMMANDS) #if ENABLED(HOST_ACTION_COMMANDS)
static bool host_handling; static bool host_handling;
@@ -107,14 +95,19 @@ class TFilamentMonitor : public FilamentMonitorBase {
// Call this method when filament is present, // Call this method when filament is present,
// so the response can reset its counter. // so the response can reset its counter.
static void filament_present(const uint8_t e) { response.filament_present(e); } static void filament_present(const uint8_t extruder) {
static float& runout_distance(const uint8_t e=0) { return response.runout_distance_mm[e]; } response.filament_present(extruder);
static void set_runout_distance(const_float_t mm, const uint8_t e=0) { response.runout_distance_mm[e] = mm; } }
#if HAS_FILAMENT_RUNOUT_DISTANCE
static float& runout_distance() { return response.runout_distance_mm; }
static void set_runout_distance(const_float_t mm) { response.runout_distance_mm = mm; }
#endif
// Handle a block completion. RunoutResponseDelayed uses this to // Handle a block completion. RunoutResponseDelayed uses this to
// add up the length of filament moved while the filament is out. // add up the length of filament moved while the filament is out.
static void block_completed(const block_t * const b) { static void block_completed(const block_t * const b) {
if (enabled[active_extruder]) { if (enabled) {
response.block_completed(b); response.block_completed(b);
sensor.block_completed(b); sensor.block_completed(b);
} }
@@ -122,12 +115,12 @@ class TFilamentMonitor : public FilamentMonitorBase {
// Give the response a chance to update its counter. // Give the response a chance to update its counter.
static void run() { static void run() {
if (enabled[active_extruder] && mode[active_extruder] != RM_NONE && !filament_ran_out && (printingIsActive() || did_pause_print)) { if (enabled && !filament_ran_out && (printingIsActive() || did_pause_print)) {
cli(); // Prevent RunoutResponseDelayed::block_completed from accumulating here TERN_(HAS_FILAMENT_RUNOUT_DISTANCE, cli()); // Prevent RunoutResponseDelayed::block_completed from accumulating here
response.run(); response.run();
sensor.run(); sensor.run();
const uint8_t runout_flags = response.has_run_out(); const uint8_t runout_flags = response.has_run_out();
sei(); TERN_(HAS_FILAMENT_RUNOUT_DISTANCE, sei());
#if MULTI_FILAMENT_SENSOR #if MULTI_FILAMENT_SENSOR
#if ENABLED(WATCH_ALL_RUNOUT_SENSORS) #if ENABLED(WATCH_ALL_RUNOUT_SENSORS)
const bool ran_out = !!runout_flags; // any sensor triggers const bool ran_out = !!runout_flags; // any sensor triggers
@@ -220,64 +213,103 @@ class FilamentSensorBase {
// Return a bitmask of runout flag states (1 bits always indicates runout) // Return a bitmask of runout flag states (1 bits always indicates runout)
static uint8_t poll_runout_states() { static uint8_t poll_runout_states() {
#define _OR_INVERT(N) | (runout.out_state((N) - 1) ? 0 : _BV((N) - 1)) return poll_runout_pins() ^ uint8_t(0
return poll_runout_pins() ^ uint8_t(0 REPEAT_1(NUM_RUNOUT_SENSORS, _OR_INVERT)); #if NUM_RUNOUT_SENSORS >= 1
#undef _OR_INVERT | (FIL_RUNOUT1_STATE ? 0 : _BV(1 - 1))
#endif
#if NUM_RUNOUT_SENSORS >= 2
| (FIL_RUNOUT2_STATE ? 0 : _BV(2 - 1))
#endif
#if NUM_RUNOUT_SENSORS >= 3
| (FIL_RUNOUT3_STATE ? 0 : _BV(3 - 1))
#endif
#if NUM_RUNOUT_SENSORS >= 4
| (FIL_RUNOUT4_STATE ? 0 : _BV(4 - 1))
#endif
#if NUM_RUNOUT_SENSORS >= 5
| (FIL_RUNOUT5_STATE ? 0 : _BV(5 - 1))
#endif
#if NUM_RUNOUT_SENSORS >= 6
| (FIL_RUNOUT6_STATE ? 0 : _BV(6 - 1))
#endif
#if NUM_RUNOUT_SENSORS >= 7
| (FIL_RUNOUT7_STATE ? 0 : _BV(7 - 1))
#endif
#if NUM_RUNOUT_SENSORS >= 8
| (FIL_RUNOUT8_STATE ? 0 : _BV(8 - 1))
#endif
);
} }
}; };
class FilamentSensorCore : public FilamentSensorBase { #if ENABLED(FILAMENT_MOTION_SENSOR)
private:
static uint8_t motion_detected;
static bool poll_runout_state(const uint8_t extruder) { /**
const uint8_t runout_states = poll_runout_states(); * This sensor uses a magnetic encoder disc and a Hall effect
#if MULTI_FILAMENT_SENSOR * sensor (or a slotted disc and optical sensor). The state
if ( !TERN0(DUAL_X_CARRIAGE, idex_is_duplicating()) * will toggle between 0 and 1 on filament movement. It can detect
&& !TERN0(MULTI_NOZZLE_DUPLICATION, extruder_duplication_enabled) * filament runout and stripouts or jams.
) return TEST(runout_states, extruder); // A specific extruder ran out */
#else class FilamentSensorEncoder : public FilamentSensorBase {
UNUSED(extruder); private:
#endif static uint8_t motion_detected;
return !!runout_states; // Any extruder ran out
}
static void poll_motion_sensor() { static void poll_motion_sensor() {
static uint8_t old_state; static uint8_t old_state;
const uint8_t new_state = poll_runout_pins(), const uint8_t new_state = poll_runout_pins(),
change = old_state ^ new_state; change = old_state ^ new_state;
old_state = new_state; old_state = new_state;
#if ENABLED(FILAMENT_RUNOUT_SENSOR_DEBUG) #if ENABLED(FILAMENT_RUNOUT_SENSOR_DEBUG)
if (change) { if (change) {
SERIAL_ECHOPGM("Motion detected:"); SERIAL_ECHOPGM("Motion detected:");
LOOP_L_N(e, NUM_RUNOUT_SENSORS) LOOP_L_N(e, NUM_RUNOUT_SENSORS)
if (TEST(change, e)) SERIAL_CHAR(' ', '0' + e); if (TEST(change, e)) SERIAL_CHAR(' ', '0' + e);
SERIAL_EOL(); SERIAL_EOL();
} }
#endif #endif
motion_detected |= change; motion_detected |= change;
}
public:
static void block_completed(const block_t * const b) {
if (runout.mode[active_extruder] != RM_MOTION_SENSOR) return;
// If the sensor wheel has moved since the last call to
// this method reset the runout counter for the extruder.
if (TEST(motion_detected, b->extruder))
filament_present(b->extruder);
// Clear motion triggers for next block
motion_detected = 0;
}
static void run() {
if (runout.mode[active_extruder] == RM_MOTION_SENSOR) {
poll_motion_sensor();
} }
else if (runout.mode[active_extruder] != RM_NONE) {
public:
static void block_completed(const block_t * const b) {
// If the sensor wheel has moved since the last call to
// this method reset the runout counter for the extruder.
if (TEST(motion_detected, b->extruder))
filament_present(b->extruder);
// Clear motion triggers for next block
motion_detected = 0;
}
static void run() { poll_motion_sensor(); }
};
#else
/**
* This is a simple endstop switch in the path of the filament.
* It can detect filament runout, but not stripouts or jams.
*/
class FilamentSensorSwitch : public FilamentSensorBase {
private:
static bool poll_runout_state(const uint8_t extruder) {
const uint8_t runout_states = poll_runout_states();
#if MULTI_FILAMENT_SENSOR
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
#else
UNUSED(extruder);
#endif
return !!runout_states; // Any extruder ran out
}
public:
static void block_completed(const block_t * const) {}
static void run() {
LOOP_L_N(s, NUM_RUNOUT_SENSORS) { LOOP_L_N(s, NUM_RUNOUT_SENSORS) {
const bool out = poll_runout_state(s); const bool out = poll_runout_state(s);
if (!out) filament_present(s); if (!out) filament_present(s);
@@ -290,55 +322,92 @@ class FilamentSensorCore : public FilamentSensorBase {
#endif #endif
} }
} }
} };
};
#endif // !FILAMENT_MOTION_SENSOR
/********************************* RESPONSE TYPE *********************************/ /********************************* RESPONSE TYPE *********************************/
// RunoutResponseDelayed triggers a runout event only if the length #if HAS_FILAMENT_RUNOUT_DISTANCE
// of filament specified by FIL_RUNOUT_DISTANCE_MM has been fed
// during a runout condition.
class RunoutResponseDelayed {
private:
static volatile float runout_mm_countdown[NUM_RUNOUT_SENSORS];
public: // RunoutResponseDelayed triggers a runout event only if the length
static float runout_distance_mm[NUM_RUNOUT_SENSORS]; // of filament specified by FILAMENT_RUNOUT_DISTANCE_MM has been fed
// during a runout condition.
class RunoutResponseDelayed {
private:
static volatile float runout_mm_countdown[NUM_RUNOUT_SENSORS];
static void reset() { public:
LOOP_L_N(i, NUM_RUNOUT_SENSORS) filament_present(i); static float runout_distance_mm;
}
static void run() { static void reset() {
#if ENABLED(FILAMENT_RUNOUT_SENSOR_DEBUG) LOOP_L_N(i, NUM_RUNOUT_SENSORS) filament_present(i);
static millis_t t = 0;
const millis_t ms = millis();
if (ELAPSED(ms, t)) {
t = millis() + 1000UL;
LOOP_L_N(i, NUM_RUNOUT_SENSORS)
SERIAL_ECHOF(i ? F(", ") : F("Remaining mm: "), runout_mm_countdown[i]);
SERIAL_EOL();
}
#endif
}
static uint8_t has_run_out() {
uint8_t runout_flags = 0;
LOOP_L_N(i, NUM_RUNOUT_SENSORS) if (runout_mm_countdown[i] < 0) SBI(runout_flags, i);
return runout_flags;
}
static void filament_present(const uint8_t extruder) {
runout_mm_countdown[extruder] = runout_distance_mm[extruder];
}
static void block_completed(const block_t * const b) {
if (b->steps.x || b->steps.y || b->steps.z || did_pause_print) { // Allow pause purge move to re-trigger runout state
// Only trigger on extrusion with XYZ movement to allow filament change and retract/recover.
const uint8_t e = b->extruder;
const int32_t steps = b->steps.e;
runout_mm_countdown[e] -= (TEST(b->direction_bits, E_AXIS) ? -steps : steps) * planner.mm_per_step[E_AXIS_N(e)];
} }
}
}; static void run() {
#if ENABLED(FILAMENT_RUNOUT_SENSOR_DEBUG)
static millis_t t = 0;
const millis_t ms = millis();
if (ELAPSED(ms, t)) {
t = millis() + 1000UL;
LOOP_L_N(i, NUM_RUNOUT_SENSORS)
SERIAL_ECHOF(i ? F(", ") : F("Remaining mm: "), runout_mm_countdown[i]);
SERIAL_EOL();
}
#endif
}
static uint8_t has_run_out() {
uint8_t runout_flags = 0;
LOOP_L_N(i, NUM_RUNOUT_SENSORS) if (runout_mm_countdown[i] < 0) SBI(runout_flags, i);
return runout_flags;
}
static void filament_present(const uint8_t extruder) {
runout_mm_countdown[extruder] = runout_distance_mm;
}
static void block_completed(const block_t * const b) {
if (b->steps.x || b->steps.y || b->steps.z || did_pause_print) { // Allow pause purge move to re-trigger runout state
// Only trigger on extrusion with XYZ movement to allow filament change and retract/recover.
const uint8_t e = b->extruder;
const int32_t steps = b->steps.e;
runout_mm_countdown[e] -= (TEST(b->direction_bits, E_AXIS) ? -steps : steps) * planner.mm_per_step[E_AXIS_N(e)];
}
}
};
#else // !HAS_FILAMENT_RUNOUT_DISTANCE
// RunoutResponseDebounced triggers a runout event after a runout
// condition has been detected runout_threshold times in a row.
class RunoutResponseDebounced {
private:
static constexpr int8_t runout_threshold = FILAMENT_RUNOUT_THRESHOLD;
static int8_t runout_count[NUM_RUNOUT_SENSORS];
public:
static void reset() {
LOOP_L_N(i, NUM_RUNOUT_SENSORS) filament_present(i);
}
static void run() {
LOOP_L_N(i, NUM_RUNOUT_SENSORS) if (runout_count[i] >= 0) runout_count[i]--;
}
static uint8_t has_run_out() {
uint8_t runout_flags = 0;
LOOP_L_N(i, NUM_RUNOUT_SENSORS) if (runout_count[i] < 0) SBI(runout_flags, i);
return runout_flags;
}
static void block_completed(const block_t * const) { }
static void filament_present(const uint8_t extruder) {
runout_count[extruder] = runout_threshold;
}
};
#endif // !HAS_FILAMENT_RUNOUT_DISTANCE
+1 -1
View File
@@ -112,7 +112,7 @@ void GcodeSuite::M48() {
set_bed_leveling_enabled(false); set_bed_leveling_enabled(false);
#endif #endif
TERN_(HAS_PTC, ptc.set_enabled(parser.boolval('C', true))); TERN_(HAS_PTC, ptc.set_enabled(!parser.seen('C') || parser.value_bool()));
// Work with reasonable feedrates // Work with reasonable feedrates
remember_feedrate_scaling_off(); remember_feedrate_scaling_off();
+2
View File
@@ -167,6 +167,8 @@
if (parser.seenval('T')) draw_area_max.y = parser.value_linear_units(); if (parser.seenval('T')) draw_area_max.y = parser.value_linear_units();
if (parser.seenval('B')) draw_area_min.y = parser.value_linear_units(); if (parser.seenval('B')) draw_area_min.y = parser.value_linear_units();
if (parser.seenval('H')) polargraph_max_belt_len = parser.value_linear_units(); if (parser.seenval('H')) polargraph_max_belt_len = parser.value_linear_units();
draw_area_size.x = draw_area_max.x - draw_area_min.x;
draw_area_size.y = draw_area_max.y - draw_area_min.y;
} }
void GcodeSuite::M665_report(const bool forReplay/*=true*/) { void GcodeSuite::M665_report(const bool forReplay/*=true*/) {
+2 -9
View File
@@ -313,16 +313,9 @@ void GcodeSuite::M43() {
// 'P' Get the range of pins to test or watch // 'P' Get the range of pins to test or watch
uint8_t first_pin = PARSED_PIN_INDEX('P', 0), uint8_t first_pin = PARSED_PIN_INDEX('P', 0),
last_pin = parser.seenval('L') ? PARSED_PIN_INDEX('L', 0) : parser.seenval('P') ? first_pin : (NUMBER_PINS_TOTAL) - 1; last_pin = parser.seenval('P') ? first_pin : (NUMBER_PINS_TOTAL) - 1;
NOMORE(first_pin, (NUMBER_PINS_TOTAL) - 1); if (first_pin > last_pin) return;
NOMORE(last_pin, (NUMBER_PINS_TOTAL) - 1);
if (first_pin > last_pin) {
const uint8_t f = first_pin;
first_pin = last_pin;
last_pin = f;
}
// 'I' to ignore protected pins // 'I' to ignore protected pins
const bool ignore_protection = parser.boolval('I'); const bool ignore_protection = parser.boolval('I');
+2 -2
View File
@@ -22,7 +22,7 @@
#include "../../inc/MarlinConfig.h" #include "../../inc/MarlinConfig.h"
#if ALL(SPI_FLASH, SDSUPPORT, MARLIN_DEV_MODE) #if ALL(HAS_SPI_FLASH, SDSUPPORT, MARLIN_DEV_MODE)
#include "../gcode.h" #include "../gcode.h"
#include "../../sd/cardreader.h" #include "../../sd/cardreader.h"
@@ -85,4 +85,4 @@ void GcodeSuite::M994() {
card.closefile(); card.closefile();
} }
#endif // SPI_FLASH && SDSUPPORT && MARLIN_DEV_MODE #endif // HAS_SPI_FLASH && SDSUPPORT && MARLIN_DEV_MODE
@@ -50,7 +50,6 @@ void GcodeSuite::M900() {
#if EXTRUDERS < 2 #if EXTRUDERS < 2
constexpr uint8_t tool_index = 0; constexpr uint8_t tool_index = 0;
UNUSED(tool_index);
#else #else
const uint8_t tool_index = parser.intval('T', active_extruder); const uint8_t tool_index = parser.intval('T', active_extruder);
if (tool_index >= EXTRUDERS) { if (tool_index >= EXTRUDERS) {
@@ -1,85 +0,0 @@
/**
* Marlin 3D Printer Firmware
* Copyright (c) 2022 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
*
* Based on Sprinter and grbl.
* Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*
*/
#include "../../../inc/MarlinConfig.h"
#if HAS_SHAPING
#include "../../gcode.h"
#include "../../../module/stepper.h"
void GcodeSuite::M593_report(const bool forReplay/*=true*/) {
report_heading_etc(forReplay, F("Input Shaping"));
#if ENABLED(INPUT_SHAPING_X)
SERIAL_ECHOLNPGM(" M593 X"
" F", stepper.get_shaping_frequency(X_AXIS),
" D", stepper.get_shaping_damping_ratio(X_AXIS)
);
#endif
#if ENABLED(INPUT_SHAPING_Y)
TERN_(INPUT_SHAPING_X, report_echo_start(forReplay));
SERIAL_ECHOLNPGM(" M593 Y"
" F", stepper.get_shaping_frequency(Y_AXIS),
" D", stepper.get_shaping_damping_ratio(Y_AXIS)
);
#endif
}
/**
* M593: Get or Set Input Shaping Parameters
* D<factor> Set the zeta/damping factor. If axes (X, Y, etc.) are not specified, set for all axes.
* F<frequency> Set the frequency. If axes (X, Y, etc.) are not specified, set for all axes.
* T[map] Input Shaping type, 0:ZV, 1:EI, 2:2H EI (not implemented yet)
* X<1> Set the given parameters only for the X axis.
* Y<1> Set the given parameters only for the Y axis.
*/
void GcodeSuite::M593() {
if (!parser.seen_any()) return M593_report();
const bool seen_X = TERN0(INPUT_SHAPING_X, parser.seen_test('X')),
seen_Y = TERN0(INPUT_SHAPING_Y, parser.seen_test('Y')),
for_X = seen_X || TERN0(INPUT_SHAPING_X, (!seen_X && !seen_Y)),
for_Y = seen_Y || TERN0(INPUT_SHAPING_Y, (!seen_X && !seen_Y));
if (parser.seen('D')) {
const float zeta = parser.value_float();
if (WITHIN(zeta, 0, 1)) {
if (for_X) stepper.set_shaping_damping_ratio(X_AXIS, zeta);
if (for_Y) stepper.set_shaping_damping_ratio(Y_AXIS, zeta);
}
else
SERIAL_ECHO_MSG("?Zeta (D) value out of range (0-1)");
}
if (parser.seen('F')) {
const float freq = parser.value_float();
constexpr float max_freq = float(uint32_t(STEPPER_TIMER_RATE) / 2) / shaping_time_t(-2);
if (freq == 0.0f || freq > max_freq) {
if (for_X) stepper.set_shaping_frequency(X_AXIS, freq);
if (for_Y) stepper.set_shaping_frequency(Y_AXIS, freq);
}
else
SERIAL_ECHOLNPGM("?Frequency (F) must be greater than ", max_freq, " or 0 to disable");
}
}
#endif
+1 -1
View File
@@ -94,7 +94,7 @@ void GcodeSuite::M600() {
// In this case, for duplicating modes set DXC_ext to the extruder that ran out. // In this case, for duplicating modes set DXC_ext to the extruder that ran out.
#if MULTI_FILAMENT_SENSOR #if MULTI_FILAMENT_SENSOR
if (idex_is_duplicating()) if (idex_is_duplicating())
DXC_ext = (READ(FIL_RUNOUT2_PIN) == runout.out_state(1)) ? 1 : 0; DXC_ext = (READ(FIL_RUNOUT2_PIN) == FIL_RUNOUT2_STATE) ? 1 : 0;
#else #else
DXC_ext = active_extruder; DXC_ext = active_extruder;
#endif #endif
+81
View File
@@ -0,0 +1,81 @@
/**
* Marlin 3D Printer Firmware
* Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
*
* Based on Sprinter and grbl.
* Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*
*/
#include "../../../inc/MarlinConfig.h"
#if HAS_FILAMENT_SENSOR
#include "../../gcode.h"
#include "../../../feature/runout.h"
/**
* M412: Enable / Disable filament runout detection
*
* Parameters
* R : Reset the runout sensor
* S<bool> : Reset and enable/disable the runout sensor
* H<bool> : Enable/disable host handling of filament runout
* D<linear> : Extra distance to continue after runout is triggered
*/
void GcodeSuite::M412() {
if (parser.seen("RS"
TERN_(HAS_FILAMENT_RUNOUT_DISTANCE, "D")
TERN_(HOST_ACTION_COMMANDS, "H")
)) {
#if ENABLED(HOST_ACTION_COMMANDS)
if (parser.seen('H')) runout.host_handling = parser.value_bool();
#endif
const bool seenR = parser.seen_test('R'), seenS = parser.seen('S');
if (seenR || seenS) runout.reset();
if (seenS) runout.enabled = parser.value_bool();
#if HAS_FILAMENT_RUNOUT_DISTANCE
if (parser.seenval('D')) runout.set_runout_distance(parser.value_linear_units());
#endif
}
else {
SERIAL_ECHO_START();
SERIAL_ECHOPGM("Filament runout ");
serialprint_onoff(runout.enabled);
#if HAS_FILAMENT_RUNOUT_DISTANCE
SERIAL_ECHOPGM(" ; Distance ", runout.runout_distance(), "mm");
#endif
#if ENABLED(HOST_ACTION_COMMANDS)
SERIAL_ECHOPGM(" ; Host handling ");
serialprint_onoff(runout.host_handling);
#endif
SERIAL_EOL();
}
}
void GcodeSuite::M412_report(const bool forReplay/*=true*/) {
report_heading_etc(forReplay, F(STR_FILAMENT_RUNOUT_SENSOR));
SERIAL_ECHOPGM(
" M412 S", runout.enabled
#if HAS_FILAMENT_RUNOUT_DISTANCE
, " D", LINEAR_UNIT(runout.runout_distance())
#endif
, " ; Sensor "
);
serialprintln_onoff(runout.enabled);
}
#endif // HAS_FILAMENT_SENSOR
-97
View File
@@ -1,97 +0,0 @@
/**
* Marlin 3D Printer Firmware
* Copyright (c) 2022 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
*
* Based on Sprinter and grbl.
* Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*
*/
#include "../../../inc/MarlinConfig.h"
#if HAS_FILAMENT_SENSOR
#include "../../gcode.h"
#include "../../../feature/runout.h"
/**
* M591: Configure filament runout detection
*
* Parameters
* R : Reset the runout sensor
* S<bool> : Reset and enable/disable the runout sensor
* H<bool> : Enable/disable host handling of filament runout
* L<linear> : Extra distance to continue after runout is triggered or motion interval
* D<linear> : Alias for L
* P<index> : Mode 0 = NONE
* 1 = Switch NO (HIGH = filament present)
* 2 = Switch NC (LOW = filament present)
* 3 = Encoder / Motion Sensor
*/
void GcodeSuite::M591() {
if (parser.seen("RSDP" TERN_(HOST_ACTION_COMMANDS, "H"))) {
#if ENABLED(HOST_ACTION_COMMANDS)
if (parser.seen('H')) runout.host_handling = parser.value_bool();
#endif
const bool seenR = parser.seen_test('R'), seenS = parser.seen('S');
if (seenR || seenS) runout.reset();
const uint8_t tool = TERN0(MULTI_FILAMENT_SENSOR, parser.ushortval('E', active_extruder));
if (seenS) runout.enabled[tool] = parser.value_bool();
if (parser.seenval('D') || parser.seenval('L')) runout.set_runout_distance(parser.value_linear_units(), tool);
if (parser.seenval('P')) {
const RunoutMode tmp_mode = (RunoutMode)parser.value_int();
switch (tmp_mode) {
case RM_NONE ... RM_OUT_ON_HIGH:
case RM_MOTION_SENSOR:
runout.mode[tool] = tmp_mode;
runout.setup();
default: break;
}
}
}
else {
#if DISABLED(SLIM_LCD_MENUS)
SERIAL_ECHO_START();
SERIAL_ECHOPGM("Filament runout ");
serialprint_onoff(runout.enabled[active_extruder]);
SERIAL_ECHOPGM(" ; Distance ", runout.runout_distance(active_extruder), "mm");
SERIAL_ECHOPGM(" ; Mode ", runout.mode[active_extruder]);
#if ENABLED(HOST_ACTION_COMMANDS)
SERIAL_ECHOPGM(" ; Host handling ");
serialprint_onoff(runout.host_handling);
#endif
SERIAL_EOL();
#else
M591_report(false);
#endif
}
}
void GcodeSuite::M591_report(const bool forReplay/*=true*/) {
report_heading_etc(forReplay, F(STR_FILAMENT_RUNOUT_SENSOR));
LOOP_S_L_N(e, 1, NUM_RUNOUT_SENSORS)
SERIAL_ECHOLNPGM(
" M591"
#if MULTI_FILAMENT_SENSOR
" E", e,
#endif
" S", runout.enabled[e]
, " D", LINEAR_UNIT(runout.runout_distance(e))
, " P", runout.mode[e]
);
}
#endif // HAS_FILAMENT_SENSOR
+2 -6
View File
@@ -197,12 +197,8 @@ void GcodeSuite::M569_report(const bool forReplay/*=true*/) {
if (chop_x2 || chop_y2 || chop_z2) { if (chop_x2 || chop_y2 || chop_z2) {
say_M569(forReplay, F("I1")); say_M569(forReplay, F("I1"));
if (chop_x2) SERIAL_ECHOPGM_P(SP_X_STR); if (chop_x2) SERIAL_ECHOPGM_P(SP_X_STR);
#if HAS_Y_AXIS if (chop_y2) SERIAL_ECHOPGM_P(SP_Y_STR);
if (chop_y2) SERIAL_ECHOPGM_P(SP_Y_STR); if (chop_z2) SERIAL_ECHOPGM_P(SP_Z_STR);
#endif
#if HAS_Z_AXIS
if (chop_z2) SERIAL_ECHOPGM_P(SP_Z_STR);
#endif
SERIAL_EOL(); SERIAL_EOL();
} }
+6 -17
View File
@@ -600,9 +600,7 @@ void GcodeSuite::process_parsed_command(const bool no_ok/*=false*/) {
case 108: M108(); break; // M108: Cancel Waiting case 108: M108(); break; // M108: Cancel Waiting
case 112: M112(); break; // M112: Full Shutdown case 112: M112(); break; // M112: Full Shutdown
case 410: M410(); break; // M410: Quickstop - Abort all the planned moves. case 410: M410(); break; // M410: Quickstop - Abort all the planned moves.
#if ENABLED(HOST_PROMPT_SUPPORT) TERN_(HOST_PROMPT_SUPPORT, case 876:) // M876: Handle Host prompt responses
case 876: M876(); break; // M876: Handle Host prompt responses
#endif
#else #else
case 108: case 112: case 410: case 108: case 112: case 410:
TERN_(HOST_PROMPT_SUPPORT, case 876:) TERN_(HOST_PROMPT_SUPPORT, case 876:)
@@ -795,10 +793,6 @@ void GcodeSuite::process_parsed_command(const bool no_ok/*=false*/) {
case 250: M250(); break; // M250: Set LCD contrast case 250: M250(); break; // M250: Set LCD contrast
#endif #endif
#if HAS_GCODE_M255
case 255: M255(); break; // M255: Set LCD Sleep/Backlight Timeout (Minutes)
#endif
#if HAS_LCD_BRIGHTNESS #if HAS_LCD_BRIGHTNESS
case 256: M256(); break; // M256: Set LCD brightness case 256: M256(); break; // M256: Set LCD brightness
#endif #endif
@@ -859,6 +853,10 @@ void GcodeSuite::process_parsed_command(const bool no_ok/*=false*/) {
case 407: M407(); break; // M407: Display measured filament diameter case 407: M407(); break; // M407: Display measured filament diameter
#endif #endif
#if HAS_FILAMENT_SENSOR
case 412: M412(); break; // M412: Enable/Disable filament runout detection
#endif
#if HAS_MULTI_LANGUAGE #if HAS_MULTI_LANGUAGE
case 414: M414(); break; // M414: Select multi language menu case 414: M414(); break; // M414: Select multi language menu
#endif #endif
@@ -929,15 +927,6 @@ void GcodeSuite::process_parsed_command(const bool no_ok/*=false*/) {
case 575: M575(); break; // M575: Set serial baudrate case 575: M575(); break; // M575: Set serial baudrate
#endif #endif
#if HAS_FILAMENT_SENSOR
case 412: M412(); break; // M412: Alias for M591
case 591: M591(); break; // M591: Configure filament runout detection
#endif
#if HAS_SHAPING
case 593: M593(); break; // M593: Set Input Shaping parameters
#endif
#if ENABLED(ADVANCED_PAUSE_FEATURE) #if ENABLED(ADVANCED_PAUSE_FEATURE)
case 600: M600(); break; // M600: Pause for Filament Change case 600: M600(); break; // M600: Pause for Filament Change
case 603: M603(); break; // M603: Configure Filament Change case 603: M603(); break; // M603: Configure Filament Change
@@ -1058,7 +1047,7 @@ void GcodeSuite::process_parsed_command(const bool no_ok/*=false*/) {
case 422: M422(); break; // M422: Set Z Stepper automatic alignment position using probe case 422: M422(); break; // M422: Set Z Stepper automatic alignment position using probe
#endif #endif
#if ALL(SPI_FLASH, SDSUPPORT, MARLIN_DEV_MODE) #if ALL(HAS_SPI_FLASH, SDSUPPORT, MARLIN_DEV_MODE)
case 993: M993(); break; // M993: Backup SPI Flash to SD case 993: M993(); break; // M993: Backup SPI Flash to SD
case 994: M994(); break; // M994: Load a Backup from SD to SPI Flash case 994: M994(); break; // M994: Load a Backup from SD to SPI Flash
#endif #endif
+4 -11
View File
@@ -234,6 +234,7 @@
* M406 - Disable Filament Sensor flow control. (Requires FILAMENT_WIDTH_SENSOR) * M406 - Disable Filament Sensor flow control. (Requires FILAMENT_WIDTH_SENSOR)
* M407 - Display measured filament diameter in millimeters. (Requires FILAMENT_WIDTH_SENSOR) * M407 - Display measured filament diameter in millimeters. (Requires FILAMENT_WIDTH_SENSOR)
* M410 - Quickstop. Abort all planned moves. * M410 - Quickstop. Abort all planned moves.
* M412 - Enable / Disable Filament Runout Detection. (Requires FILAMENT_RUNOUT_SENSOR)
* M413 - Enable / Disable Power-Loss Recovery. (Requires POWER_LOSS_RECOVERY) * M413 - Enable / Disable Power-Loss Recovery. (Requires POWER_LOSS_RECOVERY)
* M414 - Set language by index. (Requires LCD_LANGUAGE_2...) * M414 - Set language by index. (Requires LCD_LANGUAGE_2...)
* M420 - Enable/Disable Leveling (with current values) S1=enable S0=disable (Requires MESH_BED_LEVELING or ABL) * M420 - Enable/Disable Leveling (with current values) S1=enable S0=disable (Requires MESH_BED_LEVELING or ABL)
@@ -258,8 +259,6 @@
* M554 - Get or set IP gateway. (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) * M569 - Enable stealthChop on an axis. (Requires at least one _DRIVER_TYPE to be TMC2130/2160/2208/2209/5130/5160)
* M575 - Change the serial baud rate. (Requires BAUD_RATE_GCODE) * M575 - Change the serial baud rate. (Requires BAUD_RATE_GCODE)
* M591 - Configure Filament Runout Detection. (Requires FILAMENT_RUNOUT_SENSOR)
* M593 - Get or set input shaping parameters. (Requires INPUT_SHAPING_[XY])
* M600 - Pause for filament change: "M600 X<pos> Y<pos> Z<raise> E<first_retract> L<later_retract>". (Requires ADVANCED_PAUSE_FEATURE) * M600 - Pause for filament change: "M600 X<pos> Y<pos> Z<raise> E<first_retract> L<later_retract>". (Requires ADVANCED_PAUSE_FEATURE)
* M603 - Configure filament change: "M603 T<tool> U<unload_length> L<load_length>". (Requires ADVANCED_PAUSE_FEATURE) * M603 - Configure filament change: "M603 T<tool> U<unload_length> L<load_length>". (Requires ADVANCED_PAUSE_FEATURE)
* M605 - Set Dual X-Carriage movement mode: "M605 S<mode> [X<x_offset>] [R<temp_offset>]". (Requires DUAL_X_CARRIAGE) * M605 - Set Dual X-Carriage movement mode: "M605 S<mode> [X<x_offset>] [R<temp_offset>]". (Requires DUAL_X_CARRIAGE)
@@ -1003,9 +1002,8 @@ private:
#endif #endif
#if HAS_FILAMENT_SENSOR #if HAS_FILAMENT_SENSOR
static void M412() { M591(); } static void M412();
static void M591(); static void M412_report(const bool forReplay=true);
static void M591_report(const bool forReplay=true);
#endif #endif
#if HAS_MULTI_LANGUAGE #if HAS_MULTI_LANGUAGE
@@ -1082,11 +1080,6 @@ private:
static void M575(); static void M575();
#endif #endif
#if HAS_SHAPING
static void M593();
static void M593_report(const bool forReplay=true);
#endif
#if ENABLED(ADVANCED_PAUSE_FEATURE) #if ENABLED(ADVANCED_PAUSE_FEATURE)
static void M600(); static void M600();
static void M603(); static void M603();
@@ -1201,7 +1194,7 @@ private:
static void M995(); static void M995();
#endif #endif
#if BOTH(SPI_FLASH, SDSUPPORT) #if BOTH(HAS_SPI_FLASH, SDSUPPORT)
static void M993(); static void M993();
static void M994(); static void M994();
#endif #endif
+9 -26
View File
@@ -132,7 +132,7 @@ void GcodeSuite::M115() {
// AUTOLEVEL (G29) // AUTOLEVEL (G29)
cap_line(F("AUTOLEVEL"), ENABLED(HAS_AUTOLEVEL)); cap_line(F("AUTOLEVEL"), ENABLED(HAS_AUTOLEVEL));
// RUNOUT (M591, M600) // RUNOUT (M412, M600)
cap_line(F("RUNOUT"), ENABLED(FILAMENT_RUNOUT_SENSOR)); cap_line(F("RUNOUT"), ENABLED(FILAMENT_RUNOUT_SENSOR));
// Z_PROBE (G30) // Z_PROBE (G30)
@@ -222,41 +222,24 @@ void GcodeSuite::M115() {
// Machine Geometry // Machine Geometry
#if ENABLED(M115_GEOMETRY_REPORT) #if ENABLED(M115_GEOMETRY_REPORT)
constexpr xyz_pos_t bmin{0}, const xyz_pos_t bmin = { 0, 0, 0 },
bmax = ARRAY_N(NUM_AXES, X_BED_SIZE, Y_BED_SIZE, Z_MAX_POS, I_MAX_POS, J_MAX_POS, K_MAX_POS, U_MAX_POS, V_MAX_POS, W_MAX_POS), bmax = { X_BED_SIZE , Y_BED_SIZE, Z_MAX_POS },
dmin = ARRAY_N(NUM_AXES, X_MIN_POS, Y_MIN_POS, Z_MIN_POS, I_MIN_POS, J_MIN_POS, K_MIN_POS, U_MIN_POS, V_MIN_POS, W_MIN_POS), dmin = { X_MIN_POS, Y_MIN_POS, Z_MIN_POS },
dmax = ARRAY_N(NUM_AXES, X_MAX_POS, Y_MAX_POS, Z_MAX_POS, I_MAX_POS, J_MAX_POS, K_MAX_POS, U_MAX_POS, V_MAX_POS, W_MAX_POS); dmax = { X_MAX_POS, Y_MAX_POS, Z_MAX_POS };
xyz_pos_t cmin = bmin, cmax = bmax; xyz_pos_t cmin = bmin, cmax = bmax;
apply_motion_limits(cmin); apply_motion_limits(cmin);
apply_motion_limits(cmax); apply_motion_limits(cmax);
const xyz_pos_t lmin = dmin.asLogical(), lmax = dmax.asLogical(), const xyz_pos_t lmin = dmin.asLogical(), lmax = dmax.asLogical(),
wmin = cmin.asLogical(), wmax = cmax.asLogical(); wmin = cmin.asLogical(), wmax = cmax.asLogical();
SERIAL_ECHOLNPGM( SERIAL_ECHOLNPGM(
"area:{" "area:{"
"full:{" "full:{"
LIST_N(DOUBLE(NUM_AXES), "min:{x:", lmin.x, ",y:", lmin.y, ",z:", lmin.z, "},"
"min:{x:", lmin.x, ",y:", lmin.y, ",z:", lmin.z, "max:{x:", lmax.x, ",y:", lmax.y, ",z:", lmax.z, "}"
",i:", lmin.i, ",j:", lmin.j, ",k:", lmin.k,
",u:", lmin.u, ",v:", lmin.v, ",w:", lmin.w
),
LIST_N(DOUBLE(NUM_AXES),
"max:{x:", lmax.x, ",y:", lmax.y, ",z:", lmax.z,
",i:", lmax.i, ",j:", lmax.j, ",k:", lmax.k,
",u:", lmax.u, ",v:", lmax.v, ",w:", lmax.w
),
"}," "},"
"work:{" "work:{"
LIST_N(DOUBLE(NUM_AXES), "min:{x:", wmin.x, ",y:", wmin.y, ",z:", wmin.z, "},"
"min:{x:", wmin.x, ",y:", wmin.y, ",z:", wmin.z, "max:{x:", wmax.x, ",y:", wmax.y, ",z:", wmax.z, "}",
",i:", wmin.i, ",j:", wmin.j, ",k:", wmin.k,
",u:", wmin.u, ",v:", wmin.v, ",w:", wmin.w
),
LIST_N(DOUBLE(NUM_AXES),
"max:{x:", wmax.x, ",y:", wmax.y, ",z:", wmax.z,
",i:", wmax.i, ",j:", wmax.j, ",k:", wmax.k,
",u:", wmax.u, ",v:", wmax.v, ",w:", wmax.w
),
"}" "}"
"}" "}"
); );
+1 -6
View File
@@ -85,12 +85,7 @@ void GcodeSuite::M0_M1() {
#endif #endif
#if ENABLED(HOST_PROMPT_SUPPORT) TERN_(HOST_PROMPT_SUPPORT, hostui.prompt_do(PROMPT_USER_CONTINUE, parser.codenum ? F("M1 Stop") : F("M0 Stop"), FPSTR(CONTINUE_STR)));
if (parser.string_arg)
hostui.prompt_do(PROMPT_USER_CONTINUE, parser.string_arg, FPSTR(CONTINUE_STR));
else
hostui.prompt_do(PROMPT_USER_CONTINUE, parser.codenum ? F("M1 Stop") : F("M0 Stop"), FPSTR(CONTINUE_STR));
#endif
TERN_(HAS_RESUME_CONTINUE, wait_for_user_response(ms)); TERN_(HAS_RESUME_CONTINUE, wait_for_user_response(ms));
+10 -13
View File
@@ -58,13 +58,16 @@ void GcodeSuite::G30() {
tool_change(0); tool_change(0);
#endif #endif
// Convert the given logical position to native position const xy_pos_t pos = { parser.linearval('X', current_position.x + probe.offset_xy.x),
const xy_pos_t pos = { parser.linearval('Y', current_position.y + probe.offset_xy.y) };
parser.seenval('X') ? RAW_X_POSITION(parser.value_linear_units()) : current_position.x,
parser.seenval('Y') ? RAW_Y_POSITION(parser.value_linear_units()) : current_position.y
};
if (probe.can_reach(pos)) { if (!probe.can_reach(pos)) {
#if ENABLED(DWIN_LCD_PROUI)
SERIAL_ECHOLNF(GET_EN_TEXT_F(MSG_ZPROBE_OUT));
LCD_MESSAGE(MSG_ZPROBE_OUT);
#endif
}
else {
// Disable leveling so the planner won't mess with us // Disable leveling so the planner won't mess with us
TERN_(HAS_LEVELING, set_bed_leveling_enabled(false)); TERN_(HAS_LEVELING, set_bed_leveling_enabled(false));
@@ -80,7 +83,7 @@ void GcodeSuite::G30() {
const float measured_z = probe.probe_at_point(pos, raise_after, 1); const float measured_z = probe.probe_at_point(pos, raise_after, 1);
TERN_(HAS_PTC, ptc.set_enabled(true)); TERN_(HAS_PTC, ptc.set_enabled(true));
if (!isnan(measured_z)) { if (!isnan(measured_z)) {
SERIAL_ECHOLNPGM("Bed X: ", pos.asLogical().x, " Y: ", pos.asLogical().y, " Z: ", measured_z); SERIAL_ECHOLNPGM("Bed X: ", pos.x, " Y: ", pos.y, " Z: ", measured_z);
#if EITHER(DWIN_LCD_PROUI, DWIN_CREALITY_LCD_JYERSUI) #if EITHER(DWIN_LCD_PROUI, DWIN_CREALITY_LCD_JYERSUI)
char msg[31], str_1[6], str_2[6], str_3[6]; char msg[31], str_1[6], str_2[6], str_3[6];
sprintf_P(msg, PSTR("X:%s, Y:%s, Z:%s"), sprintf_P(msg, PSTR("X:%s, Y:%s, Z:%s"),
@@ -99,12 +102,6 @@ void GcodeSuite::G30() {
report_current_position(); report_current_position();
} }
else {
#if ENABLED(DWIN_LCD_PROUI)
SERIAL_ECHOLNF(GET_EN_TEXT_F(MSG_ZPROBE_OUT));
LCD_MESSAGE(MSG_ZPROBE_OUT);
#endif
}
// Restore the active tool // Restore the active tool
TERN_(HAS_MULTI_HOTEND, tool_change(old_tool_index)); TERN_(HAS_MULTI_HOTEND, tool_change(old_tool_index));
+3 -4
View File
@@ -469,11 +469,8 @@ void GCodeQueue::get_serial_commands() {
const long gcode_N = strtol(npos + 1, nullptr, 10); const long gcode_N = strtol(npos + 1, nullptr, 10);
// The line number must be in the correct sequence.
if (gcode_N != serial.last_N + 1 && !M110) { if (gcode_N != serial.last_N + 1 && !M110) {
// A request-for-resend line was already in transit so we got two - oops! // In case of error on a serial port, don't prevent other serial port from making progress
if (WITHIN(gcode_N, serial.last_N - 1, serial.last_N)) continue;
// A corrupted line or too high, indicating a lost line
gcode_line_error(F(STR_ERR_LINE_NO), p); gcode_line_error(F(STR_ERR_LINE_NO), p);
break; break;
} }
@@ -483,11 +480,13 @@ void GCodeQueue::get_serial_commands() {
uint8_t checksum = 0, count = uint8_t(apos - command); uint8_t checksum = 0, count = uint8_t(apos - command);
while (count) checksum ^= command[--count]; while (count) checksum ^= command[--count];
if (strtol(apos + 1, nullptr, 10) != checksum) { if (strtol(apos + 1, nullptr, 10) != checksum) {
// In case of error on a serial port, don't prevent other serial port from making progress
gcode_line_error(F(STR_ERR_CHECKSUM_MISMATCH), p); gcode_line_error(F(STR_ERR_CHECKSUM_MISMATCH), p);
break; break;
} }
} }
else { else {
// In case of error on a serial port, don't prevent other serial port from making progress
gcode_line_error(F(STR_ERR_NO_CHECKSUM), p); gcode_line_error(F(STR_ERR_NO_CHECKSUM), p);
break; break;
} }
+1 -7
View File
@@ -25,7 +25,6 @@
#if ENABLED(MPCTEMP) #if ENABLED(MPCTEMP)
#include "../gcode.h" #include "../gcode.h"
#include "../../lcd/marlinui.h"
#include "../../module/temperature.h" #include "../../module/temperature.h"
/** /**
@@ -43,12 +42,7 @@
*/ */
void GcodeSuite::M306() { void GcodeSuite::M306() {
if (parser.seen_test('T')) { if (parser.seen_test('T')) { thermalManager.MPC_autotune(); return; }
LCD_MESSAGE(MSG_MPC_AUTOTUNE);
thermalManager.MPC_autotune();
ui.reset_status();
return;
}
if (parser.seen("ACFPRH")) { if (parser.seen("ACFPRH")) {
const heater_id_t hid = (heater_id_t)parser.intval('E', 0); const heater_id_t hid = (heater_id_t)parser.intval('E', 0);
+60 -90
View File
@@ -1020,11 +1020,8 @@
#endif #endif
// Helper macros for extruder and hotend arrays // Helper macros for extruder and hotend arrays
#define _EXTRUDER_LOOP(E) for (int8_t E = 0; E < EXTRUDERS; E++) #define EXTRUDER_LOOP() for (int8_t e = 0; e < EXTRUDERS; e++)
#define EXTRUDER_LOOP() _EXTRUDER_LOOP(e) #define HOTEND_LOOP() for (int8_t e = 0; e < HOTENDS; e++)
#define _HOTEND_LOOP(H) for (int8_t H = 0; H < HOTENDS; H++)
#define HOTEND_LOOP() _HOTEND_LOOP(e)
#define ARRAY_BY_EXTRUDERS(V...) ARRAY_N(EXTRUDERS, V) #define ARRAY_BY_EXTRUDERS(V...) ARRAY_N(EXTRUDERS, V)
#define ARRAY_BY_EXTRUDERS1(v1) ARRAY_N_1(EXTRUDERS, v1) #define ARRAY_BY_EXTRUDERS1(v1) ARRAY_N_1(EXTRUDERS, v1)
#define ARRAY_BY_HOTENDS(V...) ARRAY_N(HOTENDS, V) #define ARRAY_BY_HOTENDS(V...) ARRAY_N(HOTENDS, V)
@@ -1111,14 +1108,10 @@
* Fill in undefined Filament Sensor options * Fill in undefined Filament Sensor options
*/ */
#if ENABLED(FILAMENT_RUNOUT_SENSOR) #if ENABLED(FILAMENT_RUNOUT_SENSOR)
#define HAS_FILAMENT_SENSOR 1
#ifndef NUM_RUNOUT_SENSORS
#define NUM_RUNOUT_SENSORS E_STEPPERS
#endif
#if ENABLED(MIXING_EXTRUDER)
#define WATCH_ALL_RUNOUT_SENSORS
#endif
#if NUM_RUNOUT_SENSORS >= 1 #if NUM_RUNOUT_SENSORS >= 1
#ifndef FIL_RUNOUT1_STATE
#define FIL_RUNOUT1_STATE FIL_RUNOUT_STATE
#endif
#ifndef FIL_RUNOUT1_PULLUP #ifndef FIL_RUNOUT1_PULLUP
#define FIL_RUNOUT1_PULLUP FIL_RUNOUT_PULLUP #define FIL_RUNOUT1_PULLUP FIL_RUNOUT_PULLUP
#endif #endif
@@ -1127,7 +1120,9 @@
#endif #endif
#endif #endif
#if NUM_RUNOUT_SENSORS >= 2 #if NUM_RUNOUT_SENSORS >= 2
#define MULTI_FILAMENT_SENSOR 1 #ifndef FIL_RUNOUT2_STATE
#define FIL_RUNOUT2_STATE FIL_RUNOUT_STATE
#endif
#ifndef FIL_RUNOUT2_PULLUP #ifndef FIL_RUNOUT2_PULLUP
#define FIL_RUNOUT2_PULLUP FIL_RUNOUT_PULLUP #define FIL_RUNOUT2_PULLUP FIL_RUNOUT_PULLUP
#endif #endif
@@ -1136,6 +1131,9 @@
#endif #endif
#endif #endif
#if NUM_RUNOUT_SENSORS >= 3 #if NUM_RUNOUT_SENSORS >= 3
#ifndef FIL_RUNOUT3_STATE
#define FIL_RUNOUT3_STATE FIL_RUNOUT_STATE
#endif
#ifndef FIL_RUNOUT3_PULLUP #ifndef FIL_RUNOUT3_PULLUP
#define FIL_RUNOUT3_PULLUP FIL_RUNOUT_PULLUP #define FIL_RUNOUT3_PULLUP FIL_RUNOUT_PULLUP
#endif #endif
@@ -1144,6 +1142,9 @@
#endif #endif
#endif #endif
#if NUM_RUNOUT_SENSORS >= 4 #if NUM_RUNOUT_SENSORS >= 4
#ifndef FIL_RUNOUT4_STATE
#define FIL_RUNOUT4_STATE FIL_RUNOUT_STATE
#endif
#ifndef FIL_RUNOUT4_PULLUP #ifndef FIL_RUNOUT4_PULLUP
#define FIL_RUNOUT4_PULLUP FIL_RUNOUT_PULLUP #define FIL_RUNOUT4_PULLUP FIL_RUNOUT_PULLUP
#endif #endif
@@ -1152,6 +1153,9 @@
#endif #endif
#endif #endif
#if NUM_RUNOUT_SENSORS >= 5 #if NUM_RUNOUT_SENSORS >= 5
#ifndef FIL_RUNOUT5_STATE
#define FIL_RUNOUT5_STATE FIL_RUNOUT_STATE
#endif
#ifndef FIL_RUNOUT5_PULLUP #ifndef FIL_RUNOUT5_PULLUP
#define FIL_RUNOUT5_PULLUP FIL_RUNOUT_PULLUP #define FIL_RUNOUT5_PULLUP FIL_RUNOUT_PULLUP
#endif #endif
@@ -1160,6 +1164,9 @@
#endif #endif
#endif #endif
#if NUM_RUNOUT_SENSORS >= 6 #if NUM_RUNOUT_SENSORS >= 6
#ifndef FIL_RUNOUT6_STATE
#define FIL_RUNOUT6_STATE FIL_RUNOUT_STATE
#endif
#ifndef FIL_RUNOUT6_PULLUP #ifndef FIL_RUNOUT6_PULLUP
#define FIL_RUNOUT6_PULLUP FIL_RUNOUT_PULLUP #define FIL_RUNOUT6_PULLUP FIL_RUNOUT_PULLUP
#endif #endif
@@ -1168,6 +1175,9 @@
#endif #endif
#endif #endif
#if NUM_RUNOUT_SENSORS >= 7 #if NUM_RUNOUT_SENSORS >= 7
#ifndef FIL_RUNOUT7_STATE
#define FIL_RUNOUT7_STATE FIL_RUNOUT_STATE
#endif
#ifndef FIL_RUNOUT7_PULLUP #ifndef FIL_RUNOUT7_PULLUP
#define FIL_RUNOUT7_PULLUP FIL_RUNOUT_PULLUP #define FIL_RUNOUT7_PULLUP FIL_RUNOUT_PULLUP
#endif #endif
@@ -1176,6 +1186,9 @@
#endif #endif
#endif #endif
#if NUM_RUNOUT_SENSORS >= 8 #if NUM_RUNOUT_SENSORS >= 8
#ifndef FIL_RUNOUT8_STATE
#define FIL_RUNOUT8_STATE FIL_RUNOUT_STATE
#endif
#ifndef FIL_RUNOUT8_PULLUP #ifndef FIL_RUNOUT8_PULLUP
#define FIL_RUNOUT8_PULLUP FIL_RUNOUT_PULLUP #define FIL_RUNOUT8_PULLUP FIL_RUNOUT_PULLUP
#endif #endif
@@ -1191,61 +1204,45 @@
#elif X_HOME_DIR < 0 #elif X_HOME_DIR < 0
#define X_HOME_TO_MIN 1 #define X_HOME_TO_MIN 1
#endif #endif
#if HAS_Y_AXIS #if Y_HOME_DIR > 0
#if Y_HOME_DIR > 0 #define Y_HOME_TO_MAX 1
#define Y_HOME_TO_MAX 1 #elif Y_HOME_DIR < 0
#elif Y_HOME_DIR < 0 #define Y_HOME_TO_MIN 1
#define Y_HOME_TO_MIN 1
#endif
#endif #endif
#if HAS_Z_AXIS #if Z_HOME_DIR > 0
#if Z_HOME_DIR > 0 #define Z_HOME_TO_MAX 1
#define Z_HOME_TO_MAX 1 #elif Z_HOME_DIR < 0
#elif Z_HOME_DIR < 0 #define Z_HOME_TO_MIN 1
#define Z_HOME_TO_MIN 1
#endif
#endif #endif
#if HAS_I_AXIS #if I_HOME_DIR > 0
#if I_HOME_DIR > 0 #define I_HOME_TO_MAX 1
#define I_HOME_TO_MAX 1 #elif I_HOME_DIR < 0
#elif I_HOME_DIR < 0 #define I_HOME_TO_MIN 1
#define I_HOME_TO_MIN 1
#endif
#endif #endif
#if HAS_J_AXIS #if J_HOME_DIR > 0
#if J_HOME_DIR > 0 #define J_HOME_TO_MAX 1
#define J_HOME_TO_MAX 1 #elif J_HOME_DIR < 0
#elif J_HOME_DIR < 0 #define J_HOME_TO_MIN 1
#define J_HOME_TO_MIN 1
#endif
#endif #endif
#if HAS_K_AXIS #if K_HOME_DIR > 0
#if K_HOME_DIR > 0 #define K_HOME_TO_MAX 1
#define K_HOME_TO_MAX 1 #elif K_HOME_DIR < 0
#elif K_HOME_DIR < 0 #define K_HOME_TO_MIN 1
#define K_HOME_TO_MIN 1
#endif
#endif #endif
#if HAS_U_AXIS #if U_HOME_DIR > 0
#if U_HOME_DIR > 0 #define U_HOME_TO_MAX 1
#define U_HOME_TO_MAX 1 #elif U_HOME_DIR < 0
#elif U_HOME_DIR < 0 #define U_HOME_TO_MIN 1
#define U_HOME_TO_MIN 1
#endif
#endif #endif
#if HAS_V_AXIS #if V_HOME_DIR > 0
#if V_HOME_DIR > 0 #define V_HOME_TO_MAX 1
#define V_HOME_TO_MAX 1 #elif V_HOME_DIR < 0
#elif V_HOME_DIR < 0 #define V_HOME_TO_MIN 1
#define V_HOME_TO_MIN 1
#endif
#endif #endif
#if HAS_W_AXIS #if W_HOME_DIR > 0
#if W_HOME_DIR > 0 #define W_HOME_TO_MAX 1
#define W_HOME_TO_MAX 1 #elif W_HOME_DIR < 0
#elif W_HOME_DIR < 0 #define W_HOME_TO_MIN 1
#define W_HOME_TO_MIN 1
#endif
#endif #endif
/** /**
@@ -1499,7 +1496,7 @@
#endif #endif
#elif ENABLED(TFT_GENERIC) #elif ENABLED(TFT_GENERIC)
#define TFT_DEFAULT_ORIENTATION (TFT_EXCHANGE_XY | TFT_INVERT_X | TFT_INVERT_Y) #define TFT_DEFAULT_ORIENTATION (TFT_EXCHANGE_XY | TFT_INVERT_X | TFT_INVERT_Y)
#if NONE(TFT_RES_320x240, TFT_RES_480x272, TFT_RES_480x320, TFT_RES_1024x600) #if NONE(TFT_RES_320x240, TFT_RES_480x272, TFT_RES_480x320)
#define TFT_RES_320x240 #define TFT_RES_320x240
#endif #endif
#if NONE(TFT_INTERFACE_FSMC, TFT_INTERFACE_SPI) #if NONE(TFT_INTERFACE_FSMC, TFT_INTERFACE_SPI)
@@ -1577,8 +1574,6 @@
#elif TFT_HEIGHT == 600 #elif TFT_HEIGHT == 600
#if ENABLED(TFT_INTERFACE_LTDC) #if ENABLED(TFT_INTERFACE_LTDC)
#define TFT_1024x600_LTDC #define TFT_1024x600_LTDC
#else
#define TFT_1024x600_SIM // "Simulation" - for testing purposes only
#endif #endif
#endif #endif
#endif #endif
@@ -1589,7 +1584,7 @@
#define HAS_UI_480x320 1 #define HAS_UI_480x320 1
#elif EITHER(TFT_480x272, TFT_480x272_SPI) #elif EITHER(TFT_480x272, TFT_480x272_SPI)
#define HAS_UI_480x272 1 #define HAS_UI_480x272 1
#elif EITHER(TFT_1024x600_LTDC, TFT_1024x600_SIM) #elif defined(TFT_1024x600_LTDC)
#define HAS_UI_1024x600 1 #define HAS_UI_1024x600 1
#endif #endif
#if ANY(HAS_UI_320x240, HAS_UI_480x320, HAS_UI_480x272) #if ANY(HAS_UI_320x240, HAS_UI_480x320, HAS_UI_480x272)
@@ -1647,28 +1642,3 @@
#if defined(NEOPIXEL_BKGD_INDEX_FIRST) && !defined(NEOPIXEL_BKGD_INDEX_LAST) #if defined(NEOPIXEL_BKGD_INDEX_FIRST) && !defined(NEOPIXEL_BKGD_INDEX_LAST)
#define NEOPIXEL_BKGD_INDEX_LAST NEOPIXEL_BKGD_INDEX_FIRST #define NEOPIXEL_BKGD_INDEX_LAST NEOPIXEL_BKGD_INDEX_FIRST
#endif #endif
/*** TEMPORARY COMPATIBILITY ***/
#if HAS_FILAMENT_SENSOR
#ifndef FIL_RUNOUT_ENABLED
#if FIL_RUNOUT_ENABLED_DEFAULT
#define FIL_RUNOUT_ENABLED ARRAY_N_1(NUM_RUNOUT_SENSORS, true)
#else
#define FIL_RUNOUT_ENABLED ARRAY_N_1(NUM_RUNOUT_SENSORS, false)
#endif
#endif
#ifndef FIL_RUNOUT_MODE
#if FIL_RUNOUT_STATE
#define FIL_RUNOUT_MODE ARRAY_N_1(NUM_RUNOUT_SENSORS, 1)
#else
#define FIL_RUNOUT_MODE ARRAY_N_1(NUM_RUNOUT_SENSORS, 2)
#endif
#endif
#ifndef FIL_RUNOUT_DISTANCE_MM
#define FIL_RUNOUT_DISTANCE_MM ARRAY_N_1(NUM_RUNOUT_SENSORS, 10)
#endif
#undef FIL_RUNOUT_ENABLED_DEFAULT
#undef FIL_RUNOUT_STATE
#undef FILAMENT_RUNOUT_DISTANCE_MM
#endif
+41 -82
View File
@@ -99,12 +99,11 @@
#undef PID_EXTRUSION_SCALING #undef PID_EXTRUSION_SCALING
#undef LIN_ADVANCE #undef LIN_ADVANCE
#undef FILAMENT_RUNOUT_SENSOR #undef FILAMENT_RUNOUT_SENSOR
#undef FIL_RUNOUT_ENABLED
#undef FIL_RUNOUT_MODE
#undef FIL_RUNOUT_DISTANCE_MM
#undef ADVANCED_PAUSE_FEATURE #undef ADVANCED_PAUSE_FEATURE
#undef FILAMENT_RUNOUT_DISTANCE_MM
#undef FILAMENT_LOAD_UNLOAD_GCODES #undef FILAMENT_LOAD_UNLOAD_GCODES
#undef DISABLE_INACTIVE_EXTRUDER #undef DISABLE_INACTIVE_EXTRUDER
#undef FILAMENT_LOAD_UNLOAD_GCODES
#undef EXTRUDER_RUNOUT_PREVENT #undef EXTRUDER_RUNOUT_PREVENT
#undef PREVENT_COLD_EXTRUSION #undef PREVENT_COLD_EXTRUSION
#undef PREVENT_LENGTHY_EXTRUDE #undef PREVENT_LENGTHY_EXTRUDE
@@ -263,72 +262,26 @@
#undef HEATER_1_MAXTEMP #undef HEATER_1_MAXTEMP
#endif #endif
#if TEMP_SENSOR_IS_MAX_TC(2)
#if TEMP_SENSOR_2 == -5
#define TEMP_SENSOR_2_IS_MAX31865 1
#define TEMP_SENSOR_2_MAX_TC_TMIN 0
#define TEMP_SENSOR_2_MAX_TC_TMAX 1024
#ifndef MAX31865_SENSOR_WIRES_2
#define MAX31865_SENSOR_WIRES_2 2
#endif
#ifndef MAX31865_WIRE_OHMS_2
#define MAX31865_WIRE_OHMS_2 0.0f
#endif
#elif TEMP_SENSOR_2 == -3
#define TEMP_SENSOR_2_IS_MAX31855 1
#define TEMP_SENSOR_2_MAX_TC_TMIN -270
#define TEMP_SENSOR_2_MAX_TC_TMAX 1800
#elif TEMP_SENSOR_2 == -2
#define TEMP_SENSOR_2_IS_MAX6675 1
#define TEMP_SENSOR_2_MAX_TC_TMIN 0
#define TEMP_SENSOR_2_MAX_TC_TMAX 1024
#endif
#if TEMP_SENSOR_2 != TEMP_SENSOR_0
#if TEMP_SENSOR_2 == -5
#error "If MAX31865 Thermocouple (-5) is used for TEMP_SENSOR_2 then TEMP_SENSOR_0 must match."
#elif TEMP_SENSOR_2 == -3
#error "If MAX31855 Thermocouple (-3) is used for TEMP_SENSOR_2 then TEMP_SENSOR_0 must match."
#elif TEMP_SENSOR_2 == -2
#error "If MAX6675 Thermocouple (-2) is used for TEMP_SENSOR_2 then TEMP_SENSOR_0 must match."
#endif
#endif
#elif TEMP_SENSOR_2 == -4
#define TEMP_SENSOR_2_IS_AD8495 1
#elif TEMP_SENSOR_2 == -1
#define TEMP_SENSOR_2_IS_AD595 1
#elif TEMP_SENSOR_2 > 0
#define TEMP_SENSOR_2_IS_THERMISTOR 1
#if TEMP_SENSOR_2 == 1000
#define TEMP_SENSOR_2_IS_CUSTOM 1
#elif TEMP_SENSOR_2 == 998 || TEMP_SENSOR_2 == 999
#define TEMP_SENSOR_2_IS_DUMMY 1
#endif
#else
#undef HEATER_2_MINTEMP
#undef HEATER_2_MAXTEMP
#endif
#if TEMP_SENSOR_IS_MAX_TC(REDUNDANT) #if TEMP_SENSOR_IS_MAX_TC(REDUNDANT)
#if TEMP_SENSOR_REDUNDANT == -5 #if TEMP_SENSOR_REDUNDANT == -5
#if !REDUNDANT_TEMP_MATCH(SOURCE, E0) && !REDUNDANT_TEMP_MATCH(SOURCE, E1) && !REDUNDANT_TEMP_MATCH(SOURCE, E2) #if !REDUNDANT_TEMP_MATCH(SOURCE, E0) && !REDUNDANT_TEMP_MATCH(SOURCE, E1)
#error "MAX31865 Thermocouples (-5) not supported for TEMP_SENSOR_REDUNDANT_SOURCE other than TEMP_SENSOR_0/TEMP_SENSOR_1/TEMP_SENSOR_2 (0/1/2)." #error "MAX31865 Thermocouples (-5) not supported for TEMP_SENSOR_REDUNDANT_SOURCE other than TEMP_SENSOR_0/TEMP_SENSOR_1 (0/1)."
#endif #endif
#define TEMP_SENSOR_REDUNDANT_IS_MAX31865 1 #define TEMP_SENSOR_REDUNDANT_IS_MAX31865 1
#define TEMP_SENSOR_REDUNDANT_MAX_TC_TMIN 0 #define TEMP_SENSOR_REDUNDANT_MAX_TC_TMIN 0
#define TEMP_SENSOR_REDUNDANT_MAX_TC_TMAX 1024 #define TEMP_SENSOR_REDUNDANT_MAX_TC_TMAX 1024
#elif TEMP_SENSOR_REDUNDANT == -3 #elif TEMP_SENSOR_REDUNDANT == -3
#if !REDUNDANT_TEMP_MATCH(SOURCE, E0) && !REDUNDANT_TEMP_MATCH(SOURCE, E1) && !REDUNDANT_TEMP_MATCH(SOURCE, E2) #if !REDUNDANT_TEMP_MATCH(SOURCE, E0) && !REDUNDANT_TEMP_MATCH(SOURCE, E1)
#error "MAX31855 Thermocouples (-3) not supported for TEMP_SENSOR_REDUNDANT_SOURCE other than TEMP_SENSOR_0/TEMP_SENSOR_1/TEMP_SENSOR_2 (0/1/2)." #error "MAX31855 Thermocouples (-3) not supported for TEMP_SENSOR_REDUNDANT_SOURCE other than TEMP_SENSOR_0/TEMP_SENSOR_1 (0/1)."
#endif #endif
#define TEMP_SENSOR_REDUNDANT_IS_MAX31855 1 #define TEMP_SENSOR_REDUNDANT_IS_MAX31855 1
#define TEMP_SENSOR_REDUNDANT_MAX_TC_TMIN -270 #define TEMP_SENSOR_REDUNDANT_MAX_TC_TMIN -270
#define TEMP_SENSOR_REDUNDANT_MAX_TC_TMAX 1800 #define TEMP_SENSOR_REDUNDANT_MAX_TC_TMAX 1800
#elif TEMP_SENSOR_REDUNDANT == -2 #elif TEMP_SENSOR_REDUNDANT == -2
#if !REDUNDANT_TEMP_MATCH(SOURCE, E0) && !REDUNDANT_TEMP_MATCH(SOURCE, E1) && !REDUNDANT_TEMP_MATCH(SOURCE, E2) #if !REDUNDANT_TEMP_MATCH(SOURCE, E0) && !REDUNDANT_TEMP_MATCH(SOURCE, E1)
#error "MAX6675 Thermocouples (-2) not supported for TEMP_SENSOR_REDUNDANT_SOURCE other than TEMP_SENSOR_0/TEMP_SENSOR_1/TEMP_SENSOR_2 (0/1/2)." #error "MAX6675 Thermocouples (-2) not supported for TEMP_SENSOR_REDUNDANT_SOURCE other than TEMP_SENSOR_0/TEMP_SENSOR_1 (0/1)."
#endif #endif
#define TEMP_SENSOR_REDUNDANT_IS_MAX6675 1 #define TEMP_SENSOR_REDUNDANT_IS_MAX6675 1
@@ -349,21 +302,15 @@
#ifndef MAX31865_SENSOR_WIRES_1 #ifndef MAX31865_SENSOR_WIRES_1
#define MAX31865_SENSOR_WIRES_1 2 #define MAX31865_SENSOR_WIRES_1 2
#endif #endif
#elif REDUNDANT_TEMP_MATCH(SOURCE, E2)
#define TEMP_SENSOR_2_MAX_TC_TMIN TEMP_SENSOR_REDUNDANT_MAX_TC_TMIN
#define TEMP_SENSOR_2_MAX_TC_TMAX TEMP_SENSOR_REDUNDANT_MAX_TC_TMAX
#ifndef MAX31865_SENSOR_WIRES_2
#define MAX31865_SENSOR_WIRES_2 2
#endif
#endif #endif
#if (TEMP_SENSOR_IS_MAX_TC(0) && TEMP_SENSOR_REDUNDANT != TEMP_SENSOR_0) || (TEMP_SENSOR_IS_MAX_TC(1) && TEMP_SENSOR_REDUNDANT != TEMP_SENSOR_1) || (TEMP_SENSOR_IS_MAX_TC(2) && TEMP_SENSOR_REDUNDANT != TEMP_SENSOR_2) #if (TEMP_SENSOR_IS_MAX_TC(0) && TEMP_SENSOR_REDUNDANT != TEMP_SENSOR_0) || (TEMP_SENSOR_IS_MAX_TC(1) && TEMP_SENSOR_REDUNDANT != TEMP_SENSOR_1)
#if TEMP_SENSOR_REDUNDANT == -5 #if TEMP_SENSOR_REDUNDANT == -5
#error "If MAX31865 Thermocouple (-5) is used for TEMP_SENSOR_0/TEMP_SENSOR_1/TEMP_SENSOR_2 then TEMP_SENSOR_REDUNDANT must match." #error "If MAX31865 Thermocouple (-5) is used for TEMP_SENSOR_0/TEMP_SENSOR_1 then TEMP_SENSOR_REDUNDANT must match."
#elif TEMP_SENSOR_REDUNDANT == -3 #elif TEMP_SENSOR_REDUNDANT == -3
#error "If MAX31855 Thermocouple (-3) is used for TEMP_SENSOR_0/TEMP_SENSOR_1/TEMP_SENSOR_2 then TEMP_SENSOR_REDUNDANT must match." #error "If MAX31855 Thermocouple (-3) is used for TEMP_SENSOR_0/TEMP_SENSOR_1 then TEMP_SENSOR_REDUNDANT must match."
#elif TEMP_SENSOR_REDUNDANT == -2 #elif TEMP_SENSOR_REDUNDANT == -2
#error "If MAX6675 Thermocouple (-2) is used for TEMP_SENSOR_0/TEMP_SENSOR_1/TEMP_SENSOR_2 then TEMP_SENSOR_REDUNDANT must match." #error "If MAX6675 Thermocouple (-2) is used for TEMP_SENSOR_0/TEMP_SENSOR_1 then TEMP_SENSOR_REDUNDANT must match."
#endif #endif
#endif #endif
#elif TEMP_SENSOR_REDUNDANT == -4 #elif TEMP_SENSOR_REDUNDANT == -4
@@ -379,19 +326,39 @@
#endif #endif
#endif #endif
#if TEMP_SENSOR_IS_MAX_TC(0) || TEMP_SENSOR_IS_MAX_TC(1) || TEMP_SENSOR_IS_MAX_TC(2) || TEMP_SENSOR_IS_MAX_TC(REDUNDANT) #if TEMP_SENSOR_IS_MAX_TC(0) || TEMP_SENSOR_IS_MAX_TC(1) || TEMP_SENSOR_IS_MAX_TC(REDUNDANT)
#define HAS_MAX_TC 1 #define HAS_MAX_TC 1
#endif #endif
#if TEMP_SENSOR_0_IS_MAX6675 || TEMP_SENSOR_1_IS_MAX6675 || TEMP_SENSOR_2_IS_MAX6675 || TEMP_SENSOR_REDUNDANT_IS_MAX6675 #if TEMP_SENSOR_0_IS_MAX6675 || TEMP_SENSOR_1_IS_MAX6675 || TEMP_SENSOR_REDUNDANT_IS_MAX6675
#define HAS_MAX6675 1 #define HAS_MAX6675 1
#endif #endif
#if TEMP_SENSOR_0_IS_MAX31855 || TEMP_SENSOR_1_IS_MAX31855 || TEMP_SENSOR_2_IS_MAX31855 || TEMP_SENSOR_REDUNDANT_IS_MAX31855 #if TEMP_SENSOR_0_IS_MAX31855 || TEMP_SENSOR_1_IS_MAX31855 || TEMP_SENSOR_REDUNDANT_IS_MAX31855
#define HAS_MAX31855 1 #define HAS_MAX31855 1
#endif #endif
#if TEMP_SENSOR_0_IS_MAX31865 || TEMP_SENSOR_1_IS_MAX31865 || TEMP_SENSOR_2_IS_MAX31865 || TEMP_SENSOR_REDUNDANT_IS_MAX31865 #if TEMP_SENSOR_0_IS_MAX31865 || TEMP_SENSOR_1_IS_MAX31865 || TEMP_SENSOR_REDUNDANT_IS_MAX31865
#define HAS_MAX31865 1 #define HAS_MAX31865 1
#endif #endif
#if TEMP_SENSOR_2 == -4
#define TEMP_SENSOR_2_IS_AD8495 1
#elif TEMP_SENSOR_2 == -3
#error "MAX31855 Thermocouples (-3) not supported for TEMP_SENSOR_2."
#elif TEMP_SENSOR_2 == -2
#error "MAX6675 Thermocouples (-2) not supported for TEMP_SENSOR_2."
#elif TEMP_SENSOR_2 == -1
#define TEMP_SENSOR_2_IS_AD595 1
#elif TEMP_SENSOR_2 > 0
#define TEMP_SENSOR_2_IS_THERMISTOR 1
#if TEMP_SENSOR_2 == 1000
#define TEMP_SENSOR_2_IS_CUSTOM 1
#elif TEMP_SENSOR_2 == 998 || TEMP_SENSOR_2 == 999
#define TEMP_SENSOR_2_IS_DUMMY 1
#endif
#else
#undef HEATER_2_MINTEMP
#undef HEATER_2_MAXTEMP
#endif
#if TEMP_SENSOR_3 == -4 #if TEMP_SENSOR_3 == -4
#define TEMP_SENSOR_3_IS_AD8495 1 #define TEMP_SENSOR_3_IS_AD8495 1
#elif TEMP_SENSOR_3 == -3 #elif TEMP_SENSOR_3 == -3
@@ -607,6 +574,9 @@
#if NUM_RUNOUT_SENSORS > 1 #if NUM_RUNOUT_SENSORS > 1
#define MULTI_FILAMENT_SENSOR 1 #define MULTI_FILAMENT_SENSOR 1
#endif #endif
#ifdef FILAMENT_RUNOUT_DISTANCE_MM
#define HAS_FILAMENT_RUNOUT_DISTANCE 1
#endif
#if ENABLED(MIXING_EXTRUDER) #if ENABLED(MIXING_EXTRUDER)
#define WATCH_ALL_RUNOUT_SENSORS #define WATCH_ALL_RUNOUT_SENSORS
#endif #endif
@@ -992,8 +962,8 @@
#undef CALIBRATION_MEASURE_IMIN #undef CALIBRATION_MEASURE_IMIN
#undef CALIBRATION_MEASURE_IMAX #undef CALIBRATION_MEASURE_IMAX
#if NUM_AXES < 3 #if NUM_AXES < 3
#undef STEALTHCHOP_Z
#undef Z_IDLE_HEIGHT #undef Z_IDLE_HEIGHT
#undef STEALTHCHOP_Z
#undef Z_PROBE_SLED #undef Z_PROBE_SLED
#undef Z_SAFE_HOMING #undef Z_SAFE_HOMING
#undef HOME_Z_FIRST #undef HOME_Z_FIRST
@@ -1003,7 +973,6 @@
#undef CNC_WORKSPACE_PLANES #undef CNC_WORKSPACE_PLANES
#if NUM_AXES < 2 #if NUM_AXES < 2
#undef STEALTHCHOP_Y #undef STEALTHCHOP_Y
#undef QUICK_HOME
#endif #endif
#endif #endif
#endif #endif
@@ -1076,7 +1045,7 @@
*/ */
#ifndef LCD_SERIAL_PORT #ifndef LCD_SERIAL_PORT
#if HAS_DWIN_E3V2 || IS_DWIN_MARLINUI || HAS_DGUS_LCD #if HAS_DWIN_E3V2 || IS_DWIN_MARLINUI || HAS_DGUS_LCD
#if MB(BTT_SKR_MINI_E3_V1_0, BTT_SKR_MINI_E3_V1_2, BTT_SKR_MINI_E3_V2_0, BTT_SKR_MINI_E3_V3_0, BTT_SKR_E3_TURBO, BTT_OCTOPUS_V1_1) #if MB(BTT_SKR_MINI_E3_V1_0, BTT_SKR_MINI_E3_V1_2, BTT_SKR_MINI_E3_V2_0, BTT_SKR_MINI_E3_V3_0, BTT_SKR_E3_TURBO)
#define LCD_SERIAL_PORT 1 #define LCD_SERIAL_PORT 1
#elif MB(CREALITY_V24S1_301, CREALITY_V24S1_301F4, CREALITY_V423, MKS_ROBIN) #elif MB(CREALITY_V24S1_301, CREALITY_V24S1_301F4, CREALITY_V423, MKS_ROBIN)
#define LCD_SERIAL_PORT 2 // Creality Ender3S1, MKS Robin #define LCD_SERIAL_PORT 2 // Creality Ender3S1, MKS Robin
@@ -1116,13 +1085,3 @@
#else #else
#define CALC_FAN_SPEED(f) (f ? map(f, 1, 255, FAN_MIN_PWM, FAN_MAX_PWM) : FAN_OFF_PWM) #define CALC_FAN_SPEED(f) (f ? map(f, 1, 255, FAN_MIN_PWM, FAN_MAX_PWM) : FAN_OFF_PWM)
#endif #endif
// Input shaping
#if !HAS_Y_AXIS
#undef INPUT_SHAPING_Y
#undef SHAPING_FREQ_Y
#undef SHAPING_BUFFER_Y
#endif
#if EITHER(INPUT_SHAPING_X, INPUT_SHAPING_Y)
#define HAS_SHAPING 1
#endif
+500 -136
View File
@@ -155,7 +155,7 @@
#define W_BED_SIZE W_MAX_LENGTH #define W_BED_SIZE W_MAX_LENGTH
#endif #endif
// Require 0,0 bed center for Delta, SCARA, and Polargraph // Require 0,0 bed center for Delta and SCARA
#if IS_KINEMATIC #if IS_KINEMATIC
#define BED_CENTER_AT_0_0 #define BED_CENTER_AT_0_0
#endif #endif
@@ -275,12 +275,10 @@
*/ */
#if IS_SCARA #if IS_SCARA
#undef SLOWDOWN #undef SLOWDOWN
#if ENABLED(AXEL_TPARA) #if DISABLED(AXEL_TPARA)
#define SCARA_PRINTABLE_RADIUS (TPARA_LINKAGE_1 + TPARA_LINKAGE_2)
#else
#define QUICK_HOME #define QUICK_HOME
#define SCARA_PRINTABLE_RADIUS (SCARA_LINKAGE_1 + SCARA_LINKAGE_2)
#endif #endif
#define SCARA_PRINTABLE_RADIUS (SCARA_LINKAGE_1 + SCARA_LINKAGE_2)
#endif #endif
/** /**
@@ -725,19 +723,19 @@
#define TEMP_0_SCK_PIN MAX31855_SCK_PIN #define TEMP_0_SCK_PIN MAX31855_SCK_PIN
#endif #endif
#elif TEMP_SENSOR_0_IS_MAX31865 #elif TEMP_SENSOR_1_IS_MAX31865
#if !PIN_EXISTS(TEMP_0_MISO) // DO #if !PIN_EXISTS(TEMP_1_MISO) // DO
#if PIN_EXISTS(MAX31865_MISO) #if PIN_EXISTS(MAX31865_MISO)
#define TEMP_0_MISO_PIN MAX31865_MISO_PIN #define TEMP_1_MISO_PIN MAX31865_MISO_PIN
#elif PIN_EXISTS(MAX31865_DO) #elif PIN_EXISTS(MAX31865_DO)
#define TEMP_0_MISO_PIN MAX31865_DO_PIN #define TEMP_1_MISO_PIN MAX31865_DO_PIN
#endif #endif
#endif #endif
#if !PIN_EXISTS(TEMP_0_SCK) && PIN_EXISTS(MAX31865_SCK) #if !PIN_EXISTS(TEMP_1_SCK) && PIN_EXISTS(MAX31865_SCK)
#define TEMP_0_SCK_PIN MAX31865_SCK_PIN #define TEMP_1_SCK_PIN MAX31865_SCK_PIN
#endif #endif
#if !PIN_EXISTS(TEMP_0_MOSI) && PIN_EXISTS(MAX31865_MOSI) // MOSI for '65 only #if !PIN_EXISTS(TEMP_1_MOSI) && PIN_EXISTS(MAX31865_MOSI) // MOSI for '65 only
#define TEMP_0_MOSI_PIN MAX31865_MOSI_PIN #define TEMP_1_MOSI_PIN MAX31865_MOSI_PIN
#endif #endif
#endif #endif
@@ -821,75 +819,6 @@
#endif // TEMP_SENSOR_IS_MAX_TC(1) #endif // TEMP_SENSOR_IS_MAX_TC(1)
#if TEMP_SENSOR_IS_MAX_TC(2) || (TEMP_SENSOR_IS_MAX_TC(REDUNDANT) && REDUNDANT_TEMP_MATCH(SOURCE, E2))
#if !PIN_EXISTS(TEMP_2_CS) // SS3, CS3
#if PIN_EXISTS(MAX6675_SS3)
#define TEMP_2_CS_PIN MAX6675_SS3_PIN
#elif PIN_EXISTS(MAX6675_CS)
#define TEMP_2_CS_PIN MAX6675_CS3_PIN
#elif PIN_EXISTS(MAX31855_SS3)
#define TEMP_2_CS_PIN MAX31855_SS3_PIN
#elif PIN_EXISTS(MAX31855_CS3)
#define TEMP_2_CS_PIN MAX31855_CS3_PIN
#elif PIN_EXISTS(MAX31865_SS3)
#define TEMP_2_CS_PIN MAX31865_SS3_PIN
#elif PIN_EXISTS(MAX31865_CS3)
#define TEMP_2_CS_PIN MAX31865_CS3_PIN
#endif
#endif
#if TEMP_SENSOR_2_IS_MAX6675
#if !PIN_EXISTS(TEMP_2_MISO) // DO
#if PIN_EXISTS(MAX6675_MISO)
#define TEMP_2_MISO_PIN MAX6675_MISO_PIN
#elif PIN_EXISTS(MAX6675_DO)
#define TEMP_2_MISO_PIN MAX6675_DO_PIN
#endif
#endif
#if !PIN_EXISTS(TEMP_2_SCK) && PIN_EXISTS(MAX6675_SCK)
#define TEMP_2_SCK_PIN MAX6675_SCK_PIN
#endif
#elif TEMP_SENSOR_2_IS_MAX31855
#if !PIN_EXISTS(TEMP_2_MISO) // DO
#if PIN_EXISTS(MAX31855_MISO)
#define TEMP_2_MISO_PIN MAX31855_MISO_PIN
#elif PIN_EXISTS(MAX31855_DO)
#define TEMP_2_MISO_PIN MAX31855_DO_PIN
#endif
#endif
#if !PIN_EXISTS(TEMP_2_SCK) && PIN_EXISTS(MAX31855_SCK)
#define TEMP_2_SCK_PIN MAX31855_SCK_PIN
#endif
#elif TEMP_SENSOR_2_IS_MAX31865
#if !PIN_EXISTS(TEMP_2_MISO) // DO
#if PIN_EXISTS(MAX31865_MISO)
#define TEMP_2_MISO_PIN MAX31865_MISO_PIN
#elif PIN_EXISTS(MAX31865_DO)
#define TEMP_2_MISO_PIN MAX31865_DO_PIN
#endif
#endif
#if !PIN_EXISTS(TEMP_2_SCK) && PIN_EXISTS(MAX31865_SCK)
#define TEMP_2_SCK_PIN MAX31865_SCK_PIN
#endif
#if !PIN_EXISTS(TEMP_2_MOSI) && PIN_EXISTS(MAX31865_MOSI) // MOSI for '65 only
#define TEMP_2_MOSI_PIN MAX31865_MOSI_PIN
#endif
#endif
// Software SPI - enable if MISO/SCK are defined.
#if PIN_EXISTS(TEMP_2_MISO) && PIN_EXISTS(TEMP_2_SCK) && DISABLED(TEMP_SENSOR_2_FORCE_HW_SPI)
#if TEMP_SENSOR_2_IS_MAX31865 && !PIN_EXISTS(TEMP_2_MOSI)
#error "TEMP_SENSOR_2 MAX31865 requires TEMP_2_MOSI_PIN defined for Software SPI. To use Hardware SPI instead, undefine MISO/SCK or enable TEMP_SENSOR_2_FORCE_HW_SPI."
#else
#define TEMP_SENSOR_2_HAS_SPI_PINS 1
#endif
#endif
#endif // TEMP_SENSOR_IS_MAX_TC(2)
// //
// User-defined thermocouple libraries // User-defined thermocouple libraries
// //
@@ -928,8 +857,56 @@
#define X2_MAX_ENDSTOP_INVERTING Z_MIN_ENDSTOP_INVERTING #define X2_MAX_ENDSTOP_INVERTING Z_MIN_ENDSTOP_INVERTING
#elif X2_USE_ENDSTOP == _ZMAX_ #elif X2_USE_ENDSTOP == _ZMAX_
#define X2_MAX_ENDSTOP_INVERTING Z_MAX_ENDSTOP_INVERTING #define X2_MAX_ENDSTOP_INVERTING Z_MAX_ENDSTOP_INVERTING
#else
#define X2_MAX_ENDSTOP_INVERTING false
#endif #endif
#endif #endif
#if !defined(X2_MAX_PIN) && !defined(X2_STOP_PIN)
#if X2_USE_ENDSTOP == _XMIN_
#define X2_MAX_PIN X_MIN_PIN
#elif X2_USE_ENDSTOP == _XMAX_
#define X2_MAX_PIN X_MAX_PIN
#elif X2_USE_ENDSTOP == _XSTOP_
#define X2_MAX_PIN X_STOP_PIN
#elif X2_USE_ENDSTOP == _YMIN_
#define X2_MAX_PIN Y_MIN_PIN
#elif X2_USE_ENDSTOP == _YMAX_
#define X2_MAX_PIN Y_MAX_PIN
#elif X2_USE_ENDSTOP == _YSTOP_
#define X2_MAX_PIN Y_STOP_PIN
#elif X2_USE_ENDSTOP == _ZMIN_
#define X2_MAX_PIN Z_MIN_PIN
#elif X2_USE_ENDSTOP == _ZMAX_
#define X2_MAX_PIN Z_MAX_PIN
#elif X2_USE_ENDSTOP == _ZSTOP_
#define X2_MAX_PIN Z_STOP_PIN
#elif X2_USE_ENDSTOP == _XDIAG_
#define X2_MAX_PIN X_DIAG_PIN
#elif X2_USE_ENDSTOP == _YDIAG_
#define X2_MAX_PIN Y_DIAG_PIN
#elif X2_USE_ENDSTOP == _ZDIAG_
#define X2_MAX_PIN Z_DIAG_PIN
#elif X2_USE_ENDSTOP == _E0DIAG_
#define X2_MAX_PIN E0_DIAG_PIN
#elif X2_USE_ENDSTOP == _E1DIAG_
#define X2_MAX_PIN E1_DIAG_PIN
#elif X2_USE_ENDSTOP == _E2DIAG_
#define X2_MAX_PIN E2_DIAG_PIN
#elif X2_USE_ENDSTOP == _E3DIAG_
#define X2_MAX_PIN E3_DIAG_PIN
#elif X2_USE_ENDSTOP == _E4DIAG_
#define X2_MAX_PIN E4_DIAG_PIN
#elif X2_USE_ENDSTOP == _E5DIAG_
#define X2_MAX_PIN E5_DIAG_PIN
#elif X2_USE_ENDSTOP == _E6DIAG_
#define X2_MAX_PIN E6_DIAG_PIN
#elif X2_USE_ENDSTOP == _E7DIAG_
#define X2_MAX_PIN E7_DIAG_PIN
#endif
#endif
#ifndef X2_MIN_ENDSTOP_INVERTING
#define X2_MIN_ENDSTOP_INVERTING false
#endif
#else #else
#ifndef X2_MIN_ENDSTOP_INVERTING #ifndef X2_MIN_ENDSTOP_INVERTING
#if X2_USE_ENDSTOP == _XMIN_ #if X2_USE_ENDSTOP == _XMIN_
@@ -944,14 +921,56 @@
#define X2_MIN_ENDSTOP_INVERTING Z_MIN_ENDSTOP_INVERTING #define X2_MIN_ENDSTOP_INVERTING Z_MIN_ENDSTOP_INVERTING
#elif X2_USE_ENDSTOP == _ZMAX_ #elif X2_USE_ENDSTOP == _ZMAX_
#define X2_MIN_ENDSTOP_INVERTING Z_MAX_ENDSTOP_INVERTING #define X2_MIN_ENDSTOP_INVERTING Z_MAX_ENDSTOP_INVERTING
#else
#define X2_MIN_ENDSTOP_INVERTING false
#endif #endif
#endif #endif
#endif #if !defined(X2_MIN_PIN) && !defined(X2_STOP_PIN)
#ifndef X2_MAX_ENDSTOP_INVERTING #if X2_USE_ENDSTOP == _XMIN_
#define X2_MAX_ENDSTOP_INVERTING false #define X2_MIN_PIN X_MIN_PIN
#endif #elif X2_USE_ENDSTOP == _XMAX_
#ifndef X2_MIN_ENDSTOP_INVERTING #define X2_MIN_PIN X_MAX_PIN
#define X2_MIN_ENDSTOP_INVERTING false #elif X2_USE_ENDSTOP == _XSTOP_
#define X2_MIN_PIN X_STOP_PIN
#elif X2_USE_ENDSTOP == _YMIN_
#define X2_MIN_PIN Y_MIN_PIN
#elif X2_USE_ENDSTOP == _YMAX_
#define X2_MIN_PIN Y_MAX_PIN
#elif X2_USE_ENDSTOP == _YSTOP_
#define X2_MIN_PIN Y_STOP_PIN
#elif X2_USE_ENDSTOP == _ZMIN_
#define X2_MIN_PIN Z_MIN_PIN
#elif X2_USE_ENDSTOP == _ZMAX_
#define X2_MIN_PIN Z_MAX_PIN
#elif X2_USE_ENDSTOP == _ZSTOP_
#define X2_MIN_PIN Z_STOP_PIN
#elif X2_USE_ENDSTOP == _XDIAG_
#define X2_MIN_PIN X_DIAG_PIN
#elif X2_USE_ENDSTOP == _YDIAG_
#define X2_MIN_PIN Y_DIAG_PIN
#elif X2_USE_ENDSTOP == _ZDIAG_
#define X2_MIN_PIN Z_DIAG_PIN
#elif X2_USE_ENDSTOP == _E0DIAG_
#define X2_MIN_PIN E0_DIAG_PIN
#elif X2_USE_ENDSTOP == _E1DIAG_
#define X2_MIN_PIN E1_DIAG_PIN
#elif X2_USE_ENDSTOP == _E2DIAG_
#define X2_MIN_PIN E2_DIAG_PIN
#elif X2_USE_ENDSTOP == _E3DIAG_
#define X2_MIN_PIN E3_DIAG_PIN
#elif X2_USE_ENDSTOP == _E4DIAG_
#define X2_MIN_PIN E4_DIAG_PIN
#elif X2_USE_ENDSTOP == _E5DIAG_
#define X2_MIN_PIN E5_DIAG_PIN
#elif X2_USE_ENDSTOP == _E6DIAG_
#define X2_MIN_PIN E6_DIAG_PIN
#elif X2_USE_ENDSTOP == _E7DIAG_
#define X2_MIN_PIN E7_DIAG_PIN
#endif
#endif
#ifndef X2_MAX_ENDSTOP_INVERTING
#define X2_MAX_ENDSTOP_INVERTING false
#endif
#endif #endif
#endif #endif
@@ -973,8 +992,56 @@
#define Y2_MAX_ENDSTOP_INVERTING Z_MIN_ENDSTOP_INVERTING #define Y2_MAX_ENDSTOP_INVERTING Z_MIN_ENDSTOP_INVERTING
#elif Y2_USE_ENDSTOP == _ZMAX_ #elif Y2_USE_ENDSTOP == _ZMAX_
#define Y2_MAX_ENDSTOP_INVERTING Z_MAX_ENDSTOP_INVERTING #define Y2_MAX_ENDSTOP_INVERTING Z_MAX_ENDSTOP_INVERTING
#else
#define Y2_MAX_ENDSTOP_INVERTING false
#endif #endif
#endif #endif
#if !defined(Y2_MAX_PIN) && !defined(Y2_STOP_PIN)
#if Y2_USE_ENDSTOP == _XMIN_
#define Y2_MAX_PIN X_MIN_PIN
#elif Y2_USE_ENDSTOP == _XMAX_
#define Y2_MAX_PIN X_MAX_PIN
#elif Y2_USE_ENDSTOP == _XSTOP_
#define Y2_MAX_PIN X_STOP_PIN
#elif Y2_USE_ENDSTOP == _YMIN_
#define Y2_MAX_PIN Y_MIN_PIN
#elif Y2_USE_ENDSTOP == _YMAX_
#define Y2_MAX_PIN Y_MAX_PIN
#elif Y2_USE_ENDSTOP == _YSTOP_
#define Y2_MAX_PIN Y_STOP_PIN
#elif Y2_USE_ENDSTOP == _ZMIN_
#define Y2_MAX_PIN Z_MIN_PIN
#elif Y2_USE_ENDSTOP == _ZMAX_
#define Y2_MAX_PIN Z_MAX_PIN
#elif Y2_USE_ENDSTOP == _ZSTOP_
#define Y2_MAX_PIN Z_STOP_PIN
#elif Y2_USE_ENDSTOP == _XDIAG_
#define Y2_MAX_PIN X_DIAG_PIN
#elif Y2_USE_ENDSTOP == _YDIAG_
#define Y2_MAX_PIN Y_DIAG_PIN
#elif Y2_USE_ENDSTOP == _ZDIAG_
#define Y2_MAX_PIN Z_DIAG_PIN
#elif Y2_USE_ENDSTOP == _E0DIAG_
#define Y2_MAX_PIN E0_DIAG_PIN
#elif Y2_USE_ENDSTOP == _E1DIAG_
#define Y2_MAX_PIN E1_DIAG_PIN
#elif Y2_USE_ENDSTOP == _E2DIAG_
#define Y2_MAX_PIN E2_DIAG_PIN
#elif Y2_USE_ENDSTOP == _E3DIAG_
#define Y2_MAX_PIN E3_DIAG_PIN
#elif Y2_USE_ENDSTOP == _E4DIAG_
#define Y2_MAX_PIN E4_DIAG_PIN
#elif Y2_USE_ENDSTOP == _E5DIAG_
#define Y2_MAX_PIN E5_DIAG_PIN
#elif Y2_USE_ENDSTOP == _E6DIAG_
#define Y2_MAX_PIN E6_DIAG_PIN
#elif Y2_USE_ENDSTOP == _E7DIAG_
#define Y2_MAX_PIN E7_DIAG_PIN
#endif
#endif
#ifndef Y2_MIN_ENDSTOP_INVERTING
#define Y2_MIN_ENDSTOP_INVERTING false
#endif
#else #else
#ifndef Y2_MIN_ENDSTOP_INVERTING #ifndef Y2_MIN_ENDSTOP_INVERTING
#if Y2_USE_ENDSTOP == _XMIN_ #if Y2_USE_ENDSTOP == _XMIN_
@@ -989,14 +1056,56 @@
#define Y2_MIN_ENDSTOP_INVERTING Z_MIN_ENDSTOP_INVERTING #define Y2_MIN_ENDSTOP_INVERTING Z_MIN_ENDSTOP_INVERTING
#elif Y2_USE_ENDSTOP == _ZMAX_ #elif Y2_USE_ENDSTOP == _ZMAX_
#define Y2_MIN_ENDSTOP_INVERTING Z_MAX_ENDSTOP_INVERTING #define Y2_MIN_ENDSTOP_INVERTING Z_MAX_ENDSTOP_INVERTING
#else
#define Y2_MIN_ENDSTOP_INVERTING false
#endif #endif
#endif #endif
#endif #if !defined(Y2_MIN_PIN) && !defined(Y2_STOP_PIN)
#ifndef Y2_MAX_ENDSTOP_INVERTING #if Y2_USE_ENDSTOP == _XMIN_
#define Y2_MAX_ENDSTOP_INVERTING false #define Y2_MIN_PIN X_MIN_PIN
#endif #elif Y2_USE_ENDSTOP == _XMAX_
#ifndef Y2_MIN_ENDSTOP_INVERTING #define Y2_MIN_PIN X_MAX_PIN
#define Y2_MIN_ENDSTOP_INVERTING false #elif Y2_USE_ENDSTOP == _XSTOP_
#define Y2_MIN_PIN X_STOP_PIN
#elif Y2_USE_ENDSTOP == _YMIN_
#define Y2_MIN_PIN Y_MIN_PIN
#elif Y2_USE_ENDSTOP == _YMAX_
#define Y2_MIN_PIN Y_MAX_PIN
#elif Y2_USE_ENDSTOP == _YSTOP_
#define Y2_MIN_PIN Y_STOP_PIN
#elif Y2_USE_ENDSTOP == _ZMIN_
#define Y2_MIN_PIN Z_MIN_PIN
#elif Y2_USE_ENDSTOP == _ZMAX_
#define Y2_MIN_PIN Z_MAX_PIN
#elif Y2_USE_ENDSTOP == _ZSTOP_
#define Y2_MIN_PIN Z_STOP_PIN
#elif Y2_USE_ENDSTOP == _XDIAG_
#define Y2_MIN_PIN X_DIAG_PIN
#elif Y2_USE_ENDSTOP == _YDIAG_
#define Y2_MIN_PIN Y_DIAG_PIN
#elif Y2_USE_ENDSTOP == _ZDIAG_
#define Y2_MIN_PIN Z_DIAG_PIN
#elif Y2_USE_ENDSTOP == _E0DIAG_
#define Y2_MIN_PIN E0_DIAG_PIN
#elif Y2_USE_ENDSTOP == _E1DIAG_
#define Y2_MIN_PIN E1_DIAG_PIN
#elif Y2_USE_ENDSTOP == _E2DIAG_
#define Y2_MIN_PIN E2_DIAG_PIN
#elif Y2_USE_ENDSTOP == _E3DIAG_
#define Y2_MIN_PIN E3_DIAG_PIN
#elif Y2_USE_ENDSTOP == _E4DIAG_
#define Y2_MIN_PIN E4_DIAG_PIN
#elif Y2_USE_ENDSTOP == _E5DIAG_
#define Y2_MIN_PIN E5_DIAG_PIN
#elif Y2_USE_ENDSTOP == _E6DIAG_
#define Y2_MIN_PIN E6_DIAG_PIN
#elif Y2_USE_ENDSTOP == _E7DIAG_
#define Y2_MIN_PIN E7_DIAG_PIN
#endif
#endif
#ifndef Y2_MAX_ENDSTOP_INVERTING
#define Y2_MAX_ENDSTOP_INVERTING false
#endif
#endif #endif
#endif #endif
@@ -1019,8 +1128,56 @@
#define Z2_MAX_ENDSTOP_INVERTING Z_MIN_ENDSTOP_INVERTING #define Z2_MAX_ENDSTOP_INVERTING Z_MIN_ENDSTOP_INVERTING
#elif Z2_USE_ENDSTOP == _ZMAX_ #elif Z2_USE_ENDSTOP == _ZMAX_
#define Z2_MAX_ENDSTOP_INVERTING Z_MAX_ENDSTOP_INVERTING #define Z2_MAX_ENDSTOP_INVERTING Z_MAX_ENDSTOP_INVERTING
#else
#define Z2_MAX_ENDSTOP_INVERTING false
#endif #endif
#endif #endif
#if !defined(Z2_MAX_PIN) && !defined(Z2_STOP_PIN)
#if Z2_USE_ENDSTOP == _XMIN_
#define Z2_MAX_PIN X_MIN_PIN
#elif Z2_USE_ENDSTOP == _XMAX_
#define Z2_MAX_PIN X_MAX_PIN
#elif Z2_USE_ENDSTOP == _XSTOP_
#define Z2_MAX_PIN X_STOP_PIN
#elif Z2_USE_ENDSTOP == _YMIN_
#define Z2_MAX_PIN Y_MIN_PIN
#elif Z2_USE_ENDSTOP == _YMAX_
#define Z2_MAX_PIN Y_MAX_PIN
#elif Z2_USE_ENDSTOP == _YSTOP_
#define Z2_MAX_PIN Y_STOP_PIN
#elif Z2_USE_ENDSTOP == _ZMIN_
#define Z2_MAX_PIN Z_MIN_PIN
#elif Z2_USE_ENDSTOP == _ZMAX_
#define Z2_MAX_PIN Z_MAX_PIN
#elif Z2_USE_ENDSTOP == _ZSTOP_
#define Z2_MAX_PIN Z_STOP_PIN
#elif Z2_USE_ENDSTOP == _XDIAG_
#define Z2_MAX_PIN X_DIAG_PIN
#elif Z2_USE_ENDSTOP == _YDIAG_
#define Z2_MAX_PIN Y_DIAG_PIN
#elif Z2_USE_ENDSTOP == _ZDIAG_
#define Z2_MAX_PIN Z_DIAG_PIN
#elif Z2_USE_ENDSTOP == _E0DIAG_
#define Z2_MAX_PIN E0_DIAG_PIN
#elif Z2_USE_ENDSTOP == _E1DIAG_
#define Z2_MAX_PIN E1_DIAG_PIN
#elif Z2_USE_ENDSTOP == _E2DIAG_
#define Z2_MAX_PIN E2_DIAG_PIN
#elif Z2_USE_ENDSTOP == _E3DIAG_
#define Z2_MAX_PIN E3_DIAG_PIN
#elif Z2_USE_ENDSTOP == _E4DIAG_
#define Z2_MAX_PIN E4_DIAG_PIN
#elif Z2_USE_ENDSTOP == _E5DIAG_
#define Z2_MAX_PIN E5_DIAG_PIN
#elif Z2_USE_ENDSTOP == _E6DIAG_
#define Z2_MAX_PIN E6_DIAG_PIN
#elif Z2_USE_ENDSTOP == _E7DIAG_
#define Z2_MAX_PIN E7_DIAG_PIN
#endif
#endif
#ifndef Z2_MIN_ENDSTOP_INVERTING
#define Z2_MIN_ENDSTOP_INVERTING false
#endif
#else #else
#ifndef Z2_MIN_ENDSTOP_INVERTING #ifndef Z2_MIN_ENDSTOP_INVERTING
#if Z2_USE_ENDSTOP == _XMIN_ #if Z2_USE_ENDSTOP == _XMIN_
@@ -1035,14 +1192,56 @@
#define Z2_MIN_ENDSTOP_INVERTING Z_MIN_ENDSTOP_INVERTING #define Z2_MIN_ENDSTOP_INVERTING Z_MIN_ENDSTOP_INVERTING
#elif Z2_USE_ENDSTOP == _ZMAX_ #elif Z2_USE_ENDSTOP == _ZMAX_
#define Z2_MIN_ENDSTOP_INVERTING Z_MAX_ENDSTOP_INVERTING #define Z2_MIN_ENDSTOP_INVERTING Z_MAX_ENDSTOP_INVERTING
#else
#define Z2_MIN_ENDSTOP_INVERTING false
#endif #endif
#endif #endif
#endif #ifndef Z2_MIN_PIN
#ifndef Z2_MAX_ENDSTOP_INVERTING #if Z2_USE_ENDSTOP == _XMIN_
#define Z2_MAX_ENDSTOP_INVERTING false #define Z2_MIN_PIN X_MIN_PIN
#endif #elif Z2_USE_ENDSTOP == _XMAX_
#ifndef Z2_MIN_ENDSTOP_INVERTING #define Z2_MIN_PIN X_MAX_PIN
#define Z2_MIN_ENDSTOP_INVERTING false #elif Z2_USE_ENDSTOP == _XSTOP_
#define Z2_MIN_PIN X_STOP_PIN
#elif Z2_USE_ENDSTOP == _YMIN_
#define Z2_MIN_PIN Y_MIN_PIN
#elif Z2_USE_ENDSTOP == _YMAX_
#define Z2_MIN_PIN Y_MAX_PIN
#elif Z2_USE_ENDSTOP == _YSTOP_
#define Z2_MIN_PIN Y_STOP_PIN
#elif Z2_USE_ENDSTOP == _ZMIN_
#define Z2_MIN_PIN Z_MIN_PIN
#elif Z2_USE_ENDSTOP == _ZMAX_
#define Z2_MIN_PIN Z_MAX_PIN
#elif Z2_USE_ENDSTOP == _ZSTOP_
#define Z2_MIN_PIN Z_STOP_PIN
#elif Z2_USE_ENDSTOP == _XDIAG_
#define Z2_MIN_PIN X_DIAG_PIN
#elif Z2_USE_ENDSTOP == _YDIAG_
#define Z2_MIN_PIN Y_DIAG_PIN
#elif Z2_USE_ENDSTOP == _ZDIAG_
#define Z2_MIN_PIN Z_DIAG_PIN
#elif Z2_USE_ENDSTOP == _E0DIAG_
#define Z2_MIN_PIN E0_DIAG_PIN
#elif Z2_USE_ENDSTOP == _E1DIAG_
#define Z2_MIN_PIN E1_DIAG_PIN
#elif Z2_USE_ENDSTOP == _E2DIAG_
#define Z2_MIN_PIN E2_DIAG_PIN
#elif Z2_USE_ENDSTOP == _E3DIAG_
#define Z2_MIN_PIN E3_DIAG_PIN
#elif Z2_USE_ENDSTOP == _E4DIAG_
#define Z2_MIN_PIN E4_DIAG_PIN
#elif Z2_USE_ENDSTOP == _E5DIAG_
#define Z2_MIN_PIN E5_DIAG_PIN
#elif Z2_USE_ENDSTOP == _E6DIAG_
#define Z2_MIN_PIN E6_DIAG_PIN
#elif Z2_USE_ENDSTOP == _E7DIAG_
#define Z2_MIN_PIN E7_DIAG_PIN
#endif
#endif
#ifndef Z2_MAX_ENDSTOP_INVERTING
#define Z2_MAX_ENDSTOP_INVERTING false
#endif
#endif #endif
#if NUM_Z_STEPPERS >= 3 #if NUM_Z_STEPPERS >= 3
@@ -1060,8 +1259,56 @@
#define Z3_MAX_ENDSTOP_INVERTING Z_MIN_ENDSTOP_INVERTING #define Z3_MAX_ENDSTOP_INVERTING Z_MIN_ENDSTOP_INVERTING
#elif Z3_USE_ENDSTOP == _ZMAX_ #elif Z3_USE_ENDSTOP == _ZMAX_
#define Z3_MAX_ENDSTOP_INVERTING Z_MAX_ENDSTOP_INVERTING #define Z3_MAX_ENDSTOP_INVERTING Z_MAX_ENDSTOP_INVERTING
#else
#define Z3_MAX_ENDSTOP_INVERTING false
#endif #endif
#endif #endif
#ifndef Z3_MAX_PIN
#if Z3_USE_ENDSTOP == _XMIN_
#define Z3_MAX_PIN X_MIN_PIN
#elif Z3_USE_ENDSTOP == _XMAX_
#define Z3_MAX_PIN X_MAX_PIN
#elif Z3_USE_ENDSTOP == _XSTOP_
#define Z3_MAX_PIN X_STOP_PIN
#elif Z3_USE_ENDSTOP == _YMIN_
#define Z3_MAX_PIN Y_MIN_PIN
#elif Z3_USE_ENDSTOP == _YMAX_
#define Z3_MAX_PIN Y_MAX_PIN
#elif Z3_USE_ENDSTOP == _YSTOP_
#define Z3_MAX_PIN Y_STOP_PIN
#elif Z3_USE_ENDSTOP == _ZMIN_
#define Z3_MAX_PIN Z_MIN_PIN
#elif Z3_USE_ENDSTOP == _ZMAX_
#define Z3_MAX_PIN Z_MAX_PIN
#elif Z3_USE_ENDSTOP == _ZSTOP_
#define Z3_MAX_PIN Z_STOP_PIN
#elif Z3_USE_ENDSTOP == _XDIAG_
#define Z3_MAX_PIN X_DIAG_PIN
#elif Z3_USE_ENDSTOP == _YDIAG_
#define Z3_MAX_PIN Y_DIAG_PIN
#elif Z3_USE_ENDSTOP == _ZDIAG_
#define Z3_MAX_PIN Z_DIAG_PIN
#elif Z3_USE_ENDSTOP == _E0DIAG_
#define Z3_MAX_PIN E0_DIAG_PIN
#elif Z3_USE_ENDSTOP == _E1DIAG_
#define Z3_MAX_PIN E1_DIAG_PIN
#elif Z3_USE_ENDSTOP == _E2DIAG_
#define Z3_MAX_PIN E2_DIAG_PIN
#elif Z3_USE_ENDSTOP == _E3DIAG_
#define Z3_MAX_PIN E3_DIAG_PIN
#elif Z3_USE_ENDSTOP == _E4DIAG_
#define Z3_MAX_PIN E4_DIAG_PIN
#elif Z3_USE_ENDSTOP == _E5DIAG_
#define Z3_MAX_PIN E5_DIAG_PIN
#elif Z3_USE_ENDSTOP == _E6DIAG_
#define Z3_MAX_PIN E6_DIAG_PIN
#elif Z3_USE_ENDSTOP == _E7DIAG_
#define Z3_MAX_PIN E7_DIAG_PIN
#endif
#endif
#ifndef Z3_MIN_ENDSTOP_INVERTING
#define Z3_MIN_ENDSTOP_INVERTING false
#endif
#else #else
#ifndef Z3_MIN_ENDSTOP_INVERTING #ifndef Z3_MIN_ENDSTOP_INVERTING
#if Z3_USE_ENDSTOP == _XMIN_ #if Z3_USE_ENDSTOP == _XMIN_
@@ -1076,14 +1323,56 @@
#define Z3_MIN_ENDSTOP_INVERTING Z_MIN_ENDSTOP_INVERTING #define Z3_MIN_ENDSTOP_INVERTING Z_MIN_ENDSTOP_INVERTING
#elif Z3_USE_ENDSTOP == _ZMAX_ #elif Z3_USE_ENDSTOP == _ZMAX_
#define Z3_MIN_ENDSTOP_INVERTING Z_MAX_ENDSTOP_INVERTING #define Z3_MIN_ENDSTOP_INVERTING Z_MAX_ENDSTOP_INVERTING
#else
#define Z3_MIN_ENDSTOP_INVERTING false
#endif #endif
#endif #endif
#endif #ifndef Z3_MIN_PIN
#ifndef Z3_MAX_ENDSTOP_INVERTING #if Z3_USE_ENDSTOP == _XMIN_
#define Z3_MAX_ENDSTOP_INVERTING false #define Z3_MIN_PIN X_MIN_PIN
#endif #elif Z3_USE_ENDSTOP == _XMAX_
#ifndef Z3_MIN_ENDSTOP_INVERTING #define Z3_MIN_PIN X_MAX_PIN
#define Z3_MIN_ENDSTOP_INVERTING false #elif Z3_USE_ENDSTOP == _XSTOP_
#define Z3_MIN_PIN X_STOP_PIN
#elif Z3_USE_ENDSTOP == _YMIN_
#define Z3_MIN_PIN Y_MIN_PIN
#elif Z3_USE_ENDSTOP == _YMAX_
#define Z3_MIN_PIN Y_MAX_PIN
#elif Z3_USE_ENDSTOP == _YSTOP_
#define Z3_MIN_PIN Y_STOP_PIN
#elif Z3_USE_ENDSTOP == _ZMIN_
#define Z3_MIN_PIN Z_MIN_PIN
#elif Z3_USE_ENDSTOP == _ZMAX_
#define Z3_MIN_PIN Z_MAX_PIN
#elif Z3_USE_ENDSTOP == _ZSTOP_
#define Z3_MIN_PIN Z_STOP_PIN
#elif Z3_USE_ENDSTOP == _XDIAG_
#define Z3_MIN_PIN X_DIAG_PIN
#elif Z3_USE_ENDSTOP == _YDIAG_
#define Z3_MIN_PIN Y_DIAG_PIN
#elif Z3_USE_ENDSTOP == _ZDIAG_
#define Z3_MIN_PIN Z_DIAG_PIN
#elif Z3_USE_ENDSTOP == _E0DIAG_
#define Z3_MIN_PIN E0_DIAG_PIN
#elif Z3_USE_ENDSTOP == _E1DIAG_
#define Z3_MIN_PIN E1_DIAG_PIN
#elif Z3_USE_ENDSTOP == _E2DIAG_
#define Z3_MIN_PIN E2_DIAG_PIN
#elif Z3_USE_ENDSTOP == _E3DIAG_
#define Z3_MIN_PIN E3_DIAG_PIN
#elif Z3_USE_ENDSTOP == _E4DIAG_
#define Z3_MIN_PIN E4_DIAG_PIN
#elif Z3_USE_ENDSTOP == _E5DIAG_
#define Z3_MIN_PIN E5_DIAG_PIN
#elif Z3_USE_ENDSTOP == _E6DIAG_
#define Z3_MIN_PIN E6_DIAG_PIN
#elif Z3_USE_ENDSTOP == _E7DIAG_
#define Z3_MIN_PIN E7_DIAG_PIN
#endif
#endif
#ifndef Z3_MAX_ENDSTOP_INVERTING
#define Z3_MAX_ENDSTOP_INVERTING false
#endif
#endif #endif
#endif #endif
@@ -1102,8 +1391,56 @@
#define Z4_MAX_ENDSTOP_INVERTING Z_MIN_ENDSTOP_INVERTING #define Z4_MAX_ENDSTOP_INVERTING Z_MIN_ENDSTOP_INVERTING
#elif Z4_USE_ENDSTOP == _ZMAX_ #elif Z4_USE_ENDSTOP == _ZMAX_
#define Z4_MAX_ENDSTOP_INVERTING Z_MAX_ENDSTOP_INVERTING #define Z4_MAX_ENDSTOP_INVERTING Z_MAX_ENDSTOP_INVERTING
#else
#define Z4_MAX_ENDSTOP_INVERTING false
#endif #endif
#endif #endif
#ifndef Z4_MAX_PIN
#if Z4_USE_ENDSTOP == _XMIN_
#define Z4_MAX_PIN X_MIN_PIN
#elif Z4_USE_ENDSTOP == _XMAX_
#define Z4_MAX_PIN X_MAX_PIN
#elif Z4_USE_ENDSTOP == _XSTOP_
#define Z4_MAX_PIN X_STOP_PIN
#elif Z4_USE_ENDSTOP == _YMIN_
#define Z4_MAX_PIN Y_MIN_PIN
#elif Z4_USE_ENDSTOP == _YMAX_
#define Z4_MAX_PIN Y_MAX_PIN
#elif Z4_USE_ENDSTOP == _YSTOP_
#define Z4_MAX_PIN Y_STOP_PIN
#elif Z4_USE_ENDSTOP == _ZMIN_
#define Z4_MAX_PIN Z_MIN_PIN
#elif Z4_USE_ENDSTOP == _ZMAX_
#define Z4_MAX_PIN Z_MAX_PIN
#elif Z4_USE_ENDSTOP == _ZSTOP_
#define Z4_MAX_PIN Z_STOP_PIN
#elif Z4_USE_ENDSTOP == _XDIAG_
#define Z4_MAX_PIN X_DIAG_PIN
#elif Z4_USE_ENDSTOP == _YDIAG_
#define Z4_MAX_PIN Y_DIAG_PIN
#elif Z4_USE_ENDSTOP == _ZDIAG_
#define Z4_MAX_PIN Z_DIAG_PIN
#elif Z4_USE_ENDSTOP == _E0DIAG_
#define Z4_MAX_PIN E0_DIAG_PIN
#elif Z4_USE_ENDSTOP == _E1DIAG_
#define Z4_MAX_PIN E1_DIAG_PIN
#elif Z4_USE_ENDSTOP == _E2DIAG_
#define Z4_MAX_PIN E2_DIAG_PIN
#elif Z4_USE_ENDSTOP == _E3DIAG_
#define Z4_MAX_PIN E3_DIAG_PIN
#elif Z4_USE_ENDSTOP == _E4DIAG_
#define Z4_MAX_PIN E4_DIAG_PIN
#elif Z4_USE_ENDSTOP == _E5DIAG_
#define Z4_MAX_PIN E5_DIAG_PIN
#elif Z4_USE_ENDSTOP == _E6DIAG_
#define Z4_MAX_PIN E6_DIAG_PIN
#elif Z4_USE_ENDSTOP == _E7DIAG_
#define Z4_MAX_PIN E7_DIAG_PIN
#endif
#endif
#ifndef Z4_MIN_ENDSTOP_INVERTING
#define Z4_MIN_ENDSTOP_INVERTING false
#endif
#else #else
#ifndef Z4_MIN_ENDSTOP_INVERTING #ifndef Z4_MIN_ENDSTOP_INVERTING
#if Z4_USE_ENDSTOP == _XMIN_ #if Z4_USE_ENDSTOP == _XMIN_
@@ -1118,14 +1455,56 @@
#define Z4_MIN_ENDSTOP_INVERTING Z_MIN_ENDSTOP_INVERTING #define Z4_MIN_ENDSTOP_INVERTING Z_MIN_ENDSTOP_INVERTING
#elif Z4_USE_ENDSTOP == _ZMAX_ #elif Z4_USE_ENDSTOP == _ZMAX_
#define Z4_MIN_ENDSTOP_INVERTING Z_MAX_ENDSTOP_INVERTING #define Z4_MIN_ENDSTOP_INVERTING Z_MAX_ENDSTOP_INVERTING
#else
#define Z4_MIN_ENDSTOP_INVERTING false
#endif #endif
#endif #endif
#endif #ifndef Z4_MIN_PIN
#ifndef Z4_MAX_ENDSTOP_INVERTING #if Z4_USE_ENDSTOP == _XMIN_
#define Z4_MAX_ENDSTOP_INVERTING false #define Z4_MIN_PIN X_MIN_PIN
#endif #elif Z4_USE_ENDSTOP == _XMAX_
#ifndef Z4_MIN_ENDSTOP_INVERTING #define Z4_MIN_PIN X_MAX_PIN
#define Z4_MIN_ENDSTOP_INVERTING false #elif Z4_USE_ENDSTOP == _XSTOP_
#define Z4_MIN_PIN X_STOP_PIN
#elif Z4_USE_ENDSTOP == _YMIN_
#define Z4_MIN_PIN Y_MIN_PIN
#elif Z4_USE_ENDSTOP == _YMAX_
#define Z4_MIN_PIN Y_MAX_PIN
#elif Z4_USE_ENDSTOP == _YSTOP_
#define Z4_MIN_PIN Y_STOP_PIN
#elif Z4_USE_ENDSTOP == _ZMIN_
#define Z4_MIN_PIN Z_MIN_PIN
#elif Z4_USE_ENDSTOP == _ZMAX_
#define Z4_MIN_PIN Z_MAX_PIN
#elif Z4_USE_ENDSTOP == _ZSTOP_
#define Z4_MIN_PIN Z_STOP_PIN
#elif Z4_USE_ENDSTOP == _XDIAG_
#define Z4_MIN_PIN X_DIAG_PIN
#elif Z4_USE_ENDSTOP == _YDIAG_
#define Z4_MIN_PIN Y_DIAG_PIN
#elif Z4_USE_ENDSTOP == _ZDIAG_
#define Z4_MIN_PIN Z_DIAG_PIN
#elif Z4_USE_ENDSTOP == _E0DIAG_
#define Z4_MIN_PIN E0_DIAG_PIN
#elif Z4_USE_ENDSTOP == _E1DIAG_
#define Z4_MIN_PIN E1_DIAG_PIN
#elif Z4_USE_ENDSTOP == _E2DIAG_
#define Z4_MIN_PIN E2_DIAG_PIN
#elif Z4_USE_ENDSTOP == _E3DIAG_
#define Z4_MIN_PIN E3_DIAG_PIN
#elif Z4_USE_ENDSTOP == _E4DIAG_
#define Z4_MIN_PIN E4_DIAG_PIN
#elif Z4_USE_ENDSTOP == _E5DIAG_
#define Z4_MIN_PIN E5_DIAG_PIN
#elif Z4_USE_ENDSTOP == _E6DIAG_
#define Z4_MIN_PIN E6_DIAG_PIN
#elif Z4_USE_ENDSTOP == _E7DIAG_
#define Z4_MIN_PIN E7_DIAG_PIN
#endif
#endif
#ifndef Z4_MAX_ENDSTOP_INVERTING
#define Z4_MAX_ENDSTOP_INVERTING false
#endif
#endif #endif
#endif #endif
@@ -2067,15 +2446,15 @@
// //
// Flag the indexed hardware serial ports in use // Flag the indexed hardware serial ports in use
#define SERIAL_IN_USE(N) ( (defined(SERIAL_PORT) && N == SERIAL_PORT) \ #define CONF_SERIAL_IS(N) ( (defined(SERIAL_PORT) && SERIAL_PORT == N) \
|| (defined(SERIAL_PORT_2) && N == SERIAL_PORT_2) \ || (defined(SERIAL_PORT_2) && SERIAL_PORT_2 == N) \
|| (defined(SERIAL_PORT_3) && N == SERIAL_PORT_3) \ || (defined(SERIAL_PORT_3) && SERIAL_PORT_3 == N) \
|| (defined(MMU2_SERIAL_PORT) && N == MMU2_SERIAL_PORT) \ || (defined(MMU2_SERIAL_PORT) && MMU2_SERIAL_PORT == N) \
|| (defined(LCD_SERIAL_PORT) && N == LCD_SERIAL_PORT) ) || (defined(LCD_SERIAL_PORT) && LCD_SERIAL_PORT == N) )
// Flag the named hardware serial ports in use // Flag the named hardware serial ports in use
#define TMC_UART_IS(A,N) (defined(A##_HARDWARE_SERIAL) && (CAT(HW_,A##_HARDWARE_SERIAL) == HW_Serial##N || CAT(HW_,A##_HARDWARE_SERIAL) == HW_MSerial##N)) #define TMC_UART_IS(A,N) (defined(A##_HARDWARE_SERIAL) && (CAT(HW_,A##_HARDWARE_SERIAL) == HW_Serial##N || CAT(HW_,A##_HARDWARE_SERIAL) == HW_MSerial##N))
#define ANY_SERIAL_IS(N) ( SERIAL_IN_USE(N) \ #define ANY_SERIAL_IS(N) ( CONF_SERIAL_IS(N) \
|| TMC_UART_IS(X, N) || TMC_UART_IS(Y , N) || TMC_UART_IS(Z , N) \ || TMC_UART_IS(X, N) || TMC_UART_IS(Y , N) || TMC_UART_IS(Z , N) \
|| TMC_UART_IS(I, N) || TMC_UART_IS(J , N) || TMC_UART_IS(K , N) \ || TMC_UART_IS(I, N) || TMC_UART_IS(J , N) || TMC_UART_IS(K , N) \
|| TMC_UART_IS(U, N) || TMC_UART_IS(V , N) || TMC_UART_IS(W , N) \ || TMC_UART_IS(U, N) || TMC_UART_IS(V , N) || TMC_UART_IS(W , N) \
@@ -2102,7 +2481,7 @@
#define HW_MSerial9 518 #define HW_MSerial9 518
#define HW_MSerial10 519 #define HW_MSerial10 519
#if SERIAL_IN_USE(-1) #if CONF_SERIAL_IS(-1)
#define USING_HW_SERIALUSB 1 #define USING_HW_SERIALUSB 1
#endif #endif
#if ANY_SERIAL_IS(0) #if ANY_SERIAL_IS(0)
@@ -2164,21 +2543,6 @@
#undef TMC_UART_IS #undef TMC_UART_IS
#undef ANY_SERIAL_IS #undef ANY_SERIAL_IS
// Clean up unused ESP_WIFI pins
#ifdef ESP_WIFI_MODULE_COM
#if !SERIAL_IN_USE(ESP_WIFI_MODULE_COM)
#undef ESP_WIFI_MODULE_COM
#undef ESP_WIFI_MODULE_BAUDRATE
#undef ESP_WIFI_MODULE_RESET_PIN
#undef ESP_WIFI_MODULE_ENABLE_PIN
#undef ESP_WIFI_MODULE_TXD_PIN
#undef ESP_WIFI_MODULE_RXD_PIN
#undef ESP_WIFI_MODULE_GPIO0_PIN
#undef ESP_WIFI_MODULE_GPIO2_PIN
#undef ESP_WIFI_MODULE_GPIO4_PIN
#endif
#endif
// //
// Endstops and bed probe // Endstops and bed probe
// //
@@ -3241,13 +3605,13 @@
#endif #endif
#endif #endif
#if EITHER(HAS_MARLINUI_MENU, TOUCH_UI_FTDI_EVE) #if HAS_MARLINUI_MENU
// LCD timeout to status screen default is 15s // LCD timeout to status screen default is 15s
#ifndef LCD_TIMEOUT_TO_STATUS #ifndef LCD_TIMEOUT_TO_STATUS
#define LCD_TIMEOUT_TO_STATUS 15000 #define LCD_TIMEOUT_TO_STATUS 15000
#endif #endif
#if LCD_TIMEOUT_TO_STATUS #if LCD_TIMEOUT_TO_STATUS
#define HAS_SCREEN_TIMEOUT 1 #define SCREENS_CAN_TIME_OUT 1
#endif #endif
#endif #endif
+48 -148
View File
@@ -416,17 +416,17 @@
#elif defined(CHDK) #elif defined(CHDK)
#error "CHDK is now CHDK_PIN." #error "CHDK is now CHDK_PIN."
#elif ANY_PIN( \ #elif ANY_PIN( \
MAX6675_SS, MAX6675_SS2, MAX6675_SS3, MAX6675_CS, MAX6675_CS2, MAX6675_CS3,\ MAX6675_SS, MAX6675_SS2, MAX6675_CS, MAX6675_CS2, \
MAX31855_SS, MAX31855_SS2, MAX31855_SS3, MAX31855_CS, MAX31855_CS2, MAX31855_CS3, \ MAX31855_SS, MAX31855_SS2, MAX31855_CS, MAX31855_CS2, \
MAX31865_SS, MAX31865_SS2, MAX31865_SS3, MAX31865_CS, MAX31865_CS2, MAX31865_CS3) MAX31865_SS, MAX31865_SS2, MAX31865_CS, MAX31865_CS2)
#warning "MAX*_SS_PIN, MAX*_SS2_PIN, MAX*_SS3_PIN, MAX*_CS_PIN, MAX*_CS2_PIN, and MAX*_CS3_PIN, are deprecated and will be removed in a future version. Please use TEMP_0_CS_PIN/TEMP_1_CS_PIN/TEMP_2_CS_PIN instead." #warning "MAX*_SS_PIN, MAX*_SS2_PIN, MAX*_CS_PIN, and MAX*_CS2_PIN are deprecated and will be removed in a future version. Please use TEMP_0_CS_PIN/TEMP_1_CS_PIN instead."
#elif ANY_PIN(MAX6675_SCK, MAX31855_SCK, MAX31865_SCK) #elif ANY_PIN(MAX6675_SCK, MAX31855_SCK, MAX31865_SCK)
#warning "MAX*_SCK_PIN is deprecated and will be removed in a future version. Please use TEMP_0_SCK_PIN/TEMP_1_SCK_PIN/TEMP_2_SCK_PIN instead." #warning "MAX*_SCK_PIN is deprecated and will be removed in a future version. Please use TEMP_0_SCK_PIN/TEMP_1_SCK_PIN instead."
#elif ANY_PIN(MAX6675_MISO, MAX6675_DO, MAX31855_MISO, MAX31855_DO, MAX31865_MISO, MAX31865_DO) #elif ANY_PIN(MAX6675_MISO, MAX6675_DO, MAX31855_MISO, MAX31855_DO, MAX31865_MISO, MAX31865_DO)
#warning "MAX*_MISO_PIN and MAX*_DO_PIN are deprecated and will be removed in a future version. Please use TEMP_0_MISO_PIN/TEMP_1_MISO_PIN/TEMP_2_MISO_PIN instead." #warning "MAX*_MISO_PIN and MAX*_DO_PIN are deprecated and will be removed in a future version. Please use TEMP_0_MISO_PIN/TEMP_1_MISO_PIN instead."
#elif PIN_EXISTS(MAX31865_MOSI) #elif PIN_EXISTS(MAX31865_MOSI)
#warning "MAX31865_MOSI_PIN is deprecated and will be removed in a future version. Please use TEMP_0_MOSI_PIN/TEMP_1_MOSI_PIN/TEMP_2_MOSI_PIN instead." #warning "MAX31865_MOSI_PIN is deprecated and will be removed in a future version. Please use TEMP_0_MOSI_PIN/TEMP_1_MOSI_PIN instead."
#elif ANY_PIN(THERMO_CS1_PIN, THERMO_CS2_PIN, THERMO_CS3_PIN, THERMO_DO_PIN, THERMO_SCK_PIN) #elif ANY_PIN(THERMO_CS1_PIN, THERMO_CS2_PIN, THERMO_DO_PIN, THERMO_SCK_PIN)
#error "THERMO_*_PIN is now TEMP_n_CS_PIN, TEMP_n_SCK_PIN, TEMP_n_MOSI_PIN, TEMP_n_MISO_PIN." #error "THERMO_*_PIN is now TEMP_n_CS_PIN, TEMP_n_SCK_PIN, TEMP_n_MOSI_PIN, TEMP_n_MISO_PIN."
#elif defined(MAX31865_SENSOR_OHMS) #elif defined(MAX31865_SENSOR_OHMS)
#error "MAX31865_SENSOR_OHMS is now MAX31865_SENSOR_OHMS_0." #error "MAX31865_SENSOR_OHMS is now MAX31865_SENSOR_OHMS_0."
@@ -570,9 +570,9 @@
#error "SHORT_MANUAL_Z_MOVE is now FINE_MANUAL_MOVE, applying to Z on most printers." #error "SHORT_MANUAL_Z_MOVE is now FINE_MANUAL_MOVE, applying to Z on most printers."
#elif defined(FIL_RUNOUT_INVERTING) #elif defined(FIL_RUNOUT_INVERTING)
#if FIL_RUNOUT_INVERTING #if FIL_RUNOUT_INVERTING
#error "FIL_RUNOUT_INVERTING true is now FIL_RUNOUT_MODE {HIGH}." #error "FIL_RUNOUT_INVERTING true is now FIL_RUNOUT_STATE HIGH."
#else #else
#error "FIL_RUNOUT_INVERTING false is now FIL_RUNOUT_MODE {LOW}." #error "FIL_RUNOUT_INVERTING false is now FIL_RUNOUT_STATE LOW."
#endif #endif
#elif defined(ASSISTED_TRAMMING_MENU_ITEM) #elif defined(ASSISTED_TRAMMING_MENU_ITEM)
#error "ASSISTED_TRAMMING_MENU_ITEM is deprecated and should be removed." #error "ASSISTED_TRAMMING_MENU_ITEM is deprecated and should be removed."
@@ -654,8 +654,6 @@
#error "SHOW_SD_PERCENT is now SHOW_PROGRESS_PERCENT." #error "SHOW_SD_PERCENT is now SHOW_PROGRESS_PERCENT."
#elif defined(EXTRA_LIN_ADVANCE_K) #elif defined(EXTRA_LIN_ADVANCE_K)
#error "EXTRA_LIN_ADVANCE_K is now ADVANCE_K_EXTRA." #error "EXTRA_LIN_ADVANCE_K is now ADVANCE_K_EXTRA."
#elif defined(POLAR_SEGMENTS_PER_SECOND) || defined(DELTA_SEGMENTS_PER_SECOND) || defined(SCARA_SEGMENTS_PER_SECOND) || defined(TPARA_SEGMENTS_PER_SECOND)
#error "(POLAR|DELTA|SCARA|TPARA)_SEGMENTS_PER_SECOND is now DEFAULT_SEGMENTS_PER_SECOND."
#endif #endif
// L64xx stepper drivers have been removed // L64xx stepper drivers have been removed
@@ -681,17 +679,6 @@
constexpr float arm[] = AXIS_RELATIVE_MODES; constexpr float arm[] = AXIS_RELATIVE_MODES;
static_assert(COUNT(arm) == LOGICAL_AXES, "AXIS_RELATIVE_MODES must contain " _LOGICAL_AXES_STR "elements."); static_assert(COUNT(arm) == LOGICAL_AXES, "AXIS_RELATIVE_MODES must contain " _LOGICAL_AXES_STR "elements.");
// Consolidate TMC26X, validate migration (#24373)
#define _ISMAX_1(A) defined(A##_MAX_CURRENT)
#define _ISSNS_1(A) defined(A##_SENSE_RESISTOR)
#if DO(ISMAX,||,ALL_AXIS_NAMES)
#error "*_MAX_CURRENT is now set with *_CURRENT."
#elif DO(ISSNS,||,ALL_AXIS_NAMES)
#error "*_SENSE_RESISTOR (in Milli-Ohms) is now set with *_RSENSE (in Ohms), so you must divide values by 1000."
#endif
#undef _ISMAX_1
#undef _ISSNS_1
/** /**
* Probe temp compensation requirements * Probe temp compensation requirements
*/ */
@@ -842,7 +829,7 @@ static_assert(Y_MAX_LENGTH >= Y_BED_SIZE, "Movement bounds (Y_MIN_POS, Y_MAX_POS
/** /**
* Granular software endstops (Marlin >= 1.1.7) * Granular software endstops (Marlin >= 1.1.7)
*/ */
#if ENABLED(MIN_SOFTWARE_ENDSTOPS) && NONE(MIN_SOFTWARE_ENDSTOP_Z, POLARGRAPH) #if ENABLED(MIN_SOFTWARE_ENDSTOPS) && DISABLED(MIN_SOFTWARE_ENDSTOP_Z)
#if IS_KINEMATIC #if IS_KINEMATIC
#error "MIN_SOFTWARE_ENDSTOPS on DELTA/SCARA also requires MIN_SOFTWARE_ENDSTOP_Z." #error "MIN_SOFTWARE_ENDSTOPS on DELTA/SCARA also requires MIN_SOFTWARE_ENDSTOP_Z."
#elif NONE(MIN_SOFTWARE_ENDSTOP_X, MIN_SOFTWARE_ENDSTOP_Y) #elif NONE(MIN_SOFTWARE_ENDSTOP_X, MIN_SOFTWARE_ENDSTOP_Y)
@@ -850,7 +837,7 @@ static_assert(Y_MAX_LENGTH >= Y_BED_SIZE, "Movement bounds (Y_MIN_POS, Y_MAX_POS
#endif #endif
#endif #endif
#if ENABLED(MAX_SOFTWARE_ENDSTOPS) && NONE(MAX_SOFTWARE_ENDSTOP_Z, POLARGRAPH) #if ENABLED(MAX_SOFTWARE_ENDSTOPS) && DISABLED(MAX_SOFTWARE_ENDSTOP_Z)
#if IS_KINEMATIC #if IS_KINEMATIC
#error "MAX_SOFTWARE_ENDSTOPS on DELTA/SCARA also requires MAX_SOFTWARE_ENDSTOP_Z." #error "MAX_SOFTWARE_ENDSTOPS on DELTA/SCARA also requires MAX_SOFTWARE_ENDSTOP_Z."
#elif NONE(MAX_SOFTWARE_ENDSTOP_X, MAX_SOFTWARE_ENDSTOP_Y) #elif NONE(MAX_SOFTWARE_ENDSTOP_X, MAX_SOFTWARE_ENDSTOP_Y)
@@ -1086,71 +1073,10 @@ static_assert(Y_MAX_LENGTH >= Y_BED_SIZE, "Movement bounds (Y_MIN_POS, Y_MAX_POS
#error "You can't enable FIL_RUNOUT7_PULLUP and FIL_RUNOUT7_PULLDOWN at the same time." #error "You can't enable FIL_RUNOUT7_PULLUP and FIL_RUNOUT7_PULLDOWN at the same time."
#elif BOTH(FIL_RUNOUT8_PULLUP, FIL_RUNOUT8_PULLDOWN) #elif BOTH(FIL_RUNOUT8_PULLUP, FIL_RUNOUT8_PULLDOWN)
#error "You can't enable FIL_RUNOUT8_PULLUP and FIL_RUNOUT8_PULLDOWN at the same time." #error "You can't enable FIL_RUNOUT8_PULLUP and FIL_RUNOUT8_PULLDOWN at the same time."
#elif FILAMENT_RUNOUT_DISTANCE_MM < 0
#error "FILAMENT_RUNOUT_DISTANCE_MM must be greater than or equal to zero."
#elif DISABLED(ADVANCED_PAUSE_FEATURE) #elif DISABLED(ADVANCED_PAUSE_FEATURE)
static_assert(nullptr == strstr(FILAMENT_RUNOUT_SCRIPT, "M600"), "ADVANCED_PAUSE_FEATURE is required to use M600 with FILAMENT_RUNOUT_SENSOR."); static_assert(nullptr == strstr(FILAMENT_RUNOUT_SCRIPT, "M600"), "ADVANCED_PAUSE_FEATURE is required to use M600 with FILAMENT_RUNOUT_SENSOR.");
#elif defined(FIL_RUNOUT_ENABLED_DEFAULT)
#error "FIL_RUNOUT_ENABLED_DEFAULT is now set with the FILAMENT_RUNOUT_ENABLED array."
#elif defined(FILAMENT_RUNOUT_DISTANCE_MM)
#error "FILAMENT_RUNOUT_DISTANCE_MM is now set with the FIL_RUNOUT_DISTANCE_MM array."
#elif defined(FIL_RUNOUT_STATE) || defined(FIL_RUNOUT2_STATE) || defined(FIL_RUNOUT3_STATE) || defined(FIL_RUNOUT4_STATE) || defined(FIL_RUNOUT5_STATE) || defined(FIL_RUNOUT6_STATE) || defined(FIL_RUNOUT7_STATE) || defined(FIL_RUNOUT8_STATE)
#ifdef FIL_RUNOUT_STATE
#if FIL_RUNOUT_STATE
#error "FIL_RUNOUT_STATE HIGH is now set with FIL_RUNOUT_MODE { 2 ... }."
#else
#error "FIL_RUNOUT_STATE LOW is now set with FIL_RUNOUT_MODE { 1 ... }."
#endif
#endif
#ifdef FIL_RUNOUT2_STATE
#if FIL_RUNOUT2_STATE
#error "FIL_RUNOUT2_STATE HIGH is now set with FIL_RUNOUT_MODE { n, 2 ... }."
#else
#error "FIL_RUNOUT2_STATE LOW is now set with FIL_RUNOUT_MODE { n, 1 ... }."
#endif
#endif
#ifdef FIL_RUNOUT3_STATE
#if FIL_RUNOUT3_STATE
#error "FIL_RUNOUT3_STATE HIGH is now set with FIL_RUNOUT_MODE { n, n, 2 ... }."
#else
#error "FIL_RUNOUT3_STATE LOW is now set with FIL_RUNOUT_MODE { n, n, 1 ... }."
#endif
#endif
#ifdef FIL_RUNOUT4_STATE
#if FIL_RUNOUT4_STATE
#error "FIL_RUNOUT4_STATE HIGH is now set with FIL_RUNOUT_MODE { n, n, n, 2 ... }."
#else
#error "FIL_RUNOUT4_STATE LOW is now set with FIL_RUNOUT_MODE { n, n, n, 1 ... }."
#endif
#endif
#ifdef FIL_RUNOUT5_STATE
#if FIL_RUNOUT5_STATE
#error "FIL_RUNOUT5_STATE HIGH is now set with FIL_RUNOUT_MODE { n, n, n, n, 2 ... }."
#else
#error "FIL_RUNOUT5_STATE LOW is now set with FIL_RUNOUT_MODE { n, n, n, n, 1 ... }."
#endif
#endif
#ifdef FIL_RUNOUT6_STATE
#if FIL_RUNOUT6_STATE
#error "FIL_RUNOUT6_STATE HIGH is now set with FIL_RUNOUT_MODE { n, n, n, n, n, 2 ... }."
#else
#error "FIL_RUNOUT6_STATE LOW is now set with FIL_RUNOUT_MODE { n, n, n, n, n, 1 ... }."
#endif
#endif
#ifdef FIL_RUNOUT7_STATE
#if FIL_RUNOUT7_STATE
#error "FIL_RUNOUT7_STATE HIGH is now set with FIL_RUNOUT_MODE { n, n, n, n, n, n, 2 ... }."
#else
#error "FIL_RUNOUT7_STATE LOW is now set with FIL_RUNOUT_MODE { n, n, n, n, n, n, 1 ... }."
#endif
#endif
#ifdef FIL_RUNOUT8_STATE
#if FIL_RUNOUT8_STATE
#error "FIL_RUNOUT8_STATE HIGH is now set with FIL_RUNOUT_MODE { n, n, n, n, n, n, n, 2 ... }."
#else
#error "FIL_RUNOUT8_STATE LOW is now set with FIL_RUNOUT_MODE { n, n, n, n, n, n, n, 1 ... }."
#endif
#endif
#elif ENABLED(FILAMENT_MOTION_SENSOR)
#error "FILAMENT_MOTION_SENSOR is now set with FIL_RUNOUT_MODE { 7 ... }."
#endif #endif
#endif #endif
@@ -1390,6 +1316,8 @@ static_assert(Y_MAX_LENGTH >= Y_BED_SIZE, "Movement bounds (Y_MIN_POS, Y_MAX_POS
#error "MIXING_EXTRUDER is incompatible with SINGLENOZZLE." #error "MIXING_EXTRUDER is incompatible with SINGLENOZZLE."
#elif ENABLED(DISABLE_INACTIVE_EXTRUDER) #elif ENABLED(DISABLE_INACTIVE_EXTRUDER)
#error "MIXING_EXTRUDER is incompatible with DISABLE_INACTIVE_EXTRUDER." #error "MIXING_EXTRUDER is incompatible with DISABLE_INACTIVE_EXTRUDER."
#elif HAS_FILAMENT_RUNOUT_DISTANCE
#error "MIXING_EXTRUDER is incompatible with FILAMENT_RUNOUT_DISTANCE_MM."
#endif #endif
#endif #endif
@@ -1412,7 +1340,7 @@ static_assert(Y_MAX_LENGTH >= Y_BED_SIZE, "Movement bounds (Y_MIN_POS, Y_MAX_POS
#if ENABLED(LIN_ADVANCE) #if ENABLED(LIN_ADVANCE)
#if DISTINCT_E > 1 #if DISTINCT_E > 1
constexpr float lak[] = ADVANCE_K; constexpr float lak[] = ADVANCE_K;
static_assert(COUNT(lak) <= DISTINCT_E, "The ADVANCE_K array has too many elements (i.e., more than " STRINGIFY(DISTINCT_E) ")."); static_assert(COUNT(lak) < DISTINCT_E, "The ADVANCE_K array has too many elements (i.e., more than " STRINGIFY(DISTINCT_E) ").");
#define _LIN_ASSERT(N) static_assert(N >= COUNT(lak) || WITHIN(lak[N], 0, 10), "ADVANCE_K values must be from 0 to 10 (Changed in LIN_ADVANCE v1.5, Marlin 1.1.9)."); #define _LIN_ASSERT(N) static_assert(N >= COUNT(lak) || WITHIN(lak[N], 0, 10), "ADVANCE_K values must be from 0 to 10 (Changed in LIN_ADVANCE v1.5, Marlin 1.1.9).");
REPEAT(DISTINCT_E, _LIN_ASSERT) REPEAT(DISTINCT_E, _LIN_ASSERT)
#undef _LIN_ASSERT #undef _LIN_ASSERT
@@ -1716,8 +1644,8 @@ static_assert(Y_MAX_LENGTH >= Y_BED_SIZE, "Movement bounds (Y_MIN_POS, Y_MAX_POS
* Delta requirements * Delta requirements
*/ */
#if ENABLED(DELTA) #if ENABLED(DELTA)
#if ANY(X_HOME_TO_MIN, Y_HOME_TO_MIN, Z_HOME_TO_MIN) #if NONE(USE_XMAX_PLUG, USE_YMAX_PLUG, USE_ZMAX_PLUG)
#error "DELTA kinematics require homing "XYZ" axes to MAX. Set [XYZ]_HOME_DIR to 1." #error "You probably want to use Max Endstops for DELTA!"
#elif ENABLED(ENABLE_LEVELING_FADE_HEIGHT) && DISABLED(AUTO_BED_LEVELING_BILINEAR) && !UBL_SEGMENTED #elif ENABLED(ENABLE_LEVELING_FADE_HEIGHT) && DISABLED(AUTO_BED_LEVELING_BILINEAR) && !UBL_SEGMENTED
#error "ENABLE_LEVELING_FADE_HEIGHT on DELTA requires AUTO_BED_LEVELING_BILINEAR or AUTO_BED_LEVELING_UBL." #error "ENABLE_LEVELING_FADE_HEIGHT on DELTA requires AUTO_BED_LEVELING_BILINEAR or AUTO_BED_LEVELING_UBL."
#elif ENABLED(DELTA_AUTO_CALIBRATION) && !(HAS_BED_PROBE || HAS_MARLINUI_MENU) #elif ENABLED(DELTA_AUTO_CALIBRATION) && !(HAS_BED_PROBE || HAS_MARLINUI_MENU)
@@ -2389,8 +2317,8 @@ static_assert(Y_MAX_LENGTH >= Y_BED_SIZE, "Movement bounds (Y_MIN_POS, Y_MAX_POS
#endif #endif
#if MAX_CONSECUTIVE_LOW_TEMPERATURE_ERROR_ALLOWED < 5 #if MAX_CONSECUTIVE_LOW_TEMPERATURE_ERROR_ALLOWED < 5
#error "Thermistor 66 requires MAX_CONSECUTIVE_LOW_TEMPERATURE_ERROR_ALLOWED ≥ 5." #error "Thermistor 66 requires MAX_CONSECUTIVE_LOW_TEMPERATURE_ERROR_ALLOWED ≥ 5."
#elif MILLISECONDS_PREHEAT_TIME < 15000 #elif MILLISECONDS_PREHEAT_TIME < 30000
#error "Thermistor 66 requires MILLISECONDS_PREHEAT_TIME ≥ 15000, but 30000 or higher is recommended." #error "Thermistor 66 requires MILLISECONDS_PREHEAT_TIME ≥ 30000."
#endif #endif
#undef _BAD_MINTEMP #undef _BAD_MINTEMP
#endif #endif
@@ -2412,13 +2340,6 @@ static_assert(Y_MAX_LENGTH >= Y_BED_SIZE, "Movement bounds (Y_MIN_POS, Y_MAX_POS
#error "MAX31865_SENSOR_OHMS_1 and MAX31865_CALIBRATION_OHMS_1 must be set if TEMP_SENSOR_1/TEMP_SENSOR_REDUNDANT is MAX31865." #error "MAX31865_SENSOR_OHMS_1 and MAX31865_CALIBRATION_OHMS_1 must be set if TEMP_SENSOR_1/TEMP_SENSOR_REDUNDANT is MAX31865."
#endif #endif
#endif #endif
#if TEMP_SENSOR_2_IS_MAX31865 || (TEMP_SENSOR_REDUNDANT_IS_MAX31865 && REDUNDANT_TEMP_MATCH(SOURCE, E2))
#if !defined(MAX31865_SENSOR_WIRES_2) || !WITHIN(MAX31865_SENSOR_WIRES_2, 2, 4)
#error "MAX31865_SENSOR_WIRES_2 must be defined as an integer between 2 and 4."
#elif !defined(MAX31865_SENSOR_OHMS_2) || !defined(MAX31865_CALIBRATION_OHMS_2)
#error "MAX31865_SENSOR_OHMS_2 and MAX31865_CALIBRATION_OHMS_2 must be set if TEMP_SENSOR_2/TEMP_SENSOR_REDUNDANT is MAX31865."
#endif
#endif
/** /**
* Redundant temperature sensor config * Redundant temperature sensor config
@@ -2725,7 +2646,7 @@ static_assert(Y_MAX_LENGTH >= Y_BED_SIZE, "Movement bounds (Y_MIN_POS, Y_MAX_POS
#define _PLUG_UNUSED_TEST(A,P) (DISABLED(USE_##P##MIN_PLUG, USE_##P##MAX_PLUG) \ #define _PLUG_UNUSED_TEST(A,P) (DISABLED(USE_##P##MIN_PLUG, USE_##P##MAX_PLUG) \
&& !(ENABLED(A##_DUAL_ENDSTOPS) && WITHIN(A##2_USE_ENDSTOP, _##P##MAX_, _##P##MIN_)) \ && !(ENABLED(A##_DUAL_ENDSTOPS) && WITHIN(A##2_USE_ENDSTOP, _##P##MAX_, _##P##MIN_)) \
&& !(ENABLED(A##_MULTI_ENDSTOPS) && WITHIN(A##2_USE_ENDSTOP, _##P##MAX_, _##P##MIN_)) ) && !(ENABLED(A##_MULTI_ENDSTOPS) && WITHIN(A##2_USE_ENDSTOP, _##P##MAX_, _##P##MIN_)) )
#define _AXIS_PLUG_UNUSED_TEST(A) (HAS_##A##_A NUM_AXIS_GANG(&& _PLUG_UNUSED_TEST(A,X), && _PLUG_UNUSED_TEST(A,Y), && _PLUG_UNUSED_TEST(A,Z), \ #define _AXIS_PLUG_UNUSED_TEST(A) (1 NUM_AXIS_GANG(&& _PLUG_UNUSED_TEST(A,X), && _PLUG_UNUSED_TEST(A,Y), && _PLUG_UNUSED_TEST(A,Z), \
&& _PLUG_UNUSED_TEST(A,I), && _PLUG_UNUSED_TEST(A,J), && _PLUG_UNUSED_TEST(A,K), \ && _PLUG_UNUSED_TEST(A,I), && _PLUG_UNUSED_TEST(A,J), && _PLUG_UNUSED_TEST(A,K), \
&& _PLUG_UNUSED_TEST(A,U), && _PLUG_UNUSED_TEST(A,V), && _PLUG_UNUSED_TEST(A,W) ) ) && _PLUG_UNUSED_TEST(A,U), && _PLUG_UNUSED_TEST(A,V), && _PLUG_UNUSED_TEST(A,W) ) )
@@ -2740,22 +2661,22 @@ static_assert(Y_MAX_LENGTH >= Y_BED_SIZE, "Movement bounds (Y_MIN_POS, Y_MAX_POS
#if _AXIS_PLUG_UNUSED_TEST(Z) #if _AXIS_PLUG_UNUSED_TEST(Z)
#error "You must enable USE_ZMIN_PLUG or USE_ZMAX_PLUG." #error "You must enable USE_ZMIN_PLUG or USE_ZMAX_PLUG."
#endif #endif
#if _AXIS_PLUG_UNUSED_TEST(I) #if HAS_I_AXIS && _AXIS_PLUG_UNUSED_TEST(I)
#error "You must enable USE_IMIN_PLUG or USE_IMAX_PLUG." #error "You must enable USE_IMIN_PLUG or USE_IMAX_PLUG."
#endif #endif
#if _AXIS_PLUG_UNUSED_TEST(J) #if HAS_J_AXIS && _AXIS_PLUG_UNUSED_TEST(J)
#error "You must enable USE_JMIN_PLUG or USE_JMAX_PLUG." #error "You must enable USE_JMIN_PLUG or USE_JMAX_PLUG."
#endif #endif
#if _AXIS_PLUG_UNUSED_TEST(K) #if HAS_K_AXIS && _AXIS_PLUG_UNUSED_TEST(K)
#error "You must enable USE_KMIN_PLUG or USE_KMAX_PLUG." #error "You must enable USE_KMIN_PLUG or USE_KMAX_PLUG."
#endif #endif
#if _AXIS_PLUG_UNUSED_TEST(U) #if HAS_U_AXIS && _AXIS_PLUG_UNUSED_TEST(U)
#error "You must enable USE_UMIN_PLUG or USE_UMAX_PLUG." #error "You must enable USE_UMIN_PLUG or USE_UMAX_PLUG."
#endif #endif
#if _AXIS_PLUG_UNUSED_TEST(V) #if HAS_V_AXIS && _AXIS_PLUG_UNUSED_TEST(V)
#error "You must enable USE_VMIN_PLUG or USE_VMAX_PLUG." #error "You must enable USE_VMIN_PLUG or USE_VMAX_PLUG."
#endif #endif
#if _AXIS_PLUG_UNUSED_TEST(W) #if HAS_W_AXIS && _AXIS_PLUG_UNUSED_TEST(W)
#error "You must enable USE_WMIN_PLUG or USE_WMAX_PLUG." #error "You must enable USE_WMIN_PLUG or USE_WMAX_PLUG."
#endif #endif
@@ -2769,29 +2690,29 @@ static_assert(Y_MAX_LENGTH >= Y_BED_SIZE, "Movement bounds (Y_MIN_POS, Y_MAX_POS
#error "Enable USE_YMIN_PLUG when homing Y to MIN." #error "Enable USE_YMIN_PLUG when homing Y to MIN."
#elif Y_HOME_TO_MAX && DISABLED(USE_YMAX_PLUG) #elif Y_HOME_TO_MAX && DISABLED(USE_YMAX_PLUG)
#error "Enable USE_YMAX_PLUG when homing Y to MAX." #error "Enable USE_YMAX_PLUG when homing Y to MAX."
#elif I_HOME_TO_MIN && DISABLED(USE_IMIN_PLUG) #elif HAS_I_AXIS && I_HOME_TO_MIN && DISABLED(USE_IMIN_PLUG)
#error "Enable USE_IMIN_PLUG when homing I to MIN." #error "Enable USE_IMIN_PLUG when homing I to MIN."
#elif I_HOME_TO_MAX && DISABLED(USE_IMAX_PLUG) #elif HAS_I_AXIS && I_HOME_TO_MAX && DISABLED(USE_IMAX_PLUG)
#error "Enable USE_IMAX_PLUG when homing I to MAX." #error "Enable USE_IMAX_PLUG when homing I to MAX."
#elif J_HOME_TO_MIN && DISABLED(USE_JMIN_PLUG) #elif HAS_J_AXIS && J_HOME_TO_MIN && DISABLED(USE_JMIN_PLUG)
#error "Enable USE_JMIN_PLUG when homing J to MIN." #error "Enable USE_JMIN_PLUG when homing J to MIN."
#elif J_HOME_TO_MAX && DISABLED(USE_JMAX_PLUG) #elif HAS_J_AXIS && J_HOME_TO_MAX && DISABLED(USE_JMAX_PLUG)
#error "Enable USE_JMAX_PLUG when homing J to MAX." #error "Enable USE_JMAX_PLUG when homing J to MAX."
#elif K_HOME_TO_MIN && DISABLED(USE_KMIN_PLUG) #elif HAS_K_AXIS && K_HOME_TO_MIN && DISABLED(USE_KMIN_PLUG)
#error "Enable USE_KMIN_PLUG when homing K to MIN." #error "Enable USE_KMIN_PLUG when homing K to MIN."
#elif K_HOME_TO_MAX && DISABLED(USE_KMAX_PLUG) #elif HAS_K_AXIS && K_HOME_TO_MAX && DISABLED(USE_KMAX_PLUG)
#error "Enable USE_KMAX_PLUG when homing K to MAX." #error "Enable USE_KMAX_PLUG when homing K to MAX."
#elif U_HOME_TO_MIN && DISABLED(USE_UMIN_PLUG) #elif HAS_U_AXIS && U_HOME_TO_MIN && DISABLED(USE_UMIN_PLUG)
#error "Enable USE_UMIN_PLUG when homing U to MIN." #error "Enable USE_UMIN_PLUG when homing U to MIN."
#elif U_HOME_TO_MAX && DISABLED(USE_UMAX_PLUG) #elif HAS_U_AXIS && U_HOME_TO_MAX && DISABLED(USE_UMAX_PLUG)
#error "Enable USE_UMAX_PLUG when homing U to MAX." #error "Enable USE_UMAX_PLUG when homing U to MAX."
#elif V_HOME_TO_MIN && DISABLED(USE_VMIN_PLUG) #elif HAS_V_AXIS && V_HOME_TO_MIN && DISABLED(USE_VMIN_PLUG)
#error "Enable USE_VMIN_PLUG when homing V to MIN." #error "Enable USE_VMIN_PLUG when homing V to MIN."
#elif V_HOME_TO_MAX && DISABLED(USE_VMAX_PLUG) #elif HAS_V_AXIS && V_HOME_TO_MAX && DISABLED(USE_VMAX_PLUG)
#error "Enable USE_VMAX_PLUG when homing V to MAX." #error "Enable USE_VMAX_PLUG when homing V to MAX."
#elif W_HOME_TO_MIN && DISABLED(USE_WMIN_PLUG) #elif HAS_W_AXIS && W_HOME_TO_MIN && DISABLED(USE_WMIN_PLUG)
#error "Enable USE_WMIN_PLUG when homing W to MIN." #error "Enable USE_WMIN_PLUG when homing W to MIN."
#elif W_HOME_TO_MAX && DISABLED(USE_WMAX_PLUG) #elif HAS_W_AXIS && W_HOME_TO_MAX && DISABLED(USE_WMAX_PLUG)
#error "Enable USE_WMAX_PLUG when homing W to MAX." #error "Enable USE_WMAX_PLUG when homing W to MAX."
#endif #endif
#endif #endif
@@ -3190,7 +3111,7 @@ static_assert(Y_MAX_LENGTH >= Y_BED_SIZE, "Movement bounds (Y_MIN_POS, Y_MAX_POS
* Display Sleep is not supported by these common displays * Display Sleep is not supported by these common displays
*/ */
#if HAS_DISPLAY_SLEEP #if HAS_DISPLAY_SLEEP
#if ANY(IS_U8GLIB_LM6059_AF, IS_U8GLIB_ST7565_64128, REPRAPWORLD_GRAPHICAL_LCD, FYSETC_MINI_12864, CR10_STOCKDISPLAY, MINIPANEL) #if ANY(IS_U8GLIB_LM6059_AF, IS_U8GLIB_ST7565_64128, REPRAPWORLD_GRAPHICAL_LCD, FYSETC_MINI, ENDER2_STOCKDISPLAY, MINIPANEL)
#error "DISPLAY_SLEEP_MINUTES is not supported by your display." #error "DISPLAY_SLEEP_MINUTES is not supported by your display."
#elif !WITHIN(DISPLAY_SLEEP_MINUTES, 0, 255) #elif !WITHIN(DISPLAY_SLEEP_MINUTES, 0, 255)
#error "DISPLAY_SLEEP_MINUTES must be between 0 and 255." #error "DISPLAY_SLEEP_MINUTES must be between 0 and 255."
@@ -3649,8 +3570,8 @@ static_assert(Y_MAX_LENGTH >= Y_BED_SIZE, "Movement bounds (Y_MIN_POS, Y_MAX_POS
#error "SENSORLESS_HOMING on DELTA currently requires STEALTHCHOP_XY and STEALTHCHOP_Z." #error "SENSORLESS_HOMING on DELTA currently requires STEALTHCHOP_XY and STEALTHCHOP_Z."
#elif ENDSTOP_NOISE_THRESHOLD #elif ENDSTOP_NOISE_THRESHOLD
#error "SENSORLESS_HOMING is incompatible with ENDSTOP_NOISE_THRESHOLD." #error "SENSORLESS_HOMING is incompatible with ENDSTOP_NOISE_THRESHOLD."
#elif !(X_SENSORLESS || Y_SENSORLESS || Z_SENSORLESS || I_SENSORLESS || J_SENSORLESS || K_SENSORLESS || U_SENSORLESS || V_SENSORLESS || W_SENSORLESS) #elif !(X_SENSORLESS || Y_SENSORLESS || Z_SENSORLESS)
#error "SENSORLESS_HOMING requires a TMC stepper driver with StallGuard on X, Y, Z, I, J, K, U, V, or W axes." #error "SENSORLESS_HOMING requires a TMC stepper driver with StallGuard on X, Y, or Z axes."
#endif #endif
#undef X_ENDSTOP_INVERTING #undef X_ENDSTOP_INVERTING
@@ -4317,6 +4238,11 @@ static_assert(_PLUS_TEST(4), "HOMING_FEEDRATE_MM_M values must be positive.");
#endif #endif
#endif #endif
// Misc. Cleanup
#undef _TEST_PWM
#undef _NUM_AXES_STR
#undef _LOGICAL_AXES_STR
// JTAG support in the HAL // JTAG support in the HAL
#if ENABLED(DISABLE_DEBUG) && !defined(JTAGSWD_DISABLE) #if ENABLED(DISABLE_DEBUG) && !defined(JTAGSWD_DISABLE)
#error "DISABLE_DEBUG is not supported for the selected MCU/Board." #error "DISABLE_DEBUG is not supported for the selected MCU/Board."
@@ -4328,29 +4254,3 @@ static_assert(_PLUS_TEST(4), "HOMING_FEEDRATE_MM_M values must be positive.");
#if ENABLED(XFER_BUILD) && !BOTH(BINARY_FILE_TRANSFER, CUSTOM_FIRMWARE_UPLOAD) #if ENABLED(XFER_BUILD) && !BOTH(BINARY_FILE_TRANSFER, CUSTOM_FIRMWARE_UPLOAD)
#error "BINARY_FILE_TRANSFER and CUSTOM_FIRMWARE_UPLOAD are required for custom upload." #error "BINARY_FILE_TRANSFER and CUSTOM_FIRMWARE_UPLOAD are required for custom upload."
#endif #endif
// Check requirements for Input Shaping
#if HAS_SHAPING && defined(__AVR__)
#if ENABLED(INPUT_SHAPING_X)
#if F_CPU > 16000000
static_assert((SHAPING_FREQ_X) * 2 * 0x10000 >= (STEPPER_TIMER_RATE), "SHAPING_FREQ_X is below the minimum (20) for AVR 20MHz.");
#else
static_assert((SHAPING_FREQ_X) * 2 * 0x10000 >= (STEPPER_TIMER_RATE), "SHAPING_FREQ_X is below the minimum (16) for AVR 16MHz.");
#endif
#elif ENABLED(INPUT_SHAPING_Y)
#if F_CPU > 16000000
static_assert((SHAPING_FREQ_Y) * 2 * 0x10000 >= (STEPPER_TIMER_RATE), "SHAPING_FREQ_Y is below the minimum (20) for AVR 20MHz.");
#else
static_assert((SHAPING_FREQ_Y) * 2 * 0x10000 >= (STEPPER_TIMER_RATE), "SHAPING_FREQ_Y is below the minimum (16) for AVR 16MHz.");
#endif
#endif
#endif
#if BOTH(HAS_SHAPING, DIRECT_STEPPING)
#error "INPUT_SHAPING_[XY] cannot currently be used with DIRECT_STEPPING."
#endif
// Misc. Cleanup
#undef _TEST_PWM
#undef _NUM_AXES_STR
#undef _LOGICAL_AXES_STR
+1 -1
View File
@@ -42,7 +42,7 @@
* version was tagged. * version was tagged.
*/ */
#ifndef STRING_DISTRIBUTION_DATE #ifndef STRING_DISTRIBUTION_DATE
#define STRING_DISTRIBUTION_DATE "2022-12-05" #define STRING_DISTRIBUTION_DATE "2022-10-12"
#endif #endif
/** /**
+2 -2
View File
@@ -56,9 +56,9 @@ typedef struct _hd44780_charmap_t {
} hd44780_charmap_t; } hd44780_charmap_t;
#ifdef __AVR__ #ifdef __AVR__
#define IV(a) lchar_t(U##a) #define IV(a) U##a
#else #else
#define IV(a) lchar_t(L##a) #define IV(a) L##a
#endif #endif
static const hd44780_charmap_t g_hd44780_charmap_device[] PROGMEM = { static const hd44780_charmap_t g_hd44780_charmap_device[] PROGMEM = {
+64 -120
View File
@@ -58,10 +58,6 @@
#include "../../feature/bedlevel/bedlevel.h" #include "../../feature/bedlevel/bedlevel.h"
#endif #endif
#if HAS_CUTTER
#include "../../feature/spindle_laser.h"
#endif
// //
// Create LCD instance and chipset-specific information // Create LCD instance and chipset-specific information
// //
@@ -410,7 +406,7 @@ void MarlinUI::clear_lcd() { lcd.clear(); }
void lcd_erase_line(const lcd_uint_t line) { void lcd_erase_line(const lcd_uint_t line) {
lcd_moveto(0, line); lcd_moveto(0, line);
for (uint8_t i = LCD_WIDTH + 1; --i;) for (uint8_t i = LCD_WIDTH + 1; --i;)
lcd_put_u8str(F(" ")); lcd_put_lchar(' ');
} }
// Scroll the PSTR 'text' in a 'len' wide field for 'time' milliseconds at position col,line // Scroll the PSTR 'text' in a 'len' wide field for 'time' milliseconds at position col,line
@@ -418,7 +414,7 @@ void MarlinUI::clear_lcd() { lcd.clear(); }
uint8_t slen = utf8_strlen(ftxt); uint8_t slen = utf8_strlen(ftxt);
if (slen < len) { if (slen < len) {
lcd_put_u8str_max(col, line, ftxt, len); lcd_put_u8str_max(col, line, ftxt, len);
for (; slen < len; ++slen) lcd_put_u8str(F(" ")); for (; slen < len; ++slen) lcd_put_lchar(' ');
safe_delay(time); safe_delay(time);
} }
else { else {
@@ -430,7 +426,7 @@ void MarlinUI::clear_lcd() { lcd.clear(); }
lcd_put_u8str_max_P(col, line, p, len); lcd_put_u8str_max_P(col, line, p, len);
// Fill with spaces // Fill with spaces
for (uint8_t ix = slen - i; ix < len; ++ix) lcd_put_u8str(F(" ")); for (uint8_t ix = slen - i; ix < len; ++ix) lcd_put_lchar(' ');
// Delay // Delay
safe_delay(dly); safe_delay(dly);
@@ -444,9 +440,9 @@ void MarlinUI::clear_lcd() { lcd.clear(); }
static void logo_lines(FSTR_P const extra) { static void logo_lines(FSTR_P const extra) {
int16_t indent = (LCD_WIDTH - 8 - utf8_strlen(extra)) / 2; int16_t indent = (LCD_WIDTH - 8 - utf8_strlen(extra)) / 2;
lcd_put_lchar(indent, 0, '\x00'); lcd_put_u8str(F( "------" )); lcd_put_u8str(F("\x01")); lcd_put_lchar(indent, 0, '\x00'); lcd_put_u8str(F( "------" )); lcd_put_lchar('\x01');
lcd_put_u8str(indent, 1, F("|Marlin|")); lcd_put_u8str(extra); lcd_put_u8str(indent, 1, F("|Marlin|")); lcd_put_u8str(extra);
lcd_put_lchar(indent, 2, '\x02'); lcd_put_u8str(F( "------" )); lcd_put_u8str(F("\x03")); lcd_put_lchar(indent, 2, '\x02'); lcd_put_u8str(F( "------" )); lcd_put_lchar('\x03');
} }
void MarlinUI::show_bootscreen() { void MarlinUI::show_bootscreen() {
@@ -526,15 +522,7 @@ FORCE_INLINE void _draw_axis_value(const AxisEnum axis, const char *value, const
lcd_put_u8str(value); lcd_put_u8str(value);
} }
/**
* @brief Draw current and target for a heater/cooler
* @details Print at the current LCD position the current/target for a single heater,
* blinking the target temperature of an idle heater has timed out.
*
* @param heater_id The heater ID, such as 0, 1, ..., H_BED, H_CHAMBER, etc.
* @param prefix A char to draw in front (e.g., a thermometer or icon)
* @param blink Flag to show the blink state instead of the regular state
*/
FORCE_INLINE void _draw_heater_status(const heater_id_t heater_id, const char prefix, const bool blink) { FORCE_INLINE void _draw_heater_status(const heater_id_t heater_id, const char prefix, const bool blink) {
#if HAS_HEATED_BED #if HAS_HEATED_BED
const bool isBed = TERN(HAS_HEATED_CHAMBER, heater_id == H_BED, heater_id < 0); const bool isBed = TERN(HAS_HEATED_CHAMBER, heater_id == H_BED, heater_id < 0);
@@ -547,74 +535,75 @@ FORCE_INLINE void _draw_heater_status(const heater_id_t heater_id, const char pr
if (prefix >= 0) lcd_put_lchar(prefix); if (prefix >= 0) lcd_put_lchar(prefix);
lcd_put_u8str(t1 < 0 ? "err" : i16tostr3rj(t1)); lcd_put_u8str(t1 < 0 ? "err" : i16tostr3rj(t1));
lcd_put_u8str(F("/")); lcd_put_lchar('/');
#if !HEATER_IDLE_HANDLER #if !HEATER_IDLE_HANDLER
UNUSED(blink); UNUSED(blink);
#else #else
if (!blink && thermalManager.heater_idle[thermalManager.idle_index_for_id(heater_id)].timed_out) if (!blink && thermalManager.heater_idle[thermalManager.idle_index_for_id(heater_id)].timed_out) {
lcd_put_u8str(F(" ")); lcd_put_lchar(' ');
if (t2 >= 10) lcd_put_lchar(' ');
if (t2 >= 100) lcd_put_lchar(' ');
}
else else
#endif #endif
lcd_put_u8str(i16tostr3left(t2)); lcd_put_u8str(i16tostr3left(t2));
if (prefix >= 0) { if (prefix >= 0) {
lcd_put_lchar(LCD_STR_DEGREE[0]); lcd_put_lchar(LCD_STR_DEGREE[0]);
lcd_put_u8str(F(" ")); lcd_put_lchar(' ');
if (t2 < 10) lcd_put_u8str(F(" ")); if (t2 < 10) lcd_put_lchar(' ');
} }
} }
#if HAS_COOLER #if HAS_COOLER
FORCE_INLINE void _draw_cooler_status(const char prefix, const bool blink) {
const celsius_t t2 = thermalManager.degTargetCooler();
FORCE_INLINE void _draw_cooler_status(const char prefix, const bool blink) { if (prefix >= 0) lcd_put_lchar(prefix);
const celsius_t t2 = thermalManager.degTargetCooler();
if (prefix >= 0) lcd_put_lchar(prefix); lcd_put_u8str(i16tostr3rj(thermalManager.wholeDegCooler()));
lcd_put_lchar('/');
lcd_put_u8str(i16tostr3rj(thermalManager.wholeDegCooler())); #if !HEATER_IDLE_HANDLER
lcd_put_u8str(F("/")); UNUSED(blink);
#else
#if !HEATER_IDLE_HANDLER if (!blink && thermalManager.heater_idle[thermalManager.idle_index_for_id(heater_id)].timed_out) {
UNUSED(blink); lcd_put_lchar(' ');
#else if (t2 >= 10) lcd_put_lchar(' ');
if (!blink && thermalManager.heater_idle[thermalManager.idle_index_for_id(heater_id)].timed_out) { if (t2 >= 100) lcd_put_lchar(' ');
lcd_put_u8str(F(" "));
if (t2 >= 10) lcd_put_u8str(F(" "));
if (t2 >= 100) lcd_put_u8str(F(" "));
}
else
#endif
lcd_put_u8str(i16tostr3left(t2));
if (prefix >= 0) {
lcd_put_lchar(LCD_STR_DEGREE[0]);
lcd_put_u8str(F(" "));
if (t2 < 10) lcd_put_u8str(F(" "));
} }
} else
#endif
lcd_put_u8str(i16tostr3left(t2));
#endif // HAS_COOLER if (prefix >= 0) {
lcd_put_lchar(LCD_STR_DEGREE[0]);
lcd_put_lchar(' ');
if (t2 < 10) lcd_put_lchar(' ');
}
}
#endif
#if ENABLED(LASER_COOLANT_FLOW_METER) #if ENABLED(LASER_COOLANT_FLOW_METER)
FORCE_INLINE void _draw_flowmeter_status() { FORCE_INLINE void _draw_flowmeter_status() {
lcd_put_u8str(F("~")); lcd_put_u8str("~");
lcd_put_u8str(ftostr11ns(cooler.flowrate)); lcd_put_u8str(ftostr11ns(cooler.flowrate));
lcd_put_u8str(F("L")); lcd_put_lchar('L');
} }
#endif #endif
#if ENABLED(I2C_AMMETER) #if ENABLED(I2C_AMMETER)
FORCE_INLINE void _draw_ammeter_status() { FORCE_INLINE void _draw_ammeter_status() {
lcd_put_u8str(F(" ")); lcd_put_u8str(" ");
ammeter.read(); ammeter.read();
if (ammeter.current <= 0.999f) { if (ammeter.current <= 0.999f) {
lcd_put_u8str(ui16tostr3rj(uint16_t(ammeter.current * 1000 + 0.5f))); lcd_put_u8str(ui16tostr3rj(uint16_t(ammeter.current * 1000 + 0.5f)));
lcd_put_u8str(F("mA")); lcd_put_u8str("mA");
} }
else { else {
lcd_put_u8str(ftostr12ns(ammeter.current)); lcd_put_u8str(ftostr12ns(ammeter.current));
lcd_put_u8str(F("A")); lcd_put_lchar('A');
} }
} }
#endif #endif
@@ -623,36 +612,6 @@ FORCE_INLINE void _draw_bed_status(const bool blink) {
_draw_heater_status(H_BED, TERN0(HAS_LEVELING, blink && planner.leveling_active) ? '_' : LCD_STR_BEDTEMP[0], blink); _draw_heater_status(H_BED, TERN0(HAS_LEVELING, blink && planner.leveling_active) ? '_' : LCD_STR_BEDTEMP[0], blink);
} }
#if HAS_CUTTER
FORCE_INLINE void _draw_cutter_status() {
lcd_put_u8str(TERN(LASER_FEATURE, GET_TEXT_F(MSG_LASER), GET_TEXT_F(MSG_CUTTER)));
lcd_put_u8str(F(": "));
#if CUTTER_UNIT_IS(RPM)
lcd_put_u8str(ftostr61rj(float(cutter.unitPower) / 1000));
lcd_put_u8str(F("K"));
#else
lcd_put_u8str(cutter_power2str(cutter.unitPower));
#if CUTTER_UNIT_IS(PERCENT)
lcd_put_u8str(F("%"));
#endif
#endif
lcd_put_u8str(F(" "));
lcd_put_u8str(cutter.enabled() ? GET_TEXT_F(MSG_LCD_ON) : GET_TEXT_F(MSG_LCD_OFF));
lcd_put_u8str(F(" "));
switch (cutter.cutter_mode) {
case CUTTER_MODE_STANDARD: lcd_put_u8str(F("S")); break;
case CUTTER_MODE_CONTINUOUS: lcd_put_u8str(F("C")); break;
case CUTTER_MODE_DYNAMIC: lcd_put_u8str(F("D")); break;
case CUTTER_MODE_ERROR: lcd_put_u8str(F("!")); break;
}
}
#endif // HAS_CUTTER
#if ENABLED(LCD_PROGRESS_BAR) #if ENABLED(LCD_PROGRESS_BAR)
void MarlinUI::draw_progress_bar(const uint8_t percent) { void MarlinUI::draw_progress_bar(const uint8_t percent) {
@@ -695,7 +654,7 @@ void MarlinUI::draw_status_message(const bool blink) {
lcd_put_u8str(ftostr12ns(filwidth.measured_mm)); lcd_put_u8str(ftostr12ns(filwidth.measured_mm));
lcd_put_u8str(F(" V")); lcd_put_u8str(F(" V"));
lcd_put_u8str(i16tostr3rj(planner.volumetric_percent(parser.volumetric_enabled))); lcd_put_u8str(i16tostr3rj(planner.volumetric_percent(parser.volumetric_enabled)));
lcd_put_u8str(F("%")); lcd_put_lchar('%');
return; return;
} }
@@ -714,7 +673,7 @@ void MarlinUI::draw_status_message(const bool blink) {
lcd_put_u8str(status_message); lcd_put_u8str(status_message);
// Fill the rest with spaces // Fill the rest with spaces
while (slen < LCD_WIDTH) { lcd_put_u8str(F(" ")); ++slen; } while (slen < LCD_WIDTH) { lcd_put_lchar(' '); ++slen; }
} }
else { else {
// String is larger than the available space in screen. // String is larger than the available space in screen.
@@ -728,11 +687,11 @@ void MarlinUI::draw_status_message(const bool blink) {
// If the remaining string doesn't completely fill the screen // If the remaining string doesn't completely fill the screen
if (rlen < LCD_WIDTH) { if (rlen < LCD_WIDTH) {
uint8_t chars = LCD_WIDTH - rlen; // Amount of space left in characters uint8_t chars = LCD_WIDTH - rlen; // Amount of space left in characters
lcd_put_u8str(F(" ")); // Always at 1+ spaces left, draw a space lcd_put_lchar(' '); // Always at 1+ spaces left, draw a space
if (--chars) { // Draw a second space if there's room if (--chars) { // Draw a second space if there's room
lcd_put_u8str(F(" ")); lcd_put_lchar(' ');
if (--chars) { // Draw a third space if there's room if (--chars) { // Draw a third space if there's room
lcd_put_u8str(F(" ")); lcd_put_lchar(' ');
if (--chars) if (--chars)
lcd_put_u8str_max(status_message, chars); // Print a second copy of the message lcd_put_u8str_max(status_message, chars); // Print a second copy of the message
} }
@@ -753,7 +712,10 @@ void MarlinUI::draw_status_message(const bool blink) {
lcd_put_u8str_max(status_message, LCD_WIDTH); lcd_put_u8str_max(status_message, LCD_WIDTH);
// Fill the rest with spaces if there are missing spaces // Fill the rest with spaces if there are missing spaces
for (; slen < LCD_WIDTH; ++slen) lcd_put_u8str(F(" ")); while (slen < LCD_WIDTH) {
lcd_put_lchar(' ');
++slen;
}
#endif #endif
} }
@@ -770,7 +732,7 @@ void MarlinUI::draw_status_message(const bool blink) {
lcd_moveto(pc, pr); lcd_moveto(pc, pr);
lcd_put_u8str(F(TERN(IS_SD_PRINTING, "SD", "P:"))); lcd_put_u8str(F(TERN(IS_SD_PRINTING, "SD", "P:")));
lcd_put_u8str(TERN(PRINT_PROGRESS_SHOW_DECIMALS, permyriadtostr4(ui.get_progress_permyriad()), ui8tostr3rj(progress))); lcd_put_u8str(TERN(PRINT_PROGRESS_SHOW_DECIMALS, permyriadtostr4(ui.get_progress_permyriad()), ui8tostr3rj(progress)));
lcd_put_u8str(F("%")); lcd_put_lchar('%');
} }
} }
#endif #endif
@@ -866,15 +828,6 @@ void MarlinUI::draw_status_screen() {
lcd_moveto(8, 0); lcd_moveto(8, 0);
_draw_bed_status(blink); _draw_bed_status(blink);
#endif #endif
#elif HAS_CUTTER
//
// Cutter Status
//
lcd_moveto(0, 0);
_draw_cutter_status();
#endif #endif
#else // LCD_WIDTH >= 20 #else // LCD_WIDTH >= 20
@@ -895,15 +848,6 @@ void MarlinUI::draw_status_screen() {
lcd_moveto(10, 0); lcd_moveto(10, 0);
_draw_bed_status(blink); _draw_bed_status(blink);
#endif #endif
#elif HAS_CUTTER
//
// Cutter Status
//
lcd_moveto(0, 0);
_draw_cutter_status();
#endif #endif
TERN_(HAS_COOLER, _draw_cooler_status('*', blink)); TERN_(HAS_COOLER, _draw_cooler_status('*', blink));
@@ -976,7 +920,7 @@ void MarlinUI::draw_status_screen() {
else { else {
const xy_pos_t lpos = current_position.asLogical(); const xy_pos_t lpos = current_position.asLogical();
_draw_axis_value(X_AXIS, ftostr4sign(lpos.x), blink); _draw_axis_value(X_AXIS, ftostr4sign(lpos.x), blink);
lcd_put_u8str(F(" ")); lcd_put_lchar(' ');
_draw_axis_value(Y_AXIS, ftostr4sign(lpos.y), blink); _draw_axis_value(Y_AXIS, ftostr4sign(lpos.y), blink);
} }
@@ -1001,7 +945,7 @@ void MarlinUI::draw_status_screen() {
lcd_put_lchar(0, 2, LCD_STR_FEEDRATE[0]); lcd_put_lchar(0, 2, LCD_STR_FEEDRATE[0]);
lcd_put_u8str(i16tostr3rj(feedrate_percentage)); lcd_put_u8str(i16tostr3rj(feedrate_percentage));
lcd_put_u8str(F("%")); lcd_put_lchar('%');
#if LCD_WIDTH >= 20 #if LCD_WIDTH >= 20
@@ -1034,7 +978,7 @@ void MarlinUI::draw_status_screen() {
} }
lcd_put_lchar(c); lcd_put_lchar(c);
lcd_put_u8str(i16tostr3rj(per)); lcd_put_u8str(i16tostr3rj(per));
lcd_put_u8str(F("%")); lcd_put_lchar('%');
#endif #endif
#endif #endif
@@ -1073,7 +1017,7 @@ void MarlinUI::draw_status_screen() {
lcd_put_lchar(LCD_WIDTH - 9, 1, LCD_STR_FEEDRATE[0]); lcd_put_lchar(LCD_WIDTH - 9, 1, LCD_STR_FEEDRATE[0]);
lcd_put_u8str(i16tostr3rj(feedrate_percentage)); lcd_put_u8str(i16tostr3rj(feedrate_percentage));
lcd_put_u8str(F("%")); lcd_put_lchar('%');
// ========== Line 3 ========== // ========== Line 3 ==========
@@ -1131,18 +1075,18 @@ void MarlinUI::draw_status_screen() {
vlen = vstr ? utf8_strlen(vstr) : 0; vlen = vstr ? utf8_strlen(vstr) : 0;
if (style & SS_CENTER) { if (style & SS_CENTER) {
int8_t pad = (LCD_WIDTH - plen - vlen) / 2; int8_t pad = (LCD_WIDTH - plen - vlen) / 2;
while (--pad >= 0) { lcd_put_u8str(F(" ")); n--; } while (--pad >= 0) { lcd_put_lchar(' '); n--; }
} }
if (plen) n = lcd_put_u8str(fstr, itemIndex, itemStringC, itemStringF, n); if (plen) n = lcd_put_u8str(fstr, itemIndex, itemStringC, itemStringF, n);
if (vlen) n -= lcd_put_u8str_max(vstr, n); if (vlen) n -= lcd_put_u8str_max(vstr, n);
for (; n > 0; --n) lcd_put_u8str(F(" ")); for (; n > 0; --n) lcd_put_lchar(' ');
} }
// Draw a generic menu item with pre_char (if selected) and post_char // Draw a generic menu item with pre_char (if selected) and post_char
void MenuItemBase::_draw(const bool sel, const uint8_t row, FSTR_P const ftpl, const char pre_char, const char post_char) { void MenuItemBase::_draw(const bool sel, const uint8_t row, FSTR_P const ftpl, const char pre_char, const char post_char) {
lcd_put_lchar(0, row, sel ? pre_char : ' '); lcd_put_lchar(0, row, sel ? pre_char : ' ');
uint8_t n = lcd_put_u8str(ftpl, itemIndex, itemStringC, itemStringF, LCD_WIDTH - 2); uint8_t n = lcd_put_u8str(ftpl, itemIndex, itemStringC, itemStringF, LCD_WIDTH - 2);
for (; n; --n) lcd_put_u8str(F(" ")); for (; n; --n) lcd_put_lchar(' ');
lcd_put_lchar(post_char); lcd_put_lchar(post_char);
} }
@@ -1152,8 +1096,8 @@ void MarlinUI::draw_status_screen() {
lcd_put_lchar(0, row, sel ? LCD_STR_ARROW_RIGHT[0] : ' '); lcd_put_lchar(0, row, sel ? LCD_STR_ARROW_RIGHT[0] : ' ');
uint8_t n = lcd_put_u8str(ftpl, itemIndex, itemStringC, itemStringF, LCD_WIDTH - 2 - vlen); uint8_t n = lcd_put_u8str(ftpl, itemIndex, itemStringC, itemStringF, LCD_WIDTH - 2 - vlen);
if (vlen) { if (vlen) {
lcd_put_u8str(F(":")); lcd_put_lchar(':');
for (; n; --n) lcd_put_u8str(F(" ")); for (; n; --n) lcd_put_lchar(' ');
if (pgm) lcd_put_u8str_P(inStr); else lcd_put_u8str(inStr); if (pgm) lcd_put_u8str_P(inStr); else lcd_put_u8str(inStr);
} }
} }
@@ -1163,7 +1107,7 @@ void MarlinUI::draw_status_screen() {
ui.encoder_direction_normal(); ui.encoder_direction_normal();
uint8_t n = lcd_put_u8str(0, 1, ftpl, itemIndex, itemStringC, itemStringF, LCD_WIDTH - 1); uint8_t n = lcd_put_u8str(0, 1, ftpl, itemIndex, itemStringC, itemStringF, LCD_WIDTH - 1);
if (value) { if (value) {
lcd_put_u8str(F(":")); n--; lcd_put_lchar(':'); n--;
const uint8_t len = utf8_strlen(value) + 1; // Plus one for a leading space const uint8_t len = utf8_strlen(value) + 1; // Plus one for a leading space
const lcd_uint_t valrow = n < len ? 2 : 1; // Value on the next row if it won't fit const lcd_uint_t valrow = n < len ? 2 : 1; // Value on the next row if it won't fit
lcd_put_lchar(LCD_WIDTH - len, valrow, ' '); // Right-justified, padded, leading space lcd_put_lchar(LCD_WIDTH - len, valrow, ' '); // Right-justified, padded, leading space
@@ -1190,7 +1134,7 @@ void MarlinUI::draw_status_screen() {
lcd_put_lchar(0, row, sel ? LCD_STR_ARROW_RIGHT[0] : ' '); lcd_put_lchar(0, row, sel ? LCD_STR_ARROW_RIGHT[0] : ' ');
constexpr uint8_t maxlen = LCD_WIDTH - 2; constexpr uint8_t maxlen = LCD_WIDTH - 2;
uint8_t n = maxlen - lcd_put_u8str_max(ui.scrolled_filename(theCard, maxlen, row, sel), maxlen); uint8_t n = maxlen - lcd_put_u8str_max(ui.scrolled_filename(theCard, maxlen, row, sel), maxlen);
for (; n; --n) lcd_put_u8str(F(" ")); for (; n; --n) lcd_put_lchar(' ');
lcd_put_lchar(isDir ? LCD_STR_FOLDER[0] : ' '); lcd_put_lchar(isDir ? LCD_STR_FOLDER[0] : ' ');
} }
@@ -1522,9 +1466,9 @@ void MarlinUI::draw_status_screen() {
*/ */
lcd_put_lchar(_LCD_W_POS, 0, '('); lcd_put_lchar(_LCD_W_POS, 0, '(');
lcd_put_u8str(ui8tostr3rj(x_plot)); lcd_put_u8str(ui8tostr3rj(x_plot));
lcd_put_u8str(F(",")); lcd_put_lchar(',');
lcd_put_u8str(ui8tostr3rj(y_plot)); lcd_put_u8str(ui8tostr3rj(y_plot));
lcd_put_u8str(F(")")); lcd_put_lchar(')');
#if LCD_HEIGHT <= 3 // 16x2 or 20x2 display #if LCD_HEIGHT <= 3 // 16x2 or 20x2 display
+11 -8
View File
@@ -523,14 +523,17 @@ FORCE_INLINE void _draw_axis_value(const AxisEnum axis, const char *value, const
#if !HEATER_IDLE_HANDLER #if !HEATER_IDLE_HANDLER
UNUSED(blink); UNUSED(blink);
#else #else
if (!blink && thermalManager.heater_idle[thermalManager.idle_index_for_id(heater_id)].timed_out) if (!blink && thermalManager.heater_idle[thermalManager.idle_index_for_id(heater_id)].timed_out) {
lcd_put_u8str(F(" ")); lcd_put_lchar(' ');
if (t2 >= 10) lcd_put_lchar(' ');
if (t2 >= 100) lcd_put_lchar(' ');
}
else else
#endif #endif
lcd_put_u8str(i16tostr3left(t2)); lcd_put_u8str(i16tostr3left(t2));
lcd_put_u8str(F(" ")); lcd_put_lchar(' ');
if (t2 < 10) lcd_put_u8str(F(" ")); if (t2 < 10) lcd_put_lchar(' ');
if (t2) picBits |= ICON_TEMP1; if (t2) picBits |= ICON_TEMP1;
else picBits &= ~ICON_TEMP1; else picBits &= ~ICON_TEMP1;
@@ -542,7 +545,7 @@ FORCE_INLINE void _draw_axis_value(const AxisEnum axis, const char *value, const
FORCE_INLINE void _draw_flowmeter_status() { FORCE_INLINE void _draw_flowmeter_status() {
lcd_moveto(5, 5); lcd_put_u8str(F("FLOW")); lcd_moveto(5, 5); lcd_put_u8str(F("FLOW"));
lcd_moveto(7, 6); lcd_put_u8str(F("L")); lcd_moveto(7, 6); lcd_put_lchar('L');
lcd_moveto(6, 7); lcd_put_u8str(ftostr11ns(cooler.flowrate)); lcd_moveto(6, 7); lcd_put_u8str(ftostr11ns(cooler.flowrate));
if (cooler.flowrate) picBits |= ICON_FAN; if (cooler.flowrate) picBits |= ICON_FAN;
@@ -561,7 +564,7 @@ FORCE_INLINE void _draw_axis_value(const AxisEnum axis, const char *value, const
{ {
lcd_put_u8str("mA"); lcd_put_u8str("mA");
lcd_moveto(10, 7); lcd_moveto(10, 7);
lcd_put_u8str(F(" ")); lcd_put_u8str(ui16tostr3rj(uint16_t(ammeter.current * 1000 + 0.5f))); lcd_put_lchar(' '); lcd_put_u8str(ui16tostr3rj(uint16_t(ammeter.current * 1000 + 0.5f)));
} }
else { else {
lcd_put_u8str(" A"); lcd_put_u8str(" A");
@@ -582,9 +585,9 @@ FORCE_INLINE void _draw_axis_value(const AxisEnum axis, const char *value, const
#if CUTTER_UNIT_IS(RPM) #if CUTTER_UNIT_IS(RPM)
lcd_moveto(16, 6); lcd_put_u8str(F("RPM")); lcd_moveto(16, 6); lcd_put_u8str(F("RPM"));
lcd_moveto(15, 7); lcd_put_u8str(ftostr31ns(float(cutter.unitPower) / 1000)); lcd_moveto(15, 7); lcd_put_u8str(ftostr31ns(float(cutter.unitPower) / 1000));
lcd_put_u8str(F("K")); lcd_put_lchar('K');
#elif CUTTER_UNIT_IS(PERCENT) #elif CUTTER_UNIT_IS(PERCENT)
lcd_moveto(17, 6); lcd_put_u8str(F("%")); lcd_moveto(17, 6); lcd_put_lchar('%');
lcd_moveto(18, 7); lcd_put_u8str(cutter_power2str(cutter.unitPower)); lcd_moveto(18, 7); lcd_put_u8str(cutter_power2str(cutter.unitPower));
#else #else
lcd_moveto(17, 7); lcd_put_u8str(cutter_power2str(cutter.unitPower)); lcd_moveto(17, 7); lcd_put_u8str(cutter_power2str(cutter.unitPower));
+17 -10
View File
@@ -26,7 +26,7 @@
#if ((!HAS_ADC_BUTTONS && IS_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 #define HAS_ENCODER_WHEEL 1
#endif #endif
#if (HAS_ENCODER_WHEEL || ANY_BUTTON(ENC, BACK, UP, DOWN, LEFT, RIGHT)) && DISABLED(TOUCH_UI_FTDI_EVE) #if (HAS_ENCODER_WHEEL || ANY_BUTTON(ENC, BACK, UP, DWN, LFT, RT)) && DISABLED(TOUCH_UI_FTDI_EVE)
#define HAS_DIGITAL_BUTTONS 1 #define HAS_DIGITAL_BUTTONS 1
#endif #endif
#if !HAS_ADC_BUTTONS && (IS_RRW_KEYPAD || (HAS_WIRED_LCD && !IS_NEWPANEL)) #if !HAS_ADC_BUTTONS && (IS_RRW_KEYPAD || (HAS_WIRED_LCD && !IS_NEWPANEL))
@@ -38,6 +38,13 @@
#define HAS_SLOW_BUTTONS 1 #define HAS_SLOW_BUTTONS 1
#endif #endif
#if HAS_ENCODER_WHEEL
#define ENCODER_PHASE_0 0
#define ENCODER_PHASE_1 2
#define ENCODER_PHASE_2 3
#define ENCODER_PHASE_3 1
#endif
#if EITHER(HAS_DIGITAL_BUTTONS, HAS_DWIN_E3V2) #if EITHER(HAS_DIGITAL_BUTTONS, HAS_DWIN_E3V2)
// Wheel spin pins where BA is 00, 10, 11, 01 (1 bit always changes) // Wheel spin pins where BA is 00, 10, 11, 01 (1 bit always changes)
#define BLEN_A 0 #define BLEN_A 0
@@ -183,20 +190,20 @@
#else #else
#define _BUTTON_PRESSED_UP false #define _BUTTON_PRESSED_UP false
#endif #endif
#if BUTTON_EXISTS(DOWN) #if BUTTON_EXISTS(DWN)
#define _BUTTON_PRESSED_DOWN _BUTTON_PRESSED(DOWN) #define _BUTTON_PRESSED_DWN _BUTTON_PRESSED(DWN)
#else #else
#define _BUTTON_PRESSED_DOWN false #define _BUTTON_PRESSED_DWN false
#endif #endif
#if BUTTON_EXISTS(LEFT) #if BUTTON_EXISTS(LFT)
#define _BUTTON_PRESSED_LEFT _BUTTON_PRESSED(LEFT) #define _BUTTON_PRESSED_LFT _BUTTON_PRESSED(LFT)
#else #else
#define _BUTTON_PRESSED_LEFT false #define _BUTTON_PRESSED_LFT false
#endif #endif
#if BUTTON_EXISTS(RIGHT) #if BUTTON_EXISTS(RT)
#define _BUTTON_PRESSED_RIGHT _BUTTON_PRESSED(RIGHT) #define _BUTTON_PRESSED_RT _BUTTON_PRESSED(RT)
#else #else
#define _BUTTON_PRESSED_RIGHT false #define _BUTTON_PRESSED_RT false
#endif #endif
#if BUTTON_EXISTS(BACK) #if BUTTON_EXISTS(BACK)
#define _BUTTON_PRESSED_BACK _BUTTON_PRESSED(BACK) #define _BUTTON_PRESSED_BACK _BUTTON_PRESSED(BACK)
+1 -1
View File
@@ -34,7 +34,7 @@ int lcd_put_lchar_max(const lchar_t &c, const pixel_len_t max_length) {
return u8g_GetFontBBXWidth(u8g.getU8g()); return u8g_GetFontBBXWidth(u8g.getU8g());
} }
u8g_uint_t x = u8g.getPrintCol(), y = u8g.getPrintRow(), u8g_uint_t x = u8g.getPrintCol(), y = u8g.getPrintRow(),
ret = uxg_DrawLchar(u8g.getU8g(), x, y, c, max_length); ret = uxg_DrawWchar(u8g.getU8g(), x, y, c, max_length);
u8g.setPrintPos(x + ret, y); u8g.setPrintPos(x + ret, y);
return ret; return ret;
} }
+12 -12
View File
@@ -372,9 +372,9 @@ void MarlinUI::clear_lcd() { } // Automatically cleared by Picture Loop
lcd_put_lchar(LCD_PIXEL_WIDTH - 11 * (MENU_FONT_WIDTH), y2, 'E'); lcd_put_lchar(LCD_PIXEL_WIDTH - 11 * (MENU_FONT_WIDTH), y2, 'E');
lcd_put_lchar((char)('1' + extruder)); lcd_put_lchar((char)('1' + extruder));
lcd_put_u8str(F(" ")); lcd_put_lchar(' ');
lcd_put_u8str(i16tostr3rj(thermalManager.wholeDegHotend(extruder))); lcd_put_u8str(i16tostr3rj(thermalManager.wholeDegHotend(extruder)));
lcd_put_u8str(F("/")); lcd_put_lchar('/');
if (get_blink() || !thermalManager.heater_idle[extruder].timed_out) if (get_blink() || !thermalManager.heater_idle[extruder].timed_out)
lcd_put_u8str(i16tostr3rj(thermalManager.degTargetHotend(extruder))); lcd_put_u8str(i16tostr3rj(thermalManager.degTargetHotend(extruder)));
@@ -420,12 +420,12 @@ void MarlinUI::clear_lcd() { } // Automatically cleared by Picture Loop
vlen = vstr ? utf8_strlen(vstr) : 0; vlen = vstr ? utf8_strlen(vstr) : 0;
if (style & SS_CENTER) { if (style & SS_CENTER) {
int pad = (LCD_PIXEL_WIDTH - plen - vlen * MENU_FONT_WIDTH) / MENU_FONT_WIDTH / 2; int pad = (LCD_PIXEL_WIDTH - plen - vlen * MENU_FONT_WIDTH) / MENU_FONT_WIDTH / 2;
while (--pad >= 0) n -= lcd_put_u8str(F(" ")); while (--pad >= 0) n -= lcd_put_lchar(' ');
} }
if (plen) n = lcd_put_u8str(ftpl, itemIndex, itemStringC, itemStringF, n / (MENU_FONT_WIDTH)) * (MENU_FONT_WIDTH); if (plen) n = lcd_put_u8str(ftpl, itemIndex, itemStringC, itemStringF, n / (MENU_FONT_WIDTH)) * (MENU_FONT_WIDTH);
if (vlen) n -= lcd_put_u8str_max(vstr, n); if (vlen) n -= lcd_put_u8str_max(vstr, n);
while (n > MENU_FONT_WIDTH) n -= lcd_put_u8str(F(" ")); while (n > MENU_FONT_WIDTH) n -= lcd_put_lchar(' ');
} }
} }
@@ -433,9 +433,9 @@ void MarlinUI::clear_lcd() { } // Automatically cleared by Picture Loop
void MenuItemBase::_draw(const bool sel, const uint8_t row, FSTR_P const ftpl, const char, const char post_char) { void MenuItemBase::_draw(const bool sel, const uint8_t row, FSTR_P const ftpl, const char, const char post_char) {
if (mark_as_selected(row, sel)) { if (mark_as_selected(row, sel)) {
pixel_len_t n = lcd_put_u8str(ftpl, itemIndex, itemStringC, itemStringF, LCD_WIDTH - 1) * (MENU_FONT_WIDTH); pixel_len_t n = lcd_put_u8str(ftpl, itemIndex, itemStringC, itemStringF, LCD_WIDTH - 1) * (MENU_FONT_WIDTH);
while (n > MENU_FONT_WIDTH) n -= lcd_put_u8str(F(" ")); while (n > MENU_FONT_WIDTH) n -= lcd_put_lchar(' ');
lcd_put_lchar(LCD_PIXEL_WIDTH - (MENU_FONT_WIDTH), row_y2, post_char); lcd_put_lchar(LCD_PIXEL_WIDTH - (MENU_FONT_WIDTH), row_y2, post_char);
lcd_put_u8str(F(" ")); lcd_put_lchar(' ');
} }
} }
@@ -448,8 +448,8 @@ void MarlinUI::clear_lcd() { } // Automatically cleared by Picture Loop
pixel_len_t n = lcd_put_u8str(ftpl, itemIndex, itemStringC, itemStringF, LCD_WIDTH - 2 - vallen * prop) * (MENU_FONT_WIDTH); pixel_len_t n = lcd_put_u8str(ftpl, itemIndex, itemStringC, itemStringF, LCD_WIDTH - 2 - vallen * prop) * (MENU_FONT_WIDTH);
if (vallen) { if (vallen) {
lcd_put_u8str(F(":")); lcd_put_lchar(':');
while (n > MENU_FONT_WIDTH) n -= lcd_put_u8str(F(" ")); while (n > MENU_FONT_WIDTH) n -= lcd_put_lchar(' ');
lcd_moveto(LCD_PIXEL_WIDTH - _MAX((MENU_FONT_WIDTH) * vallen, pixelwidth + 2), row_y2); lcd_moveto(LCD_PIXEL_WIDTH - _MAX((MENU_FONT_WIDTH) * vallen, pixelwidth + 2), row_y2);
if (pgm) lcd_put_u8str_P(inStr); else lcd_put_u8str(inStr); if (pgm) lcd_put_u8str_P(inStr); else lcd_put_u8str(inStr);
} }
@@ -493,7 +493,7 @@ void MarlinUI::clear_lcd() { } // Automatically cleared by Picture Loop
// If a value is included, print a colon, then print the value right-justified // If a value is included, print a colon, then print the value right-justified
if (value) { if (value) {
lcd_put_u8str(F(":")); lcd_put_lchar(':');
if (extra_row) { if (extra_row) {
// Assume that value is numeric (with no descender) // Assume that value is numeric (with no descender)
baseline += EDIT_FONT_ASCENT + 2; baseline += EDIT_FONT_ASCENT + 2;
@@ -535,7 +535,7 @@ void MarlinUI::clear_lcd() { } // Automatically cleared by Picture Loop
if (isDir) lcd_put_lchar(LCD_STR_FOLDER[0]); if (isDir) lcd_put_lchar(LCD_STR_FOLDER[0]);
const pixel_len_t pixw = maxlen * (MENU_FONT_WIDTH); const pixel_len_t pixw = maxlen * (MENU_FONT_WIDTH);
pixel_len_t n = pixw - lcd_put_u8str_max(ui.scrolled_filename(theCard, maxlen, row, sel), pixw); pixel_len_t n = pixw - lcd_put_u8str_max(ui.scrolled_filename(theCard, maxlen, row, sel), pixw);
while (n > MENU_FONT_WIDTH) n -= lcd_put_u8str(F(" ")); while (n > MENU_FONT_WIDTH) n -= lcd_put_lchar(' ');
} }
} }
@@ -612,9 +612,9 @@ void MarlinUI::clear_lcd() { } // Automatically cleared by Picture Loop
if (PAGE_CONTAINS(LCD_PIXEL_HEIGHT - (INFO_FONT_HEIGHT - 1), LCD_PIXEL_HEIGHT)) { if (PAGE_CONTAINS(LCD_PIXEL_HEIGHT - (INFO_FONT_HEIGHT - 1), LCD_PIXEL_HEIGHT)) {
lcd_put_lchar(5, LCD_PIXEL_HEIGHT, '('); lcd_put_lchar(5, LCD_PIXEL_HEIGHT, '(');
u8g.print(x_plot); u8g.print(x_plot);
lcd_put_u8str(F(",")); lcd_put_lchar(',');
u8g.print(y_plot); u8g.print(y_plot);
lcd_put_u8str(F(")")); lcd_put_lchar(')');
// Show the location value // Show the location value
lcd_put_u8str_P(74, LCD_PIXEL_HEIGHT, Z_LBL); lcd_put_u8str_P(74, LCD_PIXEL_HEIGHT, Z_LBL);
+19 -29
View File
@@ -438,7 +438,7 @@ FORCE_INLINE void _draw_axis_value(const AxisEnum axis, const char *value, const
else if (axis_should_home(axis)) else if (axis_should_home(axis))
while (const char c = *value++) lcd_put_lchar(c <= '.' ? c : '?'); while (const char c = *value++) lcd_put_lchar(c <= '.' ? c : '?');
else if (NONE(HOME_AFTER_DEACTIVATE, DISABLE_REDUCED_ACCURACY_WARNING) && !axis_is_trusted(axis)) else if (NONE(HOME_AFTER_DEACTIVATE, DISABLE_REDUCED_ACCURACY_WARNING) && !axis_is_trusted(axis))
lcd_put_u8str(TERN0(HAS_Z_AXIS, axis == Z_AXIS) ? F(" ") : F(" ")); lcd_put_u8str(axis == Z_AXIS ? F(" ") : F(" "));
else else
lcd_put_u8str(value); lcd_put_u8str(value);
} }
@@ -455,7 +455,7 @@ FORCE_INLINE void _draw_axis_value(const AxisEnum axis, const char *value, const
void MarlinUI::drawPercent() { void MarlinUI::drawPercent() {
if (progress_string[0]) { if (progress_string[0]) {
lcd_put_u8str(progress_x_pos, EXTRAS_BASELINE, progress_string); lcd_put_u8str(progress_x_pos, EXTRAS_BASELINE, progress_string);
lcd_put_u8str(F("%")); lcd_put_lchar('%');
} }
} }
#endif #endif
@@ -500,13 +500,7 @@ FORCE_INLINE void _draw_axis_value(const AxisEnum axis, const char *value, const
*/ */
void MarlinUI::draw_status_screen() { void MarlinUI::draw_status_screen() {
constexpr int xystorage = TERN(INCH_MODE_SUPPORT, 8, 5); constexpr int xystorage = TERN(INCH_MODE_SUPPORT, 8, 5);
static char xstring[TERN(LCD_SHOW_E_TOTAL, 12, xystorage)]; static char xstring[TERN(LCD_SHOW_E_TOTAL, 12, xystorage)], ystring[xystorage], zstring[8];
#if HAS_Y_AXIS
static char ystring[xystorage];
#endif
#if HAS_Z_AXIS
static char zstring[8];
#endif
#if ENABLED(FILAMENT_LCD_DISPLAY) #if ENABLED(FILAMENT_LCD_DISPLAY)
static char wstring[5], mstring[4]; static char wstring[5], mstring[4];
@@ -531,9 +525,7 @@ void MarlinUI::draw_status_screen() {
const xyz_pos_t lpos = current_position.asLogical(); const xyz_pos_t lpos = current_position.asLogical();
const bool is_inch = parser.using_inch_units(); const bool is_inch = parser.using_inch_units();
#if HAS_Z_AXIS strcpy(zstring, is_inch ? ftostr42_52(LINEAR_UNIT(lpos.z)) : ftostr52sp(lpos.z));
strcpy(zstring, is_inch ? ftostr42_52(LINEAR_UNIT(lpos.z)) : ftostr52sp(lpos.z));
#endif
if (show_e_total) { if (show_e_total) {
#if ENABLED(LCD_SHOW_E_TOTAL) #if ENABLED(LCD_SHOW_E_TOTAL)
@@ -543,7 +535,7 @@ void MarlinUI::draw_status_screen() {
} }
else { else {
strcpy(xstring, is_inch ? ftostr53_63(LINEAR_UNIT(lpos.x)) : ftostr4sign(lpos.x)); strcpy(xstring, is_inch ? ftostr53_63(LINEAR_UNIT(lpos.x)) : ftostr4sign(lpos.x));
TERN_(HAS_Y_AXIS, strcpy(ystring, is_inch ? ftostr53_63(LINEAR_UNIT(lpos.y)) : ftostr4sign(lpos.y))); strcpy(ystring, is_inch ? ftostr53_63(LINEAR_UNIT(lpos.y)) : ftostr4sign(lpos.y));
} }
#if ENABLED(FILAMENT_LCD_DISPLAY) #if ENABLED(FILAMENT_LCD_DISPLAY)
@@ -705,7 +697,7 @@ void MarlinUI::draw_status_screen() {
lcd_put_u8str(STATUS_CUTTER_TEXT_X, STATUS_CUTTER_TEXT_Y, cutter_power2str(cutter.unitPower)); lcd_put_u8str(STATUS_CUTTER_TEXT_X, STATUS_CUTTER_TEXT_Y, cutter_power2str(cutter.unitPower));
#elif CUTTER_UNIT_IS(RPM) #elif CUTTER_UNIT_IS(RPM)
lcd_put_u8str(STATUS_CUTTER_TEXT_X - 2, STATUS_CUTTER_TEXT_Y, ftostr61rj(float(cutter.unitPower) / 1000)); lcd_put_u8str(STATUS_CUTTER_TEXT_X - 2, STATUS_CUTTER_TEXT_Y, ftostr61rj(float(cutter.unitPower) / 1000));
lcd_put_u8str(F("K")); lcd_put_lchar('K');
#else #else
lcd_put_u8str(STATUS_CUTTER_TEXT_X, STATUS_CUTTER_TEXT_Y, cutter_power2str(cutter.unitPower)); lcd_put_u8str(STATUS_CUTTER_TEXT_X, STATUS_CUTTER_TEXT_Y, cutter_power2str(cutter.unitPower));
#endif #endif
@@ -866,14 +858,12 @@ void MarlinUI::draw_status_screen() {
} }
else { else {
_draw_axis_value(X_AXIS, xstring, blink); _draw_axis_value(X_AXIS, xstring, blink);
TERN_(HAS_Y_AXIS, _draw_axis_value(Y_AXIS, ystring, blink)); _draw_axis_value(Y_AXIS, ystring, blink);
} }
#endif #endif
#if HAS_Z_AXIS _draw_axis_value(Z_AXIS, zstring, blink);
_draw_axis_value(Z_AXIS, zstring, blink);
#endif
#if NONE(XYZ_NO_FRAME, XYZ_HOLLOW_FRAME) #if NONE(XYZ_NO_FRAME, XYZ_HOLLOW_FRAME)
u8g.setColorIndex(1); // black on white u8g.setColorIndex(1); // black on white
@@ -892,7 +882,7 @@ void MarlinUI::draw_status_screen() {
set_font(FONT_STATUSMENU); set_font(FONT_STATUSMENU);
lcd_put_u8str(12, EXTRAS_2_BASELINE, i16tostr3rj(feedrate_percentage)); lcd_put_u8str(12, EXTRAS_2_BASELINE, i16tostr3rj(feedrate_percentage));
lcd_put_u8str(F("%")); lcd_put_lchar('%');
// //
// Filament sensor display if SD is disabled // Filament sensor display if SD is disabled
@@ -900,7 +890,7 @@ void MarlinUI::draw_status_screen() {
#if ENABLED(FILAMENT_LCD_DISPLAY) && DISABLED(SDSUPPORT) #if ENABLED(FILAMENT_LCD_DISPLAY) && DISABLED(SDSUPPORT)
lcd_put_u8str(56, EXTRAS_2_BASELINE, wstring); lcd_put_u8str(56, EXTRAS_2_BASELINE, wstring);
lcd_put_u8str(102, EXTRAS_2_BASELINE, mstring); lcd_put_u8str(102, EXTRAS_2_BASELINE, mstring);
lcd_put_u8str(F("%")); lcd_put_lchar('%');
set_font(FONT_MENU); set_font(FONT_MENU);
lcd_put_lchar(47, EXTRAS_2_BASELINE, LCD_STR_FILAM_DIA[0]); // lcd_put_u8str(F(LCD_STR_FILAM_DIA)); lcd_put_lchar(47, EXTRAS_2_BASELINE, LCD_STR_FILAM_DIA[0]); // lcd_put_u8str(F(LCD_STR_FILAM_DIA));
lcd_put_lchar(93, EXTRAS_2_BASELINE, LCD_STR_FILAM_MUL[0]); lcd_put_lchar(93, EXTRAS_2_BASELINE, LCD_STR_FILAM_MUL[0]);
@@ -917,12 +907,12 @@ void MarlinUI::draw_status_screen() {
// Alternate Status message and Filament display // Alternate Status message and Filament display
if (ELAPSED(millis(), next_filament_display)) { if (ELAPSED(millis(), next_filament_display)) {
lcd_put_u8str(F(LCD_STR_FILAM_DIA)); lcd_put_u8str(F(LCD_STR_FILAM_DIA));
lcd_put_u8str(F(":")); lcd_put_lchar(':');
lcd_put_u8str(wstring); lcd_put_u8str(wstring);
lcd_put_u8str(F(" " LCD_STR_FILAM_MUL)); lcd_put_u8str(F(" " LCD_STR_FILAM_MUL));
lcd_put_u8str(F(":")); lcd_put_lchar(':');
lcd_put_u8str(mstring); lcd_put_u8str(mstring);
lcd_put_u8str(F("%")); lcd_put_lchar('%');
return; return;
} }
#endif #endif
@@ -955,7 +945,7 @@ void MarlinUI::draw_status_message(const bool blink) {
if (slen <= lcd_width) { if (slen <= lcd_width) {
// The string fits within the line. Print with no scrolling // The string fits within the line. Print with no scrolling
lcd_put_u8str(status_message); lcd_put_u8str(status_message);
while (slen < lcd_width) { lcd_put_u8str(F(" ")); ++slen; } while (slen < lcd_width) { lcd_put_lchar(' '); ++slen; }
} }
else { else {
// String is longer than the available space // String is longer than the available space
@@ -973,14 +963,14 @@ void MarlinUI::draw_status_message(const bool blink) {
// If the remaining string doesn't completely fill the screen // If the remaining string doesn't completely fill the screen
if (rlen < lcd_width) { if (rlen < lcd_width) {
uint8_t chars = lcd_width - rlen; // Amount of space left in characters uint8_t chars = lcd_width - rlen; // Amount of space left in characters
lcd_put_u8str(F(" ")); // Always at 1+ spaces left, draw a space lcd_put_lchar(' '); // Always at 1+ spaces left, draw a space
if (--chars) { // Draw a second space if there's room if (--chars) { // Draw a second space if there's room
lcd_put_u8str(F(" ")); lcd_put_lchar(' ');
if (--chars) { // Draw a third space if there's room if (--chars) { // Draw a third space if there's room
lcd_put_u8str(F(" ")); lcd_put_lchar(' ');
if (--chars) { // Print a second copy of the message if (--chars) { // Print a second copy of the message
lcd_put_u8str_max(status_message, pixel_width - (rlen + 2) * (MENU_FONT_WIDTH)); lcd_put_u8str_max(status_message, pixel_width - (rlen + 2) * (MENU_FONT_WIDTH));
lcd_put_u8str(F(" ")); lcd_put_lchar(' ');
} }
} }
} }
@@ -995,7 +985,7 @@ void MarlinUI::draw_status_message(const bool blink) {
lcd_put_u8str_max(status_message, pixel_width); lcd_put_u8str_max(status_message, pixel_width);
// Fill the rest with spaces // Fill the rest with spaces
for (; slen < lcd_width; ++slen) lcd_put_u8str(F(" ")); for (; slen < lcd_width; ++slen) lcd_put_lchar(' ');
#endif // !STATUS_MESSAGE_SCROLLING #endif // !STATUS_MESSAGE_SCROLLING
+1 -1
View File
@@ -161,7 +161,7 @@ static int fontgroup_cb_draw_u8g(void *userdata, const font_t *fnt_current, cons
* *
* Draw a UTF-8 string at the specified position * Draw a UTF-8 string at the specified position
*/ */
unsigned int uxg_DrawLchar(u8g_t *pu8g, unsigned int x, unsigned int y, const lchar_t &wc, pixel_len_t max_width) { unsigned int uxg_DrawWchar(u8g_t *pu8g, unsigned int x, unsigned int y, const lchar_t &wc, pixel_len_t max_width) {
struct _uxg_drawu8_data_t data; struct _uxg_drawu8_data_t data;
font_group_t *group = &g_fontgroup_root; font_group_t *group = &g_fontgroup_root;
const font_t *fnt_default = uxg_GetFont(pu8g); const font_t *fnt_default = uxg_GetFont(pu8g);
+1 -1
View File
@@ -26,7 +26,7 @@ typedef struct _uxg_fontinfo_t {
int uxg_SetUtf8Fonts(const uxg_fontinfo_t * fntinfo, int number); // fntinfo is type of PROGMEM int uxg_SetUtf8Fonts(const uxg_fontinfo_t * fntinfo, int number); // fntinfo is type of PROGMEM
unsigned int uxg_DrawLchar(u8g_t *pu8g, unsigned int x, unsigned int y, const lchar_t &ch, const pixel_len_t max_length); unsigned int uxg_DrawWchar(u8g_t *pu8g, unsigned int x, unsigned int y, const lchar_t &ch, const pixel_len_t max_length);
unsigned int uxg_DrawUtf8Str(u8g_t *pu8g, unsigned int x, unsigned int y, const char *utf8_msg, const pixel_len_t max_length); unsigned int uxg_DrawUtf8Str(u8g_t *pu8g, unsigned int x, unsigned int y, const char *utf8_msg, const pixel_len_t max_length);
unsigned int uxg_DrawUtf8StrP(u8g_t *pu8g, unsigned int x, unsigned int y, PGM_P utf8_msg, const pixel_len_t max_length); unsigned int uxg_DrawUtf8StrP(u8g_t *pu8g, unsigned int x, unsigned int y, PGM_P utf8_msg, const pixel_len_t max_length);
+1 -1
View File
@@ -234,7 +234,7 @@ void DWIN_Frame_AreaMove(uint8_t mode, uint8_t dir, uint16_t dis,
// *string: The string // *string: The string
// rlimit: To limit the drawn string length // rlimit: To limit the drawn string length
void DWIN_Draw_String(bool bShow, uint8_t size, uint16_t color, uint16_t bColor, uint16_t x, uint16_t y, const char * const string, uint16_t rlimit/*=0xFFFF*/) { void DWIN_Draw_String(bool bShow, uint8_t size, uint16_t color, uint16_t bColor, uint16_t x, uint16_t y, const char * const string, uint16_t rlimit/*=0xFFFF*/) {
#if NONE(DWIN_LCD_PROUI, DWIN_CREALITY_LCD_JYERSUI, IS_DWIN_MARLINUI) #if NONE(DWIN_LCD_PROUI, DWIN_CREALITY_LCD_JYERSUI)
DWIN_Draw_Rectangle(1, bColor, x, y, x + (fontWidth(size) * strlen_P(string)), y + fontHeight(size)); DWIN_Draw_Rectangle(1, bColor, x, y, x + (fontWidth(size) * strlen_P(string)), y + fontHeight(size));
#endif #endif
constexpr uint8_t widthAdjust = 0; constexpr uint8_t widthAdjust = 0;
+12 -12
View File
@@ -96,21 +96,21 @@ EncoderState Encoder_ReceiveAnalyze() {
} }
if (newbutton != lastEncoderBits) { if (newbutton != lastEncoderBits) {
switch (newbutton) { switch (newbutton) {
case 0: case ENCODER_PHASE_0:
if (lastEncoderBits == 1) temp_diff++; if (lastEncoderBits == ENCODER_PHASE_3) temp_diff++;
else if (lastEncoderBits == 2) temp_diff--; else if (lastEncoderBits == ENCODER_PHASE_1) temp_diff--;
break; break;
case 2: case ENCODER_PHASE_1:
if (lastEncoderBits == 0) temp_diff++; if (lastEncoderBits == ENCODER_PHASE_0) temp_diff++;
else if (lastEncoderBits == 3) temp_diff--; else if (lastEncoderBits == ENCODER_PHASE_2) temp_diff--;
break; break;
case 3: case ENCODER_PHASE_2:
if (lastEncoderBits == 2) temp_diff++; if (lastEncoderBits == ENCODER_PHASE_1) temp_diff++;
else if (lastEncoderBits == 1) temp_diff--; else if (lastEncoderBits == ENCODER_PHASE_3) temp_diff--;
break; break;
case 1: case ENCODER_PHASE_3:
if (lastEncoderBits == 3) temp_diff++; if (lastEncoderBits == ENCODER_PHASE_2) temp_diff++;
else if (lastEncoderBits == 0) temp_diff--; else if (lastEncoderBits == ENCODER_PHASE_0) temp_diff--;
break; break;
} }
lastEncoderBits = newbutton; lastEncoderBits = newbutton;
+4 -4
View File
@@ -3395,11 +3395,11 @@ void Draw_Max_Accel_Menu() {
Draw_Back_First(); Draw_Back_First();
LOOP_L_N(i, 3 + ENABLED(HAS_HOTEND)) Draw_Menu_Line(i + 1, ICON_MaxSpeedJerkX + i); LOOP_L_N(i, 3 + ENABLED(HAS_HOTEND)) Draw_Menu_Line(i + 1, ICON_MaxSpeedJerkX + i);
Draw_Edit_Float3(1, planner.max_jerk.x * MINUNITMULT); Draw_Edit_Float3(1, planner.max_jerk[X_AXIS] * MINUNITMULT);
Draw_Edit_Float3(2, planner.max_jerk.y * MINUNITMULT); Draw_Edit_Float3(2, planner.max_jerk[Y_AXIS] * MINUNITMULT);
Draw_Edit_Float3(3, planner.max_jerk.z * MINUNITMULT); Draw_Edit_Float3(3, planner.max_jerk[Z_AXIS] * MINUNITMULT);
#if HAS_HOTEND #if HAS_HOTEND
Draw_Edit_Float3(4, planner.max_jerk.e * MINUNITMULT); Draw_Edit_Float3(4, planner.max_jerk[E_AXIS] * MINUNITMULT);
#endif #endif
} }
#endif #endif
+25 -23
View File
@@ -2465,35 +2465,35 @@ void CrealityDWINClass::Menu_Item_Handler(uint8_t menu, uint8_t item, bool draw/
case JERK_X: case JERK_X:
if (draw) { if (draw) {
Draw_Menu_Item(row, ICON_MaxSpeedJerkX, F("X Axis")); Draw_Menu_Item(row, ICON_MaxSpeedJerkX, F("X Axis"));
Draw_Float(planner.max_jerk.x, row, false, 10); Draw_Float(planner.max_jerk[X_AXIS], row, false, 10);
} }
else else
Modify_Value(planner.max_jerk.x, 0, default_max_jerk[X_AXIS] * 2, 10); Modify_Value(planner.max_jerk[X_AXIS], 0, default_max_jerk[X_AXIS] * 2, 10);
break; break;
case JERK_Y: case JERK_Y:
if (draw) { if (draw) {
Draw_Menu_Item(row, ICON_MaxSpeedJerkY, F("Y Axis")); Draw_Menu_Item(row, ICON_MaxSpeedJerkY, F("Y Axis"));
Draw_Float(planner.max_jerk.y, row, false, 10); Draw_Float(planner.max_jerk[Y_AXIS], row, false, 10);
} }
else else
Modify_Value(planner.max_jerk.y, 0, default_max_jerk[Y_AXIS] * 2, 10); Modify_Value(planner.max_jerk[Y_AXIS], 0, default_max_jerk[Y_AXIS] * 2, 10);
break; break;
case JERK_Z: case JERK_Z:
if (draw) { if (draw) {
Draw_Menu_Item(row, ICON_MaxSpeedJerkZ, F("Z Axis")); Draw_Menu_Item(row, ICON_MaxSpeedJerkZ, F("Z Axis"));
Draw_Float(planner.max_jerk.z, row, false, 10); Draw_Float(planner.max_jerk[Z_AXIS], row, false, 10);
} }
else else
Modify_Value(planner.max_jerk.z, 0, default_max_jerk[Z_AXIS] * 2, 10); Modify_Value(planner.max_jerk[Z_AXIS], 0, default_max_jerk[Z_AXIS] * 2, 10);
break; break;
#if HAS_HOTEND #if HAS_HOTEND
case JERK_E: case JERK_E:
if (draw) { if (draw) {
Draw_Menu_Item(row, ICON_MaxSpeedJerkE, F("Extruder")); Draw_Menu_Item(row, ICON_MaxSpeedJerkE, F("Extruder"));
Draw_Float(planner.max_jerk.e, row, false, 10); Draw_Float(planner.max_jerk[E_AXIS], row, false, 10);
} }
else else
Modify_Value(planner.max_jerk.e, 0, default_max_jerk[E_AXIS] * 2, 10); Modify_Value(planner.max_jerk[E_AXIS], 0, default_max_jerk[E_AXIS] * 2, 10);
break; break;
#endif #endif
} }
@@ -2726,7 +2726,7 @@ void CrealityDWINClass::Menu_Item_Handler(uint8_t menu, uint8_t item, bool draw/
#define ADVANCED_UNLOAD (ADVANCED_LOAD + ENABLED(ADVANCED_PAUSE_FEATURE)) #define ADVANCED_UNLOAD (ADVANCED_LOAD + ENABLED(ADVANCED_PAUSE_FEATURE))
#define ADVANCED_COLD_EXTRUDE (ADVANCED_UNLOAD + ENABLED(PREVENT_COLD_EXTRUSION)) #define ADVANCED_COLD_EXTRUDE (ADVANCED_UNLOAD + ENABLED(PREVENT_COLD_EXTRUSION))
#define ADVANCED_FILSENSORENABLED (ADVANCED_COLD_EXTRUDE + ENABLED(FILAMENT_RUNOUT_SENSOR)) #define ADVANCED_FILSENSORENABLED (ADVANCED_COLD_EXTRUDE + ENABLED(FILAMENT_RUNOUT_SENSOR))
#define ADVANCED_FILSENSORDISTANCE (ADVANCED_FILSENSORENABLED + 1) #define ADVANCED_FILSENSORDISTANCE (ADVANCED_FILSENSORENABLED + ENABLED(HAS_FILAMENT_RUNOUT_DISTANCE))
#define ADVANCED_POWER_LOSS (ADVANCED_FILSENSORDISTANCE + ENABLED(POWER_LOSS_RECOVERY)) #define ADVANCED_POWER_LOSS (ADVANCED_FILSENSORDISTANCE + ENABLED(POWER_LOSS_RECOVERY))
#define ADVANCED_TOTAL ADVANCED_POWER_LOSS #define ADVANCED_TOTAL ADVANCED_POWER_LOSS
@@ -2816,22 +2816,24 @@ void CrealityDWINClass::Menu_Item_Handler(uint8_t menu, uint8_t item, bool draw/
case ADVANCED_FILSENSORENABLED: case ADVANCED_FILSENSORENABLED:
if (draw) { if (draw) {
Draw_Menu_Item(row, ICON_Extruder, F("Filament Sensor")); Draw_Menu_Item(row, ICON_Extruder, F("Filament Sensor"));
Draw_Checkbox(row, runout.enabled[0]); Draw_Checkbox(row, runout.enabled);
} }
else { else {
runout.enabled[0] = !runout.enabled[0]; runout.enabled = !runout.enabled;
Draw_Checkbox(row, runout.enabled[0]); Draw_Checkbox(row, runout.enabled);
} }
break; break;
case ADVANCED_FILSENSORDISTANCE: #if ENABLED(HAS_FILAMENT_RUNOUT_DISTANCE)
if (draw) { case ADVANCED_FILSENSORDISTANCE:
Draw_Menu_Item(row, ICON_MaxAccE, F("Runout Distance")); if (draw) {
Draw_Float(runout.runout_distance(), row, false, 10); Draw_Menu_Item(row, ICON_MaxAccE, F("Runout Distance"));
} Draw_Float(runout.runout_distance(), row, false, 10);
else }
Modify_Value(runout.runout_distance(), 0, 999, 10); else
break; Modify_Value(runout.runout_distance(), 0, 999, 10);
break;
#endif
#endif // FILAMENT_RUNOUT_SENSOR #endif // FILAMENT_RUNOUT_SENSOR
#if ENABLED(POWER_LOSS_RECOVERY) #if ENABLED(POWER_LOSS_RECOVERY)
@@ -3711,11 +3713,11 @@ void CrealityDWINClass::Menu_Item_Handler(uint8_t menu, uint8_t item, bool draw/
case TUNE_FILSENSORENABLED: case TUNE_FILSENSORENABLED:
if (draw) { if (draw) {
Draw_Menu_Item(row, ICON_Extruder, F("Filament Sensor")); Draw_Menu_Item(row, ICON_Extruder, F("Filament Sensor"));
Draw_Checkbox(row, runout.enabled[0]); Draw_Checkbox(row, runout.enabled);
} }
else { else {
runout.enabled = !runout.enabled[0]; runout.enabled = !runout.enabled;
Draw_Checkbox(row, runout.enabled[0]); Draw_Checkbox(row, runout.enabled);
} }
break; break;
#endif #endif
+4 -4
View File
@@ -213,7 +213,7 @@ void MarlinUI::draw_status_message(const bool blink) {
lcd_put_u8str(status_message); lcd_put_u8str(status_message);
// Fill the rest with spaces // Fill the rest with spaces
while (slen < max_status_chars) { lcd_put_u8str(F(" ")); ++slen; } while (slen < max_status_chars) { lcd_put_lchar(' '); ++slen; }
} }
} }
else { else {
@@ -227,10 +227,10 @@ void MarlinUI::draw_status_message(const bool blink) {
// If the string doesn't completely fill the line... // If the string doesn't completely fill the line...
if (rlen < max_status_chars) { if (rlen < max_status_chars) {
lcd_put_u8str(F(".")); // Always at 1+ spaces left, draw a dot lcd_put_lchar('.'); // Always at 1+ spaces left, draw a dot
uint8_t chars = max_status_chars - rlen; // Amount of space left in characters uint8_t chars = max_status_chars - rlen; // Amount of space left in characters
if (--chars) { // Draw a second dot if there's space if (--chars) { // Draw a second dot if there's space
lcd_put_u8str(F(".")); lcd_put_lchar('.');
if (--chars) if (--chars)
lcd_put_u8str_max(status_message, chars); // Print a second copy of the message lcd_put_u8str_max(status_message, chars); // Print a second copy of the message
} }
@@ -254,7 +254,7 @@ void MarlinUI::draw_status_message(const bool blink) {
lcd_put_u8str_max(status_message, max_status_chars); lcd_put_u8str_max(status_message, max_status_chars);
// Fill the rest with spaces if there are missing spaces // Fill the rest with spaces if there are missing spaces
while (slen < max_status_chars) { lcd_put_u8str(F(" ")); ++slen; } while (slen < max_status_chars) { lcd_put_lchar(' '); ++slen; }
} }
#endif #endif
@@ -453,7 +453,7 @@ void MarlinUI::draw_status_screen() {
DWIN_Draw_String( DWIN_Draw_String(
false, font16x32, Percent_Color, Color_Bg_Black, false, font16x32, Percent_Color, Color_Bg_Black,
pb_left + (pb_width - dwin_string.length * 16) / 2, pb_left + (pb_width - dwin_string.length * 16) / 2,
pb_top + (pb_height - 32) / 2 - 1, pb_top + (pb_height - 32) / 2,
S(dwin_string.string()) S(dwin_string.string())
); );
#endif #endif
+16 -17
View File
@@ -2322,12 +2322,14 @@ void SetPID(celsius_t t, heater_id_t h) {
#if HAS_FILAMENT_SENSOR #if HAS_FILAMENT_SENSOR
void SetRunoutEnable() { void SetRunoutEnable() {
runout.reset(); runout.reset();
runout.enabled[0] = !runout.enabled[0]; runout.enabled = !runout.enabled;
Draw_Chkb_Line(CurrentMenu->line(), runout.enabled[0]); Draw_Chkb_Line(CurrentMenu->line(), runout.enabled);
DWIN_UpdateLCD(); DWIN_UpdateLCD();
} }
void ApplyRunoutDistance() { runout.set_runout_distance(MenuData.Value / MINUNITMULT); } #if HAS_FILAMENT_RUNOUT_DISTANCE
void SetRunoutDistance() { SetFloatOnClick(0, 999, UNITFDIGITS, runout.runout_distance(0), ApplyRunoutDistance); } void ApplyRunoutDistance() { runout.set_runout_distance(MenuData.Value / MINUNITMULT); }
void SetRunoutDistance() { SetFloatOnClick(0, 999, UNITFDIGITS, runout.runout_distance(), ApplyRunoutDistance); }
#endif
#endif #endif
#if ENABLED(ADVANCED_PAUSE_FEATURE) #if ENABLED(ADVANCED_PAUSE_FEATURE)
@@ -2652,11 +2654,11 @@ void SetMaxAccelZ() { HMI_value.axis = Z_AXIS, SetIntOnClick(MIN_MAXACCELERATION
#if HAS_CLASSIC_JERK #if HAS_CLASSIC_JERK
void ApplyMaxJerk() { planner.set_max_jerk(HMI_value.axis, MenuData.Value / MINUNITMULT); } void ApplyMaxJerk() { planner.set_max_jerk(HMI_value.axis, MenuData.Value / MINUNITMULT); }
void SetMaxJerkX() { HMI_value.axis = X_AXIS, SetFloatOnClick(MIN_MAXJERK, max_jerk_edit_values[X_AXIS], UNITFDIGITS, planner.max_jerk.x, ApplyMaxJerk); } void SetMaxJerkX() { HMI_value.axis = X_AXIS, SetFloatOnClick(MIN_MAXJERK, max_jerk_edit_values[X_AXIS], UNITFDIGITS, planner.max_jerk[X_AXIS], ApplyMaxJerk); }
void SetMaxJerkY() { HMI_value.axis = Y_AXIS, SetFloatOnClick(MIN_MAXJERK, max_jerk_edit_values[Y_AXIS], UNITFDIGITS, planner.max_jerk.y, ApplyMaxJerk); } void SetMaxJerkY() { HMI_value.axis = Y_AXIS, SetFloatOnClick(MIN_MAXJERK, max_jerk_edit_values[Y_AXIS], UNITFDIGITS, planner.max_jerk[Y_AXIS], ApplyMaxJerk); }
void SetMaxJerkZ() { HMI_value.axis = Z_AXIS, SetFloatOnClick(MIN_MAXJERK, max_jerk_edit_values[Z_AXIS], UNITFDIGITS, planner.max_jerk.z, ApplyMaxJerk); } void SetMaxJerkZ() { HMI_value.axis = Z_AXIS, SetFloatOnClick(MIN_MAXJERK, max_jerk_edit_values[Z_AXIS], UNITFDIGITS, planner.max_jerk[Z_AXIS], ApplyMaxJerk); }
#if HAS_HOTEND #if HAS_HOTEND
void SetMaxJerkE() { HMI_value.axis = E_AXIS; SetFloatOnClick(MIN_MAXJERK, max_jerk_edit_values[E_AXIS], UNITFDIGITS, planner.max_jerk.e, ApplyMaxJerk); } void SetMaxJerkE() { HMI_value.axis = E_AXIS; SetFloatOnClick(MIN_MAXJERK, max_jerk_edit_values[E_AXIS], UNITFDIGITS, planner.max_jerk[E_AXIS], ApplyMaxJerk); }
#endif #endif
#endif #endif
@@ -2844,9 +2846,6 @@ void onDrawGetColorItem(MenuItemClass* menuitem, int8_t line) {
DWIN_Draw_HLine(HMI_data.SplitLine_Color, 16, MYPOS(line + 1), 240); DWIN_Draw_HLine(HMI_data.SplitLine_Color, 16, MYPOS(line + 1), 240);
} }
#if HAS_FILAMENT_SENSOR
void onDrawRunoutEnable(MenuItemClass* menuitem, int8_t line) { onDrawChkbMenu(menuitem, line, runout.enabled[0]); }
#endif
void onDrawPIDi(MenuItemClass* menuitem, int8_t line) { onDrawFloatMenu(menuitem, line, 2, unscalePID_i(*(float*)static_cast<MenuItemPtrClass*>(menuitem)->value)); } void onDrawPIDi(MenuItemClass* menuitem, int8_t line) { onDrawFloatMenu(menuitem, line, 2, unscalePID_i(*(float*)static_cast<MenuItemPtrClass*>(menuitem)->value)); }
void onDrawPIDd(MenuItemClass* menuitem, int8_t line) { onDrawFloatMenu(menuitem, line, 2, unscalePID_d(*(float*)static_cast<MenuItemPtrClass*>(menuitem)->value)); } void onDrawPIDd(MenuItemClass* menuitem, int8_t line) { onDrawFloatMenu(menuitem, line, 2, unscalePID_d(*(float*)static_cast<MenuItemPtrClass*>(menuitem)->value)); }
@@ -3321,10 +3320,10 @@ void Draw_FilSet_Menu() {
if (SetMenu(FilSetMenu, GET_TEXT_F(MSG_FILAMENT_SET), 9)) { if (SetMenu(FilSetMenu, GET_TEXT_F(MSG_FILAMENT_SET), 9)) {
BACK_ITEM(Draw_AdvancedSettings_Menu); BACK_ITEM(Draw_AdvancedSettings_Menu);
#if HAS_FILAMENT_SENSOR #if HAS_FILAMENT_SENSOR
EDIT_ITEM_F(ICON_Runout, MSG_RUNOUT_ENABLE, onDrawChkbMenu, SetRunoutEnable, &runout.enabled[0]); EDIT_ITEM_F(ICON_Runout, MSG_RUNOUT_ENABLE, onDrawChkbMenu, SetRunoutEnable, &runout.enabled);
#endif #endif
#if HAS_FILAMENT_RUNOUT_DISTANCE #if HAS_FILAMENT_RUNOUT_DISTANCE
EDIT_ITEM_F(ICON_Runout, MSG_RUNOUT_DISTANCE_MM, onDrawPFloatMenu, SetRunoutDistance, &runout.runout_distance(0)); EDIT_ITEM_F(ICON_Runout, MSG_RUNOUT_DISTANCE_MM, onDrawPFloatMenu, SetRunoutDistance, &runout.runout_distance());
#endif #endif
#if ENABLED(PREVENT_COLD_EXTRUSION) #if ENABLED(PREVENT_COLD_EXTRUSION)
EDIT_ITEM_F(ICON_ExtrudeMinT, MSG_EXTRUDER_MIN_TEMP, onDrawPIntMenu, SetExtMinT, &HMI_data.ExtMinT); EDIT_ITEM_F(ICON_ExtrudeMinT, MSG_EXTRUDER_MIN_TEMP, onDrawPIntMenu, SetExtMinT, &HMI_data.ExtMinT);
@@ -3642,11 +3641,11 @@ void Draw_MaxAccel_Menu() {
SetMenuTitle({1, 16, 28, 13}, GET_TEXT_F(MSG_JERK)); SetMenuTitle({1, 16, 28, 13}, GET_TEXT_F(MSG_JERK));
MenuItemsPrepare(5); MenuItemsPrepare(5);
BACK_ITEM(Draw_Motion_Menu); BACK_ITEM(Draw_Motion_Menu);
EDIT_ITEM_F(ICON_MaxSpeedJerkX, MSG_VA_JERK, onDrawMaxJerkX, SetMaxJerkX, &planner.max_jerk.x); EDIT_ITEM_F(ICON_MaxSpeedJerkX, MSG_VA_JERK, onDrawMaxJerkX, SetMaxJerkX, &planner.max_jerk[X_AXIS]);
EDIT_ITEM_F(ICON_MaxSpeedJerkY, MSG_VB_JERK, onDrawMaxJerkY, SetMaxJerkY, &planner.max_jerk.y); EDIT_ITEM_F(ICON_MaxSpeedJerkY, MSG_VB_JERK, onDrawMaxJerkY, SetMaxJerkY, &planner.max_jerk[Y_AXIS]);
EDIT_ITEM_F(ICON_MaxSpeedJerkZ, MSG_VC_JERK, onDrawMaxJerkZ, SetMaxJerkZ, &planner.max_jerk.z); EDIT_ITEM_F(ICON_MaxSpeedJerkZ, MSG_VC_JERK, onDrawMaxJerkZ, SetMaxJerkZ, &planner.max_jerk[Z_AXIS]);
#if HAS_HOTEND #if HAS_HOTEND
EDIT_ITEM_F(ICON_MaxSpeedJerkE, MSG_VE_JERK, onDrawMaxJerkE, SetMaxJerkE, &planner.max_jerk.e); EDIT_ITEM_F(ICON_MaxSpeedJerkE, MSG_VE_JERK, onDrawMaxJerkE, SetMaxJerkE, &planner.max_jerk[E_AXIS]);
#endif #endif
} }
CurrentMenu->draw(); CurrentMenu->draw();
+1 -1
View File
@@ -104,7 +104,7 @@ void ESDiagClass::Update() {
ES_REPORT(Z_MIN); ES_REPORT(Z_MIN);
#endif #endif
#if HAS_FILAMENT_SENSOR #if HAS_FILAMENT_SENSOR
draw_es_state(READ(FIL_RUNOUT1_PIN) != runout.out_state()); draw_es_state(READ(FIL_RUNOUT1_PIN) != FIL_RUNOUT1_STATE);
#endif #endif
DWIN_UpdateLCD(); DWIN_UpdateLCD();
} }
@@ -72,6 +72,17 @@ void ChironTFT::Startup() {
live_Zoffset = 0.0; live_Zoffset = 0.0;
file_menu = AC_menu_file; file_menu = AC_menu_file;
// Setup pins for powerloss detection
// Two IO pins are connected on the Trigorilla Board
// On a power interruption the OUTAGECON_PIN goes low.
#if ENABLED(POWER_LOSS_RECOVERY)
OUT_WRITE(OUTAGECON_PIN, HIGH);
#endif
// Filament runout is handled by Marlin settings in Configuration.h
// opt_set FIL_RUNOUT_STATE HIGH // Pin state indicating that filament is NOT present.
// opt_enable FIL_RUNOUT_PULLUP
TFTSer.begin(115200); TFTSer.begin(115200);
// Wait for the TFT panel to initialize and finish the animation // Wait for the TFT panel to initialize and finish the animation
@@ -45,16 +45,15 @@ bool BaseScreen::buttonStyleCallback(CommandProcessor &cmd, uint8_t tag, uint8_t
return false; return false;
} }
#if HAS_SCREEN_TIMEOUT #if SCREENS_CAN_TIME_OUT
if (EventLoop::get_pressed_tag() != 0) { if (EventLoop::get_pressed_tag() != 0) {
#if ENABLED(TOUCH_UI_DEBUG)
SERIAL_ECHO_MSG("buttonStyleCallback, resetting timeout");
#endif
reset_menu_timeout(); reset_menu_timeout();
} }
#endif #endif
if (buttonIsPressed(tag)) options = OPT_FLAT; if (buttonIsPressed(tag)) {
options = OPT_FLAT;
}
if (style & cmd.STYLE_DISABLED) { if (style & cmd.STYLE_DISABLED) {
cmd.tag(0); cmd.tag(0);
@@ -66,10 +65,7 @@ bool BaseScreen::buttonStyleCallback(CommandProcessor &cmd, uint8_t tag, uint8_t
} }
void BaseScreen::onIdle() { void BaseScreen::onIdle() {
#if HAS_SCREEN_TIMEOUT #if SCREENS_CAN_TIME_OUT
if (EventLoop::get_pressed_tag() != 0)
reset_menu_timeout();
if ((millis() - last_interaction) > LCD_TIMEOUT_TO_STATUS) { if ((millis() - last_interaction) > LCD_TIMEOUT_TO_STATUS) {
reset_menu_timeout(); reset_menu_timeout();
#if ENABLED(TOUCH_UI_DEBUG) #if ENABLED(TOUCH_UI_DEBUG)
@@ -81,10 +77,10 @@ void BaseScreen::onIdle() {
} }
void BaseScreen::reset_menu_timeout() { void BaseScreen::reset_menu_timeout() {
TERN_(HAS_SCREEN_TIMEOUT, last_interaction = millis()); TERN_(SCREENS_CAN_TIME_OUT, last_interaction = millis());
} }
#if HAS_SCREEN_TIMEOUT #if SCREENS_CAN_TIME_OUT
uint32_t BaseScreen::last_interaction; uint32_t BaseScreen::last_interaction;
#endif #endif
@@ -27,7 +27,7 @@
class BaseScreen : public UIScreen { class BaseScreen : public UIScreen {
protected: protected:
#if HAS_SCREEN_TIMEOUT #if SCREENS_CAN_TIME_OUT
static uint32_t last_interaction; static uint32_t last_interaction;
#endif #endif
@@ -85,12 +85,12 @@ void EndstopStatesScreen::onRedraw(draw_mode_t) {
PIN_DISABLED(5, 3, PSTR(STR_Z_MIN), Z_MIN) PIN_DISABLED(5, 3, PSTR(STR_Z_MIN), Z_MIN)
#endif #endif
#if ENABLED(FILAMENT_RUNOUT_SENSOR) && PIN_EXISTS(FIL_RUNOUT) #if ENABLED(FILAMENT_RUNOUT_SENSOR) && PIN_EXISTS(FIL_RUNOUT)
PIN_ENABLED (1, 4, GET_TEXT_F(MSG_RUNOUT_1), FIL_RUNOUT, !runout.out_state()) PIN_ENABLED (1, 4, GET_TEXT_F(MSG_RUNOUT_1), FIL_RUNOUT, FIL_RUNOUT1_STATE)
#else #else
PIN_DISABLED(1, 4, GET_TEXT_F(MSG_RUNOUT_1), FIL_RUNOUT) PIN_DISABLED(1, 4, GET_TEXT_F(MSG_RUNOUT_1), FIL_RUNOUT)
#endif #endif
#if BOTH(HAS_MULTI_EXTRUDER, FILAMENT_RUNOUT_SENSOR) && PIN_EXISTS(FIL_RUNOUT2) #if BOTH(HAS_MULTI_EXTRUDER, FILAMENT_RUNOUT_SENSOR) && PIN_EXISTS(FIL_RUNOUT2)
PIN_ENABLED (3, 4, GET_TEXT_F(MSG_RUNOUT_2), FIL_RUNOUT2, !runout.out_state(1)) PIN_ENABLED (3, 4, GET_TEXT_F(MSG_RUNOUT_2), FIL_RUNOUT2, FIL_RUNOUT2_STATE)
#else #else
PIN_DISABLED(3, 4, GET_TEXT_F(MSG_RUNOUT_2), FIL_RUNOUT2) PIN_DISABLED(3, 4, GET_TEXT_F(MSG_RUNOUT_2), FIL_RUNOUT2)
#endif #endif
@@ -34,13 +34,14 @@ void FilamentRunoutScreen::onRedraw(draw_mode_t what) {
w.heading( GET_TEXT_F(MSG_FILAMENT)); w.heading( GET_TEXT_F(MSG_FILAMENT));
w.toggle( 2, GET_TEXT_F(MSG_RUNOUT_SENSOR), getFilamentRunoutEnabled()); w.toggle( 2, GET_TEXT_F(MSG_RUNOUT_SENSOR), getFilamentRunoutEnabled());
w.heading(GET_TEXT_F(MSG_RUNOUT_DISTANCE_MM)); #if HAS_FILAMENT_RUNOUT_DISTANCE
w.units(GET_TEXT_F(MSG_UNITS_MM)); w.heading(GET_TEXT_F(MSG_RUNOUT_DISTANCE_MM));
w.precision(0); w.units(GET_TEXT_F(MSG_UNITS_MM));
w.color(e_axis); w.precision(0);
w.adjuster( 10, FPSTR(NUL_STR), getFilamentRunoutDistance_mm(), getFilamentRunoutEnabled()); w.color(e_axis);
w.increments(); w.adjuster( 10, FPSTR(NUL_STR), getFilamentRunoutDistance_mm(), getFilamentRunoutEnabled());
w.increments();
#endif
} }
bool FilamentRunoutScreen::onTouchHeld(uint8_t tag) { bool FilamentRunoutScreen::onTouchHeld(uint8_t tag) {
@@ -48,8 +49,10 @@ bool FilamentRunoutScreen::onTouchHeld(uint8_t tag) {
const float increment = getIncrement(); const float increment = getIncrement();
switch (tag) { switch (tag) {
case 2: setFilamentRunoutEnabled(!getFilamentRunoutEnabled()); break; case 2: setFilamentRunoutEnabled(!getFilamentRunoutEnabled()); break;
case 10: UI_DECREMENT(FilamentRunoutDistance_mm); break; #if HAS_FILAMENT_RUNOUT_DISTANCE
case 11: UI_INCREMENT(FilamentRunoutDistance_mm); break; case 10: UI_DECREMENT(FilamentRunoutDistance_mm); break;
case 11: UI_INCREMENT(FilamentRunoutDistance_mm); break;
#endif
default: default:
return false; return false;
} }
@@ -113,7 +113,7 @@ bool BaseMoveAxisScreen::onTouchHeld(uint8_t tag) {
void BaseMoveAxisScreen::raiseZtoTop() { void BaseMoveAxisScreen::raiseZtoTop() {
constexpr xyze_feedrate_t homing_feedrate = HOMING_FEEDRATE_MM_M; constexpr xyze_feedrate_t homing_feedrate = HOMING_FEEDRATE_MM_M;
setAxisPosition_mm(Z_MAX_POS - 5, Z, homing_feedrate.z); setAxisPosition_mm(Z_MAX_POS - 5, Z, homing_feedrate[Z_AXIS]);
} }
float BaseMoveAxisScreen::getManualFeedrate(uint8_t axis, float increment_mm) { float BaseMoveAxisScreen::getManualFeedrate(uint8_t axis, float increment_mm) {
@@ -27,8 +27,8 @@
#include "../../../inc/MarlinConfig.h" #include "../../../inc/MarlinConfig.h"
#include "SPIFlashStorage.h" #include "SPIFlashStorage.h"
#if DISABLED(SPI_FLASH) #if !HAS_SPI_FLASH
#error "SPI_FLASH is required with TFT_LVGL_UI." #error "HAS_SPI_FLASH is required with TFT_LVGL_UI."
#endif #endif
extern W25QXXFlash W25QXX; extern W25QXXFlash W25QXX;
@@ -74,16 +74,16 @@ static void event_handler(lv_obj_t *obj, lv_event_t event) {
void lv_draw_jerk_settings() { void lv_draw_jerk_settings() {
scr = lv_screen_create(JERK_UI, machine_menu.JerkConfTitle); scr = lv_screen_create(JERK_UI, machine_menu.JerkConfTitle);
dtostrf(planner.max_jerk.x, 1, 1, public_buf_l); dtostrf(planner.max_jerk[X_AXIS], 1, 1, public_buf_l);
lv_screen_menu_item_1_edit(scr, machine_menu.X_Jerk, PARA_UI_POS_X, PARA_UI_POS_Y, event_handler, ID_JERK_X, 0, public_buf_l); lv_screen_menu_item_1_edit(scr, machine_menu.X_Jerk, PARA_UI_POS_X, PARA_UI_POS_Y, event_handler, ID_JERK_X, 0, public_buf_l);
dtostrf(planner.max_jerk.y, 1, 1, public_buf_l); dtostrf(planner.max_jerk[Y_AXIS], 1, 1, public_buf_l);
lv_screen_menu_item_1_edit(scr, machine_menu.Y_Jerk, PARA_UI_POS_X, PARA_UI_POS_Y * 2, event_handler, ID_JERK_Y, 1, public_buf_l); lv_screen_menu_item_1_edit(scr, machine_menu.Y_Jerk, PARA_UI_POS_X, PARA_UI_POS_Y * 2, event_handler, ID_JERK_Y, 1, public_buf_l);
dtostrf(planner.max_jerk.z, 1, 1, public_buf_l); dtostrf(planner.max_jerk[Z_AXIS], 1, 1, public_buf_l);
lv_screen_menu_item_1_edit(scr, machine_menu.Z_Jerk, PARA_UI_POS_X, PARA_UI_POS_Y * 3, event_handler, ID_JERK_Z, 2, public_buf_l); lv_screen_menu_item_1_edit(scr, machine_menu.Z_Jerk, PARA_UI_POS_X, PARA_UI_POS_Y * 3, event_handler, ID_JERK_Z, 2, public_buf_l);
dtostrf(planner.max_jerk.e, 1, 1, public_buf_l); dtostrf(planner.max_jerk[E_AXIS], 1, 1, public_buf_l);
lv_screen_menu_item_1_edit(scr, machine_menu.E_Jerk, PARA_UI_POS_X, PARA_UI_POS_Y * 4, event_handler, ID_JERK_E, 3, public_buf_l); lv_screen_menu_item_1_edit(scr, machine_menu.E_Jerk, PARA_UI_POS_X, PARA_UI_POS_Y * 4, event_handler, ID_JERK_E, 3, public_buf_l);
lv_big_button_create(scr, "F:/bmp_back70x40.bin", common_menu.text_back, PARA_UI_BACK_POS_X, PARA_UI_BACK_POS_Y, event_handler, ID_JERK_RETURN, true); lv_big_button_create(scr, "F:/bmp_back70x40.bin", common_menu.text_back, PARA_UI_BACK_POS_X, PARA_UI_BACK_POS_Y, event_handler, ID_JERK_RETURN, true);
@@ -119,22 +119,22 @@ static void disp_key_value() {
case XJerk: case XJerk:
#if HAS_CLASSIC_JERK #if HAS_CLASSIC_JERK
dtostrf(planner.max_jerk.x, 1, 1, public_buf_m); dtostrf(planner.max_jerk[X_AXIS], 1, 1, public_buf_m);
#endif #endif
break; break;
case YJerk: case YJerk:
#if HAS_CLASSIC_JERK #if HAS_CLASSIC_JERK
dtostrf(planner.max_jerk.y, 1, 1, public_buf_m); dtostrf(planner.max_jerk[Y_AXIS], 1, 1, public_buf_m);
#endif #endif
break; break;
case ZJerk: case ZJerk:
#if HAS_CLASSIC_JERK #if HAS_CLASSIC_JERK
dtostrf(planner.max_jerk.z, 1, 1, public_buf_m); dtostrf(planner.max_jerk[Z_AXIS], 1, 1, public_buf_m);
#endif #endif
break; break;
case EJerk: case EJerk:
#if HAS_CLASSIC_JERK #if HAS_CLASSIC_JERK
dtostrf(planner.max_jerk.e, 1, 1, public_buf_m); dtostrf(planner.max_jerk[E_AXIS], 1, 1, public_buf_m);
#endif #endif
break; break;
@@ -307,10 +307,10 @@ static void set_value_confirm() {
case ZMaxFeedRate: planner.settings.max_feedrate_mm_s[Z_AXIS] = atof(key_value); break; case ZMaxFeedRate: planner.settings.max_feedrate_mm_s[Z_AXIS] = atof(key_value); break;
case E0MaxFeedRate: planner.settings.max_feedrate_mm_s[E_AXIS] = atof(key_value); break; case E0MaxFeedRate: planner.settings.max_feedrate_mm_s[E_AXIS] = atof(key_value); break;
case E1MaxFeedRate: planner.settings.max_feedrate_mm_s[E_AXIS_N(1)] = atof(key_value); break; case E1MaxFeedRate: planner.settings.max_feedrate_mm_s[E_AXIS_N(1)] = atof(key_value); break;
case XJerk: TERN_(HAS_CLASSIC_JERK, planner.max_jerk.x = atof(key_value)); break; case XJerk: TERN_(HAS_CLASSIC_JERK, planner.max_jerk[X_AXIS] = atof(key_value)); break;
case YJerk: TERN_(HAS_CLASSIC_JERK, planner.max_jerk.y = atof(key_value)); break; case YJerk: TERN_(HAS_CLASSIC_JERK, planner.max_jerk[Y_AXIS] = atof(key_value)); break;
case ZJerk: TERN_(HAS_CLASSIC_JERK, planner.max_jerk.z = atof(key_value)); break; case ZJerk: TERN_(HAS_CLASSIC_JERK, planner.max_jerk[Z_AXIS] = atof(key_value)); break;
case EJerk: TERN_(HAS_CLASSIC_JERK, planner.max_jerk.e = atof(key_value)); break; case EJerk: TERN_(HAS_CLASSIC_JERK, planner.max_jerk[E_AXIS] = atof(key_value)); break;
case Xstep: planner.settings.axis_steps_per_mm[X_AXIS] = atof(key_value); planner.refresh_positioning(); break; case Xstep: planner.settings.axis_steps_per_mm[X_AXIS] = atof(key_value); planner.refresh_positioning(); break;
case Ystep: planner.settings.axis_steps_per_mm[Y_AXIS] = atof(key_value); planner.refresh_positioning(); break; case Ystep: planner.settings.axis_steps_per_mm[Y_AXIS] = atof(key_value); planner.refresh_positioning(); break;
case Zstep: planner.settings.axis_steps_per_mm[Z_AXIS] = atof(key_value); planner.refresh_positioning(); break; case Zstep: planner.settings.axis_steps_per_mm[Z_AXIS] = atof(key_value); planner.refresh_positioning(); break;
@@ -482,14 +482,14 @@ void lv_encoder_pin_init() {
#if BUTTON_EXISTS(UP) #if BUTTON_EXISTS(UP)
SET_INPUT(BTN_UP); SET_INPUT(BTN_UP);
#endif #endif
#if BUTTON_EXISTS(DOWN) #if BUTTON_EXISTS(DWN)
SET_INPUT(BTN_DOWN); SET_INPUT(BTN_DWN);
#endif #endif
#if BUTTON_EXISTS(LEFT) #if BUTTON_EXISTS(LFT)
SET_INPUT(BTN_LEFT); SET_INPUT(BTN_LFT);
#endif #endif
#if BUTTON_EXISTS(RIGHT) #if BUTTON_EXISTS(RT)
SET_INPUT(BTN_RIGHT); SET_INPUT(BTN_RT);
#endif #endif
} }
+10 -7
View File
@@ -375,9 +375,9 @@ namespace ExtUI {
bool canMove(const axis_t axis) { bool canMove(const axis_t axis) {
switch (axis) { switch (axis) {
#if IS_KINEMATIC || ENABLED(NO_MOTION_BEFORE_HOMING) #if IS_KINEMATIC || ENABLED(NO_MOTION_BEFORE_HOMING)
case X: return !axis_should_home(X_AXIS); case X: return axis_should_home(X_AXIS);
OPTCODE(HAS_Y_AXIS, case Y: return !axis_should_home(Y_AXIS)) OPTCODE(HAS_Y_AXIS, case Y: return axis_should_home(Y_AXIS))
OPTCODE(HAS_Z_AXIS, case Z: return !axis_should_home(Z_AXIS)) OPTCODE(HAS_Z_AXIS, case Z: return axis_should_home(Z_AXIS))
#else #else
case X: case Y: case Z: return true; case X: case Y: case Z: return true;
#endif #endif
@@ -683,12 +683,15 @@ namespace ExtUI {
} }
#if HAS_FILAMENT_SENSOR #if HAS_FILAMENT_SENSOR
bool getFilamentRunoutEnabled(const extruder_t extruder/*=E0*/) { return runout.enabled[extruder]; } bool getFilamentRunoutEnabled() { return runout.enabled; }
void setFilamentRunoutEnabled(const bool value, const extruder_t extruder/*=E0*/) { runout.enabled[extruder] = value; } void setFilamentRunoutEnabled(const bool value) { runout.enabled = value; }
bool getFilamentRunoutState() { return runout.filament_ran_out; } bool getFilamentRunoutState() { return runout.filament_ran_out; }
void setFilamentRunoutState(const bool value) { runout.filament_ran_out = value; } void setFilamentRunoutState(const bool value) { runout.filament_ran_out = value; }
float getFilamentRunoutDistance_mm() { return runout.runout_distance(); }
void setFilamentRunoutDistance_mm(const_float_t value) { runout.set_runout_distance(constrain(value, 0, 999)); } #if HAS_FILAMENT_RUNOUT_DISTANCE
float getFilamentRunoutDistance_mm() { return runout.runout_distance(); }
void setFilamentRunoutDistance_mm(const_float_t value) { runout.set_runout_distance(constrain(value, 0, 999)); }
#endif
#endif #endif
#if ENABLED(CASE_LIGHT_ENABLE) #if ENABLED(CASE_LIGHT_ENABLE)

Some files were not shown because too many files have changed in this diff Show More