Compare commits
56 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 2065f1e267 | |||
| 5a4b2ba5c5 | |||
| 7726af9c53 | |||
| 733d5fd57d | |||
| d18c834029 | |||
| da8576f642 | |||
| c73d47327b | |||
| 53a82511ff | |||
| 9d3bc551bc | |||
| c2c771a1cc | |||
| a6125b859d | |||
| eea9b6d8ae | |||
| 6131d2c5a6 | |||
| 29ab4f5982 | |||
| 30c9b9bbba | |||
| 0398a0b780 | |||
| 9d1d35f1ed | |||
| 4e9ccffc10 | |||
| 62dc3e7a22 | |||
| 67c1075e47 | |||
| a4e955d606 | |||
| 25053572ec | |||
| 8f59d44e4d | |||
| b99411b62b | |||
| dc202b3cb3 | |||
| 08155b4875 | |||
| c207111cc6 | |||
| 5ceccc95a8 | |||
| 62a595750d | |||
| 0987c3a3a3 | |||
| d099cb3b5a | |||
| 82ea06e6a4 | |||
| 74be64a1ec | |||
| da76381605 | |||
| bc6e90f4ab | |||
| 52ae3e6967 | |||
| dceaeeeaf9 | |||
| dbed009090 | |||
| 25a8bbcbf3 | |||
| b80179d14a | |||
| 605b539ecd | |||
| 5c6a2f4d0d | |||
| 6a32d87e58 | |||
| 214fe90a3b | |||
| e400ef346a | |||
| e60c38b622 | |||
| a80c371340 | |||
| d051495dec | |||
| 2dd25938cc | |||
| dd4990252e | |||
| 0d7075b90c | |||
| 76e80aa400 | |||
| 9398c43112 | |||
| 84fd0eff17 | |||
| 731370051d | |||
| 5fde86406f |
@@ -56,29 +56,31 @@ jobs:
|
||||
|
||||
# STM32F1 (Maple) Environments
|
||||
|
||||
- STM32F103RC_btt
|
||||
- STM32F103RC_btt_USB
|
||||
- STM32F103RE_btt
|
||||
- STM32F103RE_btt_USB
|
||||
#- STM32F103RC_btt_maple
|
||||
- STM32F103RC_btt_USB_maple
|
||||
- STM32F103RC_fysetc
|
||||
- STM32F103RC_meeb
|
||||
- jgaurora_a5s_a1
|
||||
- STM32F103VE_longer
|
||||
- mks_robin
|
||||
#- mks_robin_maple
|
||||
- mks_robin_lite
|
||||
- mks_robin_pro
|
||||
- STM32F103RET6_creality
|
||||
- mks_robin_nano35
|
||||
#- mks_robin_nano35_maple
|
||||
#- STM32F103RET6_creality_maple
|
||||
|
||||
# STM32 (ST) Environments
|
||||
|
||||
- STM32F103RC_btt_stm32
|
||||
- STM32F103RC_btt
|
||||
#- STM32F103RC_btt_USB
|
||||
- STM32F103RE_btt
|
||||
- STM32F103RE_btt_USB
|
||||
- STM32F103RET6_creality
|
||||
- STM32F407VE_black
|
||||
- STM32F401VE_STEVAL
|
||||
- BIGTREE_BTT002
|
||||
- BIGTREE_SKR_PRO
|
||||
- BIGTREE_GTR_V1_0
|
||||
- mks_robin_stm32
|
||||
- mks_robin
|
||||
- ARMED
|
||||
- FYSETC_S6
|
||||
- STM32F070CB_malyan
|
||||
@@ -88,7 +90,7 @@ jobs:
|
||||
- rumba32
|
||||
- LERDGEX
|
||||
- LERDGEK
|
||||
- mks_robin_nano35_stm32
|
||||
- mks_robin_nano35
|
||||
- NUCLEO_F767ZI
|
||||
- REMRAM_V1
|
||||
- BTT_SKR_SE_BX
|
||||
|
||||
+183
-68
@@ -35,7 +35,7 @@
|
||||
*
|
||||
* Advanced settings can be found in Configuration_adv.h
|
||||
*/
|
||||
#define CONFIGURATION_H_VERSION 02000801
|
||||
#define CONFIGURATION_H_VERSION 02000900
|
||||
|
||||
//===========================================================================
|
||||
//============================= Getting Started =============================
|
||||
@@ -66,11 +66,19 @@
|
||||
//
|
||||
//===========================================================================
|
||||
|
||||
//===========================================================================
|
||||
//=========================== FOAMCUTTER_XYUV ==============================
|
||||
//===========================================================================
|
||||
// For a hot wire cutter with parallel horizontal axes X, I where the hights
|
||||
// of the two wire ends are controlled by parallel axes Y, J.
|
||||
//
|
||||
//#define FOAMCUTTER_XYUV
|
||||
|
||||
// @section info
|
||||
|
||||
// Author info of this build printed to the host during boot and M115
|
||||
#define STRING_CONFIG_H_AUTHOR "Insanity Automation" // Who made the changes.
|
||||
//#define CUSTOM_VERSION_FILE Version.h // Path from the root directory (no quotes)
|
||||
#define STRING_CONFIG_H_AUTHOR "InsanityAutomation" // Who made the changes.
|
||||
#define CUSTOM_VERSION_FILE Version.h // Path from the root directory (no quotes)
|
||||
|
||||
/**
|
||||
* *** VENDORS PLEASE READ ***
|
||||
@@ -87,7 +95,7 @@
|
||||
#define SHOW_BOOTSCREEN
|
||||
|
||||
// Show the bitmap in Marlin/_Bootscreen.h on startup.
|
||||
//#define SHOW_CUSTOM_BOOTSCREEN
|
||||
#define SHOW_CUSTOM_BOOTSCREEN
|
||||
|
||||
// Show the bitmap in Marlin/_Statusscreen.h on the status screen.
|
||||
//#define CUSTOM_STATUS_SCREEN_IMAGE
|
||||
@@ -139,7 +147,7 @@
|
||||
|
||||
// Choose the name from boards.h that matches your setup
|
||||
#ifndef MOTHERBOARD
|
||||
#define MOTHERBOARD BOARD_ORTUR_4
|
||||
#define MOTHERBOARD BOARD_RAMPS_14_EFB
|
||||
#endif
|
||||
|
||||
// Name displayed in the LCD "Ready" message and Info menu
|
||||
@@ -149,6 +157,45 @@
|
||||
// Choose your own or use a service like https://www.uuidgenerator.net/version4
|
||||
//#define MACHINE_UUID "00000000-0000-0000-0000-000000000000"
|
||||
|
||||
/**
|
||||
* Define the number of coordinated linear axes.
|
||||
* See https://github.com/DerAndere1/Marlin/wiki
|
||||
* Each linear axis gets its own stepper control and endstop:
|
||||
*
|
||||
* Steppers: *_STEP_PIN, *_ENABLE_PIN, *_DIR_PIN, *_ENABLE_ON
|
||||
* Endstops: *_STOP_PIN, USE_*MIN_PLUG, USE_*MAX_PLUG
|
||||
* Axes: *_MIN_POS, *_MAX_POS, INVERT_*_DIR
|
||||
* Planner: DEFAULT_AXIS_STEPS_PER_UNIT, DEFAULT_MAX_FEEDRATE
|
||||
* DEFAULT_MAX_ACCELERATION, AXIS_RELATIVE_MODES,
|
||||
* MICROSTEP_MODES, MANUAL_FEEDRATE
|
||||
*
|
||||
* :[3, 4, 5, 6]
|
||||
*/
|
||||
//#define LINEAR_AXES 3
|
||||
|
||||
/**
|
||||
* Axis codes for additional axes:
|
||||
* This defines the axis code that is used in G-code commands to
|
||||
* reference a specific axis.
|
||||
* 'A' for rotational axis parallel to X
|
||||
* 'B' for rotational axis parallel to Y
|
||||
* 'C' for rotational axis parallel to Z
|
||||
* 'U' for secondary linear axis parallel to X
|
||||
* 'V' for secondary linear axis parallel to Y
|
||||
* 'W' for secondary linear axis parallel to Z
|
||||
* Regardless of the settings, firmware-internal axis IDs are
|
||||
* I (AXIS4), J (AXIS5), K (AXIS6).
|
||||
*/
|
||||
#if LINEAR_AXES >= 4
|
||||
#define AXIS4_NAME 'A' // :['A', 'B', 'C', 'U', 'V', 'W']
|
||||
#endif
|
||||
#if LINEAR_AXES >= 5
|
||||
#define AXIS5_NAME 'B' // :['A', 'B', 'C', 'U', 'V', 'W']
|
||||
#endif
|
||||
#if LINEAR_AXES >= 6
|
||||
#define AXIS6_NAME 'C' // :['A', 'B', 'C', 'U', 'V', 'W']
|
||||
#endif
|
||||
|
||||
// @section extruder
|
||||
|
||||
// This defines the number of extruders
|
||||
@@ -450,11 +497,11 @@
|
||||
#define MAX_REDUNDANT_TEMP_SENSOR_DIFF 10
|
||||
|
||||
#define TEMP_RESIDENCY_TIME 5 // (seconds) Time to wait for hotend to "settle" in M109
|
||||
#define TEMP_WINDOW 2 // (°C) Temperature proximity for the "temperature reached" timer
|
||||
#define TEMP_WINDOW 3 // (°C) Temperature proximity for the "temperature reached" timer
|
||||
#define TEMP_HYSTERESIS 3 // (°C) Temperature proximity considered "close enough" to the target
|
||||
|
||||
#define TEMP_BED_RESIDENCY_TIME 5 // (seconds) Time to wait for bed to "settle" in M190
|
||||
#define TEMP_BED_WINDOW 1 // (°C) Temperature proximity for the "temperature reached" timer
|
||||
#define TEMP_BED_WINDOW 2 // (°C) Temperature proximity for the "temperature reached" timer
|
||||
#define TEMP_BED_HYSTERESIS 3 // (°C) Temperature proximity considered "close enough" to the target
|
||||
|
||||
#define TEMP_CHAMBER_RESIDENCY_TIME 10 // (seconds) Time to wait for chamber to "settle" in M191
|
||||
@@ -477,7 +524,7 @@
|
||||
// Above this temperature the heater will be switched off.
|
||||
// This can protect components from overheating, but NOT from shorts and failures.
|
||||
// (Use MINTEMP for thermistor short/failure protection.)
|
||||
#define HEATER_0_MAXTEMP 275
|
||||
#define HEATER_0_MAXTEMP 305
|
||||
#define HEATER_1_MAXTEMP 275
|
||||
#define HEATER_2_MAXTEMP 275
|
||||
#define HEATER_3_MAXTEMP 275
|
||||
@@ -485,7 +532,7 @@
|
||||
#define HEATER_5_MAXTEMP 275
|
||||
#define HEATER_6_MAXTEMP 275
|
||||
#define HEATER_7_MAXTEMP 275
|
||||
#define BED_MAXTEMP 120
|
||||
#define BED_MAXTEMP 150
|
||||
#define CHAMBER_MAXTEMP 60
|
||||
|
||||
/**
|
||||
@@ -522,9 +569,9 @@
|
||||
#define DEFAULT_Ki_LIST { 1.08, 1.08 }
|
||||
#define DEFAULT_Kd_LIST { 114.00, 114.00 }
|
||||
#else
|
||||
#define DEFAULT_Kp 22.20
|
||||
#define DEFAULT_Ki 1.08
|
||||
#define DEFAULT_Kd 114.00
|
||||
#define DEFAULT_Kp 19.0
|
||||
#define DEFAULT_Ki 1.47
|
||||
#define DEFAULT_Kd 61.00
|
||||
#endif
|
||||
#endif // PIDTEMP
|
||||
|
||||
@@ -563,9 +610,9 @@
|
||||
|
||||
// 120V 250W silicone heater into 4mm borosilicate (MendelMax 1.5+)
|
||||
// from FOPDT model - kp=.39 Tp=405 Tdead=66, Tc set to 79.2, aggressive factor of .15 (vs .1, 1, 10)
|
||||
#define DEFAULT_bedKp 87.23
|
||||
#define DEFAULT_bedKi 13.31
|
||||
#define DEFAULT_bedKd 381.14
|
||||
#define DEFAULT_bedKp 195.13
|
||||
#define DEFAULT_bedKi 29.05
|
||||
#define DEFAULT_bedKd 873.85
|
||||
|
||||
// FIND YOUR OWN: "M303 E-1 C8 S90" to run autotune on the bed at 90 degreesC for 8 cycles.
|
||||
#endif // PIDTEMPBED
|
||||
@@ -691,9 +738,15 @@
|
||||
#define USE_XMIN_PLUG
|
||||
#define USE_YMIN_PLUG
|
||||
#define USE_ZMIN_PLUG
|
||||
//#define USE_IMIN_PLUG
|
||||
//#define USE_JMIN_PLUG
|
||||
//#define USE_KMIN_PLUG
|
||||
//#define USE_XMAX_PLUG
|
||||
//#define USE_YMAX_PLUG
|
||||
//#define USE_ZMAX_PLUG
|
||||
//#define USE_IMAX_PLUG
|
||||
//#define USE_JMAX_PLUG
|
||||
//#define USE_KMAX_PLUG
|
||||
|
||||
// Enable pullup for all endstops to prevent a floating state
|
||||
#define ENDSTOPPULLUPS
|
||||
@@ -702,9 +755,15 @@
|
||||
//#define ENDSTOPPULLUP_XMAX
|
||||
//#define ENDSTOPPULLUP_YMAX
|
||||
//#define ENDSTOPPULLUP_ZMAX
|
||||
//#define ENDSTOPPULLUP_IMAX
|
||||
//#define ENDSTOPPULLUP_JMAX
|
||||
//#define ENDSTOPPULLUP_KMAX
|
||||
//#define ENDSTOPPULLUP_XMIN
|
||||
//#define ENDSTOPPULLUP_YMIN
|
||||
//#define ENDSTOPPULLUP_ZMIN
|
||||
//#define ENDSTOPPULLUP_IMIN
|
||||
//#define ENDSTOPPULLUP_JMIN
|
||||
//#define ENDSTOPPULLUP_KMIN
|
||||
//#define ENDSTOPPULLUP_ZMIN_PROBE
|
||||
#endif
|
||||
|
||||
@@ -715,9 +774,15 @@
|
||||
//#define ENDSTOPPULLDOWN_XMAX
|
||||
//#define ENDSTOPPULLDOWN_YMAX
|
||||
//#define ENDSTOPPULLDOWN_ZMAX
|
||||
//#define ENDSTOPPULLDOWN_IMAX
|
||||
//#define ENDSTOPPULLDOWN_JMAX
|
||||
//#define ENDSTOPPULLDOWN_KMAX
|
||||
//#define ENDSTOPPULLDOWN_XMIN
|
||||
//#define ENDSTOPPULLDOWN_YMIN
|
||||
//#define ENDSTOPPULLDOWN_ZMIN
|
||||
//#define ENDSTOPPULLDOWN_IMIN
|
||||
//#define ENDSTOPPULLDOWN_JMIN
|
||||
//#define ENDSTOPPULLDOWN_KMIN
|
||||
//#define ENDSTOPPULLDOWN_ZMIN_PROBE
|
||||
#endif
|
||||
|
||||
@@ -725,10 +790,16 @@
|
||||
#define X_MIN_ENDSTOP_INVERTING true // Set to true to invert the logic of the endstop.
|
||||
#define Y_MIN_ENDSTOP_INVERTING true // Set to true to invert the logic of the endstop.
|
||||
#define Z_MIN_ENDSTOP_INVERTING true // Set to true to invert the logic of the endstop.
|
||||
#define I_MIN_ENDSTOP_INVERTING false // Set to true to invert the logic of the endstop.
|
||||
#define J_MIN_ENDSTOP_INVERTING false // Set to true to invert the logic of the endstop.
|
||||
#define K_MIN_ENDSTOP_INVERTING false // Set to true to invert the logic of the endstop.
|
||||
#define X_MAX_ENDSTOP_INVERTING false // Set to true to invert the logic of the endstop.
|
||||
#define Y_MAX_ENDSTOP_INVERTING false // Set to true to invert the logic of the endstop.
|
||||
#define Z_MAX_ENDSTOP_INVERTING false // Set to true to invert the logic of the endstop.
|
||||
#define Z_MIN_PROBE_ENDSTOP_INVERTING true // Set to true to invert the logic of the probe.
|
||||
#define I_MAX_ENDSTOP_INVERTING false // Set to true to invert the logic of the endstop.
|
||||
#define J_MAX_ENDSTOP_INVERTING false // Set to true to invert the logic of the endstop.
|
||||
#define K_MAX_ENDSTOP_INVERTING false // Set to true to invert the logic of the endstop.
|
||||
#define Z_MIN_PROBE_ENDSTOP_INVERTING false // Set to true to invert the logic of the probe.
|
||||
|
||||
/**
|
||||
* Stepper Drivers
|
||||
@@ -756,6 +827,9 @@
|
||||
//#define Z2_DRIVER_TYPE A4988
|
||||
//#define Z3_DRIVER_TYPE A4988
|
||||
//#define Z4_DRIVER_TYPE A4988
|
||||
//#define I_DRIVER_TYPE A4988
|
||||
//#define J_DRIVER_TYPE A4988
|
||||
//#define K_DRIVER_TYPE A4988
|
||||
#define E0_DRIVER_TYPE A4988
|
||||
//#define E1_DRIVER_TYPE A4988
|
||||
//#define E2_DRIVER_TYPE A4988
|
||||
@@ -809,16 +883,16 @@
|
||||
/**
|
||||
* Default Axis Steps Per Unit (steps/mm)
|
||||
* Override with M92
|
||||
* X, Y, Z, E0 [, E1[, E2...]]
|
||||
* X, Y, Z [, I [, J [, K]]], E0 [, E1[, E2...]]
|
||||
*/
|
||||
#define DEFAULT_AXIS_STEPS_PER_UNIT { 80, 80, 400, 95 }
|
||||
#define DEFAULT_AXIS_STEPS_PER_UNIT { 80, 80, 400, 106.09 }
|
||||
|
||||
/**
|
||||
* Default Max Feed Rate (mm/s)
|
||||
* Override with M203
|
||||
* X, Y, Z, E0 [, E1[, E2...]]
|
||||
* X, Y, Z [, I [, J [, K]]], E0 [, E1[, E2...]]
|
||||
*/
|
||||
#define DEFAULT_MAX_FEEDRATE { 500, 500, 10, 65 }
|
||||
#define DEFAULT_MAX_FEEDRATE { 300, 300, 15, 75 }
|
||||
|
||||
//#define LIMITED_MAX_FR_EDITING // Limit edit via M203 or LCD to DEFAULT_MAX_FEEDRATE * 2
|
||||
#if ENABLED(LIMITED_MAX_FR_EDITING)
|
||||
@@ -829,9 +903,9 @@
|
||||
* Default Max Acceleration (change/s) change = mm/s
|
||||
* (Maximum start speed for accelerated moves)
|
||||
* Override with M201
|
||||
* X, Y, Z, E0 [, E1[, E2...]]
|
||||
* X, Y, Z [, I [, J [, K]]], E0 [, E1[, E2...]]
|
||||
*/
|
||||
#define DEFAULT_MAX_ACCELERATION { 2500, 2500, 18000, 8000 }
|
||||
#define DEFAULT_MAX_ACCELERATION { 1500, 1500, 100, 10000 }
|
||||
|
||||
//#define LIMITED_MAX_ACCEL_EDITING // Limit edit via M201 or LCD to DEFAULT_MAX_ACCELERATION * 2
|
||||
#if ENABLED(LIMITED_MAX_ACCEL_EDITING)
|
||||
@@ -846,9 +920,9 @@
|
||||
* M204 R Retract Acceleration
|
||||
* M204 T Travel Acceleration
|
||||
*/
|
||||
#define DEFAULT_ACCELERATION 2000 // X, Y, Z and E acceleration for printing moves
|
||||
#define DEFAULT_RETRACT_ACCELERATION 2000 // E acceleration for retracts
|
||||
#define DEFAULT_TRAVEL_ACCELERATION 3000 // X, Y, Z acceleration for travel (non printing) moves
|
||||
#define DEFAULT_ACCELERATION 750 // X, Y, Z and E acceleration for printing moves
|
||||
#define DEFAULT_RETRACT_ACCELERATION 3000 // E acceleration for retracts
|
||||
#define DEFAULT_TRAVEL_ACCELERATION 750 // X, Y, Z acceleration for travel (non printing) moves
|
||||
|
||||
/**
|
||||
* Default Jerk limits (mm/s)
|
||||
@@ -860,9 +934,12 @@
|
||||
*/
|
||||
#define CLASSIC_JERK
|
||||
#if ENABLED(CLASSIC_JERK)
|
||||
#define DEFAULT_XJERK 15.0
|
||||
#define DEFAULT_YJERK 15.0
|
||||
#define DEFAULT_XJERK 10.0
|
||||
#define DEFAULT_YJERK 10.0
|
||||
#define DEFAULT_ZJERK 0.3
|
||||
//#define DEFAULT_IJERK 0.3
|
||||
//#define DEFAULT_JJERK 0.3
|
||||
//#define DEFAULT_KJERK 0.3
|
||||
|
||||
//#define TRAVEL_EXTRA_XYJERK 0.0 // Additional jerk allowance for all travel moves
|
||||
|
||||
@@ -911,7 +988,7 @@
|
||||
* The probe replaces the Z-MIN endstop and is used for Z homing.
|
||||
* (Automatically enables USE_PROBE_FOR_Z_HOMING.)
|
||||
*/
|
||||
//#define Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN
|
||||
#define Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN
|
||||
|
||||
// Force the use of the probe for Z-axis homing
|
||||
//#define USE_PROBE_FOR_Z_HOMING
|
||||
@@ -945,13 +1022,13 @@
|
||||
* Use G29 repeatedly, adjusting the Z height at each point with movement commands
|
||||
* or (with LCD_BED_LEVELING) the LCD controller.
|
||||
*/
|
||||
//#define PROBE_MANUALLY
|
||||
#define PROBE_MANUALLY
|
||||
|
||||
/**
|
||||
* A Fix-Mounted Probe either doesn't deploy or needs manual deployment.
|
||||
* (e.g., an inductive probe or a nozzle-based probe-switch.)
|
||||
*/
|
||||
#define FIX_MOUNTED_PROBE
|
||||
//#define FIX_MOUNTED_PROBE
|
||||
|
||||
/**
|
||||
* Use the nozzle as the probe, as with a conductive
|
||||
@@ -1060,17 +1137,17 @@
|
||||
* | [-] |
|
||||
* O-- FRONT --+
|
||||
*/
|
||||
#define NOZZLE_TO_PROBE_OFFSET { -25, 0, 0 }
|
||||
#define NOZZLE_TO_PROBE_OFFSET { 10, 10, 0 }
|
||||
|
||||
// Most probes should stay away from the edges of the bed, but
|
||||
// with NOZZLE_AS_PROBE this can be negative for a wider probing area.
|
||||
#define PROBING_MARGIN 8
|
||||
#define PROBING_MARGIN 10
|
||||
|
||||
// X and Y axis travel speed (mm/min) between probes
|
||||
#define XY_PROBE_FEEDRATE (133*60)
|
||||
|
||||
// Feedrate (mm/min) for the first approach when double-probing (MULTIPLE_PROBING == 2)
|
||||
#define Z_PROBE_FEEDRATE_FAST (10*60)
|
||||
#define Z_PROBE_FEEDRATE_FAST (4*60)
|
||||
|
||||
// Feedrate (mm/min) for the "accurate" probe of each point
|
||||
#define Z_PROBE_FEEDRATE_SLOW (Z_PROBE_FEEDRATE_FAST / 2)
|
||||
@@ -1111,7 +1188,7 @@
|
||||
* A total of 2 does fast/slow probes with a weighted average.
|
||||
* A total of 3 or more adds more slow probes, taking the average.
|
||||
*/
|
||||
#define MULTIPLE_PROBING 2
|
||||
//#define MULTIPLE_PROBING 2
|
||||
//#define EXTRA_PROBING 1
|
||||
|
||||
/**
|
||||
@@ -1128,16 +1205,16 @@
|
||||
* Example: `M851 Z-5` with a CLEARANCE of 4 => 9mm from bed to nozzle.
|
||||
* But: `M851 Z+1` with a CLEARANCE of 2 => 2mm from bed to nozzle.
|
||||
*/
|
||||
#define Z_CLEARANCE_DEPLOY_PROBE 5 // Z Clearance for Deploy/Stow
|
||||
#define Z_CLEARANCE_DEPLOY_PROBE 10 // Z Clearance for Deploy/Stow
|
||||
#define Z_CLEARANCE_BETWEEN_PROBES 5 // Z Clearance between probe points
|
||||
#define Z_CLEARANCE_MULTI_PROBE 5 // Z Clearance between multiple probes
|
||||
//#define Z_AFTER_PROBING 5 // Z position after probing is done
|
||||
|
||||
#define Z_PROBE_LOW_POINT -4 // Farthest distance below the trigger-point to go before stopping
|
||||
#define Z_PROBE_LOW_POINT -2 // Farthest distance below the trigger-point to go before stopping
|
||||
|
||||
// For M851 give a range for adjusting the Z probe offset
|
||||
#define Z_PROBE_OFFSET_RANGE_MIN -9
|
||||
#define Z_PROBE_OFFSET_RANGE_MAX 9
|
||||
#define Z_PROBE_OFFSET_RANGE_MIN -20
|
||||
#define Z_PROBE_OFFSET_RANGE_MAX 20
|
||||
|
||||
// Enable the M48 repeatability test to test probe accuracy
|
||||
//#define Z_MIN_PROBE_REPEATABILITY_TEST
|
||||
@@ -1177,12 +1254,18 @@
|
||||
#define Y_ENABLE_ON 0
|
||||
#define Z_ENABLE_ON 0
|
||||
#define E_ENABLE_ON 0 // For all extruders
|
||||
//#define I_ENABLE_ON 0
|
||||
//#define J_ENABLE_ON 0
|
||||
//#define K_ENABLE_ON 0
|
||||
|
||||
// Disable axis steppers immediately when they're not being stepped.
|
||||
// WARNING: When motors turn off there is a chance of losing position accuracy!
|
||||
#define DISABLE_X false
|
||||
#define DISABLE_Y false
|
||||
#define DISABLE_Z false
|
||||
//#define DISABLE_I false
|
||||
//#define DISABLE_J false
|
||||
//#define DISABLE_K false
|
||||
|
||||
// Turn off the display blinking that warns about possible accuracy reduction
|
||||
//#define DISABLE_REDUCED_ACCURACY_WARNING
|
||||
@@ -1195,9 +1278,12 @@
|
||||
// @section machine
|
||||
|
||||
// Invert the stepper direction. Change (or reverse the motor connector) if an axis goes the wrong way.
|
||||
#define INVERT_X_DIR false
|
||||
#define INVERT_X_DIR true
|
||||
#define INVERT_Y_DIR true
|
||||
#define INVERT_Z_DIR true
|
||||
#define INVERT_Z_DIR false
|
||||
//#define INVERT_I_DIR false
|
||||
//#define INVERT_J_DIR false
|
||||
//#define INVERT_K_DIR false
|
||||
|
||||
// @section extruder
|
||||
|
||||
@@ -1233,20 +1319,29 @@
|
||||
#define X_HOME_DIR -1
|
||||
#define Y_HOME_DIR -1
|
||||
#define Z_HOME_DIR -1
|
||||
//#define I_HOME_DIR -1
|
||||
//#define J_HOME_DIR -1
|
||||
//#define K_HOME_DIR -1
|
||||
|
||||
// @section machine
|
||||
|
||||
// The size of the printable area
|
||||
#define X_BED_SIZE 255
|
||||
#define Y_BED_SIZE 300
|
||||
#define X_BED_SIZE 310
|
||||
#define Y_BED_SIZE 310
|
||||
|
||||
// Travel limits (mm) after homing, corresponding to endstop positions.
|
||||
#define X_MIN_POS -10.5
|
||||
#define Y_MIN_POS -9
|
||||
#define X_MIN_POS -10
|
||||
#define Y_MIN_POS -10
|
||||
#define Z_MIN_POS 0
|
||||
#define X_MAX_POS 260
|
||||
#define Y_MAX_POS 310
|
||||
#define Z_MAX_POS 295
|
||||
#define X_MAX_POS X_BED_SIZE
|
||||
#define Y_MAX_POS Y_BED_SIZE
|
||||
#define Z_MAX_POS 400
|
||||
//#define I_MIN_POS 0
|
||||
//#define I_MAX_POS 50
|
||||
//#define J_MIN_POS 0
|
||||
//#define J_MAX_POS 50
|
||||
//#define K_MIN_POS 0
|
||||
//#define K_MAX_POS 50
|
||||
|
||||
/**
|
||||
* Software Endstops
|
||||
@@ -1263,6 +1358,9 @@
|
||||
#define MIN_SOFTWARE_ENDSTOP_X
|
||||
#define MIN_SOFTWARE_ENDSTOP_Y
|
||||
#define MIN_SOFTWARE_ENDSTOP_Z
|
||||
#define MIN_SOFTWARE_ENDSTOP_I
|
||||
#define MIN_SOFTWARE_ENDSTOP_J
|
||||
#define MIN_SOFTWARE_ENDSTOP_K
|
||||
#endif
|
||||
|
||||
// Max software endstops constrain movement within maximum coordinate bounds
|
||||
@@ -1271,6 +1369,9 @@
|
||||
#define MAX_SOFTWARE_ENDSTOP_X
|
||||
#define MAX_SOFTWARE_ENDSTOP_Y
|
||||
#define MAX_SOFTWARE_ENDSTOP_Z
|
||||
#define MAX_SOFTWARE_ENDSTOP_I
|
||||
#define MAX_SOFTWARE_ENDSTOP_J
|
||||
#define MAX_SOFTWARE_ENDSTOP_K
|
||||
#endif
|
||||
|
||||
#if EITHER(MIN_SOFTWARE_ENDSTOPS, MAX_SOFTWARE_ENDSTOPS)
|
||||
@@ -1294,6 +1395,7 @@
|
||||
#if ENABLED(FILAMENT_RUNOUT_SENSOR)
|
||||
#define FIL_RUNOUT_ENABLED_DEFAULT true // Enable the sensor on startup. Override with M412 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_PIN 2
|
||||
|
||||
#define FIL_RUNOUT_STATE LOW // Pin state indicating that filament is NOT present.
|
||||
#define FIL_RUNOUT_PULLUP // Use internal pullup for filament runout pins.
|
||||
@@ -1407,7 +1509,7 @@
|
||||
/**
|
||||
* Auto-leveling needs preheating
|
||||
*/
|
||||
#define PREHEAT_BEFORE_LEVELING
|
||||
//#define PREHEAT_BEFORE_LEVELING
|
||||
#if ENABLED(PREHEAT_BEFORE_LEVELING)
|
||||
#define LEVELING_NOZZLE_TEMP 120 // (°C) Only applies to E0 at this time
|
||||
#define LEVELING_BED_TEMP 50
|
||||
@@ -1431,7 +1533,7 @@
|
||||
// The height can be set with M420 Z<height>
|
||||
#define ENABLE_LEVELING_FADE_HEIGHT
|
||||
#if ENABLED(ENABLE_LEVELING_FADE_HEIGHT)
|
||||
#define DEFAULT_LEVELING_FADE_HEIGHT 0.0 // (mm) Default fade height.
|
||||
#define DEFAULT_LEVELING_FADE_HEIGHT 00.0 // (mm) Default fade height.
|
||||
#endif
|
||||
|
||||
// For Cartesian machines, instead of dividing moves on mesh boundaries,
|
||||
@@ -1443,7 +1545,7 @@
|
||||
/**
|
||||
* Enable the G26 Mesh Validation Pattern tool.
|
||||
*/
|
||||
//#define G26_MESH_VALIDATION
|
||||
#define G26_MESH_VALIDATION
|
||||
#if ENABLED(G26_MESH_VALIDATION)
|
||||
#define MESH_TEST_NOZZLE_SIZE 0.4 // (mm) Diameter of primary nozzle.
|
||||
#define MESH_TEST_LAYER_HEIGHT 0.2 // (mm) Default layer height for G26.
|
||||
@@ -1469,13 +1571,13 @@
|
||||
|
||||
// Beyond the probed grid, continue the implied tilt?
|
||||
// Default is to maintain the height of the nearest edge.
|
||||
//#define EXTRAPOLATE_BEYOND_GRID
|
||||
#define EXTRAPOLATE_BEYOND_GRID
|
||||
|
||||
//
|
||||
// Experimental Subdivision of the grid by Catmull-Rom method.
|
||||
// Synthesizes intermediate points to produce a more detailed mesh.
|
||||
//
|
||||
//#define ABL_BILINEAR_SUBDIVISION
|
||||
#define ABL_BILINEAR_SUBDIVISION
|
||||
#if ENABLED(ABL_BILINEAR_SUBDIVISION)
|
||||
// Number of subdivisions between probe points
|
||||
#define BILINEAR_SUBDIVISIONS 3
|
||||
@@ -1511,8 +1613,8 @@
|
||||
//=================================== Mesh ==================================
|
||||
//===========================================================================
|
||||
|
||||
#define MESH_INSET 10 // Set Mesh bounds as an inset region of the bed
|
||||
#define GRID_MAX_POINTS_X 3 // Don't use more than 7 points per axis, implementation limited.
|
||||
#define MESH_INSET 5 // Set Mesh bounds as an inset region of the bed
|
||||
#define GRID_MAX_POINTS_X 5 // Don't use more than 7 points per axis, implementation limited.
|
||||
#define GRID_MAX_POINTS_Y GRID_MAX_POINTS_X
|
||||
|
||||
//#define MESH_G28_REST_ORIGIN // After homing all axes ('G28' or 'G28 XYZ') rest Z at Z_MIN_POS
|
||||
@@ -1532,18 +1634,18 @@
|
||||
#endif
|
||||
|
||||
// Add a menu item to move between bed corners for manual bed adjustment
|
||||
#define LEVEL_BED_CORNERS
|
||||
//#define LEVEL_BED_CORNERS
|
||||
|
||||
#if ENABLED(LEVEL_BED_CORNERS)
|
||||
#define LEVEL_CORNERS_INSET_LFRB { 30, 30, 30, 30 } // (mm) Left, Front, Right, Back insets
|
||||
#define LEVEL_CORNERS_HEIGHT 0.0 // (mm) Z height of nozzle at leveling points
|
||||
#define LEVEL_CORNERS_Z_HOP 4.0 // (mm) Z height of nozzle between leveling points
|
||||
//#define LEVEL_CENTER_TOO // Move to the center after the last corner
|
||||
#define LEVEL_CORNERS_USE_PROBE
|
||||
//#define LEVEL_CORNERS_USE_PROBE
|
||||
#if ENABLED(LEVEL_CORNERS_USE_PROBE)
|
||||
#define LEVEL_CORNERS_PROBE_TOLERANCE 0.1
|
||||
#define LEVEL_CORNERS_VERIFY_RAISED // After adjustment triggers the probe, re-probe to verify
|
||||
#define LEVEL_CORNERS_AUDIO_FEEDBACK
|
||||
//#define LEVEL_CORNERS_AUDIO_FEEDBACK
|
||||
#endif
|
||||
|
||||
/**
|
||||
@@ -1582,6 +1684,9 @@
|
||||
//#define MANUAL_X_HOME_POS 0
|
||||
//#define MANUAL_Y_HOME_POS 0
|
||||
//#define MANUAL_Z_HOME_POS 0
|
||||
//#define MANUAL_I_HOME_POS 0
|
||||
//#define MANUAL_J_HOME_POS 0
|
||||
//#define MANUAL_K_HOME_POS 0
|
||||
|
||||
// Use "Z Safe Homing" to avoid homing with a Z probe outside the bed area.
|
||||
//
|
||||
@@ -1824,11 +1929,20 @@
|
||||
/**
|
||||
* Print Job Timer
|
||||
*
|
||||
* Automatically start and stop the print job timer on M104/M109/M190.
|
||||
* Automatically start and stop the print job timer on M104/M109/M140/M190/M141/M191.
|
||||
* The print job timer will only be stopped if the bed/chamber target temp is
|
||||
* below BED_MINTEMP/CHAMBER_MINTEMP.
|
||||
*
|
||||
* M104 (hotend, no wait) - high temp = none, low temp = stop timer
|
||||
* M109 (hotend, wait) - high temp = start timer, low temp = stop timer
|
||||
* M190 (bed, wait) - high temp = start timer, low temp = none
|
||||
* M104 (hotend, no wait) - high temp = none, low temp = stop timer
|
||||
* M109 (hotend, wait) - high temp = start timer, low temp = stop timer
|
||||
* M140 (bed, no wait) - high temp = none, low temp = stop timer
|
||||
* M190 (bed, wait) - high temp = start timer, low temp = none
|
||||
* M141 (chamber, no wait) - high temp = none, low temp = stop timer
|
||||
* M191 (chamber, wait) - high temp = start timer, low temp = none
|
||||
*
|
||||
* For M104/M109, high temp is anything over EXTRUDE_MINTEMP / 2.
|
||||
* For M140/M190, high temp is anything over BED_MINTEMP.
|
||||
* For M141/M191, high temp is anything over CHAMBER_MINTEMP.
|
||||
*
|
||||
* The timer can also be controlled with the following commands:
|
||||
*
|
||||
@@ -1988,7 +2102,7 @@
|
||||
//
|
||||
// Set this option if CLOCKWISE causes values to DECREASE
|
||||
//
|
||||
#define REVERSE_ENCODER_DIRECTION
|
||||
//#define REVERSE_ENCODER_DIRECTION
|
||||
|
||||
//
|
||||
// This option reverses the encoder direction for navigating LCD menus.
|
||||
@@ -2019,7 +2133,7 @@
|
||||
// If you have a speaker that can produce tones, enable it here.
|
||||
// By default Marlin assumes you have a buzzer with a fixed frequency.
|
||||
//
|
||||
#define SPEAKER
|
||||
//#define SPEAKER
|
||||
|
||||
//
|
||||
// The duration and frequency for the UI feedback sound.
|
||||
@@ -2690,7 +2804,7 @@
|
||||
//#define NEOPIXEL_LED
|
||||
#if ENABLED(NEOPIXEL_LED)
|
||||
#define NEOPIXEL_TYPE NEO_GRBW // NEO_GRBW / NEO_GRB - four/three channel driver type (defined in Adafruit_NeoPixel.h)
|
||||
#define NEOPIXEL_PIN 4 // LED driving pin
|
||||
//#define NEOPIXEL_PIN 4 // LED driving pin
|
||||
//#define NEOPIXEL2_TYPE NEOPIXEL_TYPE
|
||||
//#define NEOPIXEL2_PIN 5
|
||||
#define NEOPIXEL_PIXELS 30 // Number of LEDs in the strip. (Longest strip when NEOPIXEL2_SEPARATE is disabled.)
|
||||
@@ -2708,10 +2822,11 @@
|
||||
//#define NEOPIXEL2_INSERIES // Default behavior is NeoPixel 2 in parallel
|
||||
#endif
|
||||
|
||||
// Use a single NeoPixel LED for static (background) lighting
|
||||
//#define NEOPIXEL_BKGD_LED_INDEX 0 // Index of the LED to use
|
||||
//#define NEOPIXEL_BKGD_COLOR { 255, 255, 255, 0 } // R, G, B, W
|
||||
//#define NEOPIXEL_BKGD_ALWAYS_ON // Keep the backlight on when other NeoPixels are off
|
||||
// Use some of the NeoPixel LEDs for static (background) lighting
|
||||
//#define NEOPIXEL_BKGD_INDEX_FIRST 0 // Index of the first background LED
|
||||
//#define NEOPIXEL_BKGD_INDEX_LAST 5 // Index of the last background LED
|
||||
//#define NEOPIXEL_BKGD_COLOR { 255, 255, 255, 0 } // R, G, B, W
|
||||
//#define NEOPIXEL_BKGD_ALWAYS_ON // Keep the backlight on when other NeoPixels are off
|
||||
#endif
|
||||
|
||||
/**
|
||||
|
||||
+123
-15
@@ -30,7 +30,7 @@
|
||||
*
|
||||
* Basic settings can be found in Configuration.h
|
||||
*/
|
||||
#define CONFIGURATION_ADV_H_VERSION 02000801
|
||||
#define CONFIGURATION_ADV_H_VERSION 02000900
|
||||
|
||||
//===========================================================================
|
||||
//============================= Thermal Settings ============================
|
||||
@@ -238,7 +238,7 @@
|
||||
* THERMAL_PROTECTION_HYSTERESIS and/or THERMAL_PROTECTION_PERIOD
|
||||
*/
|
||||
#if ENABLED(THERMAL_PROTECTION_HOTENDS)
|
||||
#define THERMAL_PROTECTION_PERIOD 40 // Seconds
|
||||
#define THERMAL_PROTECTION_PERIOD 60 // Seconds
|
||||
#define THERMAL_PROTECTION_HYSTERESIS 15 // Degrees Celsius
|
||||
|
||||
#define ADAPTIVE_FAN_SLOWING // Slow part cooling fan if temperature drops
|
||||
@@ -259,7 +259,7 @@
|
||||
* below 2.
|
||||
*/
|
||||
#define WATCH_TEMP_PERIOD 20 // Seconds
|
||||
#define WATCH_TEMP_INCREASE 2 // Degrees Celsius
|
||||
#define WATCH_TEMP_INCREASE 2 // Degrees Celsius
|
||||
#endif
|
||||
|
||||
/**
|
||||
@@ -648,7 +648,7 @@
|
||||
//
|
||||
// For Z set the number of stepper drivers
|
||||
//
|
||||
#define NUM_Z_STEPPER_DRIVERS 2 // (1-4) Z options change based on how many
|
||||
#define NUM_Z_STEPPER_DRIVERS 1 // (1-4) Z options change based on how many
|
||||
|
||||
#if NUM_Z_STEPPER_DRIVERS > 1
|
||||
// Enable if Z motor direction signals are the opposite of Z1
|
||||
@@ -821,7 +821,7 @@
|
||||
* Z Steppers Auto-Alignment
|
||||
* Add the G34 command to align multiple Z steppers using a bed probe.
|
||||
*/
|
||||
#define Z_STEPPER_AUTO_ALIGN
|
||||
//#define Z_STEPPER_AUTO_ALIGN
|
||||
#if ENABLED(Z_STEPPER_AUTO_ALIGN)
|
||||
// Define probe X and Y positions for Z1, Z2 [, Z3 [, Z4]]
|
||||
// If not defined, probe limits will be used.
|
||||
@@ -918,6 +918,9 @@
|
||||
#define INVERT_X_STEP_PIN false
|
||||
#define INVERT_Y_STEP_PIN false
|
||||
#define INVERT_Z_STEP_PIN false
|
||||
#define INVERT_I_STEP_PIN false
|
||||
#define INVERT_J_STEP_PIN false
|
||||
#define INVERT_K_STEP_PIN false
|
||||
#define INVERT_E_STEP_PIN false
|
||||
|
||||
/**
|
||||
@@ -929,6 +932,9 @@
|
||||
#define DISABLE_INACTIVE_X true
|
||||
#define DISABLE_INACTIVE_Y true
|
||||
#define DISABLE_INACTIVE_Z true // Set 'false' if the nozzle could fall onto your printed part!
|
||||
#define DISABLE_INACTIVE_I true
|
||||
#define DISABLE_INACTIVE_J true
|
||||
#define DISABLE_INACTIVE_K true
|
||||
#define DISABLE_INACTIVE_E true
|
||||
|
||||
// Default Minimum Feedrates for printing and travel moves
|
||||
@@ -969,8 +975,8 @@
|
||||
#if ENABLED(BACKLASH_COMPENSATION)
|
||||
// Define values for backlash distance and correction.
|
||||
// If BACKLASH_GCODE is enabled these values are the defaults.
|
||||
#define BACKLASH_DISTANCE_MM { 0, 0, 0 } // (mm)
|
||||
#define BACKLASH_CORRECTION 0.1 // 0.0 = no correction; 1.0 = full correction
|
||||
#define BACKLASH_DISTANCE_MM { 0, 0, 0 } // (mm) One value for each linear axis
|
||||
#define BACKLASH_CORRECTION 0.02 // 0.0 = no correction; 1.0 = full correction
|
||||
|
||||
// Add steps for motor direction changes on CORE kinematics
|
||||
//#define CORE_BACKLASH
|
||||
@@ -984,7 +990,7 @@
|
||||
|
||||
#if ENABLED(BACKLASH_GCODE)
|
||||
// Measure the Z backlash when probing (G29) and set with "M425 Z"
|
||||
#define MEASURE_BACKLASH_WHEN_PROBING
|
||||
//#define MEASURE_BACKLASH_WHEN_PROBING
|
||||
|
||||
#if ENABLED(MEASURE_BACKLASH_WHEN_PROBING)
|
||||
// When measuring, the probe will move up to BACKLASH_MEASUREMENT_LIMIT
|
||||
@@ -1040,6 +1046,13 @@
|
||||
#define CALIBRATION_MEASURE_LEFT
|
||||
#define CALIBRATION_MEASURE_BACK
|
||||
|
||||
//#define CALIBRATION_MEASURE_IMIN
|
||||
//#define CALIBRATION_MEASURE_IMAX
|
||||
//#define CALIBRATION_MEASURE_JMIN
|
||||
//#define CALIBRATION_MEASURE_JMAX
|
||||
//#define CALIBRATION_MEASURE_KMIN
|
||||
//#define CALIBRATION_MEASURE_KMAX
|
||||
|
||||
// Probing at the exact top center only works if the center is flat. If
|
||||
// probing on a screwhead or hollow washer, probe near the edges.
|
||||
//#define CALIBRATION_MEASURE_AT_TOP_EDGES
|
||||
@@ -1303,7 +1316,7 @@
|
||||
|
||||
//#define MEDIA_MENU_AT_TOP // Force the media menu to be listed on the top of the main menu
|
||||
|
||||
#define EVENT_GCODE_SD_ABORT "G28XY" // G-code to run on SD Abort Print (e.g., "G28XY" or "G27")
|
||||
#define EVENT_GCODE_SD_ABORT "M84" // G-code to run on SD Abort Print (e.g., "G28XY" or "G27")
|
||||
|
||||
#if ENABLED(PRINTER_EVENT_LEDS)
|
||||
#define PE_LEDS_COMPLETED_TIME (30*60) // (seconds) Time to keep the LED "done" color before restoring normal illumination
|
||||
@@ -1813,12 +1826,12 @@
|
||||
#endif
|
||||
#endif
|
||||
|
||||
//#define BABYSTEP_DISPLAY_TOTAL // Display total babysteps since last G28
|
||||
#define BABYSTEP_DISPLAY_TOTAL // Display total babysteps since last G28
|
||||
|
||||
#define BABYSTEP_ZPROBE_OFFSET // Combine M851 Z and Babystepping
|
||||
//#define BABYSTEP_ZPROBE_OFFSET // Combine M851 Z and Babystepping
|
||||
#if ENABLED(BABYSTEP_ZPROBE_OFFSET)
|
||||
//#define BABYSTEP_HOTEND_Z_OFFSET // For multiple hotends, babystep relative Z offsets
|
||||
#define BABYSTEP_ZPROBE_GFX_OVERLAY // Enable graphical overlay on Z-offset editor
|
||||
//#define BABYSTEP_ZPROBE_GFX_OVERLAY // Enable graphical overlay on Z-offset editor
|
||||
#endif
|
||||
#endif
|
||||
|
||||
@@ -2166,7 +2179,7 @@
|
||||
// Therefore some clients abort after 30 seconds in a timeout.
|
||||
// Some other clients start sending commands while receiving a 'wait'.
|
||||
// This "wait" is only sent when the buffer is empty. 1 second is a good value here.
|
||||
//#define NO_TIMEOUTS 1000 // Milliseconds
|
||||
#define NO_TIMEOUTS 1000 // Milliseconds
|
||||
|
||||
// Some clients will have this feature soon. This could make the NO_TIMEOUTS unnecessary.
|
||||
#define ADVANCED_OK
|
||||
@@ -2236,6 +2249,13 @@
|
||||
//#define EVENT_GCODE_AFTER_TOOLCHANGE "G12X" // Extra G-code to run after tool-change
|
||||
#endif
|
||||
|
||||
/**
|
||||
* Extra G-code to run while executing tool-change commands. Can be used to use an additional
|
||||
* stepper motor (I axis, see option LINEAR_AXES in Configuration.h) to drive the tool-changer.
|
||||
*/
|
||||
//#define EVENT_GCODE_TOOLCHANGE_T0 "G28 A\nG1 I0" // Extra G-code to run while executing tool-change command T0
|
||||
//#define EVENT_GCODE_TOOLCHANGE_T1 "G1 A10" // Extra G-code to run while executing tool-change command T1
|
||||
|
||||
/**
|
||||
* Tool Sensors detect when tools have been picked up or dropped.
|
||||
* Requires the pins TOOL_SENSOR1_PIN, TOOL_SENSOR2_PIN, etc.
|
||||
@@ -2345,7 +2365,7 @@
|
||||
#define FILAMENT_UNLOAD_PURGE_FEEDRATE 25 // (mm/s) feedrate to purge before unload
|
||||
|
||||
#define PAUSE_PARK_NOZZLE_TIMEOUT 45 // (seconds) Time limit before the nozzle is turned off for safety.
|
||||
#define FILAMENT_CHANGE_ALERT_BEEPS 2 // Number of alert beeps to play when a response is needed.
|
||||
#define FILAMENT_CHANGE_ALERT_BEEPS 10 // Number of alert beeps to play when a response is needed.
|
||||
#define PAUSE_PARK_NO_STEPPER_TIMEOUT // Enable for XYZ steppers to stay powered on during filament change.
|
||||
|
||||
#define PARK_HEAD_ON_PAUSE // Park the nozzle during pause and filament change.
|
||||
@@ -2413,6 +2433,24 @@
|
||||
#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_E0(TMC26X)
|
||||
#define E0_MAX_CURRENT 1000
|
||||
#define E0_SENSE_RESISTOR 91
|
||||
@@ -2563,6 +2601,33 @@
|
||||
//#define Z4_INTERPOLATE true
|
||||
#endif
|
||||
|
||||
#if AXIS_IS_TMC(I)
|
||||
#define I_CURRENT 800
|
||||
#define I_CURRENT_HOME I_CURRENT
|
||||
#define I_MICROSTEPS 16
|
||||
#define I_RSENSE 0.11
|
||||
#define I_CHAIN_POS -1
|
||||
//#define I_INTERPOLATE true
|
||||
#endif
|
||||
|
||||
#if AXIS_IS_TMC(J)
|
||||
#define J_CURRENT 800
|
||||
#define J_CURRENT_HOME J_CURRENT
|
||||
#define J_MICROSTEPS 16
|
||||
#define J_RSENSE 0.11
|
||||
#define J_CHAIN_POS -1
|
||||
//#define J_INTERPOLATE true
|
||||
#endif
|
||||
|
||||
#if AXIS_IS_TMC(K)
|
||||
#define K_CURRENT 800
|
||||
#define K_CURRENT_HOME K_CURRENT
|
||||
#define K_MICROSTEPS 16
|
||||
#define K_RSENSE 0.11
|
||||
#define K_CHAIN_POS -1
|
||||
//#define K_INTERPOLATE true
|
||||
#endif
|
||||
|
||||
#if AXIS_IS_TMC(E0)
|
||||
#define E0_CURRENT 800
|
||||
#define E0_MICROSTEPS 16
|
||||
@@ -2638,6 +2703,10 @@
|
||||
//#define Y2_CS_PIN -1
|
||||
//#define Z2_CS_PIN -1
|
||||
//#define Z3_CS_PIN -1
|
||||
//#define Z4_CS_PIN -1
|
||||
//#define I_CS_PIN -1
|
||||
//#define J_CS_PIN -1
|
||||
//#define K_CS_PIN -1
|
||||
//#define E0_CS_PIN -1
|
||||
//#define E1_CS_PIN -1
|
||||
//#define E2_CS_PIN -1
|
||||
@@ -2677,6 +2746,9 @@
|
||||
//#define Z2_SLAVE_ADDRESS 0
|
||||
//#define Z3_SLAVE_ADDRESS 0
|
||||
//#define Z4_SLAVE_ADDRESS 0
|
||||
//#define I_SLAVE_ADDRESS 0
|
||||
//#define J_SLAVE_ADDRESS 0
|
||||
//#define K_SLAVE_ADDRESS 0
|
||||
//#define E0_SLAVE_ADDRESS 0
|
||||
//#define E1_SLAVE_ADDRESS 0
|
||||
//#define E2_SLAVE_ADDRESS 0
|
||||
@@ -2701,6 +2773,9 @@
|
||||
*/
|
||||
#define STEALTHCHOP_XY
|
||||
#define STEALTHCHOP_Z
|
||||
#define STEALTHCHOP_I
|
||||
#define STEALTHCHOP_J
|
||||
#define STEALTHCHOP_K
|
||||
#define STEALTHCHOP_E
|
||||
|
||||
/**
|
||||
@@ -2772,6 +2847,9 @@
|
||||
#define Z2_HYBRID_THRESHOLD 3
|
||||
#define Z3_HYBRID_THRESHOLD 3
|
||||
#define Z4_HYBRID_THRESHOLD 3
|
||||
#define I_HYBRID_THRESHOLD 3
|
||||
#define J_HYBRID_THRESHOLD 3
|
||||
#define K_HYBRID_THRESHOLD 3
|
||||
#define E0_HYBRID_THRESHOLD 30
|
||||
#define E1_HYBRID_THRESHOLD 30
|
||||
#define E2_HYBRID_THRESHOLD 30
|
||||
@@ -2818,6 +2896,9 @@
|
||||
//#define Z2_STALL_SENSITIVITY Z_STALL_SENSITIVITY
|
||||
//#define Z3_STALL_SENSITIVITY Z_STALL_SENSITIVITY
|
||||
//#define Z4_STALL_SENSITIVITY Z_STALL_SENSITIVITY
|
||||
//#define I_STALL_SENSITIVITY 8
|
||||
//#define J_STALL_SENSITIVITY 8
|
||||
//#define K_STALL_SENSITIVITY 8
|
||||
//#define SPI_ENDSTOPS // TMC2130 only
|
||||
//#define IMPROVE_HOMING_RELIABILITY
|
||||
#endif
|
||||
@@ -2958,6 +3039,33 @@
|
||||
#define Z4_SLEW_RATE 1
|
||||
#endif
|
||||
|
||||
#if AXIS_DRIVER_TYPE_I(L6470)
|
||||
#define I_MICROSTEPS 128
|
||||
#define I_OVERCURRENT 2000
|
||||
#define I_STALLCURRENT 1500
|
||||
#define I_MAX_VOLTAGE 127
|
||||
#define I_CHAIN_POS -1
|
||||
#define I_SLEW_RATE 1
|
||||
#endif
|
||||
|
||||
#if AXIS_DRIVER_TYPE_J(L6470)
|
||||
#define J_MICROSTEPS 128
|
||||
#define J_OVERCURRENT 2000
|
||||
#define J_STALLCURRENT 1500
|
||||
#define J_MAX_VOLTAGE 127
|
||||
#define J_CHAIN_POS -1
|
||||
#define J_SLEW_RATE 1
|
||||
#endif
|
||||
|
||||
#if AXIS_DRIVER_TYPE_K(L6470)
|
||||
#define K_MICROSTEPS 128
|
||||
#define K_OVERCURRENT 2000
|
||||
#define K_STALLCURRENT 1500
|
||||
#define K_MAX_VOLTAGE 127
|
||||
#define K_CHAIN_POS -1
|
||||
#define K_SLEW_RATE 1
|
||||
#endif
|
||||
|
||||
#if AXIS_IS_L64XX(E0)
|
||||
#define E0_MICROSTEPS 128
|
||||
#define E0_OVERCURRENT 2000
|
||||
@@ -4001,7 +4109,7 @@
|
||||
//
|
||||
// M43 - display pin status, toggle pins, watch pins, watch endstops & toggle LED, test servo probe
|
||||
//
|
||||
#define PINS_DEBUGGING
|
||||
//#define PINS_DEBUGGING
|
||||
|
||||
// Enable Marlin dev mode which adds some special commands
|
||||
//#define MARLIN_DEV_MODE
|
||||
|
||||
+6
-6
@@ -28,25 +28,25 @@
|
||||
/**
|
||||
* Marlin release version identifier
|
||||
*/
|
||||
//#define SHORT_BUILD_VERSION "bugfix-2.0.x"
|
||||
#define SHORT_BUILD_VERSION "2.0.8"
|
||||
|
||||
/**
|
||||
* Verbose version identifier which should contain a reference to the location
|
||||
* from where the binary was downloaded or the source code was compiled.
|
||||
*/
|
||||
//#define DETAILED_BUILD_VERSION SHORT_BUILD_VERSION
|
||||
#define DETAILED_BUILD_VERSION "IA_" SHORT_BUILD_VERSION
|
||||
|
||||
/**
|
||||
* The STRING_DISTRIBUTION_DATE represents when the binary file was built,
|
||||
* here we define this default string as the date where the latest release
|
||||
* version was tagged.
|
||||
*/
|
||||
//#define STRING_DISTRIBUTION_DATE "2019-07-10"
|
||||
#define STRING_DISTRIBUTION_DATE "2021-06-05"
|
||||
|
||||
/**
|
||||
* Defines a generic printer name to be output to the LCD after booting Marlin.
|
||||
*/
|
||||
//#define MACHINE_NAME "3D Printer"
|
||||
#define MACHINE_NAME "Insanity Automation S8"
|
||||
|
||||
/**
|
||||
* The SOURCE_CODE_URL is the location where users will find the Marlin Source
|
||||
@@ -54,7 +54,7 @@
|
||||
* has a distinct Github fork— the Source Code URL should just be the main
|
||||
* Marlin repository.
|
||||
*/
|
||||
//#define SOURCE_CODE_URL "github.com/MarlinFirmware/Marlin"
|
||||
#define SOURCE_CODE_URL "github.com/InsanityAutomation"
|
||||
|
||||
/**
|
||||
* Default generic printer UUID.
|
||||
@@ -65,7 +65,7 @@
|
||||
* The WEBSITE_URL is the location where users can get more information such as
|
||||
* documentation about a specific Marlin release.
|
||||
*/
|
||||
//#define WEBSITE_URL "marlinfw.org"
|
||||
//#define WEBSITE_URL "insanityautomation.com"
|
||||
|
||||
/**
|
||||
* Set the vendor info the serial USB interface, if changable
|
||||
|
||||
@@ -0,0 +1,113 @@
|
||||
/**
|
||||
* Marlin 3D Printer Firmware
|
||||
* Copyright (C) 2016 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 <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
*/
|
||||
|
||||
/**
|
||||
* Custom Bitmap for splashscreen
|
||||
*
|
||||
* You may use one of the following tools to generate the C++ bitmap array from
|
||||
* a black and white image:
|
||||
*
|
||||
* - http://www.marlinfw.org/tools/u8glib/converter.html
|
||||
* - http://www.digole.com/tools/PicturetoC_Hex_converter.php
|
||||
*/
|
||||
#pragma once
|
||||
|
||||
#define CUSTOM_BOOTSCREEN_TIMEOUT 2500
|
||||
#define CUSTOM_BOOTSCREEN_BMPWIDTH 128
|
||||
#define CUSTOM_BOOTSCREEN_BMPHEIGHT 64
|
||||
|
||||
/**
|
||||
* Made with Marlin Bitmap Converter
|
||||
* https://marlinfw.org/tools/u8glib/converter.html
|
||||
*
|
||||
* This bitmap from 128x64 C/C++ data
|
||||
*/
|
||||
|
||||
|
||||
#define HMIJ3S_BMPWIDTH 128
|
||||
|
||||
const unsigned char custom_start_bmp[] PROGMEM = {
|
||||
B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,
|
||||
B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,
|
||||
B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00001111,B11100000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,
|
||||
B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00111111,B11111000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,
|
||||
B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B01111111,B11111100,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,
|
||||
B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B11111111,B11111110,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,
|
||||
B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B11111111,B11111110,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,
|
||||
B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000001,B11111111,B11111111,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,
|
||||
B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000001,B11111111,B11111111,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,
|
||||
B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000001,B11111111,B11111111,B10000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,
|
||||
B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000011,B11111111,B11111111,B11100000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,
|
||||
B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000111,B11111111,B11111111,B11100000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,
|
||||
B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000111,B11111111,B11111111,B11111000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,
|
||||
B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00001111,B11111111,B11111111,B11111000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,
|
||||
B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00011111,B11111111,B11111111,B11111100,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,
|
||||
B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00111111,B11111111,B11111111,B11111110,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,
|
||||
B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B01111111,B11111111,B01111111,B11111111,B10000000,B00000000,B00000000,B00000000,B00000000,B00000000,
|
||||
B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B11111111,B11111110,B00011111,B11111111,B11000000,B00000000,B00000000,B00000000,B00000000,B00000000,
|
||||
B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B11111111,B11111100,B00001111,B11111111,B11100000,B00000000,B00000000,B00000000,B00000000,B00000000,
|
||||
B00000000,B00000000,B00000000,B00000000,B00000000,B00000001,B11111111,B11111000,B00000011,B11111111,B11110000,B00000000,B00000000,B00000000,B00000000,B00000000,
|
||||
B00000000,B00000000,B00000000,B00000000,B00000000,B00000011,B11111111,B11111000,B00000001,B11111111,B11111000,B00000000,B00000000,B00000000,B00000000,B00000000,
|
||||
B00000000,B00000000,B00000000,B00000000,B00000000,B00000111,B11111111,B11110000,B00000000,B11111111,B11111100,B00000000,B00000000,B00000000,B00000000,B00000000,
|
||||
B00000000,B00000000,B00000000,B00000000,B00000000,B00001111,B11111111,B11100000,B00000000,B00111111,B11111110,B00000000,B00000000,B00000000,B00000000,B00000000,
|
||||
B00000000,B00000000,B00000000,B00000000,B00000000,B00011111,B11111111,B11000000,B00000000,B00001111,B11111111,B00000000,B00000000,B00000000,B00000000,B00000000,
|
||||
B00000000,B00000000,B00000000,B00000000,B00000000,B00011111,B11111111,B10000000,B00000000,B00000111,B11111111,B10000000,B00000000,B00000000,B00000000,B00000000,
|
||||
B00000000,B00000000,B00000000,B00000000,B00000000,B00111111,B11111111,B00000000,B00000000,B00000001,B11111111,B11111000,B00000000,B00000000,B00000000,B00000000,
|
||||
B00000000,B00000000,B00000000,B00000000,B00000000,B01111111,B11111111,B00000000,B00000000,B00000000,B11111111,B11111110,B00000000,B00000000,B00000000,B00000000,
|
||||
B00000000,B00000000,B00000000,B00000000,B00000000,B11111111,B11111110,B00000000,B00000000,B00000000,B01111111,B11111111,B00000000,B00000000,B00000000,B00000000,
|
||||
B00000000,B00000000,B00000000,B00000000,B00000001,B11111111,B11111100,B00000000,B00000000,B00000000,B00011111,B11111111,B10000000,B00000000,B00000000,B00000000,
|
||||
B00000000,B00000000,B00000000,B00000000,B00000001,B11111111,B11111000,B00000000,B00000000,B00000000,B00001111,B11111111,B10000000,B00000000,B00000000,B00000000,
|
||||
B00000000,B00000000,B00000000,B00000000,B00000011,B11111111,B11110000,B00000000,B00000000,B00000000,B00000111,B11111111,B10000000,B00000000,B00000000,B00000000,
|
||||
B00000000,B00000000,B00000000,B00000000,B00000111,B11111111,B11100000,B00000000,B00000000,B00000000,B00000111,B11111111,B11100000,B00000000,B00000000,B00000000,
|
||||
B00000000,B00000000,B00000000,B00000000,B00001111,B11111111,B11100000,B00000000,B00000000,B00000000,B00000011,B11111111,B11111110,B00000000,B00000000,B00000000,
|
||||
B00000000,B00000000,B00000000,B00000000,B00011111,B11111111,B11000000,B00000000,B00000000,B00000000,B00000001,B11111111,B11111110,B00000000,B00000000,B00000000,
|
||||
B00000000,B00000000,B00000000,B00000000,B00111111,B11111111,B10000000,B00000000,B00000000,B00000000,B00000000,B11111110,B01111110,B00000000,B00000000,B00000000,
|
||||
B00000000,B00000000,B00000000,B00000001,B11111111,B11111111,B00000000,B00000000,B00000000,B00000000,B00000000,B11111000,B00001110,B00000000,B00000000,B00000000,
|
||||
B00000000,B00000000,B00000000,B00001111,B11111111,B11111110,B00000000,B00000000,B00000000,B00000000,B00000000,B11110000,B00001110,B00000000,B00000000,B00000000,
|
||||
B00000000,B00000000,B00000000,B00011111,B11111111,B11111100,B00000000,B00000000,B00000000,B00000000,B00000000,B11100000,B00000110,B00000000,B00000000,B00000000,
|
||||
B00000000,B00000000,B00000000,B00111111,B11111111,B11111100,B00000000,B00000000,B00000000,B00000000,B00000000,B11100000,B00000110,B00000000,B00000000,B00000000,
|
||||
B00000000,B00000000,B00000000,B01111111,B11111111,B11111000,B00000000,B00000000,B00000000,B00000000,B00000001,B11100000,B00000110,B00000000,B00000000,B00000000,
|
||||
B00000000,B00000000,B00000000,B01111111,B11111111,B11110000,B00000000,B00000000,B00000000,B00000000,B00000001,B11111000,B00000110,B00000000,B00000000,B00000000,
|
||||
B00000000,B00000111,B11111111,B11111111,B11111111,B11100000,B00000000,B00000000,B00000000,B00000000,B00000001,B11111111,B00111110,B00000000,B00000000,B00000000,
|
||||
B00000000,B00011111,B11111111,B11111111,B11111111,B11100000,B00000000,B00000000,B00000000,B00000000,B00000000,B00011111,B11111001,B11110000,B00000000,B00000000,
|
||||
B00000000,B00011111,B11111111,B11111111,B11111111,B11100000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000001,B11111111,B11110000,B00000000,B00000000,
|
||||
B00000000,B00011111,B11111111,B11111111,B11111111,B11100000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000011,B11111111,B11000000,B00000000,B00000000,
|
||||
B00000000,B00011111,B11111111,B11111111,B11111111,B11100000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000011,B11111111,B11100010,B00000000,B00000000,
|
||||
B00000000,B00011111,B11111111,B11111111,B11111111,B11000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B11111111,B11111111,B10000000,B00000000,
|
||||
B00000000,B00011111,B11111111,B11111111,B11111111,B11000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B01000011,B11111111,B11000000,B00000000,
|
||||
B00000000,B00011111,B11111111,B11111111,B11111111,B10000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000111,B11111111,B10000000,B00000000,
|
||||
B00000000,B00011111,B11111111,B11111111,B11111111,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00001111,B11111100,B00000000,B00000000,
|
||||
B00000000,B00001111,B11111111,B11111111,B11111000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00011111,B11111100,B00000000,B00000000,
|
||||
B00011111,B11111111,B11111111,B11111111,B11111111,B11111111,B11100000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000100,B00111100,B00000000,B00000000,
|
||||
B00111111,B11111111,B11111111,B11111111,B11111111,B11111111,B11100000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00111001,B00000000,B00000000,
|
||||
B00111111,B11111111,B11111111,B11111111,B11111111,B11111111,B11100000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B11100001,B11000000,B00000000,
|
||||
B00111111,B11111111,B11111111,B11111111,B11111111,B11111111,B11100000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000001,B11111111,B11110000,B00000000,
|
||||
B00111111,B11111111,B11111111,B11111111,B11111111,B11111111,B11100000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B11111111,B11111100,B00000000,
|
||||
B00111111,B11111111,B11111111,B11111111,B11111111,B11111111,B11100000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B11111111,B11111111,B00000000,
|
||||
B00011111,B11111111,B11111111,B11111111,B11111111,B11111111,B11100000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000111,B11111111,B11100111,B11000000,
|
||||
B00001111,B11111111,B11111111,B11111111,B11111111,B11111111,B10000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000111,B11111111,B11000011,B11110000,
|
||||
B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000011,B11011111,B11100001,B10000000,
|
||||
B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00001111,B11110000,B00000000,
|
||||
B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000111,B11100000,B00000000,
|
||||
B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000011,B00000000,B00000000,
|
||||
B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000
|
||||
};
|
||||
@@ -168,6 +168,51 @@ void setup_endstop_interrupts() {
|
||||
pciSetup(Z_MIN_PIN);
|
||||
#endif
|
||||
#endif
|
||||
#if HAS_I_MAX
|
||||
#if (digitalPinToInterrupt(I_MAX_PIN) != NOT_AN_INTERRUPT)
|
||||
_ATTACH(I_MAX_PIN);
|
||||
#else
|
||||
static_assert(digitalPinHasPCICR(I_MAX_PIN), "I_MAX_PIN is not interrupt-capable");
|
||||
pciSetup(I_MAX_PIN);
|
||||
#endif
|
||||
#elif HAS_I_MIN
|
||||
#if (digitalPinToInterrupt(I_MIN_PIN) != NOT_AN_INTERRUPT)
|
||||
_ATTACH(I_MIN_PIN);
|
||||
#else
|
||||
static_assert(digitalPinHasPCICR(I_MIN_PIN), "I_MIN_PIN is not interrupt-capable");
|
||||
pciSetup(I_MIN_PIN);
|
||||
#endif
|
||||
#endif
|
||||
#if HAS_J_MAX
|
||||
#if (digitalPinToInterrupt(J_MAX_PIN) != NOT_AN_INTERRUPT)
|
||||
_ATTACH(J_MAX_PIN);
|
||||
#else
|
||||
static_assert(digitalPinHasPCICR(J_MAX_PIN), "J_MAX_PIN is not interrupt-capable");
|
||||
pciSetup(J_MAX_PIN);
|
||||
#endif
|
||||
#elif HAS_J_MIN
|
||||
#if (digitalPinToInterrupt(J_MIN_PIN) != NOT_AN_INTERRUPT)
|
||||
_ATTACH(J_MIN_PIN);
|
||||
#else
|
||||
static_assert(digitalPinHasPCICR(J_MIN_PIN), "J_MIN_PIN is not interrupt-capable");
|
||||
pciSetup(J_MIN_PIN);
|
||||
#endif
|
||||
#endif
|
||||
#if HAS_K_MAX
|
||||
#if (digitalPinToInterrupt(K_MAX_PIN) != NOT_AN_INTERRUPT)
|
||||
_ATTACH(K_MAX_PIN);
|
||||
#else
|
||||
static_assert(digitalPinHasPCICR(K_MAX_PIN), "K_MAX_PIN is not interrupt-capable");
|
||||
pciSetup(K_MAX_PIN);
|
||||
#endif
|
||||
#elif HAS_K_MIN
|
||||
#if (digitalPinToInterrupt(K_MIN_PIN) != NOT_AN_INTERRUPT)
|
||||
_ATTACH(K_MIN_PIN);
|
||||
#else
|
||||
static_assert(digitalPinHasPCICR(K_MIN_PIN), "K_MIN_PIN is not interrupt-capable");
|
||||
pciSetup(K_MIN_PIN);
|
||||
#endif
|
||||
#endif
|
||||
#if HAS_X2_MAX
|
||||
#if (digitalPinToInterrupt(X2_MAX_PIN) != NOT_AN_INTERRUPT)
|
||||
_ATTACH(X2_MAX_PIN);
|
||||
@@ -256,6 +301,5 @@ void setup_endstop_interrupts() {
|
||||
pciSetup(Z_MIN_PROBE_PIN);
|
||||
#endif
|
||||
#endif
|
||||
|
||||
// If we arrive here without raising an assertion, each pin has either an EXT-interrupt or a PCI.
|
||||
}
|
||||
|
||||
@@ -64,4 +64,10 @@ void setup_endstop_interrupts() {
|
||||
TERN_(HAS_Z4_MAX, _ATTACH(Z4_MAX_PIN));
|
||||
TERN_(HAS_Z4_MIN, _ATTACH(Z4_MIN_PIN));
|
||||
TERN_(HAS_Z_MIN_PROBE_PIN, _ATTACH(Z_MIN_PROBE_PIN));
|
||||
TERN_(HAS_I_MAX, _ATTACH(I_MAX_PIN));
|
||||
TERN_(HAS_I_MIN, _ATTACH(I_MIN_PIN));
|
||||
TERN_(HAS_J_MAX, _ATTACH(J_MAX_PIN));
|
||||
TERN_(HAS_J_MIN, _ATTACH(J_MIN_PIN));
|
||||
TERN_(HAS_K_MAX, _ATTACH(K_MAX_PIN));
|
||||
TERN_(HAS_K_MIN, _ATTACH(K_MIN_PIN));
|
||||
}
|
||||
|
||||
@@ -59,4 +59,10 @@ void setup_endstop_interrupts() {
|
||||
TERN_(HAS_Z4_MAX, _ATTACH(Z4_MAX_PIN));
|
||||
TERN_(HAS_Z4_MIN, _ATTACH(Z4_MIN_PIN));
|
||||
TERN_(HAS_Z_MIN_PROBE_PIN, _ATTACH(Z_MIN_PROBE_PIN));
|
||||
TERN_(HAS_I_MAX, _ATTACH(I_MAX_PIN));
|
||||
TERN_(HAS_I_MIN, _ATTACH(I_MIN_PIN));
|
||||
TERN_(HAS_J_MAX, _ATTACH(J_MAX_PIN));
|
||||
TERN_(HAS_J_MIN, _ATTACH(J_MIN_PIN));
|
||||
TERN_(HAS_K_MAX, _ATTACH(K_MAX_PIN));
|
||||
TERN_(HAS_K_MIN, _ATTACH(K_MIN_PIN));
|
||||
}
|
||||
|
||||
@@ -122,4 +122,37 @@ void setup_endstop_interrupts() {
|
||||
#endif
|
||||
_ATTACH(Z_MIN_PROBE_PIN);
|
||||
#endif
|
||||
#if HAS_I_MAX
|
||||
#if !LPC1768_PIN_INTERRUPT_M(I_MAX_PIN)
|
||||
#error "I_MAX_PIN is not INTERRUPT-capable."
|
||||
#endif
|
||||
_ATTACH(I_MAX_PIN);
|
||||
#elif HAS_I_MIN
|
||||
#if !LPC1768_PIN_INTERRUPT_M(I_MIN_PIN)
|
||||
#error "I_MIN_PIN is not INTERRUPT-capable."
|
||||
#endif
|
||||
_ATTACH(I_MIN_PIN);
|
||||
#endif
|
||||
#if HAS_J_MAX
|
||||
#if !LPC1768_PIN_INTERRUPT_M(J_MAX_PIN)
|
||||
#error "J_MAX_PIN is not INTERRUPT-capable."
|
||||
#endif
|
||||
_ATTACH(J_MAX_PIN);
|
||||
#elif HAS_J_MIN
|
||||
#if !LPC1768_PIN_INTERRUPT_M(J_MIN_PIN)
|
||||
#error "J_MIN_PIN is not INTERRUPT-capable."
|
||||
#endif
|
||||
_ATTACH(J_MIN_PIN);
|
||||
#endif
|
||||
#if HAS_K_MAX
|
||||
#if !LPC1768_PIN_INTERRUPT_M(K_MAX_PIN)
|
||||
#error "K_MAX_PIN is not INTERRUPT-capable."
|
||||
#endif
|
||||
_ATTACH(K_MAX_PIN);
|
||||
#elif HAS_K_MIN
|
||||
#if !LPC1768_PIN_INTERRUPT_M(K_MIN_PIN)
|
||||
#error "K_MIN_PIN is not INTERRUPT-capable."
|
||||
#endif
|
||||
_ATTACH(K_MIN_PIN);
|
||||
#endif
|
||||
}
|
||||
|
||||
@@ -47,80 +47,38 @@
|
||||
|
||||
#include "../../module/endstops.h"
|
||||
|
||||
#define MATCH_EILINE(P1,P2) (P1 != P2 && PIN_TO_EILINE(P1) == PIN_TO_EILINE(P2))
|
||||
#if HAS_X_MAX
|
||||
#define MATCH_X_MAX_EILINE(P) MATCH_EILINE(P, X_MAX_PIN)
|
||||
#else
|
||||
#define MATCH_X_MAX_EILINE(P) false
|
||||
#endif
|
||||
#if HAS_X_MIN
|
||||
#define MATCH_X_MIN_EILINE(P) MATCH_EILINE(P, X_MIN_PIN)
|
||||
#else
|
||||
#define MATCH_X_MIN_EILINE(P) false
|
||||
#endif
|
||||
#if HAS_Y_MAX
|
||||
#define MATCH_Y_MAX_EILINE(P) MATCH_EILINE(P, Y_MAX_PIN)
|
||||
#else
|
||||
#define MATCH_Y_MAX_EILINE(P) false
|
||||
#endif
|
||||
#if HAS_Y_MIN
|
||||
#define MATCH_Y_MIN_EILINE(P) MATCH_EILINE(P, Y_MIN_PIN)
|
||||
#else
|
||||
#define MATCH_Y_MIN_EILINE(P) false
|
||||
#endif
|
||||
#if HAS_Z_MAX
|
||||
#define MATCH_Z_MAX_EILINE(P) MATCH_EILINE(P, Z_MAX_PIN)
|
||||
#else
|
||||
#define MATCH_Z_MAX_EILINE(P) false
|
||||
#endif
|
||||
#if HAS_Z_MIN
|
||||
#define MATCH_Z_MIN_EILINE(P) MATCH_EILINE(P, Z_MIN_PIN)
|
||||
#else
|
||||
#define MATCH_Z_MIN_EILINE(P) false
|
||||
#endif
|
||||
#if HAS_Z2_MAX
|
||||
#define MATCH_Z2_MAX_EILINE(P) MATCH_EILINE(P, Z2_MAX_PIN)
|
||||
#else
|
||||
#define MATCH_Z2_MAX_EILINE(P) false
|
||||
#endif
|
||||
#if HAS_Z2_MIN
|
||||
#define MATCH_Z2_MIN_EILINE(P) MATCH_EILINE(P, Z2_MIN_PIN)
|
||||
#else
|
||||
#define MATCH_Z2_MIN_EILINE(P) false
|
||||
#endif
|
||||
#if HAS_Z3_MAX
|
||||
#define MATCH_Z3_MAX_EILINE(P) MATCH_EILINE(P, Z3_MAX_PIN)
|
||||
#else
|
||||
#define MATCH_Z3_MAX_EILINE(P) false
|
||||
#endif
|
||||
#if HAS_Z3_MIN
|
||||
#define MATCH_Z3_MIN_EILINE(P) MATCH_EILINE(P, Z3_MIN_PIN)
|
||||
#else
|
||||
#define MATCH_Z3_MIN_EILINE(P) false
|
||||
#endif
|
||||
#if HAS_Z4_MAX
|
||||
#define MATCH_Z4_MAX_EILINE(P) MATCH_EILINE(P, Z4_MAX_PIN)
|
||||
#else
|
||||
#define MATCH_Z4_MAX_EILINE(P) false
|
||||
#endif
|
||||
#if HAS_Z4_MIN
|
||||
#define MATCH_Z4_MIN_EILINE(P) MATCH_EILINE(P, Z4_MIN_PIN)
|
||||
#else
|
||||
#define MATCH_Z4_MIN_EILINE(P) false
|
||||
#endif
|
||||
#if HAS_Z_MIN_PROBE_PIN
|
||||
#define MATCH_Z_MIN_PROBE_EILINE(P) MATCH_EILINE(P, Z_MIN_PROBE_PIN)
|
||||
#else
|
||||
#define MATCH_Z_MIN_PROBE_EILINE(P) false
|
||||
#endif
|
||||
#define AVAILABLE_EILINE(P) (PIN_TO_EILINE(P) != -1 \
|
||||
&& !MATCH_X_MAX_EILINE(P) && !MATCH_X_MIN_EILINE(P) \
|
||||
&& !MATCH_Y_MAX_EILINE(P) && !MATCH_Y_MIN_EILINE(P) \
|
||||
&& !MATCH_Z_MAX_EILINE(P) && !MATCH_Z_MIN_EILINE(P) \
|
||||
&& !MATCH_Z2_MAX_EILINE(P) && !MATCH_Z2_MIN_EILINE(P) \
|
||||
&& !MATCH_Z3_MAX_EILINE(P) && !MATCH_Z3_MIN_EILINE(P) \
|
||||
&& !MATCH_Z4_MAX_EILINE(P) && !MATCH_Z4_MIN_EILINE(P) \
|
||||
&& !MATCH_Z_MIN_PROBE_EILINE(P))
|
||||
#define MATCH_EILINE(P1,P2) (P1 != P2 && PIN_TO_EILINE(P1) == PIN_TO_EILINE(P2))
|
||||
#define MATCH_X_MAX_EILINE(P) TERN0(HAS_X_MAX, DEFER4(MATCH_EILINE)(P, X_MAX_PIN))
|
||||
#define MATCH_X_MIN_EILINE(P) TERN0(HAS_X_MIN, DEFER4(MATCH_EILINE)(P, X_MIN_PIN))
|
||||
#define MATCH_Y_MAX_EILINE(P) TERN0(HAS_Y_MAX, DEFER4(MATCH_EILINE)(P, Y_MAX_PIN))
|
||||
#define MATCH_Y_MIN_EILINE(P) TERN0(HAS_Y_MIN, DEFER4(MATCH_EILINE)(P, Y_MIN_PIN))
|
||||
#define MATCH_Z_MAX_EILINE(P) TERN0(HAS_Z_MAX, DEFER4(MATCH_EILINE)(P, Z_MAX_PIN))
|
||||
#define MATCH_Z_MIN_EILINE(P) TERN0(HAS_Z_MIN, DEFER4(MATCH_EILINE)(P, Z_MIN_PIN))
|
||||
#define MATCH_I_MAX_EILINE(P) TERN0(HAS_I_MAX, DEFER4(MATCH_EILINE)(P, I_MAX_PIN))
|
||||
#define MATCH_I_MIN_EILINE(P) TERN0(HAS_I_MIN, DEFER4(MATCH_EILINE)(P, I_MIN_PIN))
|
||||
#define MATCH_J_MAX_EILINE(P) TERN0(HAS_J_MAX, DEFER4(MATCH_EILINE)(P, J_MAX_PIN))
|
||||
#define MATCH_J_MIN_EILINE(P) TERN0(HAS_J_MIN, DEFER4(MATCH_EILINE)(P, J_MIN_PIN))
|
||||
#define MATCH_K_MAX_EILINE(P) TERN0(HAS_K_MAX, DEFER4(MATCH_EILINE)(P, K_MAX_PIN))
|
||||
#define MATCH_K_MIN_EILINE(P) TERN0(HAS_K_MIN, DEFER4(MATCH_EILINE)(P, K_MIN_PIN))
|
||||
#define MATCH_Z2_MAX_EILINE(P) TERN0(HAS_Z2_MAX, DEFER4(MATCH_EILINE)(P, Z2_MAX_PIN))
|
||||
#define MATCH_Z2_MIN_EILINE(P) TERN0(HAS_Z2_MIN, DEFER4(MATCH_EILINE)(P, Z2_MIN_PIN))
|
||||
#define MATCH_Z3_MAX_EILINE(P) TERN0(HAS_Z3_MAX, DEFER4(MATCH_EILINE)(P, Z3_MAX_PIN))
|
||||
#define MATCH_Z3_MIN_EILINE(P) TERN0(HAS_Z3_MIN, DEFER4(MATCH_EILINE)(P, Z3_MIN_PIN))
|
||||
#define MATCH_Z4_MAX_EILINE(P) TERN0(HAS_Z4_MAX, DEFER4(MATCH_EILINE)(P, Z4_MAX_PIN))
|
||||
#define MATCH_Z4_MIN_EILINE(P) TERN0(HAS_Z4_MIN, DEFER4(MATCH_EILINE)(P, Z4_MIN_PIN))
|
||||
#define MATCH_Z_MIN_PROBE_EILINE(P) TERN0(HAS_Z_MIN_PROBE_PIN, DEFER4(MATCH_EILINE)(P, Z_MIN_PROBE_PIN))
|
||||
|
||||
#define AVAILABLE_EILINE(P) ( PIN_TO_EILINE(P) != -1 \
|
||||
&& !MATCH_X_MAX_EILINE(P) && !MATCH_X_MIN_EILINE(P) \
|
||||
&& !MATCH_Y_MAX_EILINE(P) && !MATCH_Y_MIN_EILINE(P) \
|
||||
&& !MATCH_Z_MAX_EILINE(P) && !MATCH_Z_MIN_EILINE(P) \
|
||||
&& !MATCH_I_MAX_EILINE(P) && !MATCH_I_MIN_EILINE(P) \
|
||||
&& !MATCH_J_MAX_EILINE(P) && !MATCH_J_MIN_EILINE(P) \
|
||||
&& !MATCH_K_MAX_EILINE(P) && !MATCH_K_MIN_EILINE(P) \
|
||||
&& !MATCH_Z2_MAX_EILINE(P) && !MATCH_Z2_MIN_EILINE(P) \
|
||||
&& !MATCH_Z3_MAX_EILINE(P) && !MATCH_Z3_MIN_EILINE(P) \
|
||||
&& !MATCH_Z4_MAX_EILINE(P) && !MATCH_Z4_MIN_EILINE(P) \
|
||||
&& !MATCH_Z_MIN_PROBE_EILINE(P) )
|
||||
|
||||
// One ISR for all EXT-Interrupts
|
||||
void endstop_ISR() { endstops.update(); }
|
||||
@@ -204,5 +162,37 @@ void setup_endstop_interrupts() {
|
||||
#error "Z_MIN_PROBE_PIN has no EXTINT line available."
|
||||
#endif
|
||||
_ATTACH(Z_MIN_PROBE_PIN);
|
||||
#elif HAS_I_MAX
|
||||
#if !AVAILABLE_EILINE(I_MAX_PIN)
|
||||
#error "I_MAX_PIN has no EXTINT line available."
|
||||
#endif
|
||||
attachInterrupt(I_MAX_PIN, endstop_ISR, CHANGE);
|
||||
#elif HAS_I_MIN
|
||||
#if !AVAILABLE_EILINE(I_MIN_PIN)
|
||||
#error "I_MIN_PIN has no EXTINT line available."
|
||||
#endif
|
||||
attachInterrupt(I_MIN_PIN, endstop_ISR, CHANGE);
|
||||
#endif
|
||||
#if HAS_J_MAX
|
||||
#if !AVAILABLE_EILINE(J_MAX_PIN)
|
||||
#error "J_MAX_PIN has no EXTINT line available."
|
||||
#endif
|
||||
attachInterrupt(J_MAX_PIN, endstop_ISR, CHANGE);
|
||||
#elif HAS_J_MIN
|
||||
#if !AVAILABLE_EILINE(J_MIN_PIN)
|
||||
#error "J_MIN_PIN has no EXTINT line available."
|
||||
#endif
|
||||
attachInterrupt(J_MIN_PIN, endstop_ISR, CHANGE);
|
||||
#endif
|
||||
#if HAS_K_MAX
|
||||
#if !AVAILABLE_EILINE(K_MAX_PIN)
|
||||
#error "K_MAX_PIN has no EXTINT line available."
|
||||
#endif
|
||||
attachInterrupt(K_MAX_PIN, endstop_ISR, CHANGE);
|
||||
#elif HAS_K_MIN
|
||||
#if !AVAILABLE_EILINE(K_MIN_PIN)
|
||||
#error "K_MIN_PIN has no EXTINT line available."
|
||||
#endif
|
||||
attachInterrupt(K_MIN_PIN, endstop_ISR, CHANGE);
|
||||
#endif
|
||||
}
|
||||
|
||||
@@ -0,0 +1,82 @@
|
||||
/**
|
||||
* 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/>.
|
||||
*
|
||||
*/
|
||||
#ifdef STM32F1
|
||||
|
||||
/**
|
||||
* PersistentStore for Arduino-style EEPROM interface
|
||||
* with simple implementations supplied by Marlin.
|
||||
*/
|
||||
|
||||
#include "../../inc/MarlinConfig.h"
|
||||
|
||||
#if ENABLED(IIC_BL24CXX_EEPROM)
|
||||
|
||||
#include "../shared/eeprom_if.h"
|
||||
#include "../shared/eeprom_api.h"
|
||||
|
||||
//
|
||||
// PersistentStore
|
||||
//
|
||||
|
||||
#ifndef MARLIN_EEPROM_SIZE
|
||||
#error "MARLIN_EEPROM_SIZE is required for IIC_BL24CXX_EEPROM."
|
||||
#endif
|
||||
|
||||
size_t PersistentStore::capacity() { return MARLIN_EEPROM_SIZE; }
|
||||
|
||||
bool PersistentStore::access_start() { eeprom_init(); return true; }
|
||||
bool PersistentStore::access_finish() { return true; }
|
||||
|
||||
bool PersistentStore::write_data(int &pos, const uint8_t *value, size_t size, uint16_t *crc) {
|
||||
uint16_t written = 0;
|
||||
while (size--) {
|
||||
uint8_t v = *value;
|
||||
uint8_t * const p = (uint8_t * const)pos;
|
||||
if (v != eeprom_read_byte(p)) { // EEPROM has only ~100,000 write cycles, so only write bytes that have changed!
|
||||
eeprom_write_byte(p, v);
|
||||
if (++written & 0x7F) delay(2); else safe_delay(2); // Avoid triggering watchdog during long EEPROM writes
|
||||
if (eeprom_read_byte(p) != v) {
|
||||
SERIAL_ECHO_MSG(STR_ERR_EEPROM_WRITE);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
crc16(crc, &v, 1);
|
||||
pos++;
|
||||
value++;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
bool PersistentStore::read_data(int &pos, uint8_t *value, size_t size, uint16_t *crc, const bool writing/*=true*/) {
|
||||
do {
|
||||
uint8_t * const p = (uint8_t * const)pos;
|
||||
uint8_t c = eeprom_read_byte(p);
|
||||
if (writing) *value = c;
|
||||
crc16(crc, &c, 1);
|
||||
pos++;
|
||||
value++;
|
||||
} while (--size);
|
||||
return false;
|
||||
}
|
||||
|
||||
#endif // IIC_BL24CXX_EEPROM
|
||||
#endif // STM32F1
|
||||
@@ -0,0 +1,54 @@
|
||||
/**
|
||||
* 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/>.
|
||||
*
|
||||
*/
|
||||
|
||||
/**
|
||||
* Platform-independent Arduino functions for I2C EEPROM.
|
||||
* Enable USE_SHARED_EEPROM if not supplied by the framework.
|
||||
*/
|
||||
|
||||
#ifdef STM32F1
|
||||
|
||||
#include "../../inc/MarlinConfig.h"
|
||||
|
||||
#if ENABLED(IIC_BL24CXX_EEPROM)
|
||||
|
||||
#include "../../libs/BL24CXX.h"
|
||||
#include "../shared/eeprom_if.h"
|
||||
|
||||
void eeprom_init() { BL24CXX::init(); }
|
||||
|
||||
// ------------------------
|
||||
// Public functions
|
||||
// ------------------------
|
||||
|
||||
void eeprom_write_byte(uint8_t *pos, uint8_t value) {
|
||||
const unsigned eeprom_address = (unsigned)pos;
|
||||
return BL24CXX::writeOneByte(eeprom_address, value);
|
||||
}
|
||||
|
||||
uint8_t eeprom_read_byte(uint8_t *pos) {
|
||||
const unsigned eeprom_address = (unsigned)pos;
|
||||
return BL24CXX::readOneByte(eeprom_address);
|
||||
}
|
||||
|
||||
#endif // IIC_BL24CXX_EEPROM
|
||||
#endif // STM32F1
|
||||
@@ -46,4 +46,10 @@ void setup_endstop_interrupts() {
|
||||
TERN_(HAS_Z4_MAX, _ATTACH(Z4_MAX_PIN));
|
||||
TERN_(HAS_Z4_MIN, _ATTACH(Z4_MIN_PIN));
|
||||
TERN_(HAS_Z_MIN_PROBE_PIN, _ATTACH(Z_MIN_PROBE_PIN));
|
||||
TERN_(HAS_I_MAX, _ATTACH(I_MAX_PIN));
|
||||
TERN_(HAS_I_MIN, _ATTACH(I_MIN_PIN));
|
||||
TERN_(HAS_J_MAX, _ATTACH(J_MAX_PIN));
|
||||
TERN_(HAS_J_MIN, _ATTACH(J_MIN_PIN));
|
||||
TERN_(HAS_K_MAX, _ATTACH(K_MAX_PIN));
|
||||
TERN_(HAS_K_MIN, _ATTACH(K_MIN_PIN));
|
||||
}
|
||||
|
||||
@@ -21,7 +21,7 @@
|
||||
*/
|
||||
#pragma once
|
||||
|
||||
#if defined(USBD_USE_CDC_MSC) && DISABLED(NO_SD_HOST_DRIVE)
|
||||
#if BOTH(SDSUPPORT, USBD_USE_CDC_MSC) && DISABLED(NO_SD_HOST_DRIVE)
|
||||
#define HAS_SD_HOST_DRIVE 1
|
||||
#endif
|
||||
|
||||
|
||||
@@ -167,6 +167,15 @@ constexpr bool IsSerialClassAllowed(const HardwareSerial&) { return false; }
|
||||
#if AXIS_HAS_HW_SERIAL(Z4)
|
||||
CHECK_AXIS_SERIAL(Z4);
|
||||
#endif
|
||||
#if AXIS_HAS_HW_SERIAL(I)
|
||||
CHECK_AXIS_SERIAL(I);
|
||||
#endif
|
||||
#if AXIS_HAS_HW_SERIAL(J)
|
||||
CHECK_AXIS_SERIAL(J);
|
||||
#endif
|
||||
#if AXIS_HAS_HW_SERIAL(K)
|
||||
CHECK_AXIS_SERIAL(K);
|
||||
#endif
|
||||
#if AXIS_HAS_HW_SERIAL(E0)
|
||||
CHECK_AXIS_SERIAL(E0);
|
||||
#endif
|
||||
|
||||
@@ -11,6 +11,7 @@ if __name__ == "__main__":
|
||||
"-fsigned-char",
|
||||
"-fno-move-loop-invariants",
|
||||
"-fno-strict-aliasing",
|
||||
"-fsingle-precision-constant",
|
||||
|
||||
"--specs=nano.specs",
|
||||
"--specs=nosys.specs",
|
||||
|
||||
@@ -71,4 +71,10 @@ void setup_endstop_interrupts() {
|
||||
TERN_(HAS_Z4_MAX, _ATTACH(Z4_MAX_PIN));
|
||||
TERN_(HAS_Z4_MIN, _ATTACH(Z4_MIN_PIN));
|
||||
TERN_(HAS_Z_MIN_PROBE_PIN, _ATTACH(Z_MIN_PROBE_PIN));
|
||||
TERN_(HAS_I_MAX, _ATTACH(I_MAX_PIN));
|
||||
TERN_(HAS_I_MIN, _ATTACH(I_MIN_PIN));
|
||||
TERN_(HAS_J_MAX, _ATTACH(J_MAX_PIN));
|
||||
TERN_(HAS_J_MIN, _ATTACH(J_MIN_PIN));
|
||||
TERN_(HAS_K_MAX, _ATTACH(K_MAX_PIN));
|
||||
TERN_(HAS_K_MIN, _ATTACH(K_MIN_PIN));
|
||||
}
|
||||
|
||||
@@ -64,4 +64,10 @@ void setup_endstop_interrupts() {
|
||||
TERN_(HAS_Z4_MAX, _ATTACH(Z4_MAX_PIN));
|
||||
TERN_(HAS_Z4_MIN, _ATTACH(Z4_MIN_PIN));
|
||||
TERN_(HAS_Z_MIN_PROBE_PIN, _ATTACH(Z_MIN_PROBE_PIN));
|
||||
TERN_(HAS_I_MAX, _ATTACH(I_MAX_PIN));
|
||||
TERN_(HAS_I_MIN, _ATTACH(I_MIN_PIN));
|
||||
TERN_(HAS_J_MAX, _ATTACH(J_MAX_PIN));
|
||||
TERN_(HAS_J_MIN, _ATTACH(J_MIN_PIN));
|
||||
TERN_(HAS_K_MAX, _ATTACH(K_MAX_PIN));
|
||||
TERN_(HAS_K_MIN, _ATTACH(K_MIN_PIN));
|
||||
}
|
||||
|
||||
@@ -63,4 +63,10 @@ void setup_endstop_interrupts() {
|
||||
TERN_(HAS_Z4_MAX, _ATTACH(Z4_MAX_PIN));
|
||||
TERN_(HAS_Z4_MIN, _ATTACH(Z4_MIN_PIN));
|
||||
TERN_(HAS_Z_MIN_PROBE_PIN, _ATTACH(Z_MIN_PROBE_PIN));
|
||||
TERN_(HAS_I_MAX, _ATTACH(I_MAX_PIN));
|
||||
TERN_(HAS_I_MIN, _ATTACH(I_MIN_PIN));
|
||||
TERN_(HAS_J_MAX, _ATTACH(J_MAX_PIN));
|
||||
TERN_(HAS_J_MIN, _ATTACH(J_MIN_PIN));
|
||||
TERN_(HAS_K_MAX, _ATTACH(K_MAX_PIN));
|
||||
TERN_(HAS_K_MIN, _ATTACH(K_MIN_PIN));
|
||||
}
|
||||
|
||||
@@ -63,4 +63,10 @@ void setup_endstop_interrupts() {
|
||||
TERN_(HAS_Z4_MAX, _ATTACH(Z4_MAX_PIN));
|
||||
TERN_(HAS_Z4_MIN, _ATTACH(Z4_MIN_PIN));
|
||||
TERN_(HAS_Z_MIN_PROBE_PIN, _ATTACH(Z_MIN_PROBE_PIN));
|
||||
TERN_(HAS_I_MAX, _ATTACH(I_MAX_PIN));
|
||||
TERN_(HAS_I_MIN, _ATTACH(I_MIN_PIN));
|
||||
TERN_(HAS_J_MAX, _ATTACH(J_MAX_PIN));
|
||||
TERN_(HAS_J_MIN, _ATTACH(J_MIN_PIN));
|
||||
TERN_(HAS_K_MAX, _ATTACH(K_MAX_PIN));
|
||||
TERN_(HAS_K_MIN, _ATTACH(K_MIN_PIN));
|
||||
}
|
||||
|
||||
@@ -304,6 +304,9 @@ void enable_all_steppers() {
|
||||
ENABLE_AXIS_X();
|
||||
ENABLE_AXIS_Y();
|
||||
ENABLE_AXIS_Z();
|
||||
ENABLE_AXIS_I(); // Marlin 6-axis support by DerAndere (https://github.com/DerAndere1/Marlin/wiki)
|
||||
ENABLE_AXIS_J();
|
||||
ENABLE_AXIS_K();
|
||||
enable_e_steppers();
|
||||
|
||||
TERN_(EXTENSIBLE_UI, ExtUI::onSteppersEnabled());
|
||||
@@ -317,7 +320,7 @@ void disable_e_steppers() {
|
||||
void disable_e_stepper(const uint8_t e) {
|
||||
#define _CASE_DIS_E(N) case N: DISABLE_AXIS_E##N(); break;
|
||||
switch (e) {
|
||||
REPEAT(EXTRUDERS, _CASE_DIS_E)
|
||||
REPEAT(E_STEPPERS, _CASE_DIS_E)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -325,6 +328,9 @@ void disable_all_steppers() {
|
||||
DISABLE_AXIS_X();
|
||||
DISABLE_AXIS_Y();
|
||||
DISABLE_AXIS_Z();
|
||||
DISABLE_AXIS_I();
|
||||
DISABLE_AXIS_J();
|
||||
DISABLE_AXIS_K();
|
||||
disable_e_steppers();
|
||||
|
||||
TERN_(EXTENSIBLE_UI, ExtUI::onSteppersDisabled());
|
||||
@@ -444,6 +450,9 @@ inline void manage_inactivity(const bool ignore_stepper_queue=false) {
|
||||
if (ENABLED(DISABLE_INACTIVE_X)) DISABLE_AXIS_X();
|
||||
if (ENABLED(DISABLE_INACTIVE_Y)) DISABLE_AXIS_Y();
|
||||
if (ENABLED(DISABLE_INACTIVE_Z)) DISABLE_AXIS_Z();
|
||||
if (ENABLED(DISABLE_INACTIVE_I)) DISABLE_AXIS_I();
|
||||
if (ENABLED(DISABLE_INACTIVE_J)) DISABLE_AXIS_J();
|
||||
if (ENABLED(DISABLE_INACTIVE_K)) DISABLE_AXIS_K();
|
||||
if (ENABLED(DISABLE_INACTIVE_E)) disable_e_steppers();
|
||||
|
||||
TERN_(AUTO_BED_LEVELING_UBL, ubl.steppers_were_disabled());
|
||||
@@ -935,6 +944,15 @@ inline void tmc_standby_setup() {
|
||||
#if PIN_EXISTS(Z4_STDBY)
|
||||
SET_INPUT_PULLDOWN(Z4_STDBY_PIN);
|
||||
#endif
|
||||
#if PIN_EXISTS(I_STDBY)
|
||||
SET_INPUT_PULLDOWN(I_STDBY_PIN);
|
||||
#endif
|
||||
#if PIN_EXISTS(J_STDBY)
|
||||
SET_INPUT_PULLDOWN(J_STDBY_PIN);
|
||||
#endif
|
||||
#if PIN_EXISTS(K_STDBY)
|
||||
SET_INPUT_PULLDOWN(K_STDBY_PIN);
|
||||
#endif
|
||||
#if PIN_EXISTS(E0_STDBY)
|
||||
SET_INPUT_PULLDOWN(E0_STDBY_PIN);
|
||||
#endif
|
||||
@@ -1423,10 +1441,7 @@ void setup() {
|
||||
#endif
|
||||
|
||||
#if HAS_PRUSA_MMU1
|
||||
SETUP_LOG("Prusa MMU1");
|
||||
SET_OUTPUT(E_MUX0_PIN);
|
||||
SET_OUTPUT(E_MUX1_PIN);
|
||||
SET_OUTPUT(E_MUX2_PIN);
|
||||
SETUP_RUN(mmu_init());
|
||||
#endif
|
||||
|
||||
#if HAS_FANMUX
|
||||
|
||||
+16
-14
@@ -159,6 +159,7 @@
|
||||
#define BOARD_PICA_REVB 1324 // PICA Shield (original version)
|
||||
#define BOARD_PICA 1325 // PICA Shield (rev C or later)
|
||||
#define BOARD_INTAMSYS40 1326 // Intamsys 4.0 (Funmat HT)
|
||||
#define BOARD_MALYAN_M180 1327 // Malyan M180 Mainboard Version 2 (no display function, direct gcode only)
|
||||
|
||||
//
|
||||
// ATmega1281, ATmega2561
|
||||
@@ -371,20 +372,21 @@
|
||||
#define BOARD_BTT_SKR_V2_0_REV_B 4212 // BigTreeTech SKR v2.0 Rev B (STM32F407VGT6)
|
||||
#define BOARD_BTT_GTR_V1_0 4213 // BigTreeTech GTR v1.0 (STM32F407IGT)
|
||||
#define BOARD_BTT_OCTOPUS_V1_0 4214 // BigTreeTech Octopus v1.0 (STM32F446ZET6)
|
||||
#define BOARD_LERDGE_K 4215 // Lerdge K (STM32F407ZG)
|
||||
#define BOARD_LERDGE_S 4216 // Lerdge S (STM32F407VE)
|
||||
#define BOARD_LERDGE_X 4217 // Lerdge X (STM32F407VE)
|
||||
#define BOARD_VAKE403D 4218 // VAkE 403D (STM32F446VET6)
|
||||
#define BOARD_FYSETC_S6 4219 // FYSETC S6 (STM32F446VET6)
|
||||
#define BOARD_FYSETC_S6_V2_0 4220 // FYSETC S6 v2.0 (STM32F446VET6)
|
||||
#define BOARD_FYSETC_SPIDER 4221 // FYSETC Spider (STM32F446VET6)
|
||||
#define BOARD_FLYF407ZG 4222 // FLYF407ZG (STM32F407ZG)
|
||||
#define BOARD_MKS_ROBIN2 4223 // MKS_ROBIN2 (STM32F407ZE)
|
||||
#define BOARD_MKS_ROBIN_PRO_V2 4224 // MKS Robin Pro V2 (STM32F407VE)
|
||||
#define BOARD_MKS_ROBIN_NANO_V3 4225 // MKS Robin Nano V3 (STM32F407VG)
|
||||
#define BOARD_ANET_ET4 4226 // ANET ET4 V1.x (STM32F407VGT6)
|
||||
#define BOARD_ANET_ET4P 4227 // ANET ET4P V1.x (STM32F407VGT6)
|
||||
#define BOARD_FYSETC_CHEETAH_V20 4228 // FYSETC Cheetah V2.0
|
||||
#define BOARD_BTT_OCTOPUS_V1_1 4215 // BigTreeTech Octopus v1.1 (STM32F446ZET6)
|
||||
#define BOARD_LERDGE_K 4216 // Lerdge K (STM32F407ZG)
|
||||
#define BOARD_LERDGE_S 4217 // Lerdge S (STM32F407VE)
|
||||
#define BOARD_LERDGE_X 4218 // Lerdge X (STM32F407VE)
|
||||
#define BOARD_VAKE403D 4219 // VAkE 403D (STM32F446VET6)
|
||||
#define BOARD_FYSETC_S6 4220 // FYSETC S6 (STM32F446VET6)
|
||||
#define BOARD_FYSETC_S6_V2_0 4221 // FYSETC S6 v2.0 (STM32F446VET6)
|
||||
#define BOARD_FYSETC_SPIDER 4222 // FYSETC Spider (STM32F446VET6)
|
||||
#define BOARD_FLYF407ZG 4223 // FLYF407ZG (STM32F407ZG)
|
||||
#define BOARD_MKS_ROBIN2 4224 // MKS_ROBIN2 (STM32F407ZE)
|
||||
#define BOARD_MKS_ROBIN_PRO_V2 4225 // MKS Robin Pro V2 (STM32F407VE)
|
||||
#define BOARD_MKS_ROBIN_NANO_V3 4226 // MKS Robin Nano V3 (STM32F407VG)
|
||||
#define BOARD_ANET_ET4 4227 // ANET ET4 V1.x (STM32F407VGT6)
|
||||
#define BOARD_ANET_ET4P 4228 // ANET ET4P V1.x (STM32F407VGT6)
|
||||
#define BOARD_FYSETC_CHEETAH_V20 4229 // FYSETC Cheetah V2.0
|
||||
|
||||
|
||||
//
|
||||
|
||||
@@ -60,6 +60,9 @@
|
||||
#define AXIS_DRIVER_TYPE_X(T) _AXIS_DRIVER_TYPE(X,T)
|
||||
#define AXIS_DRIVER_TYPE_Y(T) _AXIS_DRIVER_TYPE(Y,T)
|
||||
#define AXIS_DRIVER_TYPE_Z(T) _AXIS_DRIVER_TYPE(Z,T)
|
||||
#define AXIS_DRIVER_TYPE_I(T) _AXIS_DRIVER_TYPE(I,T)
|
||||
#define AXIS_DRIVER_TYPE_J(T) _AXIS_DRIVER_TYPE(J,T)
|
||||
#define AXIS_DRIVER_TYPE_K(T) _AXIS_DRIVER_TYPE(K,T)
|
||||
|
||||
#define AXIS_DRIVER_TYPE_X2(T) (EITHER(X_DUAL_STEPPER_DRIVERS, DUAL_X_CARRIAGE) && _AXIS_DRIVER_TYPE(X2,T))
|
||||
#define AXIS_DRIVER_TYPE_Y2(T) (ENABLED(Y_DUAL_STEPPER_DRIVERS) && _AXIS_DRIVER_TYPE(Y2,T))
|
||||
@@ -83,6 +86,7 @@
|
||||
#define HAS_E_DRIVER(T) (0 RREPEAT2(E_STEPPERS, _OR_ADTE, T))
|
||||
|
||||
#define HAS_DRIVER(T) ( AXIS_DRIVER_TYPE_X(T) || AXIS_DRIVER_TYPE_Y(T) || AXIS_DRIVER_TYPE_Z(T) \
|
||||
|| AXIS_DRIVER_TYPE_I(T) || AXIS_DRIVER_TYPE_J(T) || AXIS_DRIVER_TYPE_K(T) \
|
||||
|| AXIS_DRIVER_TYPE_X2(T) || AXIS_DRIVER_TYPE_Y2(T) || AXIS_DRIVER_TYPE_Z2(T) \
|
||||
|| AXIS_DRIVER_TYPE_Z3(T) || AXIS_DRIVER_TYPE_Z4(T) || HAS_E_DRIVER(T) )
|
||||
|
||||
@@ -153,9 +157,11 @@
|
||||
#define _OR_EAH(N,T) || AXIS_HAS_##T(E##N)
|
||||
#define E_AXIS_HAS(T) (0 _OR_EAH(0,T) _OR_EAH(1,T) _OR_EAH(2,T) _OR_EAH(3,T) _OR_EAH(4,T) _OR_EAH(5,T) _OR_EAH(6,T) _OR_EAH(7,T))
|
||||
|
||||
#define ANY_AXIS_HAS(T) ( AXIS_HAS_##T(X) || AXIS_HAS_##T(Y) || AXIS_HAS_##T(Z) \
|
||||
|| AXIS_HAS_##T(X2) || AXIS_HAS_##T(Y2) || AXIS_HAS_##T(Z2) \
|
||||
|| AXIS_HAS_##T(Z3) || AXIS_HAS_##T(Z4) || E_AXIS_HAS(T) )
|
||||
#define ANY_AXIS_HAS(T) ( AXIS_HAS_##T(X) || AXIS_HAS_##T(X2) \
|
||||
|| AXIS_HAS_##T(Y) || AXIS_HAS_##T(Y2) \
|
||||
|| AXIS_HAS_##T(Z) || AXIS_HAS_##T(Z2) || AXIS_HAS_##T(Z3) || AXIS_HAS_##T(Z4) \
|
||||
|| AXIS_HAS_##T(I) || AXIS_HAS_##T(J) || AXIS_HAS_##T(K) \
|
||||
|| E_AXIS_HAS(T) )
|
||||
|
||||
#if ANY_AXIS_HAS(STEALTHCHOP)
|
||||
#define HAS_STEALTHCHOP 1
|
||||
|
||||
+128
-12
@@ -266,18 +266,25 @@
|
||||
#define STR_X_MAX "x_max"
|
||||
#define STR_X2_MIN "x2_min"
|
||||
#define STR_X2_MAX "x2_max"
|
||||
#define STR_Y_MIN "y_min"
|
||||
#define STR_Y_MAX "y_max"
|
||||
#define STR_Y2_MIN "y2_min"
|
||||
#define STR_Y2_MAX "y2_max"
|
||||
#define STR_Z_MIN "z_min"
|
||||
#define STR_Z_MAX "z_max"
|
||||
#define STR_Z2_MIN "z2_min"
|
||||
#define STR_Z2_MAX "z2_max"
|
||||
#define STR_Z3_MIN "z3_min"
|
||||
#define STR_Z3_MAX "z3_max"
|
||||
#define STR_Z4_MIN "z4_min"
|
||||
#define STR_Z4_MAX "z4_max"
|
||||
|
||||
#if HAS_Y_AXIS
|
||||
#define STR_Y_MIN "y_min"
|
||||
#define STR_Y_MAX "y_max"
|
||||
#define STR_Y2_MIN "y2_min"
|
||||
#define STR_Y2_MAX "y2_max"
|
||||
#endif
|
||||
|
||||
#if HAS_Z_AXIS
|
||||
#define STR_Z_MIN "z_min"
|
||||
#define STR_Z_MAX "z_max"
|
||||
#define STR_Z2_MIN "z2_min"
|
||||
#define STR_Z2_MAX "z2_max"
|
||||
#define STR_Z3_MIN "z3_min"
|
||||
#define STR_Z3_MAX "z3_max"
|
||||
#define STR_Z4_MIN "z4_min"
|
||||
#define STR_Z4_MAX "z4_max"
|
||||
#endif
|
||||
|
||||
#define STR_Z_PROBE "z_probe"
|
||||
#define STR_PROBE_EN "probe_en"
|
||||
#define STR_FILAMENT_RUNOUT_SENSOR "filament"
|
||||
@@ -286,6 +293,9 @@
|
||||
#define STR_X "X"
|
||||
#define STR_Y "Y"
|
||||
#define STR_Z "Z"
|
||||
#define STR_I AXIS4_STR
|
||||
#define STR_J AXIS5_STR
|
||||
#define STR_K AXIS6_STR
|
||||
#define STR_E "E"
|
||||
#if IS_KINEMATIC
|
||||
#define STR_A "A"
|
||||
@@ -305,8 +315,114 @@
|
||||
#define LCD_STR_A STR_A
|
||||
#define LCD_STR_B STR_B
|
||||
#define LCD_STR_C STR_C
|
||||
#define LCD_STR_I STR_I
|
||||
#define LCD_STR_J STR_J
|
||||
#define LCD_STR_K STR_K
|
||||
#define LCD_STR_E STR_E
|
||||
|
||||
// Extra Axis and Endstop Names
|
||||
#if LINEAR_AXES >= 4
|
||||
#if AXIS4_NAME == 'A'
|
||||
#define AXIS4_STR "A"
|
||||
#define STR_I_MIN "a_min"
|
||||
#define STR_I_MAX "a_max"
|
||||
#elif AXIS4_NAME == 'B'
|
||||
#define AXIS4_STR "B"
|
||||
#define STR_I_MIN "b_min"
|
||||
#define STR_I_MAX "b_max"
|
||||
#elif AXIS4_NAME == 'C'
|
||||
#define AXIS4_STR "C"
|
||||
#define STR_I_MIN "c_min"
|
||||
#define STR_I_MAX "c_max"
|
||||
#elif AXIS4_NAME == 'U'
|
||||
#define AXIS4_STR "U"
|
||||
#define STR_I_MIN "u_min"
|
||||
#define STR_I_MAX "u_max"
|
||||
#elif AXIS4_NAME == 'V'
|
||||
#define AXIS4_STR "V"
|
||||
#define STR_I_MIN "v_min"
|
||||
#define STR_I_MAX "v_max"
|
||||
#elif AXIS4_NAME == 'W'
|
||||
#define AXIS4_STR "W"
|
||||
#define STR_I_MIN "w_min"
|
||||
#define STR_I_MAX "w_max"
|
||||
#else
|
||||
#define AXIS4_STR "A"
|
||||
#define STR_I_MIN "a_min"
|
||||
#define STR_I_MAX "a_max"
|
||||
#endif
|
||||
#else
|
||||
#define AXIS4_STR ""
|
||||
#endif
|
||||
|
||||
#if LINEAR_AXES >= 5
|
||||
#if AXIS5_NAME == 'A'
|
||||
#define AXIS5_STR "A"
|
||||
#define STR_J_MIN "a_min"
|
||||
#define STR_J_MAX "a_max"
|
||||
#elif AXIS5_NAME == 'B'
|
||||
#define AXIS5_STR "B"
|
||||
#define STR_J_MIN "b_min"
|
||||
#define STR_J_MAX "b_max"
|
||||
#elif AXIS5_NAME == 'C'
|
||||
#define AXIS5_STR "C"
|
||||
#define STR_J_MIN "c_min"
|
||||
#define STR_J_MAX "c_max"
|
||||
#elif AXIS5_NAME == 'U'
|
||||
#define AXIS5_STR "U"
|
||||
#define STR_J_MIN "u_min"
|
||||
#define STR_J_MAX "u_max"
|
||||
#elif AXIS5_NAME == 'V'
|
||||
#define AXIS5_STR "V"
|
||||
#define STR_J_MIN "v_min"
|
||||
#define STR_J_MAX "v_max"
|
||||
#elif AXIS5_NAME == 'W'
|
||||
#define AXIS5_STR "W"
|
||||
#define STR_J_MIN "w_min"
|
||||
#define STR_J_MAX "w_max"
|
||||
#else
|
||||
#define AXIS5_STR "B"
|
||||
#define STR_J_MIN "b_min"
|
||||
#define STR_J_MAX "b_max"
|
||||
#endif
|
||||
#else
|
||||
#define AXIS5_STR ""
|
||||
#endif
|
||||
|
||||
#if LINEAR_AXES >= 6
|
||||
#if AXIS6_NAME == 'A'
|
||||
#define AXIS6_STR "A"
|
||||
#define STR_K_MIN "a_min"
|
||||
#define STR_K_MAX "a_max"
|
||||
#elif AXIS6_NAME == 'B'
|
||||
#define AXIS6_STR "B"
|
||||
#define STR_K_MIN "b_min"
|
||||
#define STR_K_MAX "b_max"
|
||||
#elif AXIS6_NAME == 'C'
|
||||
#define AXIS6_STR "C"
|
||||
#define STR_K_MIN "c_min"
|
||||
#define STR_K_MAX "c_max"
|
||||
#elif AXIS6_NAME == 'U'
|
||||
#define AXIS6_STR "U"
|
||||
#define STR_K_MIN "u_min"
|
||||
#define STR_K_MAX "u_max"
|
||||
#elif AXIS6_NAME == 'V'
|
||||
#define AXIS6_STR "V"
|
||||
#define STR_K_MIN "v_min"
|
||||
#define STR_K_MAX "v_max"
|
||||
#elif AXIS6_NAME == 'W'
|
||||
#define AXIS6_STR "W"
|
||||
#define STR_K_MIN "w_min"
|
||||
#define STR_K_MAX "w_max"
|
||||
#else
|
||||
#define AXIS6_STR "C"
|
||||
#define STR_K_MIN "c_min"
|
||||
#define STR_K_MAX "c_max"
|
||||
#endif
|
||||
#else
|
||||
#define AXIS6_STR ""
|
||||
#endif
|
||||
|
||||
#if EITHER(HAS_MARLINUI_HD44780, IS_TFTGLCD_PANEL)
|
||||
|
||||
// Custom characters defined in the first 8 characters of the LCD
|
||||
|
||||
@@ -36,12 +36,21 @@
|
||||
#define _XMIN_ 100
|
||||
#define _YMIN_ 200
|
||||
#define _ZMIN_ 300
|
||||
#define _IMIN_ 400
|
||||
#define _JMIN_ 500
|
||||
#define _KMIN_ 600
|
||||
#define _XMAX_ 101
|
||||
#define _YMAX_ 201
|
||||
#define _ZMAX_ 301
|
||||
#define _IMAX_ 401
|
||||
#define _JMAX_ 501
|
||||
#define _KMAX_ 601
|
||||
#define _XDIAG_ 102
|
||||
#define _YDIAG_ 202
|
||||
#define _ZDIAG_ 302
|
||||
#define _IDIAG_ 502
|
||||
#define _JDIAG_ 602
|
||||
#define _KDIAG_ 702
|
||||
#define _E0DIAG_ 400
|
||||
#define _E1DIAG_ 401
|
||||
#define _E2DIAG_ 402
|
||||
@@ -195,6 +204,11 @@
|
||||
#define __TERN(T,V...) ___TERN(_CAT(_NO,T),V) // Prepend '_NO' to get '_NOT_0' or '_NOT_1'
|
||||
#define ___TERN(P,V...) THIRD(P,V) // If first argument has a comma, A. Else B.
|
||||
|
||||
#define _OPTARG(A) , A
|
||||
#define OPTARG(O,A) TERN_(O,DEFER4(_OPTARG)(A))
|
||||
#define _OPTCODE(A) A;
|
||||
#define OPTCODE(O,A) TERN_(O,DEFER4(_OPTCODE)(A))
|
||||
|
||||
// Macros to avoid 'f + 0.0' which is not always optimized away. Minus included for symmetry.
|
||||
// Compiler flags -fno-signed-zeros -ffinite-math-only also cover 'f * 1.0', 'f - f', etc.
|
||||
#define PLUS_TERN0(O,A) _TERN(_ENA_1(O),,+ (A)) // OPTION ? '+ (A)' : '<nul>'
|
||||
|
||||
@@ -36,6 +36,10 @@ PGMSTR(X_LBL, "X:"); PGMSTR(Y_LBL, "Y:"); PGMSTR(Z_LBL, "Z:"); PGMST
|
||||
PGMSTR(SP_A_STR, " A"); PGMSTR(SP_B_STR, " B"); PGMSTR(SP_C_STR, " C");
|
||||
PGMSTR(SP_X_STR, " X"); PGMSTR(SP_Y_STR, " Y"); PGMSTR(SP_Z_STR, " Z"); PGMSTR(SP_E_STR, " E");
|
||||
PGMSTR(SP_X_LBL, " X:"); PGMSTR(SP_Y_LBL, " Y:"); PGMSTR(SP_Z_LBL, " Z:"); PGMSTR(SP_E_LBL, " E:");
|
||||
PGMSTR(I_STR, AXIS4_STR); PGMSTR(J_STR, AXIS5_STR); PGMSTR(K_STR, AXIS6_STR);
|
||||
PGMSTR(I_LBL, AXIS4_STR ":"); PGMSTR(J_LBL, AXIS5_STR ":"); PGMSTR(K_LBL, AXIS6_STR ":");
|
||||
PGMSTR(SP_I_STR, " " AXIS4_STR); PGMSTR(SP_J_STR, " " AXIS5_STR); PGMSTR(SP_K_STR, " " AXIS6_STR);
|
||||
PGMSTR(SP_I_LBL, " " AXIS4_STR ":"); PGMSTR(SP_J_LBL, " " AXIS5_STR ":"); PGMSTR(SP_K_LBL, " " AXIS6_STR ":");
|
||||
|
||||
// Hook Meatpack if it's enabled on the first leaf
|
||||
#if ENABLED(MEATPACK_ON_SERIAL_PORT_1)
|
||||
@@ -101,8 +105,10 @@ void print_bin(uint16_t val) {
|
||||
}
|
||||
}
|
||||
|
||||
void print_pos(const_float_t x, const_float_t y, const_float_t z, PGM_P const prefix/*=nullptr*/, PGM_P const suffix/*=nullptr*/) {
|
||||
void print_pos(LINEAR_AXIS_ARGS(const_float_t), PGM_P const prefix/*=nullptr*/, PGM_P const suffix/*=nullptr*/) {
|
||||
if (prefix) serialprintPGM(prefix);
|
||||
SERIAL_ECHOPAIR_P(SP_X_STR, x, SP_Y_STR, y, SP_Z_STR, z);
|
||||
SERIAL_ECHOPAIR_P(
|
||||
LIST_N(DOUBLE(LINEAR_AXES), SP_X_STR, x, SP_Y_STR, y, SP_Z_STR, z, SP_I_STR, i, SP_J_STR, j, SP_K_STR, k)
|
||||
);
|
||||
if (suffix) serialprintPGM(suffix); else SERIAL_EOL();
|
||||
}
|
||||
|
||||
@@ -29,12 +29,16 @@
|
||||
#endif
|
||||
|
||||
// Commonly-used strings in serial output
|
||||
extern const char NUL_STR[], SP_P_STR[], SP_T_STR[],
|
||||
extern const char NUL_STR[],
|
||||
SP_X_STR[], SP_Y_STR[], SP_Z_STR[],
|
||||
SP_A_STR[], SP_B_STR[], SP_C_STR[], SP_E_STR[],
|
||||
SP_X_LBL[], SP_Y_LBL[], SP_Z_LBL[], SP_E_LBL[],
|
||||
SP_I_STR[], SP_J_STR[], SP_K_STR[],
|
||||
SP_I_LBL[], SP_J_LBL[], SP_K_LBL[],
|
||||
SP_P_STR[], SP_T_STR[],
|
||||
X_STR[], Y_STR[], Z_STR[], E_STR[],
|
||||
X_LBL[], Y_LBL[], Z_LBL[], E_LBL[],
|
||||
SP_A_STR[], SP_B_STR[], SP_C_STR[],
|
||||
SP_X_STR[], SP_Y_STR[], SP_Z_STR[], SP_E_STR[],
|
||||
SP_X_LBL[], SP_Y_LBL[], SP_Z_LBL[], SP_E_LBL[];
|
||||
I_LBL[], J_LBL[], K_LBL[];
|
||||
|
||||
//
|
||||
// Debugging flags for use by M111
|
||||
@@ -310,10 +314,10 @@ void serialprint_truefalse(const bool tf);
|
||||
void serial_spaces(uint8_t count);
|
||||
|
||||
void print_bin(const uint16_t val);
|
||||
void print_pos(const_float_t x, const_float_t y, const_float_t z, PGM_P const prefix=nullptr, PGM_P const suffix=nullptr);
|
||||
void print_pos(LINEAR_AXIS_ARGS(const_float_t), PGM_P const prefix=nullptr, PGM_P const suffix=nullptr);
|
||||
|
||||
inline void print_pos(const xyz_pos_t &xyz, PGM_P const prefix=nullptr, PGM_P const suffix=nullptr) {
|
||||
print_pos(xyz.x, xyz.y, xyz.z, prefix, suffix);
|
||||
print_pos(LINEAR_AXIS_ELEM(xyz), prefix, suffix);
|
||||
}
|
||||
|
||||
#define SERIAL_POS(SUFFIX,VAR) do { print_pos(VAR, PSTR(" " STRINGIFY(VAR) "="), PSTR(" : " SUFFIX "\n")); }while(0)
|
||||
|
||||
+359
-210
@@ -39,6 +39,32 @@ struct IF { typedef R type; };
|
||||
template <class L, class R>
|
||||
struct IF<true, L, R> { typedef L type; };
|
||||
|
||||
#define LINEAR_AXIS_GANG(V...) GANG_N(LINEAR_AXES, V)
|
||||
#define LINEAR_AXIS_CODE(V...) CODE_N(LINEAR_AXES, V)
|
||||
#define LINEAR_AXIS_LIST(V...) LIST_N(LINEAR_AXES, V)
|
||||
#define LINEAR_AXIS_ARRAY(V...) { LINEAR_AXIS_LIST(V) }
|
||||
#define LINEAR_AXIS_ARGS(T...) LINEAR_AXIS_LIST(T x, T y, T z, T i, T j, T k)
|
||||
#define LINEAR_AXIS_ELEM(O) LINEAR_AXIS_LIST(O.x, O.y, O.z, O.i, O.j, O.k)
|
||||
#define LINEAR_AXIS_DEFS(T,V) LINEAR_AXIS_LIST(T x=V, T y=V, T z=V, T i=V, T j=V, T k=V)
|
||||
|
||||
#define LOGICAL_AXIS_GANG(E,V...) LINEAR_AXIS_GANG(V) GANG_ITEM_E(E)
|
||||
#define LOGICAL_AXIS_CODE(E,V...) LINEAR_AXIS_CODE(V) CODE_ITEM_E(E)
|
||||
#define LOGICAL_AXIS_LIST(E,V...) LINEAR_AXIS_LIST(V) LIST_ITEM_E(E)
|
||||
#define LOGICAL_AXIS_ARRAY(E,V...) { LOGICAL_AXIS_LIST(E,V) }
|
||||
#define LOGICAL_AXIS_ARGS(T...) LOGICAL_AXIS_LIST(T e, T x, T y, T z, T i, T j, T k)
|
||||
#define LOGICAL_AXIS_ELEM(O) LOGICAL_AXIS_LIST(O.e, O.x, O.y, O.z, O.i, O.j, O.k)
|
||||
#define LOGICAL_AXIS_DECL(T,V) LOGICAL_AXIS_LIST(T e=V, T x=V, T y=V, T z=V, T i=V, T j=V, T k=V)
|
||||
|
||||
#if HAS_EXTRUDERS
|
||||
#define LIST_ITEM_E(N) , N
|
||||
#define CODE_ITEM_E(N) ; N
|
||||
#define GANG_ITEM_E(N) N
|
||||
#else
|
||||
#define LIST_ITEM_E(N)
|
||||
#define CODE_ITEM_E(N)
|
||||
#define GANG_ITEM_E(N)
|
||||
#endif
|
||||
|
||||
//
|
||||
// Enumerated axis indices
|
||||
//
|
||||
@@ -47,16 +73,43 @@ struct IF<true, L, R> { typedef L type; };
|
||||
// - X_HEAD, Y_HEAD, and Z_HEAD should be used for Steppers on Core kinematics
|
||||
//
|
||||
enum AxisEnum : uint8_t {
|
||||
X_AXIS = 0, A_AXIS = X_AXIS,
|
||||
Y_AXIS = 1, B_AXIS = Y_AXIS,
|
||||
Z_AXIS = 2, C_AXIS = Z_AXIS,
|
||||
E_AXIS,
|
||||
X_HEAD, Y_HEAD, Z_HEAD,
|
||||
E0_AXIS = E_AXIS,
|
||||
E1_AXIS, E2_AXIS, E3_AXIS, E4_AXIS, E5_AXIS, E6_AXIS, E7_AXIS,
|
||||
ALL_AXES_ENUM = 0xFE, NO_AXIS_ENUM = 0xFF
|
||||
|
||||
// Linear axes may be controlled directly or indirectly
|
||||
LINEAR_AXIS_LIST(X_AXIS, Y_AXIS, Z_AXIS, I_AXIS, J_AXIS, K_AXIS)
|
||||
|
||||
// Extruder axes may be considered distinctly
|
||||
#define _EN_ITEM(N) , E##N##_AXIS
|
||||
REPEAT(EXTRUDERS, _EN_ITEM)
|
||||
#undef _EN_ITEM
|
||||
|
||||
// Core also keeps toolhead directions
|
||||
#if IS_CORE
|
||||
, X_HEAD, Y_HEAD, Z_HEAD
|
||||
#endif
|
||||
|
||||
// Distinct axes, including all E and Core
|
||||
, NUM_AXIS_ENUMS
|
||||
|
||||
// Most of the time we refer only to the single E_AXIS
|
||||
#if HAS_EXTRUDERS
|
||||
, E_AXIS = E0_AXIS
|
||||
#endif
|
||||
|
||||
// A, B, and C are for DELTA, SCARA, etc.
|
||||
, A_AXIS = X_AXIS
|
||||
#if LINEAR_AXES >= 2
|
||||
, B_AXIS = Y_AXIS
|
||||
#endif
|
||||
#if LINEAR_AXES >= 3
|
||||
, C_AXIS = Z_AXIS
|
||||
#endif
|
||||
|
||||
// To refer to all or none
|
||||
, ALL_AXES_ENUM = 0xFE, NO_AXIS_ENUM = 0xFF
|
||||
};
|
||||
|
||||
typedef IF<(NUM_AXIS_ENUMS > 8), uint16_t, uint8_t>::type axis_bits_t;
|
||||
|
||||
//
|
||||
// Loop over axes
|
||||
//
|
||||
@@ -185,7 +238,7 @@ void toNative(xyz_pos_t &raw);
|
||||
void toNative(xyze_pos_t &raw);
|
||||
|
||||
//
|
||||
// XY coordinates, counters, etc.
|
||||
// Paired XY coordinates, counters, flags, etc.
|
||||
//
|
||||
template<typename T>
|
||||
struct XYval {
|
||||
@@ -194,18 +247,34 @@ struct XYval {
|
||||
struct { T a, b; };
|
||||
T pos[2];
|
||||
};
|
||||
FI void set(const T px) { x = px; }
|
||||
FI void set(const T px, const T py) { x = px; y = py; }
|
||||
FI void set(const T (&arr)[XY]) { x = arr[0]; y = arr[1]; }
|
||||
FI void set(const T (&arr)[XYZ]) { x = arr[0]; y = arr[1]; }
|
||||
FI void set(const T (&arr)[XYZE]) { x = arr[0]; y = arr[1]; }
|
||||
#if DISTINCT_AXES > LOGICAL_AXES
|
||||
FI void set(const T (&arr)[DISTINCT_AXES]) { x = arr[0]; y = arr[1]; }
|
||||
#endif
|
||||
|
||||
// Set all to 0
|
||||
FI void reset() { x = y = 0; }
|
||||
|
||||
// Setters taking struct types and arrays
|
||||
FI void set(const T px) { x = px; }
|
||||
#if HAS_Y_AXIS
|
||||
FI void set(const T px, const T py) { x = px; y = py; }
|
||||
FI void set(const T (&arr)[XY]) { x = arr[0]; y = arr[1]; }
|
||||
#endif
|
||||
#if LINEAR_AXES > XY
|
||||
FI void set(const T (&arr)[LINEAR_AXES]) { x = arr[0]; y = arr[1]; }
|
||||
#endif
|
||||
#if LOGICAL_AXES > LINEAR_AXES
|
||||
FI void set(const T (&arr)[LOGICAL_AXES]) { x = arr[0]; y = arr[1]; }
|
||||
#if DISTINCT_AXES > LOGICAL_AXES
|
||||
FI void set(const T (&arr)[DISTINCT_AXES]) { x = arr[0]; y = arr[1]; }
|
||||
#endif
|
||||
#endif
|
||||
|
||||
// Length reduced to one dimension
|
||||
FI T magnitude() const { return (T)sqrtf(x*x + y*y); }
|
||||
// Pointer to the data as a simple array
|
||||
FI operator T* () { return pos; }
|
||||
// If any element is true then it's true
|
||||
FI operator bool() { return x || y; }
|
||||
|
||||
// Explicit copy and copies with conversion
|
||||
FI XYval<T> copy() const { return *this; }
|
||||
FI XYval<T> ABS() const { return { T(_ABS(x)), T(_ABS(y)) }; }
|
||||
FI XYval<int16_t> asInt() { return { int16_t(x), int16_t(y) }; }
|
||||
@@ -217,17 +286,27 @@ struct XYval {
|
||||
FI XYval<float> asFloat() { return { static_cast<float>(x), static_cast<float>(y) }; }
|
||||
FI XYval<float> asFloat() const { return { static_cast<float>(x), static_cast<float>(y) }; }
|
||||
FI XYval<float> reciprocal() const { return { _RECIP(x), _RECIP(y) }; }
|
||||
|
||||
// Marlin workspace shifting is done with G92 and M206
|
||||
FI XYval<float> asLogical() const { XYval<float> o = asFloat(); toLogical(o); return o; }
|
||||
FI XYval<float> asNative() const { XYval<float> o = asFloat(); toNative(o); return o; }
|
||||
|
||||
// Cast to a type with more fields by making a new object
|
||||
FI operator XYZval<T>() { return { x, y }; }
|
||||
FI operator XYZval<T>() const { return { x, y }; }
|
||||
FI operator XYZEval<T>() { return { x, y }; }
|
||||
FI operator XYZEval<T>() const { return { x, y }; }
|
||||
FI T& operator[](const int i) { return pos[i]; }
|
||||
FI const T& operator[](const int i) const { return pos[i]; }
|
||||
|
||||
// Accessor via an AxisEnum (or any integer) [index]
|
||||
FI T& operator[](const int n) { return pos[n]; }
|
||||
FI const T& operator[](const int n) const { return pos[n]; }
|
||||
|
||||
// Assignment operator overrides do the expected thing
|
||||
FI XYval<T>& operator= (const T v) { set(v, v ); return *this; }
|
||||
FI XYval<T>& operator= (const XYZval<T> &rs) { set(rs.x, rs.y); return *this; }
|
||||
FI XYval<T>& operator= (const XYZEval<T> &rs) { set(rs.x, rs.y); return *this; }
|
||||
|
||||
// Override other operators to get intuitive behaviors
|
||||
FI XYval<T> operator+ (const XYval<T> &rs) const { XYval<T> ls = *this; ls.x += rs.x; ls.y += rs.y; return ls; }
|
||||
FI XYval<T> operator+ (const XYval<T> &rs) { XYval<T> ls = *this; ls.x += rs.x; ls.y += rs.y; return ls; }
|
||||
FI XYval<T> operator- (const XYval<T> &rs) const { XYval<T> ls = *this; ls.x -= rs.x; ls.y -= rs.y; return ls; }
|
||||
@@ -264,6 +343,10 @@ struct XYval {
|
||||
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 &v) const { 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 XYval<T> operator-() { XYval<T> o = *this; o.x = -x; o.y = -y; return o; }
|
||||
|
||||
// Modifier operators
|
||||
FI XYval<T>& operator+=(const XYval<T> &rs) { x += rs.x; y += rs.y; return *this; }
|
||||
FI XYval<T>& operator-=(const XYval<T> &rs) { x -= rs.x; y -= rs.y; return *this; }
|
||||
FI XYval<T>& operator*=(const XYval<T> &rs) { x *= rs.x; y *= rs.y; return *this; }
|
||||
@@ -277,6 +360,8 @@ struct XYval {
|
||||
FI XYval<T>& operator*=(const int &v) { x *= v; y *= v; return *this; }
|
||||
FI XYval<T>& operator>>=(const int &v) { _RS(x); _RS(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.
|
||||
FI bool operator==(const XYval<T> &rs) { return x == rs.x && y == rs.y; }
|
||||
FI bool operator==(const XYZval<T> &rs) { return x == rs.x && y == rs.y; }
|
||||
FI bool operator==(const XYZEval<T> &rs) { return x == rs.x && y == rs.y; }
|
||||
@@ -289,224 +374,291 @@ struct XYval {
|
||||
FI bool operator!=(const XYval<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 XYval<T> operator-() { 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; }
|
||||
};
|
||||
|
||||
//
|
||||
// XYZ coordinates, counters, etc.
|
||||
// Linear Axes coordinates, counters, flags, etc.
|
||||
//
|
||||
template<typename T>
|
||||
struct XYZval {
|
||||
union {
|
||||
struct { T x, y, z; };
|
||||
struct { T a, b, c; };
|
||||
T pos[3];
|
||||
struct { T LINEAR_AXIS_ARGS(); };
|
||||
struct { T LINEAR_AXIS_LIST(a, b, c, u, v, w); };
|
||||
T pos[LINEAR_AXES];
|
||||
};
|
||||
|
||||
// Set all to 0
|
||||
FI void reset() { LINEAR_AXIS_GANG(x =, y =, z =, i =, j =, k =) 0; }
|
||||
|
||||
// Setters taking struct types and arrays
|
||||
FI void set(const T px) { x = px; }
|
||||
FI void set(const T px, const T py) { x = px; y = py; }
|
||||
FI void set(const T px, const T py, const T pz) { x = px; y = py; z = pz; }
|
||||
FI void set(const XYval<T> pxy, const T pz) { x = pxy.x; y = pxy.y; z = pz; }
|
||||
FI void set(const XYval<T> pxy) { x = pxy.x; y = pxy.y; }
|
||||
FI void set(const XYval<T> pxy, const T pz) { LINEAR_AXIS_CODE(x = pxy.x, y = pxy.y, z = pz, NOOP, NOOP, NOOP); }
|
||||
FI void set(const T (&arr)[XY]) { x = arr[0]; y = arr[1]; }
|
||||
FI void set(const T (&arr)[XYZ]) { x = arr[0]; y = arr[1]; z = arr[2]; }
|
||||
FI void set(const T (&arr)[XYZE]) { x = arr[0]; y = arr[1]; z = arr[2]; }
|
||||
#if DISTINCT_AXES > XYZE
|
||||
FI void set(const T (&arr)[DISTINCT_AXES]) { x = arr[0]; y = arr[1]; z = arr[2]; }
|
||||
#if HAS_Z_AXIS
|
||||
FI void set(const T (&arr)[LINEAR_AXES]) { LINEAR_AXIS_CODE(x = arr[0], y = arr[1], z = arr[2], i = arr[3], j = arr[4], k = arr[5]); }
|
||||
FI void set(LINEAR_AXIS_ARGS(const T)) { LINEAR_AXIS_CODE(a = x, b = y, c = z, u = i, v = j, w = k ); }
|
||||
#endif
|
||||
FI void reset() { x = y = z = 0; }
|
||||
FI T magnitude() const { return (T)sqrtf(x*x + y*y + z*z); }
|
||||
#if LOGICAL_AXES > LINEAR_AXES
|
||||
FI void set(const T (&arr)[LOGICAL_AXES]) { LINEAR_AXIS_CODE(x = arr[0], y = arr[1], z = arr[2], i = arr[3], j = arr[4], k = arr[5]); }
|
||||
FI void set(LOGICAL_AXIS_ARGS(const T)) { LINEAR_AXIS_CODE(a = x, b = y, c = z, u = i, v = j, w = k ); }
|
||||
#if DISTINCT_AXES > LOGICAL_AXES
|
||||
FI void set(const T (&arr)[DISTINCT_AXES]) { LINEAR_AXIS_CODE(x = arr[0], y = arr[1], z = arr[2], i = arr[3], j = arr[4], k = arr[5]); }
|
||||
#endif
|
||||
#endif
|
||||
#if LINEAR_AXES >= 4
|
||||
FI void set(const T px, const T py, const T pz) { x = px; y = py; z = pz; }
|
||||
#endif
|
||||
#if LINEAR_AXES >= 5
|
||||
FI void set(const T px, const T py, const T pz, const T pi) { x = px; y = py; z = pz; i = pi; }
|
||||
#endif
|
||||
#if LINEAR_AXES >= 6
|
||||
FI void set(const T px, const T py, const T pz, const T pi, const T pj) { x = px; y = py; z = pz; i = pi; j = pj; }
|
||||
#endif
|
||||
|
||||
// Length reduced to one dimension
|
||||
FI T magnitude() const { return (T)sqrtf(LINEAR_AXIS_GANG(x*x, + y*y, + z*z, + i*i, + j*j, + k*k)); }
|
||||
// Pointer to the data as a simple array
|
||||
FI operator T* () { return pos; }
|
||||
FI operator bool() { return z || x || y; }
|
||||
// If any element is true then it's true
|
||||
FI operator bool() { return LINEAR_AXIS_GANG(x, || y, || z, || i, || j, || k); }
|
||||
|
||||
// Explicit copy and copies with conversion
|
||||
FI XYZval<T> copy() const { XYZval<T> o = *this; return o; }
|
||||
FI XYZval<T> ABS() const { return { T(_ABS(x)), T(_ABS(y)), T(_ABS(z)) }; }
|
||||
FI XYZval<int16_t> asInt() { return { int16_t(x), int16_t(y), int16_t(z) }; }
|
||||
FI XYZval<int16_t> asInt() const { return { int16_t(x), int16_t(y), int16_t(z) }; }
|
||||
FI XYZval<int32_t> asLong() { return { int32_t(x), int32_t(y), int32_t(z) }; }
|
||||
FI XYZval<int32_t> asLong() const { return { int32_t(x), int32_t(y), int32_t(z) }; }
|
||||
FI XYZval<int32_t> ROUNDL() { return { int32_t(LROUND(x)), int32_t(LROUND(y)), int32_t(LROUND(z)) }; }
|
||||
FI XYZval<int32_t> ROUNDL() const { return { int32_t(LROUND(x)), int32_t(LROUND(y)), int32_t(LROUND(z)) }; }
|
||||
FI XYZval<float> asFloat() { return { static_cast<float>(x), static_cast<float>(y), static_cast<float>(z) }; }
|
||||
FI XYZval<float> asFloat() const { return { static_cast<float>(x), static_cast<float>(y), static_cast<float>(z) }; }
|
||||
FI XYZval<float> reciprocal() const { return { _RECIP(x), _RECIP(y), _RECIP(z) }; }
|
||||
FI XYZval<T> ABS() const { return LINEAR_AXIS_ARRAY(T(_ABS(x)), T(_ABS(y)), T(_ABS(z)), T(_ABS(i)), T(_ABS(j)), T(_ABS(k))); }
|
||||
FI XYZval<int16_t> asInt() { return LINEAR_AXIS_ARRAY(int16_t(x), int16_t(y), int16_t(z), int16_t(i), int16_t(j), int16_t(k)); }
|
||||
FI XYZval<int16_t> asInt() const { return LINEAR_AXIS_ARRAY(int16_t(x), int16_t(y), int16_t(z), int16_t(i), int16_t(j), int16_t(k)); }
|
||||
FI XYZval<int32_t> asLong() { return LINEAR_AXIS_ARRAY(int32_t(x), int32_t(y), int32_t(z), int32_t(i), int32_t(j), int32_t(k)); }
|
||||
FI XYZval<int32_t> asLong() const { return LINEAR_AXIS_ARRAY(int32_t(x), int32_t(y), int32_t(z), int32_t(i), int32_t(j), int32_t(k)); }
|
||||
FI XYZval<int32_t> ROUNDL() { return LINEAR_AXIS_ARRAY(int32_t(LROUND(x)), int32_t(LROUND(y)), int32_t(LROUND(z)), int32_t(LROUND(i)), int32_t(LROUND(j)), int32_t(LROUND(k))); }
|
||||
FI XYZval<int32_t> ROUNDL() const { return LINEAR_AXIS_ARRAY(int32_t(LROUND(x)), int32_t(LROUND(y)), int32_t(LROUND(z)), int32_t(LROUND(i)), int32_t(LROUND(j)), int32_t(LROUND(k))); }
|
||||
FI XYZval<float> asFloat() { return LINEAR_AXIS_ARRAY(static_cast<float>(x), static_cast<float>(y), static_cast<float>(z), static_cast<float>(i), static_cast<float>(j), static_cast<float>(k)); }
|
||||
FI XYZval<float> asFloat() const { return LINEAR_AXIS_ARRAY(static_cast<float>(x), static_cast<float>(y), static_cast<float>(z), static_cast<float>(i), static_cast<float>(j), static_cast<float>(k)); }
|
||||
FI XYZval<float> reciprocal() const { return LINEAR_AXIS_ARRAY(_RECIP(x), _RECIP(y), _RECIP(z), _RECIP(i), _RECIP(j), _RECIP(k)); }
|
||||
|
||||
// Marlin workspace shifting is done with G92 and M206
|
||||
FI XYZval<float> asLogical() const { XYZval<float> o = asFloat(); toLogical(o); return o; }
|
||||
FI XYZval<float> asNative() const { XYZval<float> o = asFloat(); toNative(o); return o; }
|
||||
|
||||
// In-place cast to types having fewer fields
|
||||
FI operator XYval<T>&() { return *(XYval<T>*)this; }
|
||||
FI operator const XYval<T>&() const { return *(const XYval<T>*)this; }
|
||||
FI operator XYZEval<T>() const { return { x, y, z }; }
|
||||
FI T& operator[](const int i) { return pos[i]; }
|
||||
FI const T& operator[](const int i) const { return pos[i]; }
|
||||
FI XYZval<T>& operator= (const T v) { set(v, v, v ); return *this; }
|
||||
|
||||
// Cast to a type with more fields by making a new object
|
||||
FI operator XYZEval<T>() const { return LINEAR_AXIS_ARRAY(x, y, z, i, j, k); }
|
||||
|
||||
// Accessor via an AxisEnum (or any integer) [index]
|
||||
FI T& operator[](const int n) { return pos[n]; }
|
||||
FI const T& operator[](const int n) const { return pos[n]; }
|
||||
|
||||
// Assignment operator overrides do the expected thing
|
||||
FI XYZval<T>& operator= (const T v) { set(ARRAY_N_1(LINEAR_AXES, v)); return *this; }
|
||||
FI XYZval<T>& operator= (const XYval<T> &rs) { set(rs.x, rs.y ); return *this; }
|
||||
FI XYZval<T>& operator= (const XYZEval<T> &rs) { set(rs.x, rs.y, rs.z); return *this; }
|
||||
FI XYZval<T> operator+ (const XYval<T> &rs) const { XYZval<T> ls = *this; ls.x += rs.x; ls.y += rs.y; return ls; }
|
||||
FI XYZval<T> operator+ (const XYval<T> &rs) { XYZval<T> ls = *this; ls.x += rs.x; ls.y += rs.y; return ls; }
|
||||
FI XYZval<T> operator- (const XYval<T> &rs) const { XYZval<T> ls = *this; ls.x -= rs.x; ls.y -= rs.y; return ls; }
|
||||
FI XYZval<T> operator- (const XYval<T> &rs) { XYZval<T> ls = *this; ls.x -= rs.x; ls.y -= rs.y; return ls; }
|
||||
FI XYZval<T> operator* (const XYval<T> &rs) const { XYZval<T> ls = *this; ls.x *= rs.x; ls.y *= rs.y; return ls; }
|
||||
FI XYZval<T> operator* (const XYval<T> &rs) { XYZval<T> ls = *this; ls.x *= rs.x; ls.y *= rs.y; return ls; }
|
||||
FI XYZval<T> operator/ (const XYval<T> &rs) const { XYZval<T> ls = *this; ls.x /= rs.x; ls.y /= rs.y; return ls; }
|
||||
FI XYZval<T> operator/ (const XYval<T> &rs) { XYZval<T> ls = *this; ls.x /= rs.x; ls.y /= rs.y; return ls; }
|
||||
FI XYZval<T> operator+ (const XYZval<T> &rs) const { XYZval<T> ls = *this; ls.x += rs.x; ls.y += rs.y; ls.z += rs.z; return ls; }
|
||||
FI XYZval<T> operator+ (const XYZval<T> &rs) { XYZval<T> ls = *this; ls.x += rs.x; ls.y += rs.y; ls.z += rs.z; return ls; }
|
||||
FI XYZval<T> operator- (const XYZval<T> &rs) const { XYZval<T> ls = *this; ls.x -= rs.x; ls.y -= rs.y; ls.z -= rs.z; return ls; }
|
||||
FI XYZval<T> operator- (const XYZval<T> &rs) { XYZval<T> ls = *this; ls.x -= rs.x; ls.y -= rs.y; ls.z -= rs.z; return ls; }
|
||||
FI XYZval<T> operator* (const XYZval<T> &rs) const { XYZval<T> ls = *this; ls.x *= rs.x; ls.y *= rs.y; ls.z *= rs.z; return ls; }
|
||||
FI XYZval<T> operator* (const XYZval<T> &rs) { XYZval<T> ls = *this; ls.x *= rs.x; ls.y *= rs.y; ls.z *= rs.z; return ls; }
|
||||
FI XYZval<T> operator/ (const XYZval<T> &rs) const { XYZval<T> ls = *this; ls.x /= rs.x; ls.y /= rs.y; ls.z /= rs.z; return ls; }
|
||||
FI XYZval<T> operator/ (const XYZval<T> &rs) { XYZval<T> ls = *this; ls.x /= rs.x; ls.y /= rs.y; ls.z /= rs.z; return ls; }
|
||||
FI XYZval<T> operator+ (const XYZEval<T> &rs) const { XYZval<T> ls = *this; ls.x += rs.x; ls.y += rs.y; ls.z += rs.z; return ls; }
|
||||
FI XYZval<T> operator+ (const XYZEval<T> &rs) { XYZval<T> ls = *this; ls.x += rs.x; ls.y += rs.y; ls.z += rs.z; return ls; }
|
||||
FI XYZval<T> operator- (const XYZEval<T> &rs) const { XYZval<T> ls = *this; ls.x -= rs.x; ls.y -= rs.y; ls.z -= rs.z; return ls; }
|
||||
FI XYZval<T> operator- (const XYZEval<T> &rs) { XYZval<T> ls = *this; ls.x -= rs.x; ls.y -= rs.y; ls.z -= rs.z; return ls; }
|
||||
FI XYZval<T> operator* (const XYZEval<T> &rs) const { XYZval<T> ls = *this; ls.x *= rs.x; ls.y *= rs.y; ls.z *= rs.z; return ls; }
|
||||
FI XYZval<T> operator* (const XYZEval<T> &rs) { XYZval<T> ls = *this; ls.x *= rs.x; ls.y *= rs.y; ls.z *= rs.z; return ls; }
|
||||
FI XYZval<T> operator/ (const XYZEval<T> &rs) const { XYZval<T> ls = *this; ls.x /= rs.x; ls.y /= rs.y; ls.z /= rs.z; return ls; }
|
||||
FI XYZval<T> operator/ (const XYZEval<T> &rs) { XYZval<T> ls = *this; ls.x /= rs.x; ls.y /= rs.y; ls.z /= rs.z; return ls; }
|
||||
FI XYZval<T> operator* (const float &v) const { XYZval<T> ls = *this; ls.x *= v; ls.y *= v; ls.z *= v; return ls; }
|
||||
FI XYZval<T> operator* (const float &v) { XYZval<T> ls = *this; ls.x *= v; ls.y *= v; ls.z *= v; return ls; }
|
||||
FI XYZval<T> operator* (const int &v) const { XYZval<T> ls = *this; ls.x *= v; ls.y *= v; ls.z *= v; return ls; }
|
||||
FI XYZval<T> operator* (const int &v) { XYZval<T> ls = *this; ls.x *= v; ls.y *= v; ls.z *= v; return ls; }
|
||||
FI XYZval<T> operator/ (const float &v) const { XYZval<T> ls = *this; ls.x /= v; ls.y /= v; ls.z /= v; return ls; }
|
||||
FI XYZval<T> operator/ (const float &v) { XYZval<T> ls = *this; ls.x /= v; ls.y /= v; ls.z /= v; return ls; }
|
||||
FI XYZval<T> operator/ (const int &v) const { XYZval<T> ls = *this; ls.x /= v; ls.y /= v; ls.z /= v; return ls; }
|
||||
FI XYZval<T> operator/ (const int &v) { XYZval<T> ls = *this; ls.x /= v; ls.y /= v; ls.z /= v; return ls; }
|
||||
FI XYZval<T> operator>>(const int &v) const { XYZval<T> ls = *this; _RS(ls.x); _RS(ls.y); _RS(ls.z); return ls; }
|
||||
FI XYZval<T> operator>>(const int &v) { XYZval<T> ls = *this; _RS(ls.x); _RS(ls.y); _RS(ls.z); return ls; }
|
||||
FI XYZval<T> operator<<(const int &v) const { XYZval<T> ls = *this; _LS(ls.x); _LS(ls.y); _LS(ls.z); return ls; }
|
||||
FI XYZval<T> operator<<(const int &v) { XYZval<T> ls = *this; _LS(ls.x); _LS(ls.y); _LS(ls.z); return ls; }
|
||||
FI XYZval<T>& operator+=(const XYval<T> &rs) { x += rs.x; y += rs.y; return *this; }
|
||||
FI XYZval<T>& operator-=(const XYval<T> &rs) { x -= rs.x; y -= rs.y; return *this; }
|
||||
FI XYZval<T>& operator*=(const XYval<T> &rs) { x *= rs.x; y *= rs.y; return *this; }
|
||||
FI XYZval<T>& operator/=(const XYval<T> &rs) { x /= rs.x; y /= rs.y; return *this; }
|
||||
FI XYZval<T>& operator+=(const XYZval<T> &rs) { x += rs.x; y += rs.y; z += rs.z; return *this; }
|
||||
FI XYZval<T>& operator-=(const XYZval<T> &rs) { x -= rs.x; y -= rs.y; z -= rs.z; return *this; }
|
||||
FI XYZval<T>& operator*=(const XYZval<T> &rs) { x *= rs.x; y *= rs.y; z *= rs.z; return *this; }
|
||||
FI XYZval<T>& operator/=(const XYZval<T> &rs) { x /= rs.x; y /= rs.y; z /= rs.z; return *this; }
|
||||
FI XYZval<T>& operator+=(const XYZEval<T> &rs) { x += rs.x; y += rs.y; z += rs.z; return *this; }
|
||||
FI XYZval<T>& operator-=(const XYZEval<T> &rs) { x -= rs.x; y -= rs.y; z -= rs.z; return *this; }
|
||||
FI XYZval<T>& operator*=(const XYZEval<T> &rs) { x *= rs.x; y *= rs.y; z *= rs.z; return *this; }
|
||||
FI XYZval<T>& operator/=(const XYZEval<T> &rs) { x /= rs.x; y /= rs.y; z /= rs.z; return *this; }
|
||||
FI XYZval<T>& operator*=(const float &v) { x *= v; y *= v; z *= v; return *this; }
|
||||
FI XYZval<T>& operator*=(const int &v) { x *= v; y *= v; z *= v; return *this; }
|
||||
FI XYZval<T>& operator>>=(const int &v) { _RS(x); _RS(y); _RS(z); return *this; }
|
||||
FI XYZval<T>& operator<<=(const int &v) { _LS(x); _LS(y); _LS(z); return *this; }
|
||||
FI bool operator==(const XYZEval<T> &rs) { return x == rs.x && y == rs.y && z == rs.z; }
|
||||
FI XYZval<T>& operator= (const XYZEval<T> &rs) { set(LINEAR_AXIS_ELEM(rs)); return *this; }
|
||||
|
||||
// Override other operators to get intuitive behaviors
|
||||
FI XYZval<T> operator+ (const XYval<T> &rs) const { XYZval<T> ls = *this; LINEAR_AXIS_CODE(ls.x += rs.x, ls.y += rs.y, NOOP , NOOP , NOOP , NOOP ); return ls; }
|
||||
FI XYZval<T> operator+ (const XYval<T> &rs) { XYZval<T> ls = *this; LINEAR_AXIS_CODE(ls.x += rs.x, ls.y += rs.y, NOOP , NOOP , NOOP , NOOP ); return ls; }
|
||||
FI XYZval<T> operator- (const XYval<T> &rs) const { XYZval<T> ls = *this; LINEAR_AXIS_CODE(ls.x -= rs.x, ls.y -= rs.y, NOOP , NOOP , NOOP , NOOP ); return ls; }
|
||||
FI XYZval<T> operator- (const XYval<T> &rs) { XYZval<T> ls = *this; LINEAR_AXIS_CODE(ls.x -= rs.x, ls.y -= rs.y, NOOP , NOOP , NOOP , NOOP ); return ls; }
|
||||
FI XYZval<T> operator* (const XYval<T> &rs) const { XYZval<T> ls = *this; LINEAR_AXIS_CODE(ls.x *= rs.x, ls.y *= rs.y, NOOP , NOOP , NOOP , NOOP ); return ls; }
|
||||
FI XYZval<T> operator* (const XYval<T> &rs) { XYZval<T> ls = *this; LINEAR_AXIS_CODE(ls.x *= rs.x, ls.y *= rs.y, NOOP , NOOP , NOOP , NOOP ); return ls; }
|
||||
FI XYZval<T> operator/ (const XYval<T> &rs) const { XYZval<T> ls = *this; LINEAR_AXIS_CODE(ls.x /= rs.x, ls.y /= rs.y, NOOP , NOOP , NOOP , NOOP ); return ls; }
|
||||
FI XYZval<T> operator/ (const XYval<T> &rs) { XYZval<T> ls = *this; LINEAR_AXIS_CODE(ls.x /= rs.x, ls.y /= rs.y, NOOP , NOOP , NOOP , NOOP ); return ls; }
|
||||
FI XYZval<T> operator+ (const XYZval<T> &rs) const { XYZval<T> ls = *this; LINEAR_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); return ls; }
|
||||
FI XYZval<T> operator+ (const XYZval<T> &rs) { XYZval<T> ls = *this; LINEAR_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); return ls; }
|
||||
FI XYZval<T> operator- (const XYZval<T> &rs) const { XYZval<T> ls = *this; LINEAR_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); return ls; }
|
||||
FI XYZval<T> operator- (const XYZval<T> &rs) { XYZval<T> ls = *this; LINEAR_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); return ls; }
|
||||
FI XYZval<T> operator* (const XYZval<T> &rs) const { XYZval<T> ls = *this; LINEAR_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); return ls; }
|
||||
FI XYZval<T> operator* (const XYZval<T> &rs) { XYZval<T> ls = *this; LINEAR_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); return ls; }
|
||||
FI XYZval<T> operator/ (const XYZval<T> &rs) const { XYZval<T> ls = *this; LINEAR_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); return ls; }
|
||||
FI XYZval<T> operator/ (const XYZval<T> &rs) { XYZval<T> ls = *this; LINEAR_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); return ls; }
|
||||
FI XYZval<T> operator+ (const XYZEval<T> &rs) const { XYZval<T> ls = *this; LINEAR_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); return ls; }
|
||||
FI XYZval<T> operator+ (const XYZEval<T> &rs) { XYZval<T> ls = *this; LINEAR_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); return ls; }
|
||||
FI XYZval<T> operator- (const XYZEval<T> &rs) const { XYZval<T> ls = *this; LINEAR_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); return ls; }
|
||||
FI XYZval<T> operator- (const XYZEval<T> &rs) { XYZval<T> ls = *this; LINEAR_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); return ls; }
|
||||
FI XYZval<T> operator* (const XYZEval<T> &rs) const { XYZval<T> ls = *this; LINEAR_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); return ls; }
|
||||
FI XYZval<T> operator* (const XYZEval<T> &rs) { XYZval<T> ls = *this; LINEAR_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); return ls; }
|
||||
FI XYZval<T> operator/ (const XYZEval<T> &rs) const { XYZval<T> ls = *this; LINEAR_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); return ls; }
|
||||
FI XYZval<T> operator/ (const XYZEval<T> &rs) { XYZval<T> ls = *this; LINEAR_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); return ls; }
|
||||
FI XYZval<T> operator* (const float &v) const { XYZval<T> ls = *this; LINEAR_AXIS_CODE(ls.x *= v, ls.y *= v, ls.z *= v, ls.i *= v, ls.j *= v, ls.k *= v ); return ls; }
|
||||
FI XYZval<T> operator* (const float &v) { XYZval<T> ls = *this; LINEAR_AXIS_CODE(ls.x *= v, ls.y *= v, ls.z *= v, ls.i *= v, ls.j *= v, ls.k *= v ); return ls; }
|
||||
FI XYZval<T> operator* (const int &v) const { XYZval<T> ls = *this; LINEAR_AXIS_CODE(ls.x *= v, ls.y *= v, ls.z *= v, ls.i *= v, ls.j *= v, ls.k *= v ); return ls; }
|
||||
FI XYZval<T> operator* (const int &v) { XYZval<T> ls = *this; LINEAR_AXIS_CODE(ls.x *= v, ls.y *= v, ls.z *= v, ls.i *= v, ls.j *= v, ls.k *= v ); return ls; }
|
||||
FI XYZval<T> operator/ (const float &v) const { XYZval<T> ls = *this; LINEAR_AXIS_CODE(ls.x /= v, ls.y /= v, ls.z /= v, ls.i /= v, ls.j /= v, ls.k /= v ); return ls; }
|
||||
FI XYZval<T> operator/ (const float &v) { XYZval<T> ls = *this; LINEAR_AXIS_CODE(ls.x /= v, ls.y /= v, ls.z /= v, ls.i /= v, ls.j /= v, ls.k /= v ); return ls; }
|
||||
FI XYZval<T> operator/ (const int &v) const { XYZval<T> ls = *this; LINEAR_AXIS_CODE(ls.x /= v, ls.y /= v, ls.z /= v, ls.i /= v, ls.j /= v, ls.k /= v ); return ls; }
|
||||
FI XYZval<T> operator/ (const int &v) { XYZval<T> ls = *this; LINEAR_AXIS_CODE(ls.x /= v, ls.y /= v, ls.z /= v, ls.i /= v, ls.j /= v, ls.k /= v ); return ls; }
|
||||
FI XYZval<T> operator>>(const int &v) const { XYZval<T> ls = *this; LINEAR_AXIS_CODE(_RS(ls.x), _RS(ls.y), _RS(ls.z), _RS(ls.i), _RS(ls.j), _RS(ls.k) ); return ls; }
|
||||
FI XYZval<T> operator>>(const int &v) { XYZval<T> ls = *this; LINEAR_AXIS_CODE(_RS(ls.x), _RS(ls.y), _RS(ls.z), _RS(ls.i), _RS(ls.j), _RS(ls.k) ); return ls; }
|
||||
FI XYZval<T> operator<<(const int &v) const { XYZval<T> ls = *this; LINEAR_AXIS_CODE(_LS(ls.x), _LS(ls.y), _LS(ls.z), _LS(ls.i), _LS(ls.j), _LS(ls.k) ); return ls; }
|
||||
FI XYZval<T> operator<<(const int &v) { XYZval<T> ls = *this; LINEAR_AXIS_CODE(_LS(ls.x), _LS(ls.y), _LS(ls.z), _LS(ls.i), _LS(ls.j), _LS(ls.k) ); return ls; }
|
||||
FI const XYZval<T> operator-() const { XYZval<T> o = *this; LINEAR_AXIS_CODE(o.x = -x, o.y = -y, o.z = -z, o.i = -i, o.j = -j, o.k = -k); return o; }
|
||||
FI XYZval<T> operator-() { XYZval<T> o = *this; LINEAR_AXIS_CODE(o.x = -x, o.y = -y, o.z = -z, o.i = -i, o.j = -j, o.k = -k); return o; }
|
||||
|
||||
// Modifier operators
|
||||
FI XYZval<T>& operator+=(const XYval<T> &rs) { LINEAR_AXIS_CODE(x += rs.x, y += rs.y, NOOP, NOOP, NOOP, NOOP ); return *this; }
|
||||
FI XYZval<T>& operator-=(const XYval<T> &rs) { LINEAR_AXIS_CODE(x -= rs.x, y -= rs.y, NOOP, NOOP, NOOP, NOOP ); return *this; }
|
||||
FI XYZval<T>& operator*=(const XYval<T> &rs) { LINEAR_AXIS_CODE(x *= rs.x, y *= rs.y, NOOP, NOOP, NOOP, NOOP ); return *this; }
|
||||
FI XYZval<T>& operator/=(const XYval<T> &rs) { LINEAR_AXIS_CODE(x /= rs.x, y /= rs.y, NOOP, NOOP, NOOP, NOOP ); return *this; }
|
||||
FI XYZval<T>& operator+=(const XYZval<T> &rs) { LINEAR_AXIS_CODE(x += rs.x, y += rs.y, z += rs.z, i += rs.i, j += rs.j, k += rs.k); return *this; }
|
||||
FI XYZval<T>& operator-=(const XYZval<T> &rs) { LINEAR_AXIS_CODE(x -= rs.x, y -= rs.y, z -= rs.z, i -= rs.i, j -= rs.j, k -= rs.k); return *this; }
|
||||
FI XYZval<T>& operator*=(const XYZval<T> &rs) { LINEAR_AXIS_CODE(x *= rs.x, y *= rs.y, z *= rs.z, i *= rs.i, j *= rs.j, k *= rs.k); return *this; }
|
||||
FI XYZval<T>& operator/=(const XYZval<T> &rs) { LINEAR_AXIS_CODE(x /= rs.x, y /= rs.y, z /= rs.z, i /= rs.i, j /= rs.j, k /= rs.k); return *this; }
|
||||
FI XYZval<T>& operator+=(const XYZEval<T> &rs) { LINEAR_AXIS_CODE(x += rs.x, y += rs.y, z += rs.z, i += rs.i, j += rs.j, k += rs.k); return *this; }
|
||||
FI XYZval<T>& operator-=(const XYZEval<T> &rs) { LINEAR_AXIS_CODE(x -= rs.x, y -= rs.y, z -= rs.z, i -= rs.i, j -= rs.j, k -= rs.k); return *this; }
|
||||
FI XYZval<T>& operator*=(const XYZEval<T> &rs) { LINEAR_AXIS_CODE(x *= rs.x, y *= rs.y, z *= rs.z, i *= rs.i, j *= rs.j, k *= rs.k); return *this; }
|
||||
FI XYZval<T>& operator/=(const XYZEval<T> &rs) { LINEAR_AXIS_CODE(x /= rs.x, y /= rs.y, z /= rs.z, i /= rs.i, j /= rs.j, k /= rs.k); return *this; }
|
||||
FI XYZval<T>& operator*=(const float &v) { LINEAR_AXIS_CODE(x *= v, y *= v, z *= v, i *= v, j *= v, k *= v); return *this; }
|
||||
FI XYZval<T>& operator*=(const int &v) { LINEAR_AXIS_CODE(x *= v, y *= v, z *= v, i *= v, j *= v, k *= v); return *this; }
|
||||
FI XYZval<T>& operator>>=(const int &v) { LINEAR_AXIS_CODE(_RS(x), _RS(y), _RS(z), _RS(i), _RS(j), _RS(k)); return *this; }
|
||||
FI XYZval<T>& operator<<=(const int &v) { LINEAR_AXIS_CODE(_LS(x), _LS(y), _LS(z), _LS(i), _LS(j), _LS(k)); return *this; }
|
||||
|
||||
// Exact comparisons. For floats a "NEAR" operation may be better.
|
||||
FI bool operator==(const XYZEval<T> &rs) { return true LINEAR_AXIS_GANG(&& x == rs.x, && y == rs.y, && z == rs.z, && i == rs.i, && j == rs.j, && k == rs.k); }
|
||||
FI bool operator==(const XYZEval<T> &rs) const { return true LINEAR_AXIS_GANG(&& x == rs.x, && y == rs.y, && z == rs.z, && i == rs.i, && j == rs.j, && k == rs.k); }
|
||||
FI bool operator!=(const XYZEval<T> &rs) { return !operator==(rs); }
|
||||
FI bool operator==(const XYZEval<T> &rs) const { return x == rs.x && y == rs.y && z == rs.z; }
|
||||
FI bool operator!=(const XYZEval<T> &rs) const { return !operator==(rs); }
|
||||
FI XYZval<T> operator-() { XYZval<T> o = *this; o.x = -x; o.y = -y; o.z = -z; return o; }
|
||||
FI const XYZval<T> operator-() const { XYZval<T> o = *this; o.x = -x; o.y = -y; o.z = -z; return o; }
|
||||
};
|
||||
|
||||
//
|
||||
// XYZE coordinates, counters, etc.
|
||||
// Logical Axes coordinates, counters, etc.
|
||||
//
|
||||
template<typename T>
|
||||
struct XYZEval {
|
||||
union {
|
||||
struct{ T x, y, z, e; };
|
||||
struct{ T a, b, c; };
|
||||
T pos[4];
|
||||
struct { T LOGICAL_AXIS_ARGS(); };
|
||||
struct { T LOGICAL_AXIS_LIST(_e, a, b, c, u, v, w); };
|
||||
T pos[LOGICAL_AXES];
|
||||
};
|
||||
FI void reset() { x = y = z = e = 0; }
|
||||
FI T magnitude() const { return (T)sqrtf(x*x + y*y + z*z + e*e); }
|
||||
FI operator T* () { return pos; }
|
||||
FI operator bool() { return e || z || x || y; }
|
||||
FI void set(const T px) { x = px; }
|
||||
FI void set(const T px, const T py) { x = px; y = py; }
|
||||
FI void set(const T px, const T py, const T pz) { x = px; y = py; z = pz; }
|
||||
FI void set(const T px, const T py, const T pz, const T pe) { x = px; y = py; z = pz; e = pe; }
|
||||
FI void set(const XYval<T> pxy) { x = pxy.x; y = pxy.y; }
|
||||
FI void set(const XYval<T> pxy, const T pz) { x = pxy.x; y = pxy.y; z = pz; }
|
||||
FI void set(const XYZval<T> pxyz) { x = pxyz.x; y = pxyz.y; z = pxyz.z; }
|
||||
FI void set(const XYval<T> pxy, const T pz, const T pe) { x = pxy.x; y = pxy.y; z = pz; e = pe; }
|
||||
FI void set(const XYval<T> pxy, const XYval<T> pze) { x = pxy.x; y = pxy.y; z = pze.z; e = pze.e; }
|
||||
FI void set(const XYZval<T> pxyz, const T pe) { x = pxyz.x; y = pxyz.y; z = pxyz.z; e = pe; }
|
||||
FI void set(const T (&arr)[XY]) { x = arr[0]; y = arr[1]; }
|
||||
FI void set(const T (&arr)[XYZ]) { x = arr[0]; y = arr[1]; z = arr[2]; }
|
||||
FI void set(const T (&arr)[XYZE]) { x = arr[0]; y = arr[1]; z = arr[2]; e = arr[3]; }
|
||||
#if DISTINCT_AXES > XYZE
|
||||
FI void set(const T (&arr)[DISTINCT_AXES]) { x = arr[0]; y = arr[1]; z = arr[2]; e = arr[3]; }
|
||||
// Reset all to 0
|
||||
FI void reset() { LOGICAL_AXIS_GANG(e =, x =, y =, z =, i =, j =, k =) 0; }
|
||||
|
||||
// Setters taking struct types and arrays
|
||||
FI void set(const T px) { x = px; }
|
||||
FI void set(const T px, const T py) { x = px; y = py; }
|
||||
FI void set(const XYval<T> pxy) { x = pxy.x; y = pxy.y; }
|
||||
FI void set(const XYZval<T> pxyz) { set(LINEAR_AXIS_ELEM(pxyz)); }
|
||||
#if HAS_Z_AXIS
|
||||
FI void set(LINEAR_AXIS_ARGS(const T)) { LINEAR_AXIS_CODE(a = x, b = y, c = z, u = i, v = j, w = k); }
|
||||
#endif
|
||||
FI XYZEval<T> copy() const { return *this; }
|
||||
FI XYZEval<T> ABS() const { return { T(_ABS(x)), T(_ABS(y)), T(_ABS(z)), T(_ABS(e)) }; }
|
||||
FI XYZEval<int16_t> asInt() { return { int16_t(x), int16_t(y), int16_t(z), int16_t(e) }; }
|
||||
FI XYZEval<int16_t> asInt() const { return { int16_t(x), int16_t(y), int16_t(z), int16_t(e) }; }
|
||||
FI XYZEval<int32_t> asLong() { return { int32_t(x), int32_t(y), int32_t(z), int32_t(e) }; }
|
||||
FI XYZEval<int32_t> asLong() const { return { int32_t(x), int32_t(y), int32_t(z), int32_t(e) }; }
|
||||
FI XYZEval<int32_t> ROUNDL() { return { int32_t(LROUND(x)), int32_t(LROUND(y)), int32_t(LROUND(z)), int32_t(LROUND(e)) }; }
|
||||
FI XYZEval<int32_t> ROUNDL() const { return { int32_t(LROUND(x)), int32_t(LROUND(y)), int32_t(LROUND(z)), int32_t(LROUND(e)) }; }
|
||||
FI XYZEval<float> asFloat() { return { static_cast<float>(x), static_cast<float>(y), static_cast<float>(z), static_cast<float>(e) }; }
|
||||
FI XYZEval<float> asFloat() const { return { static_cast<float>(x), static_cast<float>(y), static_cast<float>(z), static_cast<float>(e) }; }
|
||||
FI XYZEval<float> reciprocal() const { return { _RECIP(x), _RECIP(y), _RECIP(z), _RECIP(e) }; }
|
||||
FI XYZEval<float> asLogical() const { XYZEval<float> o = asFloat(); toLogical(o); return o; }
|
||||
FI XYZEval<float> asNative() const { XYZEval<float> o = asFloat(); toNative(o); return o; }
|
||||
FI operator XYval<T>&() { return *(XYval<T>*)this; }
|
||||
FI operator const XYval<T>&() const { return *(const XYval<T>*)this; }
|
||||
FI operator XYZval<T>&() { return *(XYZval<T>*)this; }
|
||||
FI operator const XYZval<T>&() const { return *(const XYZval<T>*)this; }
|
||||
FI T& operator[](const int i) { return pos[i]; }
|
||||
FI const T& operator[](const int i) const { return pos[i]; }
|
||||
FI XYZEval<T>& operator= (const T v) { set(v, v, v, v); 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(rs.x, rs.y, rs.z); return *this; }
|
||||
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) 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) 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) 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 XYZval<T> &rs) const { XYZEval<T> ls = *this; ls.x += rs.x; ls.y += rs.y; ls.z += rs.z; return ls; }
|
||||
FI XYZEval<T> operator+ (const XYZval<T> &rs) { XYZEval<T> ls = *this; ls.x += rs.x; ls.y += rs.y; ls.z += rs.z; return ls; }
|
||||
FI XYZEval<T> operator- (const XYZval<T> &rs) const { XYZEval<T> ls = *this; ls.x -= rs.x; ls.y -= rs.y; ls.z -= rs.z; return ls; }
|
||||
FI XYZEval<T> operator- (const XYZval<T> &rs) { XYZEval<T> ls = *this; ls.x -= rs.x; ls.y -= rs.y; ls.z -= rs.z; return ls; }
|
||||
FI XYZEval<T> operator* (const XYZval<T> &rs) const { XYZEval<T> ls = *this; ls.x *= rs.x; ls.y *= rs.y; ls.z *= rs.z; return ls; }
|
||||
FI XYZEval<T> operator* (const XYZval<T> &rs) { XYZEval<T> ls = *this; ls.x *= rs.x; ls.y *= rs.y; ls.z *= rs.z; return ls; }
|
||||
FI XYZEval<T> operator/ (const XYZval<T> &rs) const { XYZEval<T> ls = *this; ls.x /= rs.x; ls.y /= rs.y; ls.z /= rs.z; return ls; }
|
||||
FI XYZEval<T> operator/ (const XYZval<T> &rs) { XYZEval<T> ls = *this; ls.x /= rs.x; ls.y /= rs.y; ls.z /= rs.z; return ls; }
|
||||
FI XYZEval<T> operator+ (const XYZEval<T> &rs) const { XYZEval<T> ls = *this; ls.x += rs.x; ls.y += rs.y; ls.z += rs.z; ls.e += rs.e; return ls; }
|
||||
FI XYZEval<T> operator+ (const XYZEval<T> &rs) { XYZEval<T> ls = *this; ls.x += rs.x; ls.y += rs.y; ls.z += rs.z; ls.e += rs.e; return ls; }
|
||||
FI XYZEval<T> operator- (const XYZEval<T> &rs) const { XYZEval<T> ls = *this; ls.x -= rs.x; ls.y -= rs.y; ls.z -= rs.z; ls.e -= rs.e; return ls; }
|
||||
FI XYZEval<T> operator- (const XYZEval<T> &rs) { XYZEval<T> ls = *this; ls.x -= rs.x; ls.y -= rs.y; ls.z -= rs.z; ls.e -= rs.e; return ls; }
|
||||
FI XYZEval<T> operator* (const XYZEval<T> &rs) const { XYZEval<T> ls = *this; ls.x *= rs.x; ls.y *= rs.y; ls.z *= rs.z; ls.e *= rs.e; return ls; }
|
||||
FI XYZEval<T> operator* (const XYZEval<T> &rs) { XYZEval<T> ls = *this; ls.x *= rs.x; ls.y *= rs.y; ls.z *= rs.z; ls.e *= rs.e; return ls; }
|
||||
FI XYZEval<T> operator/ (const XYZEval<T> &rs) const { XYZEval<T> ls = *this; ls.x /= rs.x; ls.y /= rs.y; ls.z /= rs.z; ls.e /= rs.e; return ls; }
|
||||
FI XYZEval<T> operator/ (const XYZEval<T> &rs) { XYZEval<T> ls = *this; ls.x /= rs.x; ls.y /= rs.y; ls.z /= rs.z; ls.e /= rs.e; return ls; }
|
||||
FI XYZEval<T> operator* (const float &v) const { XYZEval<T> ls = *this; ls.x *= v; ls.y *= v; ls.z *= v; ls.e *= v; return ls; }
|
||||
FI XYZEval<T> operator* (const float &v) { XYZEval<T> ls = *this; ls.x *= v; ls.y *= v; ls.z *= v; ls.e *= v; return ls; }
|
||||
FI XYZEval<T> operator* (const int &v) const { XYZEval<T> ls = *this; ls.x *= v; ls.y *= v; ls.z *= v; ls.e *= v; return ls; }
|
||||
FI XYZEval<T> operator* (const int &v) { XYZEval<T> ls = *this; ls.x *= v; ls.y *= v; ls.z *= v; ls.e *= v; return ls; }
|
||||
FI XYZEval<T> operator/ (const float &v) const { XYZEval<T> ls = *this; ls.x /= v; ls.y /= v; ls.z /= v; ls.e /= v; return ls; }
|
||||
FI XYZEval<T> operator/ (const float &v) { XYZEval<T> ls = *this; ls.x /= v; ls.y /= v; ls.z /= v; ls.e /= v; return ls; }
|
||||
FI XYZEval<T> operator/ (const int &v) const { XYZEval<T> ls = *this; ls.x /= v; ls.y /= v; ls.z /= v; ls.e /= v; return ls; }
|
||||
FI XYZEval<T> operator/ (const int &v) { XYZEval<T> ls = *this; ls.x /= v; ls.y /= v; ls.z /= v; ls.e /= v; return ls; }
|
||||
FI XYZEval<T> operator>>(const int &v) const { XYZEval<T> ls = *this; _RS(ls.x); _RS(ls.y); _RS(ls.z); _RS(ls.e); return ls; }
|
||||
FI XYZEval<T> operator>>(const int &v) { XYZEval<T> ls = *this; _RS(ls.x); _RS(ls.y); _RS(ls.z); _RS(ls.e); return ls; }
|
||||
FI XYZEval<T> operator<<(const int &v) const { XYZEval<T> ls = *this; _LS(ls.x); _LS(ls.y); _LS(ls.z); _LS(ls.e); return ls; }
|
||||
FI XYZEval<T> operator<<(const int &v) { XYZEval<T> ls = *this; _LS(ls.x); _LS(ls.y); _LS(ls.z); _LS(ls.e); return ls; }
|
||||
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) { x += rs.x; y += rs.y; z += rs.z; return *this; }
|
||||
FI XYZEval<T>& operator-=(const XYZval<T> &rs) { x -= rs.x; y -= rs.y; z -= rs.z; return *this; }
|
||||
FI XYZEval<T>& operator*=(const XYZval<T> &rs) { x *= rs.x; y *= rs.y; z *= rs.z; return *this; }
|
||||
FI XYZEval<T>& operator/=(const XYZval<T> &rs) { x /= rs.x; y /= rs.y; z /= rs.z; return *this; }
|
||||
FI XYZEval<T>& operator+=(const XYZEval<T> &rs) { x += rs.x; y += rs.y; z += rs.z; e += rs.e; return *this; }
|
||||
FI XYZEval<T>& operator-=(const XYZEval<T> &rs) { x -= rs.x; y -= rs.y; z -= rs.z; e -= rs.e; return *this; }
|
||||
FI XYZEval<T>& operator*=(const XYZEval<T> &rs) { x *= rs.x; y *= rs.y; z *= rs.z; e *= rs.e; return *this; }
|
||||
FI XYZEval<T>& operator/=(const XYZEval<T> &rs) { x /= rs.x; y /= rs.y; z /= rs.z; e /= rs.e; return *this; }
|
||||
FI XYZEval<T>& operator*=(const T &v) { x *= v; y *= v; z *= v; e *= v; return *this; }
|
||||
FI XYZEval<T>& operator>>=(const int &v) { _RS(x); _RS(y); _RS(z); _RS(e); return *this; }
|
||||
FI XYZEval<T>& operator<<=(const int &v) { _LS(x); _LS(y); _LS(z); _LS(e); return *this; }
|
||||
FI bool operator==(const XYZval<T> &rs) { return x == rs.x && y == rs.y && z == rs.z; }
|
||||
FI bool operator!=(const XYZval<T> &rs) { return !operator==(rs); }
|
||||
FI bool operator==(const XYZval<T> &rs) const { return x == rs.x && y == rs.y && z == rs.z; }
|
||||
FI bool operator!=(const XYZval<T> &rs) const { return !operator==(rs); }
|
||||
FI XYZEval<T> operator-() { return { -x, -y, -z, -e }; }
|
||||
FI const XYZEval<T> operator-() const { return { -x, -y, -z, -e }; }
|
||||
#if LOGICAL_AXES > LINEAR_AXES
|
||||
FI void set(const XYval<T> pxy, const T pe) { set(pxy); e = pe; }
|
||||
FI void set(const XYZval<T> pxyz, const T pe) { set(pxyz); e = pe; }
|
||||
FI void set(LOGICAL_AXIS_ARGS(const T)) { LOGICAL_AXIS_CODE(_e = e, a = x, b = y, c = z, u = i, v = j, w = k); }
|
||||
#endif
|
||||
#if LINEAR_AXES >= 4
|
||||
FI void set(const T px, const T py, const T pz) { x = px; y = py; z = pz; }
|
||||
#endif
|
||||
#if LINEAR_AXES >= 5
|
||||
FI void set(const T px, const T py, const T pz, const T pi) { x = px; y = py; z = pz; i = pi; }
|
||||
#endif
|
||||
#if LINEAR_AXES >= 6
|
||||
FI void set(const T px, const T py, const T pz, const T pi, const T pj) { x = px; y = py; z = pz; i = pi; j = pj; }
|
||||
#endif
|
||||
|
||||
// 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)); }
|
||||
// Pointer to the data as a simple array
|
||||
FI operator T* () { return pos; }
|
||||
// If any element is true then it's true
|
||||
FI operator bool() { return 0 LOGICAL_AXIS_GANG(|| e, || x, || y, || z, || i, || j, || k); }
|
||||
|
||||
// Explicit copy and copies with conversion
|
||||
FI XYZEval<T> copy() const { XYZEval<T> o = *this; return o; }
|
||||
FI XYZEval<T> ABS() const { return LOGICAL_AXIS_ARRAY(T(_ABS(e)), T(_ABS(x)), T(_ABS(y)), T(_ABS(z)), T(_ABS(i)), T(_ABS(j)), T(_ABS(k))); }
|
||||
FI XYZEval<int16_t> asInt() { return LOGICAL_AXIS_ARRAY(int16_t(e), int16_t(x), int16_t(y), int16_t(z), int16_t(i), int16_t(j), int16_t(k)); }
|
||||
FI XYZEval<int16_t> asInt() const { return LOGICAL_AXIS_ARRAY(int16_t(e), int16_t(x), int16_t(y), int16_t(z), int16_t(i), int16_t(j), int16_t(k)); }
|
||||
FI XYZEval<int32_t> asLong() { return LOGICAL_AXIS_ARRAY(int32_t(e), int32_t(x), int32_t(y), int32_t(z), int32_t(i), int32_t(j), int32_t(k)); }
|
||||
FI XYZEval<int32_t> asLong() const { return LOGICAL_AXIS_ARRAY(int32_t(e), int32_t(x), int32_t(y), int32_t(z), int32_t(i), int32_t(j), int32_t(k)); }
|
||||
FI XYZEval<int32_t> ROUNDL() { return LOGICAL_AXIS_ARRAY(int32_t(LROUND(e)), int32_t(LROUND(x)), int32_t(LROUND(y)), int32_t(LROUND(z)), int32_t(LROUND(i)), int32_t(LROUND(j)), int32_t(LROUND(k))); }
|
||||
FI XYZEval<int32_t> ROUNDL() const { return LOGICAL_AXIS_ARRAY(int32_t(LROUND(e)), int32_t(LROUND(x)), int32_t(LROUND(y)), int32_t(LROUND(z)), int32_t(LROUND(i)), int32_t(LROUND(j)), int32_t(LROUND(k))); }
|
||||
FI XYZEval<float> asFloat() { return LOGICAL_AXIS_ARRAY(static_cast<float>(e), static_cast<float>(x), static_cast<float>(y), static_cast<float>(z), static_cast<float>(i), static_cast<float>(j), static_cast<float>(k)); }
|
||||
FI XYZEval<float> asFloat() const { return LOGICAL_AXIS_ARRAY(static_cast<float>(e), static_cast<float>(x), static_cast<float>(y), static_cast<float>(z), static_cast<float>(i), static_cast<float>(j), static_cast<float>(k)); }
|
||||
FI XYZEval<float> reciprocal() const { return LOGICAL_AXIS_ARRAY(_RECIP(e), _RECIP(x), _RECIP(y), _RECIP(z), _RECIP(i), _RECIP(j), _RECIP(k)); }
|
||||
|
||||
// Marlin workspace shifting is done with G92 and M206
|
||||
FI XYZEval<float> asLogical() const { XYZEval<float> o = asFloat(); toLogical(o); return o; }
|
||||
FI XYZEval<float> asNative() const { XYZEval<float> o = asFloat(); toNative(o); return o; }
|
||||
|
||||
// In-place cast to types having fewer fields
|
||||
FI operator XYval<T>&() { return *(XYval<T>*)this; }
|
||||
FI operator const XYval<T>&() const { return *(const XYval<T>*)this; }
|
||||
FI operator XYZval<T>&() { return *(XYZval<T>*)this; }
|
||||
FI operator const XYZval<T>&() const { return *(const XYZval<T>*)this; }
|
||||
|
||||
// Accessor via an AxisEnum (or any integer) [index]
|
||||
FI T& operator[](const int n) { return pos[n]; }
|
||||
FI const T& operator[](const int n) const { return pos[n]; }
|
||||
|
||||
// Assignment operator overrides do the expected thing
|
||||
FI XYZEval<T>& operator= (const T v) { set(LIST_N_1(LINEAR_AXES, v)); 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(LINEAR_AXIS_ELEM(rs)); return *this; }
|
||||
|
||||
// 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) { 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) 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) 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 XYZval<T> &rs) const { XYZval<T> ls = *this; LINEAR_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); return ls; }
|
||||
FI XYZEval<T> operator+ (const XYZval<T> &rs) { XYZval<T> ls = *this; LINEAR_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); return ls; }
|
||||
FI XYZEval<T> operator- (const XYZval<T> &rs) const { XYZval<T> ls = *this; LINEAR_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); return ls; }
|
||||
FI XYZEval<T> operator- (const XYZval<T> &rs) { XYZval<T> ls = *this; LINEAR_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); return ls; }
|
||||
FI XYZEval<T> operator* (const XYZval<T> &rs) const { XYZval<T> ls = *this; LINEAR_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); return ls; }
|
||||
FI XYZEval<T> operator* (const XYZval<T> &rs) { XYZval<T> ls = *this; LINEAR_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); return ls; }
|
||||
FI XYZEval<T> operator/ (const XYZval<T> &rs) const { XYZval<T> ls = *this; LINEAR_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); return ls; }
|
||||
FI XYZEval<T> operator/ (const XYZval<T> &rs) { XYZval<T> ls = *this; LINEAR_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); 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); 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); 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); 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); 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); 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); 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); 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); 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 ); 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 ); 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 ); 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 ); 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 ); 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 ); 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 ); 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 ); 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) ); 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) ); 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) ); 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) ); return ls; }
|
||||
FI const XYZEval<T> operator-() const { return LOGICAL_AXIS_ARRAY(-e, -x, -y, -z, -i, -j, -k); }
|
||||
FI XYZEval<T> operator-() { return LOGICAL_AXIS_ARRAY(-e, -x, -y, -z, -i, -j, -k); }
|
||||
|
||||
// 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 XYZval<T> &rs) { LINEAR_AXIS_CODE(x += rs.x, y += rs.y, z += rs.z, i += rs.i, j += rs.j, k += rs.k); return *this; }
|
||||
FI XYZEval<T>& operator-=(const XYZval<T> &rs) { LINEAR_AXIS_CODE(x -= rs.x, y -= rs.y, z -= rs.z, i -= rs.i, j -= rs.j, k -= rs.k); return *this; }
|
||||
FI XYZEval<T>& operator*=(const XYZval<T> &rs) { LINEAR_AXIS_CODE(x *= rs.x, y *= rs.y, z *= rs.z, i *= rs.i, j *= rs.j, k *= rs.k); return *this; }
|
||||
FI XYZEval<T>& operator/=(const XYZval<T> &rs) { LINEAR_AXIS_CODE(x /= rs.x, y /= rs.y, z /= rs.z, i /= rs.i, j /= rs.j, k /= rs.k); 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); 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); 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); 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); 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); 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)); 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)); return *this; }
|
||||
|
||||
// Exact comparisons. For floats a "NEAR" operation may be better.
|
||||
FI bool operator==(const XYZval<T> &rs) { return true LINEAR_AXIS_GANG(&& x == rs.x, && y == rs.y, && z == rs.z, && i == rs.i, && j == rs.j, && k == rs.k); }
|
||||
FI bool operator==(const XYZval<T> &rs) const { return true LINEAR_AXIS_GANG(&& x == rs.x, && y == rs.y, && z == rs.z, && i == rs.i, && j == rs.j, && k == rs.k); }
|
||||
FI bool operator!=(const XYZval<T> &rs) { return !operator==(rs); }
|
||||
FI bool operator!=(const XYZval<T> &rs) const { return !operator==(rs); }
|
||||
};
|
||||
|
||||
#undef _RECIP
|
||||
@@ -514,6 +666,3 @@ struct XYZEval {
|
||||
#undef _LS
|
||||
#undef _RS
|
||||
#undef FI
|
||||
|
||||
const xyze_char_t axis_codes { 'X', 'Y', 'Z', 'E' };
|
||||
#define AXIS_CHAR(A) ((char)('X' + A))
|
||||
|
||||
@@ -122,7 +122,7 @@ void safe_delay(millis_t ms) {
|
||||
SERIAL_ECHOLNPAIR("Z Fade: ", planner.z_fade_height);
|
||||
#endif
|
||||
#if ABL_PLANAR
|
||||
SERIAL_ECHOPGM("ABL Adjustment X");
|
||||
SERIAL_ECHOPGM("ABL Adjustment");
|
||||
LOOP_LINEAR_AXES(a) {
|
||||
const float v = planner.get_axis_position_mm(AxisEnum(a)) - current_position[a];
|
||||
SERIAL_CHAR(' ', AXIS_CHAR(a));
|
||||
|
||||
@@ -76,3 +76,11 @@ public:
|
||||
// Converts from an uint8_t in the range of 0-255 to an uint8_t
|
||||
// in the range 0-100 while avoiding rounding artifacts
|
||||
constexpr uint8_t ui8_to_percent(const uint8_t i) { return (int(i) * 100 + 127) / 255; }
|
||||
|
||||
const xyze_char_t axis_codes LOGICAL_AXIS_ARRAY('E', 'X', 'Y', 'Z', AXIS4_NAME, AXIS5_NAME, AXIS6_NAME);
|
||||
|
||||
#if LINEAR_AXES <= XYZ
|
||||
#define AXIS_CHAR(A) ((char)('X' + A))
|
||||
#else
|
||||
#define AXIS_CHAR(A) axis_codes[A]
|
||||
#endif
|
||||
|
||||
@@ -103,9 +103,7 @@ public:
|
||||
}
|
||||
|
||||
static float get_z(const xy_pos_t &pos
|
||||
#if ENABLED(ENABLE_LEVELING_FADE_HEIGHT)
|
||||
, const_float_t factor=1.0f
|
||||
#endif
|
||||
OPTARG(ENABLE_LEVELING_FADE_HEIGHT, const_float_t factor=1.0f)
|
||||
) {
|
||||
#if DISABLED(ENABLE_LEVELING_FADE_HEIGHT)
|
||||
constexpr float factor = 1.0f;
|
||||
|
||||
@@ -113,20 +113,22 @@
|
||||
const xy_float_t ad = sign * dist;
|
||||
const bool use_x_dist = ad.x > ad.y;
|
||||
|
||||
float on_axis_distance = use_x_dist ? dist.x : dist.y,
|
||||
e_position = end.e - start.e,
|
||||
z_position = end.z - start.z;
|
||||
float on_axis_distance = use_x_dist ? dist.x : dist.y;
|
||||
|
||||
const float e_normalized_dist = e_position / on_axis_distance, // Allow divide by zero
|
||||
z_normalized_dist = z_position / on_axis_distance;
|
||||
const float z_normalized_dist = (end.z - start.z) / on_axis_distance; // Allow divide by zero
|
||||
#if HAS_EXTRUDERS
|
||||
const float e_normalized_dist = (end.e - start.e) / on_axis_distance;
|
||||
const bool inf_normalized_flag = isinf(e_normalized_dist);
|
||||
#endif
|
||||
|
||||
xy_int8_t icell = istart;
|
||||
|
||||
const float ratio = dist.y / dist.x, // Allow divide by zero
|
||||
c = start.y - ratio * start.x;
|
||||
|
||||
const bool inf_normalized_flag = isinf(e_normalized_dist),
|
||||
inf_ratio_flag = isinf(ratio);
|
||||
const bool inf_ratio_flag = isinf(ratio);
|
||||
|
||||
xyze_pos_t dest; // Stores XYZE for segmented moves
|
||||
|
||||
/**
|
||||
* Handle vertical lines that stay within one column.
|
||||
@@ -143,34 +145,36 @@
|
||||
* For others the next X is the same so this can continue.
|
||||
* Calculate X at the next Y mesh line.
|
||||
*/
|
||||
const float rx = inf_ratio_flag ? start.x : (next_mesh_line_y - c) / ratio;
|
||||
dest.x = inf_ratio_flag ? start.x : (next_mesh_line_y - c) / ratio;
|
||||
|
||||
float z0 = z_correction_for_x_on_horizontal_mesh_line(rx, icell.x, icell.y)
|
||||
float z0 = z_correction_for_x_on_horizontal_mesh_line(dest.x, icell.x, icell.y)
|
||||
* planner.fade_scaling_factor_for_z(end.z);
|
||||
|
||||
// Undefined parts of the Mesh in z_values[][] are NAN.
|
||||
// Replace NAN corrections with 0.0 to prevent NAN propagation.
|
||||
if (isnan(z0)) z0 = 0.0;
|
||||
|
||||
const float ry = mesh_index_to_ypos(icell.y);
|
||||
dest.y = mesh_index_to_ypos(icell.y);
|
||||
|
||||
/**
|
||||
* Without this check, it's possible to generate a zero length move, as in the case where
|
||||
* the line is heading down, starting exactly on a mesh line boundary. Since this is rare
|
||||
* it might be fine to remove this check and let planner.buffer_segment() filter it out.
|
||||
*/
|
||||
if (ry != start.y) {
|
||||
if (dest.y != start.y) {
|
||||
if (!inf_normalized_flag) { // fall-through faster than branch
|
||||
on_axis_distance = use_x_dist ? rx - start.x : ry - start.y;
|
||||
e_position = start.e + on_axis_distance * e_normalized_dist;
|
||||
z_position = start.z + on_axis_distance * z_normalized_dist;
|
||||
on_axis_distance = use_x_dist ? dest.x - start.x : dest.y - start.y;
|
||||
TERN_(HAS_EXTRUDERS, dest.e = start.e + on_axis_distance * e_normalized_dist);
|
||||
dest.z = start.z + on_axis_distance * z_normalized_dist;
|
||||
}
|
||||
else {
|
||||
e_position = end.e;
|
||||
z_position = end.z;
|
||||
TERN_(HAS_EXTRUDERS, dest.e = end.e);
|
||||
dest.z = end.z;
|
||||
}
|
||||
|
||||
planner.buffer_segment(rx, ry, z_position + z0, e_position, scaled_fr_mm_s, extruder);
|
||||
dest.z += z0;
|
||||
planner.buffer_segment(dest, scaled_fr_mm_s, extruder);
|
||||
|
||||
} //else printf("FIRST MOVE PRUNED ");
|
||||
}
|
||||
|
||||
@@ -188,12 +192,13 @@
|
||||
*/
|
||||
if (iadd.y == 0) { // Horizontal line?
|
||||
icell.x += ineg.x; // Heading left? Just go to the left edge of the cell for the first move.
|
||||
|
||||
while (icell.x != iend.x + ineg.x) {
|
||||
icell.x += iadd.x;
|
||||
const float rx = mesh_index_to_xpos(icell.x);
|
||||
const float ry = ratio * rx + c; // Calculate Y at the next X mesh line
|
||||
dest.x = mesh_index_to_xpos(icell.x);
|
||||
dest.y = ratio * dest.x + c; // Calculate Y at the next X mesh line
|
||||
|
||||
float z0 = z_correction_for_y_on_vertical_mesh_line(ry, icell.x, icell.y)
|
||||
float z0 = z_correction_for_y_on_vertical_mesh_line(dest.y, icell.x, icell.y)
|
||||
* planner.fade_scaling_factor_for_z(end.z);
|
||||
|
||||
// Undefined parts of the Mesh in z_values[][] are NAN.
|
||||
@@ -205,19 +210,20 @@
|
||||
* the line is heading left, starting exactly on a mesh line boundary. Since this is rare
|
||||
* it might be fine to remove this check and let planner.buffer_segment() filter it out.
|
||||
*/
|
||||
if (rx != start.x) {
|
||||
if (dest.x != start.x) {
|
||||
if (!inf_normalized_flag) {
|
||||
on_axis_distance = use_x_dist ? rx - start.x : ry - start.y;
|
||||
e_position = start.e + on_axis_distance * e_normalized_dist; // is based on X or Y because this is a horizontal move
|
||||
z_position = start.z + on_axis_distance * z_normalized_dist;
|
||||
on_axis_distance = use_x_dist ? dest.x - start.x : dest.y - start.y;
|
||||
TERN_(HAS_EXTRUDERS, dest.e = start.e + on_axis_distance * e_normalized_dist); // Based on X or Y because the move is horizontal
|
||||
dest.z = start.z + on_axis_distance * z_normalized_dist;
|
||||
}
|
||||
else {
|
||||
e_position = end.e;
|
||||
z_position = end.z;
|
||||
TERN_(HAS_EXTRUDERS, dest.e = end.e);
|
||||
dest.z = end.z;
|
||||
}
|
||||
|
||||
if (!planner.buffer_segment(rx, ry, z_position + z0, e_position, scaled_fr_mm_s, extruder))
|
||||
break;
|
||||
dest.z += z0;
|
||||
if (!planner.buffer_segment(dest, scaled_fr_mm_s, extruder)) break;
|
||||
|
||||
} //else printf("FIRST MOVE PRUNED ");
|
||||
}
|
||||
|
||||
@@ -239,57 +245,65 @@
|
||||
while (cnt) {
|
||||
|
||||
const float next_mesh_line_x = mesh_index_to_xpos(icell.x + iadd.x),
|
||||
next_mesh_line_y = mesh_index_to_ypos(icell.y + iadd.y),
|
||||
ry = ratio * next_mesh_line_x + c, // Calculate Y at the next X mesh line
|
||||
rx = (next_mesh_line_y - c) / ratio; // Calculate X at the next Y mesh line
|
||||
// (No need to worry about ratio == 0.
|
||||
// In that case, it was already detected
|
||||
// as a vertical line move above.)
|
||||
next_mesh_line_y = mesh_index_to_ypos(icell.y + iadd.y);
|
||||
|
||||
if (neg.x == (rx > next_mesh_line_x)) { // Check if we hit the Y line first
|
||||
dest.y = ratio * next_mesh_line_x + c; // Calculate Y at the next X mesh line
|
||||
dest.x = (next_mesh_line_y - c) / ratio; // Calculate X at the next Y mesh line
|
||||
// (No need to worry about ratio == 0.
|
||||
// In that case, it was already detected
|
||||
// as a vertical line move above.)
|
||||
|
||||
if (neg.x == (dest.x > next_mesh_line_x)) { // Check if we hit the Y line first
|
||||
// Yes! Crossing a Y Mesh Line next
|
||||
float z0 = z_correction_for_x_on_horizontal_mesh_line(rx, icell.x - ineg.x, icell.y + iadd.y)
|
||||
float z0 = z_correction_for_x_on_horizontal_mesh_line(dest.x, icell.x - ineg.x, icell.y + iadd.y)
|
||||
* planner.fade_scaling_factor_for_z(end.z);
|
||||
|
||||
// Undefined parts of the Mesh in z_values[][] are NAN.
|
||||
// Replace NAN corrections with 0.0 to prevent NAN propagation.
|
||||
if (isnan(z0)) z0 = 0.0;
|
||||
|
||||
dest.y = next_mesh_line_y;
|
||||
|
||||
if (!inf_normalized_flag) {
|
||||
on_axis_distance = use_x_dist ? rx - start.x : next_mesh_line_y - start.y;
|
||||
e_position = start.e + on_axis_distance * e_normalized_dist;
|
||||
z_position = start.z + on_axis_distance * z_normalized_dist;
|
||||
on_axis_distance = use_x_dist ? dest.x - start.x : dest.y - start.y;
|
||||
TERN_(HAS_EXTRUDERS, dest.e = start.e + on_axis_distance * e_normalized_dist);
|
||||
dest.z = start.z + on_axis_distance * z_normalized_dist;
|
||||
}
|
||||
else {
|
||||
e_position = end.e;
|
||||
z_position = end.z;
|
||||
TERN_(HAS_EXTRUDERS, dest.e = end.e);
|
||||
dest.z = end.z;
|
||||
}
|
||||
if (!planner.buffer_segment(rx, next_mesh_line_y, z_position + z0, e_position, scaled_fr_mm_s, extruder))
|
||||
break;
|
||||
|
||||
dest.z += z0;
|
||||
if (!planner.buffer_segment(dest, scaled_fr_mm_s, extruder)) break;
|
||||
|
||||
icell.y += iadd.y;
|
||||
cnt.y--;
|
||||
}
|
||||
else {
|
||||
// Yes! Crossing a X Mesh Line next
|
||||
float z0 = z_correction_for_y_on_vertical_mesh_line(ry, icell.x + iadd.x, icell.y - ineg.y)
|
||||
float z0 = z_correction_for_y_on_vertical_mesh_line(dest.y, icell.x + iadd.x, icell.y - ineg.y)
|
||||
* planner.fade_scaling_factor_for_z(end.z);
|
||||
|
||||
// Undefined parts of the Mesh in z_values[][] are NAN.
|
||||
// Replace NAN corrections with 0.0 to prevent NAN propagation.
|
||||
if (isnan(z0)) z0 = 0.0;
|
||||
|
||||
dest.x = next_mesh_line_x;
|
||||
|
||||
if (!inf_normalized_flag) {
|
||||
on_axis_distance = use_x_dist ? next_mesh_line_x - start.x : ry - start.y;
|
||||
e_position = start.e + on_axis_distance * e_normalized_dist;
|
||||
z_position = start.z + on_axis_distance * z_normalized_dist;
|
||||
on_axis_distance = use_x_dist ? dest.x - start.x : dest.y - start.y;
|
||||
TERN_(HAS_EXTRUDERS, dest.e = start.e + on_axis_distance * e_normalized_dist);
|
||||
dest.z = start.z + on_axis_distance * z_normalized_dist;
|
||||
}
|
||||
else {
|
||||
e_position = end.e;
|
||||
z_position = end.z;
|
||||
TERN_(HAS_EXTRUDERS, dest.e = end.e);
|
||||
dest.z = end.z;
|
||||
}
|
||||
|
||||
if (!planner.buffer_segment(next_mesh_line_x, ry, z_position + z0, e_position, scaled_fr_mm_s, extruder))
|
||||
break;
|
||||
dest.z += z0;
|
||||
if (!planner.buffer_segment(dest, scaled_fr_mm_s, extruder)) break;
|
||||
|
||||
icell.x += iadd.x;
|
||||
cnt.x--;
|
||||
}
|
||||
@@ -362,15 +376,11 @@
|
||||
while (--segments) {
|
||||
raw += diff;
|
||||
planner.buffer_line(raw, scaled_fr_mm_s, active_extruder, segment_xyz_mm
|
||||
#if ENABLED(SCARA_FEEDRATE_SCALING)
|
||||
, inv_duration
|
||||
#endif
|
||||
OPTARG(SCARA_FEEDRATE_SCALING, inv_duration)
|
||||
);
|
||||
}
|
||||
planner.buffer_line(destination, scaled_fr_mm_s, active_extruder, segment_xyz_mm
|
||||
#if ENABLED(SCARA_FEEDRATE_SCALING)
|
||||
, inv_duration
|
||||
#endif
|
||||
OPTARG(SCARA_FEEDRATE_SCALING, inv_duration)
|
||||
);
|
||||
return false; // Did not set current from destination
|
||||
}
|
||||
@@ -442,11 +452,9 @@
|
||||
#endif
|
||||
;
|
||||
|
||||
planner.buffer_line(raw.x, raw.y, raw.z + z_cxcy, raw.e, scaled_fr_mm_s, active_extruder, segment_xyz_mm
|
||||
#if ENABLED(SCARA_FEEDRATE_SCALING)
|
||||
, inv_duration
|
||||
#endif
|
||||
);
|
||||
const float oldz = raw.z; raw.z += z_cxcy;
|
||||
planner.buffer_line(raw, scaled_fr_mm_s, active_extruder, segment_xyz_mm OPTARG(SCARA_FEEDRATE_SCALING, inv_duration) );
|
||||
raw.z = oldz;
|
||||
|
||||
if (segments == 0) // done with last segment
|
||||
return false; // didn't set current from destination
|
||||
|
||||
@@ -41,7 +41,7 @@ bool CaseLight::on = CASE_LIGHT_DEFAULT_ON;
|
||||
#if CASE_LIGHT_IS_COLOR_LED
|
||||
#include "leds/leds.h"
|
||||
constexpr uint8_t init_case_light[] = CASE_LIGHT_DEFAULT_COLOR;
|
||||
LEDColor CaseLight::color = { init_case_light[0], init_case_light[1], init_case_light[2], TERN_(HAS_WHITE_LED, init_case_light[3]) };
|
||||
LEDColor CaseLight::color = { init_case_light[0], init_case_light[1], init_case_light[2] OPTARG(HAS_WHITE_LED, init_case_light[3]) };
|
||||
#endif
|
||||
|
||||
void CaseLight::update(const bool sflag) {
|
||||
@@ -65,9 +65,7 @@ void CaseLight::update(const bool sflag) {
|
||||
#endif
|
||||
|
||||
#if CASE_LIGHT_IS_COLOR_LED
|
||||
|
||||
leds.set_color(MakeLEDColor(color.r, color.g, color.b, color.w, n10ct));
|
||||
|
||||
leds.set_color(LEDColor(color.r, color.g, color.b OPTARG(HAS_WHITE_LED, color.w), n10ct));
|
||||
#else // !CASE_LIGHT_IS_COLOR_LED
|
||||
|
||||
#if CASELIGHT_USES_BRIGHTNESS
|
||||
|
||||
@@ -78,10 +78,8 @@ public:
|
||||
|
||||
// Get the total flow (in liters per minute) since the last reading
|
||||
static void calc_flowrate() {
|
||||
//flowmeter_interrupt_disable();
|
||||
// const uint16_t pulses = flowpulses;
|
||||
//flowmeter_interrupt_enable();
|
||||
flowrate = flowpulses * 60.0f * (1000.0f / (FLOWMETER_INTERVAL)) * (1000.0f / (FLOWMETER_PPL));
|
||||
// flowrate = (litres) * (seconds) = litres per minute
|
||||
flowrate = (flowpulses / (float)FLOWMETER_PPL) * ((1000.0f / (float)FLOWMETER_INTERVAL) * 60.0f);
|
||||
flowpulses = 0;
|
||||
}
|
||||
|
||||
|
||||
@@ -327,7 +327,7 @@ int32_t I2CPositionEncoder::get_raw_count() {
|
||||
}
|
||||
|
||||
bool I2CPositionEncoder::test_axis() {
|
||||
//only works on XYZ cartesian machines for the time being
|
||||
// Only works on XYZ Cartesian machines for the time being
|
||||
if (!(encoderAxis == X_AXIS || encoderAxis == Y_AXIS || encoderAxis == Z_AXIS)) return false;
|
||||
|
||||
const float startPosition = soft_endstop.min[encoderAxis] + 10,
|
||||
@@ -345,9 +345,12 @@ bool I2CPositionEncoder::test_axis() {
|
||||
endCoord[encoderAxis] = endPosition;
|
||||
|
||||
planner.synchronize();
|
||||
startCoord.e = planner.get_axis_position_mm(E_AXIS);
|
||||
planner.buffer_line(startCoord, fr_mm_s, 0);
|
||||
planner.synchronize();
|
||||
|
||||
#if HAS_EXTRUDERS
|
||||
startCoord.e = planner.get_axis_position_mm(E_AXIS);
|
||||
planner.buffer_line(startCoord, fr_mm_s, 0);
|
||||
planner.synchronize();
|
||||
#endif
|
||||
|
||||
// if the module isn't currently trusted, wait until it is (or until it should be if things are working)
|
||||
if (!trusted) {
|
||||
@@ -357,7 +360,7 @@ bool I2CPositionEncoder::test_axis() {
|
||||
}
|
||||
|
||||
if (trusted) { // if trusted, commence test
|
||||
endCoord.e = planner.get_axis_position_mm(E_AXIS);
|
||||
TERN_(HAS_EXTRUDERS, endCoord.e = planner.get_axis_position_mm(E_AXIS));
|
||||
planner.buffer_line(endCoord, fr_mm_s, 0);
|
||||
planner.synchronize();
|
||||
}
|
||||
@@ -402,7 +405,7 @@ void I2CPositionEncoder::calibrate_steps_mm(const uint8_t iter) {
|
||||
planner.synchronize();
|
||||
|
||||
LOOP_L_N(i, iter) {
|
||||
startCoord.e = planner.get_axis_position_mm(E_AXIS);
|
||||
TERN_(HAS_EXTRUDERS, startCoord.e = planner.get_axis_position_mm(E_AXIS));
|
||||
planner.buffer_line(startCoord, fr_mm_s, 0);
|
||||
planner.synchronize();
|
||||
|
||||
@@ -411,7 +414,7 @@ void I2CPositionEncoder::calibrate_steps_mm(const uint8_t iter) {
|
||||
|
||||
//do_blocking_move_to(endCoord);
|
||||
|
||||
endCoord.e = planner.get_axis_position_mm(E_AXIS);
|
||||
TERN_(HAS_EXTRUDERS, endCoord.e = planner.get_axis_position_mm(E_AXIS));
|
||||
planner.buffer_line(endCoord, fr_mm_s, 0);
|
||||
planner.synchronize();
|
||||
|
||||
@@ -497,9 +500,7 @@ void I2CPositionEncodersMgr::init() {
|
||||
|
||||
encoders[i].set_active(encoders[i].passes_test(true));
|
||||
|
||||
#if I2CPE_ENC_1_AXIS == E_AXIS
|
||||
encoders[i].set_homed();
|
||||
#endif
|
||||
TERN_(HAS_EXTRUDERS, if (I2CPE_ENC_1_AXIS == E_AXIS) encoders[i].set_homed());
|
||||
#endif
|
||||
|
||||
#if I2CPE_ENCODER_CNT > 1
|
||||
@@ -528,9 +529,7 @@ void I2CPositionEncodersMgr::init() {
|
||||
|
||||
encoders[i].set_active(encoders[i].passes_test(true));
|
||||
|
||||
#if I2CPE_ENC_2_AXIS == E_AXIS
|
||||
encoders[i].set_homed();
|
||||
#endif
|
||||
TERN_(HAS_EXTRUDERS, if (I2CPE_ENC_2_AXIS == E_AXIS) encoders[i].set_homed());
|
||||
#endif
|
||||
|
||||
#if I2CPE_ENCODER_CNT > 2
|
||||
@@ -557,11 +556,9 @@ void I2CPositionEncodersMgr::init() {
|
||||
encoders[i].set_ec_threshold(I2CPE_ENC_3_EC_THRESH);
|
||||
#endif
|
||||
|
||||
encoders[i].set_active(encoders[i].passes_test(true));
|
||||
encoders[i].set_active(encoders[i].passes_test(true));
|
||||
|
||||
#if I2CPE_ENC_3_AXIS == E_AXIS
|
||||
encoders[i].set_homed();
|
||||
#endif
|
||||
TERN_(HAS_EXTRUDERS, if (I2CPE_ENC_3_AXIS == E_AXIS) encoders[i].set_homed());
|
||||
#endif
|
||||
|
||||
#if I2CPE_ENCODER_CNT > 3
|
||||
@@ -590,9 +587,7 @@ void I2CPositionEncodersMgr::init() {
|
||||
|
||||
encoders[i].set_active(encoders[i].passes_test(true));
|
||||
|
||||
#if I2CPE_ENC_4_AXIS == E_AXIS
|
||||
encoders[i].set_homed();
|
||||
#endif
|
||||
TERN_(HAS_EXTRUDERS, if (I2CPE_ENC_4_AXIS == E_AXIS) encoders[i].set_homed());
|
||||
#endif
|
||||
|
||||
#if I2CPE_ENCODER_CNT > 4
|
||||
@@ -621,9 +616,7 @@ void I2CPositionEncodersMgr::init() {
|
||||
|
||||
encoders[i].set_active(encoders[i].passes_test(true));
|
||||
|
||||
#if I2CPE_ENC_5_AXIS == E_AXIS
|
||||
encoders[i].set_homed();
|
||||
#endif
|
||||
TERN_(HAS_EXTRUDERS, if (I2CPE_ENC_5_AXIS == E_AXIS) encoders[i].set_homed());
|
||||
#endif
|
||||
|
||||
#if I2CPE_ENCODER_CNT > 5
|
||||
@@ -652,9 +645,7 @@ void I2CPositionEncodersMgr::init() {
|
||||
|
||||
encoders[i].set_active(encoders[i].passes_test(true));
|
||||
|
||||
#if I2CPE_ENC_6_AXIS == E_AXIS
|
||||
encoders[i].set_homed();
|
||||
#endif
|
||||
TERN_(HAS_EXTRUDERS, if (I2CPE_ENC_6_AXIS == E_AXIS) encoders[i].set_homed());
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
@@ -91,11 +91,7 @@ void FWRetract::reset() {
|
||||
* Note: Auto-retract will apply the set Z hop in addition to any Z hop
|
||||
* included in the G-code. Use M207 Z0 to to prevent double hop.
|
||||
*/
|
||||
void FWRetract::retract(const bool retracting
|
||||
#if HAS_MULTI_EXTRUDER
|
||||
, bool swapping/*=false*/
|
||||
#endif
|
||||
) {
|
||||
void FWRetract::retract(const bool retracting OPTARG(HAS_MULTI_EXTRUDER, bool swapping/*=false*/)) {
|
||||
// Prevent two retracts or recovers in a row
|
||||
if (retracted[active_extruder] == retracting) return;
|
||||
|
||||
|
||||
@@ -74,11 +74,7 @@ public:
|
||||
#endif
|
||||
}
|
||||
|
||||
static void retract(const bool retracting
|
||||
#if HAS_MULTI_EXTRUDER
|
||||
, bool swapping = false
|
||||
#endif
|
||||
);
|
||||
static void retract(const bool retracting OPTARG(HAS_MULTI_EXTRUDER, bool swapping = false));
|
||||
|
||||
static void M207();
|
||||
static void M207_report(const bool forReplay=false);
|
||||
|
||||
@@ -47,9 +47,10 @@
|
||||
#endif
|
||||
|
||||
#if ENABLED(LED_COLOR_PRESETS)
|
||||
const LEDColor LEDLights::defaultLEDColor = MakeLEDColor(
|
||||
LED_USER_PRESET_RED, LED_USER_PRESET_GREEN, LED_USER_PRESET_BLUE,
|
||||
LED_USER_PRESET_WHITE, LED_USER_PRESET_BRIGHTNESS
|
||||
const LEDColor LEDLights::defaultLEDColor = LEDColor(
|
||||
LED_USER_PRESET_RED, LED_USER_PRESET_GREEN, LED_USER_PRESET_BLUE
|
||||
OPTARG(HAS_WHITE_LED, LED_USER_PRESET_WHITE)
|
||||
OPTARG(NEOPIXEL_LED, LED_USER_PRESET_BRIGHTNESS)
|
||||
);
|
||||
#endif
|
||||
|
||||
@@ -75,36 +76,35 @@ void LEDLights::setup() {
|
||||
}
|
||||
|
||||
void LEDLights::set_color(const LEDColor &incol
|
||||
#if ENABLED(NEOPIXEL_LED)
|
||||
, bool isSequence/*=false*/
|
||||
#endif
|
||||
OPTARG(NEOPIXEL_IS_SEQUENTIAL, bool isSequence/*=false*/)
|
||||
) {
|
||||
|
||||
#if ENABLED(NEOPIXEL_LED)
|
||||
|
||||
const uint32_t neocolor = LEDColorWhite() == incol
|
||||
? neo.Color(NEO_WHITE)
|
||||
: neo.Color(incol.r, incol.g, incol.b, incol.w);
|
||||
static uint16_t nextLed = 0;
|
||||
: neo.Color(incol.r, incol.g, incol.b OPTARG(HAS_WHITE_LED, incol.w));
|
||||
|
||||
#ifdef NEOPIXEL_BKGD_LED_INDEX
|
||||
if (NEOPIXEL_BKGD_LED_INDEX == nextLed) {
|
||||
neo.set_color_background();
|
||||
if (++nextLed >= neo.pixels()) {
|
||||
nextLed = 0;
|
||||
return;
|
||||
#if ENABLED(NEOPIXEL_IS_SEQUENTIAL)
|
||||
static uint16_t nextLed = 0;
|
||||
#ifdef NEOPIXEL_BKGD_INDEX_FIRST
|
||||
while (WITHIN(nextLed, NEOPIXEL_BKGD_INDEX_FIRST, NEOPIXEL_BKGD_INDEX_LAST)) {
|
||||
neo.reset_background_color();
|
||||
if (++nextLed >= neo.pixels()) { nextLed = 0; return; }
|
||||
}
|
||||
}
|
||||
#endif
|
||||
#endif
|
||||
|
||||
neo.set_brightness(incol.i);
|
||||
|
||||
if (isSequence) {
|
||||
neo.set_pixel_color(nextLed, neocolor);
|
||||
neo.show();
|
||||
if (++nextLed >= neo.pixels()) nextLed = 0;
|
||||
return;
|
||||
}
|
||||
#if ENABLED(NEOPIXEL_IS_SEQUENTIAL)
|
||||
if (isSequence) {
|
||||
neo.set_pixel_color(nextLed, neocolor);
|
||||
neo.show();
|
||||
if (++nextLed >= neo.pixels()) nextLed = 0;
|
||||
return;
|
||||
}
|
||||
#endif
|
||||
|
||||
neo.set_color(neocolor);
|
||||
|
||||
@@ -169,9 +169,10 @@ void LEDLights::set_color(const LEDColor &incol
|
||||
#if ENABLED(NEOPIXEL2_SEPARATE)
|
||||
|
||||
#if ENABLED(NEO2_COLOR_PRESETS)
|
||||
const LEDColor LEDLights2::defaultLEDColor = MakeLEDColor(
|
||||
NEO2_USER_PRESET_RED, NEO2_USER_PRESET_GREEN, NEO2_USER_PRESET_BLUE,
|
||||
NEO2_USER_PRESET_WHITE, NEO2_USER_PRESET_BRIGHTNESS
|
||||
const LEDColor LEDLights2::defaultLEDColor = LEDColor(
|
||||
LED_USER_PRESET_RED, LED_USER_PRESET_GREEN, LED_USER_PRESET_BLUE
|
||||
OPTARG(HAS_WHITE_LED2, LED_USER_PRESET_WHITE)
|
||||
OPTARG(NEOPIXEL_LED, LED_USER_PRESET_BRIGHTNESS)
|
||||
);
|
||||
#endif
|
||||
|
||||
@@ -190,7 +191,7 @@ void LEDLights::set_color(const LEDColor &incol
|
||||
void LEDLights2::set_color(const LEDColor &incol) {
|
||||
const uint32_t neocolor = LEDColorWhite() == incol
|
||||
? neo2.Color(NEO2_WHITE)
|
||||
: neo2.Color(incol.r, incol.g, incol.b, incol.w);
|
||||
: neo2.Color(incol.r, incol.g, incol.b OPTARG(HAS_WHITE_LED2, incol.w));
|
||||
neo2.set_brightness(incol.i);
|
||||
neo2.set_color(neocolor);
|
||||
|
||||
|
||||
@@ -29,13 +29,15 @@
|
||||
|
||||
#include <string.h>
|
||||
|
||||
#if ENABLED(NEOPIXEL_LED)
|
||||
#include "neopixel.h"
|
||||
// A white component can be passed
|
||||
#if EITHER(RGBW_LED, PCA9632_RGBW)
|
||||
#define HAS_WHITE_LED 1
|
||||
#endif
|
||||
|
||||
// A white component can be passed
|
||||
#if ANY(RGBW_LED, NEOPIXEL_LED, PCA9632_RGBW)
|
||||
#define HAS_WHITE_LED 1
|
||||
#if ENABLED(NEOPIXEL_LED)
|
||||
#define _NEOPIXEL_INCLUDE_
|
||||
#include "neopixel.h"
|
||||
#undef _NEOPIXEL_INCLUDE_
|
||||
#endif
|
||||
|
||||
/**
|
||||
@@ -43,46 +45,21 @@
|
||||
*/
|
||||
typedef struct LEDColor {
|
||||
uint8_t r, g, b
|
||||
#if HAS_WHITE_LED
|
||||
, w
|
||||
#if ENABLED(NEOPIXEL_LED)
|
||||
, i
|
||||
#endif
|
||||
#endif
|
||||
OPTARG(HAS_WHITE_LED, w)
|
||||
OPTARG(NEOPIXEL_LED, i)
|
||||
;
|
||||
|
||||
LEDColor() : r(255), g(255), b(255)
|
||||
#if HAS_WHITE_LED
|
||||
, w(255)
|
||||
#if ENABLED(NEOPIXEL_LED)
|
||||
, i(NEOPIXEL_BRIGHTNESS)
|
||||
#endif
|
||||
#endif
|
||||
OPTARG(HAS_WHITE_LED, w(255))
|
||||
OPTARG(NEOPIXEL_LED, i(NEOPIXEL_BRIGHTNESS))
|
||||
{}
|
||||
|
||||
LEDColor(uint8_t r, uint8_t g, uint8_t b
|
||||
#if HAS_WHITE_LED
|
||||
, uint8_t w=0
|
||||
#if ENABLED(NEOPIXEL_LED)
|
||||
, uint8_t i=NEOPIXEL_BRIGHTNESS
|
||||
#endif
|
||||
#endif
|
||||
) : r(r), g(g), b(b)
|
||||
#if HAS_WHITE_LED
|
||||
, w(w)
|
||||
#if ENABLED(NEOPIXEL_LED)
|
||||
, i(i)
|
||||
#endif
|
||||
#endif
|
||||
{}
|
||||
LEDColor(uint8_t r, uint8_t g, uint8_t b OPTARG(HAS_WHITE_LED, uint8_t w=0) OPTARG(NEOPIXEL_LED, uint8_t i=NEOPIXEL_BRIGHTNESS))
|
||||
: r(r), g(g), b(b) OPTARG(HAS_WHITE_LED, w(w)) OPTARG(NEOPIXEL_LED, i(i)) {}
|
||||
|
||||
LEDColor(const uint8_t (&rgbw)[4]) : r(rgbw[0]), g(rgbw[1]), b(rgbw[2])
|
||||
#if HAS_WHITE_LED
|
||||
, w(rgbw[3])
|
||||
#if ENABLED(NEOPIXEL_LED)
|
||||
, i(NEOPIXEL_BRIGHTNESS)
|
||||
#endif
|
||||
#endif
|
||||
OPTARG(HAS_WHITE_LED, w(rgbw[3]))
|
||||
OPTARG(NEOPIXEL_LED, i(NEOPIXEL_BRIGHTNESS))
|
||||
{}
|
||||
|
||||
LEDColor& operator=(const uint8_t (&rgbw)[4]) {
|
||||
@@ -109,17 +86,8 @@ typedef struct LEDColor {
|
||||
} LEDColor;
|
||||
|
||||
/**
|
||||
* Color helpers and presets
|
||||
* Color presets
|
||||
*/
|
||||
#if HAS_WHITE_LED
|
||||
#if ENABLED(NEOPIXEL_LED)
|
||||
#define MakeLEDColor(R,G,B,W,I) LEDColor(R, G, B, W, I)
|
||||
#else
|
||||
#define MakeLEDColor(R,G,B,W,I) LEDColor(R, G, B, W)
|
||||
#endif
|
||||
#else
|
||||
#define MakeLEDColor(R,G,B,W,I) LEDColor(R, G, B)
|
||||
#endif
|
||||
|
||||
#define LEDColorOff() LEDColor( 0, 0, 0)
|
||||
#define LEDColorRed() LEDColor(255, 0, 0)
|
||||
@@ -147,25 +115,15 @@ public:
|
||||
static void setup(); // init()
|
||||
|
||||
static void set_color(const LEDColor &color
|
||||
#if ENABLED(NEOPIXEL_LED)
|
||||
, bool isSequence=false
|
||||
#endif
|
||||
OPTARG(NEOPIXEL_IS_SEQUENTIAL, bool isSequence=false)
|
||||
);
|
||||
|
||||
static inline void set_color(uint8_t r, uint8_t g, uint8_t b
|
||||
#if HAS_WHITE_LED
|
||||
, uint8_t w=0
|
||||
#endif
|
||||
#if ENABLED(NEOPIXEL_LED)
|
||||
, uint8_t i=NEOPIXEL_BRIGHTNESS
|
||||
, bool isSequence=false
|
||||
#endif
|
||||
OPTARG(HAS_WHITE_LED, uint8_t w=0)
|
||||
OPTARG(NEOPIXEL_LED, uint8_t i=NEOPIXEL_BRIGHTNESS)
|
||||
OPTARG(NEOPIXEL_IS_SEQUENTIAL, bool isSequence=false)
|
||||
) {
|
||||
set_color(MakeLEDColor(r, g, b, w, i)
|
||||
#if ENABLED(NEOPIXEL_LED)
|
||||
, isSequence
|
||||
#endif
|
||||
);
|
||||
set_color(LEDColor(r, g, b OPTARG(HAS_WHITE_LED, w) OPTARG(NEOPIXEL_LED, i)) OPTARG(NEOPIXEL_IS_SEQUENTIAL, isSequence));
|
||||
}
|
||||
|
||||
static inline void set_off() { set_color(LEDColorOff()); }
|
||||
@@ -223,8 +181,14 @@ extern LEDLights leds;
|
||||
|
||||
static void set_color(const LEDColor &color);
|
||||
|
||||
inline void set_color(uint8_t r, uint8_t g, uint8_t b, uint8_t w=0, uint8_t i=NEOPIXEL2_BRIGHTNESS) {
|
||||
set_color(MakeLEDColor(r, g, b, w, i));
|
||||
static inline void set_color(uint8_t r, uint8_t g, uint8_t b
|
||||
OPTARG(HAS_WHITE_LED, uint8_t w=0)
|
||||
OPTARG(NEOPIXEL_LED, uint8_t i=NEOPIXEL_BRIGHTNESS)
|
||||
) {
|
||||
set_color(LEDColor(r, g, b
|
||||
OPTARG(HAS_WHITE_LED, w)
|
||||
OPTARG(NEOPIXEL_LED, i)
|
||||
));
|
||||
}
|
||||
|
||||
static inline void set_off() { set_color(LEDColorOff()); }
|
||||
|
||||
@@ -28,7 +28,7 @@
|
||||
|
||||
#if ENABLED(NEOPIXEL_LED)
|
||||
|
||||
#include "neopixel.h"
|
||||
#include "leds.h"
|
||||
|
||||
#if EITHER(NEOPIXEL_STARTUP_TEST, NEOPIXEL2_STARTUP_TEST)
|
||||
#include "../../core/utility.h"
|
||||
@@ -37,17 +37,21 @@
|
||||
Marlin_NeoPixel neo;
|
||||
int8_t Marlin_NeoPixel::neoindex;
|
||||
|
||||
Adafruit_NeoPixel Marlin_NeoPixel::adaneo1(NEOPIXEL_PIXELS, NEOPIXEL_PIN, NEOPIXEL_TYPE + NEO_KHZ800)
|
||||
#if CONJOINED_NEOPIXEL
|
||||
, Marlin_NeoPixel::adaneo2(NEOPIXEL_PIXELS, NEOPIXEL2_PIN, NEOPIXEL2_TYPE + NEO_KHZ800)
|
||||
#endif
|
||||
;
|
||||
Adafruit_NeoPixel Marlin_NeoPixel::adaneo1(NEOPIXEL_PIXELS, NEOPIXEL_PIN, NEOPIXEL_TYPE + NEO_KHZ800);
|
||||
#if CONJOINED_NEOPIXEL
|
||||
Adafruit_NeoPixel Marlin_NeoPixel::adaneo2(NEOPIXEL_PIXELS, NEOPIXEL2_PIN, NEOPIXEL2_TYPE + NEO_KHZ800);
|
||||
#endif
|
||||
|
||||
#ifdef NEOPIXEL_BKGD_LED_INDEX
|
||||
#ifdef NEOPIXEL_BKGD_INDEX_FIRST
|
||||
|
||||
void Marlin_NeoPixel::set_color_background() {
|
||||
uint8_t background_color[4] = NEOPIXEL_BKGD_COLOR;
|
||||
set_pixel_color(NEOPIXEL_BKGD_LED_INDEX, adaneo1.Color(background_color[0], background_color[1], background_color[2], background_color[3]));
|
||||
void Marlin_NeoPixel::set_background_color(uint8_t r, uint8_t g, uint8_t b, uint8_t w) {
|
||||
for (int background_led = NEOPIXEL_BKGD_INDEX_FIRST; background_led <= NEOPIXEL_BKGD_INDEX_LAST; background_led++)
|
||||
set_pixel_color(background_led, adaneo1.Color(r, g, b, w));
|
||||
}
|
||||
|
||||
void Marlin_NeoPixel::reset_background_color() {
|
||||
constexpr uint8_t background_color[4] = NEOPIXEL_BKGD_COLOR;
|
||||
set_background_color(background_color[0], background_color[1], background_color[2], background_color[3]);
|
||||
}
|
||||
|
||||
#endif
|
||||
@@ -59,9 +63,10 @@ void Marlin_NeoPixel::set_color(const uint32_t color) {
|
||||
}
|
||||
else {
|
||||
for (uint16_t i = 0; i < pixels(); ++i) {
|
||||
#ifdef NEOPIXEL_BKGD_LED_INDEX
|
||||
if (i == NEOPIXEL_BKGD_LED_INDEX && TERN(NEOPIXEL_BKGD_ALWAYS_ON, true, color != 0x000000)) {
|
||||
set_color_background();
|
||||
#ifdef NEOPIXEL_BKGD_INDEX_FIRST
|
||||
if (i == NEOPIXEL_BKGD_INDEX_FIRST && TERN(NEOPIXEL_BKGD_ALWAYS_ON, true, color != 0x000000)) {
|
||||
reset_background_color();
|
||||
i += NEOPIXEL_BKGD_INDEX_LAST - (NEOPIXEL_BKGD_INDEX_FIRST);
|
||||
continue;
|
||||
}
|
||||
#endif
|
||||
@@ -90,36 +95,23 @@ void Marlin_NeoPixel::init() {
|
||||
safe_delay(500);
|
||||
set_color_startup(adaneo1.Color(0, 0, 255, 0)); // blue
|
||||
safe_delay(500);
|
||||
#if HAS_WHITE_LED
|
||||
set_color_startup(adaneo1.Color(0, 0, 0, 255)); // white
|
||||
safe_delay(500);
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifdef NEOPIXEL_BKGD_LED_INDEX
|
||||
set_color_background();
|
||||
#ifdef NEOPIXEL_BKGD_INDEX_FIRST
|
||||
reset_background_color();
|
||||
#endif
|
||||
|
||||
#if ENABLED(LED_USER_PRESET_STARTUP)
|
||||
set_color(adaneo1.Color(LED_USER_PRESET_RED, LED_USER_PRESET_GREEN, LED_USER_PRESET_BLUE, LED_USER_PRESET_WHITE));
|
||||
#else
|
||||
set_color(adaneo1.Color(0, 0, 0, 0));
|
||||
#endif
|
||||
set_color(adaneo1.Color
|
||||
TERN(LED_USER_PRESET_STARTUP,
|
||||
(LED_USER_PRESET_RED, LED_USER_PRESET_GREEN, LED_USER_PRESET_BLUE, LED_USER_PRESET_WHITE),
|
||||
(0, 0, 0, 0))
|
||||
);
|
||||
}
|
||||
|
||||
#if 0
|
||||
bool Marlin_NeoPixel::set_led_color(const uint8_t r, const uint8_t g, const uint8_t b, const uint8_t w, const uint8_t p) {
|
||||
const uint32_t color = adaneo1.Color(r, g, b, w);
|
||||
set_brightness(p);
|
||||
#if DISABLED(NEOPIXEL_IS_SEQUENTIAL)
|
||||
set_color(color);
|
||||
return false;
|
||||
#else
|
||||
static uint16_t nextLed = 0;
|
||||
set_pixel_color(nextLed, color);
|
||||
show();
|
||||
if (++nextLed >= pixels()) nextLed = 0;
|
||||
return true;
|
||||
#endif
|
||||
}
|
||||
#endif
|
||||
|
||||
#if ENABLED(NEOPIXEL2_SEPARATE)
|
||||
|
||||
Marlin_NeoPixel2 neo2;
|
||||
@@ -158,13 +150,17 @@ bool Marlin_NeoPixel::set_led_color(const uint8_t r, const uint8_t g, const uint
|
||||
safe_delay(500);
|
||||
set_color_startup(adaneo.Color(0, 0, 255, 0)); // blue
|
||||
safe_delay(500);
|
||||
#if HAS_WHITE_LED2
|
||||
set_color_startup(adaneo.Color(0, 0, 0, 255)); // white
|
||||
safe_delay(500);
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#if ENABLED(NEO2_USER_PRESET_STARTUP)
|
||||
set_color(adaneo.Color(NEO2_USER_PRESET_RED, NEO2_USER_PRESET_GREEN, NEO2_USER_PRESET_BLUE, NEO2_USER_PRESET_WHITE));
|
||||
#else
|
||||
set_color(adaneo.Color(0, 0, 0, 0));
|
||||
#endif
|
||||
set_color(adaneo.Color
|
||||
TERN(NEO2_USER_PRESET_STARTUP,
|
||||
(NEO2_USER_PRESET_RED, NEO2_USER_PRESET_GREEN, NEO2_USER_PRESET_BLUE, NEO2_USER_PRESET_WHITE),
|
||||
(0, 0, 0, 0))
|
||||
);
|
||||
}
|
||||
|
||||
#endif // NEOPIXEL2_SEPARATE
|
||||
|
||||
@@ -25,6 +25,10 @@
|
||||
* NeoPixel support
|
||||
*/
|
||||
|
||||
#ifndef _NEOPIXEL_INCLUDE_
|
||||
#error "Always include 'leds.h' and not 'neopixel.h' directly."
|
||||
#endif
|
||||
|
||||
// ------------------------
|
||||
// Includes
|
||||
// ------------------------
|
||||
@@ -38,6 +42,18 @@
|
||||
// Defines
|
||||
// ------------------------
|
||||
|
||||
#define _NEO_IS_RGB(N) (N == NEO_RGB || N == NEO_RBG || N == NEO_GRB || N == NEO_GBR || N == NEO_BRG || N == NEO_BGR)
|
||||
|
||||
#if !_NEO_IS_RGB(NEOPIXEL_TYPE)
|
||||
#define HAS_WHITE_LED 1
|
||||
#endif
|
||||
|
||||
#if HAS_WHITE_LED
|
||||
#define NEO_WHITE 0, 0, 0, 255
|
||||
#else
|
||||
#define NEO_WHITE 255, 255, 255
|
||||
#endif
|
||||
|
||||
#if defined(NEOPIXEL2_TYPE) && NEOPIXEL2_TYPE != NEOPIXEL_TYPE && DISABLED(NEOPIXEL2_SEPARATE)
|
||||
#define MULTIPLE_NEOPIXEL_TYPES 1
|
||||
#endif
|
||||
@@ -46,29 +62,16 @@
|
||||
#define CONJOINED_NEOPIXEL 1
|
||||
#endif
|
||||
|
||||
#if NEOPIXEL_TYPE == NEO_RGB || NEOPIXEL_TYPE == NEO_RBG || NEOPIXEL_TYPE == NEO_GRB || NEOPIXEL_TYPE == NEO_GBR || NEOPIXEL_TYPE == NEO_BRG || NEOPIXEL_TYPE == NEO_BGR
|
||||
#define NEOPIXEL_IS_RGB 1
|
||||
#else
|
||||
#define NEOPIXEL_IS_RGBW 1
|
||||
#endif
|
||||
|
||||
#if NEOPIXEL_IS_RGB
|
||||
#define NEO_WHITE 255, 255, 255, 0
|
||||
#else
|
||||
#define NEO_WHITE 0, 0, 0, 255
|
||||
#endif
|
||||
|
||||
// ------------------------
|
||||
// Function prototypes
|
||||
// ------------------------
|
||||
|
||||
class Marlin_NeoPixel {
|
||||
private:
|
||||
static Adafruit_NeoPixel adaneo1
|
||||
#if CONJOINED_NEOPIXEL
|
||||
, adaneo2
|
||||
#endif
|
||||
;
|
||||
static Adafruit_NeoPixel adaneo1;
|
||||
#if CONJOINED_NEOPIXEL
|
||||
static Adafruit_NeoPixel adaneo2;
|
||||
#endif
|
||||
|
||||
public:
|
||||
static int8_t neoindex;
|
||||
@@ -78,8 +81,9 @@ public:
|
||||
|
||||
static void set_color(const uint32_t c);
|
||||
|
||||
#ifdef NEOPIXEL_BKGD_LED_INDEX
|
||||
static void set_color_background();
|
||||
#ifdef NEOPIXEL_BKGD_INDEX_FIRST
|
||||
static void set_background_color(uint8_t r, uint8_t g, uint8_t b, uint8_t w);
|
||||
static void reset_background_color();
|
||||
#endif
|
||||
|
||||
static inline void begin() {
|
||||
@@ -93,9 +97,7 @@ public:
|
||||
else adaneo1.setPixelColor(n, c);
|
||||
#else
|
||||
adaneo1.setPixelColor(n, c);
|
||||
#if MULTIPLE_NEOPIXEL_TYPES
|
||||
adaneo2.setPixelColor(n, c);
|
||||
#endif
|
||||
TERN_(MULTIPLE_NEOPIXEL_TYPES, adaneo2.setPixelColor(n, c));
|
||||
#endif
|
||||
}
|
||||
|
||||
@@ -120,15 +122,13 @@ public:
|
||||
TERN_(HAS_PAUSE_SERVO_OUTPUT, RESUME_SERVO_OUTPUT());
|
||||
}
|
||||
|
||||
#if 0
|
||||
bool set_led_color(const uint8_t r, const uint8_t g, const uint8_t b, const uint8_t w, const uint8_t p);
|
||||
#endif
|
||||
|
||||
// Accessors
|
||||
static inline uint16_t pixels() { TERN(NEOPIXEL2_INSERIES, return adaneo1.numPixels() * 2, return adaneo1.numPixels()); }
|
||||
static inline uint16_t pixels() { return adaneo1.numPixels() * TERN1(NEOPIXEL2_INSERIES, 2); }
|
||||
|
||||
static inline uint8_t brightness() { return adaneo1.getBrightness(); }
|
||||
static inline uint32_t Color(uint8_t r, uint8_t g, uint8_t b, uint8_t w) {
|
||||
return adaneo1.Color(r, g, b, w);
|
||||
|
||||
static inline uint32_t Color(uint8_t r, uint8_t g, uint8_t b OPTARG(HAS_WHITE_LED, uint8_t w)) {
|
||||
return adaneo1.Color(r, g, b OPTARG(HAS_WHITE_LED, w));
|
||||
}
|
||||
};
|
||||
|
||||
@@ -137,15 +137,12 @@ extern Marlin_NeoPixel neo;
|
||||
// Neo pixel channel 2
|
||||
#if ENABLED(NEOPIXEL2_SEPARATE)
|
||||
|
||||
#if NEOPIXEL2_TYPE == NEO_RGB || NEOPIXEL2_TYPE == NEO_RBG || NEOPIXEL2_TYPE == NEO_GRB || NEOPIXEL2_TYPE == NEO_GBR || NEOPIXEL2_TYPE == NEO_BRG || NEOPIXEL2_TYPE == NEO_BGR
|
||||
#if _NEO_IS_RGB(NEOPIXEL2_TYPE)
|
||||
#define NEOPIXEL2_IS_RGB 1
|
||||
#define NEO2_WHITE 255, 255, 255
|
||||
#else
|
||||
#define NEOPIXEL2_IS_RGBW 1
|
||||
#endif
|
||||
|
||||
#if NEOPIXEL2_IS_RGB
|
||||
#define NEO2_WHITE 255, 255, 255, 0
|
||||
#else
|
||||
#define HAS_WHITE_LED2 1 // A white component can be passed for NEOPIXEL2
|
||||
#define NEO2_WHITE 0, 0, 0, 255
|
||||
#endif
|
||||
|
||||
@@ -172,11 +169,13 @@ extern Marlin_NeoPixel neo;
|
||||
// Accessors
|
||||
static inline uint16_t pixels() { return adaneo.numPixels();}
|
||||
static inline uint8_t brightness() { return adaneo.getBrightness(); }
|
||||
static inline uint32_t Color(uint8_t r, uint8_t g, uint8_t b, uint8_t w) {
|
||||
return adaneo.Color(r, g, b, w);
|
||||
static inline uint32_t Color(uint8_t r, uint8_t g, uint8_t b OPTARG(HAS_WHITE_LED2, uint8_t w)) {
|
||||
return adaneo.Color(r, g, b OPTARG(HAS_WHITE_LED2, w));
|
||||
}
|
||||
};
|
||||
|
||||
extern Marlin_NeoPixel2 neo2;
|
||||
|
||||
#endif // NEOPIXEL2_SEPARATE
|
||||
|
||||
#undef _NEO_IS_RGB
|
||||
|
||||
@@ -93,9 +93,7 @@ static void PCA9632_WriteRegister(const byte addr, const byte regadd, const byte
|
||||
}
|
||||
|
||||
static void PCA9632_WriteAllRegisters(const byte addr, const byte regadd, const byte vr, const byte vg, const byte vb
|
||||
#if ENABLED(PCA9632_RGBW)
|
||||
, const byte vw
|
||||
#endif
|
||||
OPTARG(PCA9632_RGBW, const byte vw)
|
||||
) {
|
||||
#if DISABLED(PCA9632_NO_AUTO_INC)
|
||||
uint8_t data[4];
|
||||
@@ -143,9 +141,7 @@ void PCA9632_set_led_color(const LEDColor &color) {
|
||||
;
|
||||
|
||||
PCA9632_WriteAllRegisters(PCA9632_ADDRESS,PCA9632_PWM0, color.r, color.g, color.b
|
||||
#if ENABLED(PCA9632_RGBW)
|
||||
, color.w
|
||||
#endif
|
||||
OPTARG(PCA9632_RGBW, color.w)
|
||||
);
|
||||
PCA9632_WriteRegister(PCA9632_ADDRESS,PCA9632_LEDOUT, LEDOUT);
|
||||
}
|
||||
|
||||
@@ -45,12 +45,10 @@ PrinterEventLEDs printerEventLEDs;
|
||||
return (uint8_t)map(constrain(current, start, target), start, target, 0, 255);
|
||||
}
|
||||
|
||||
inline void pel_set_rgb(const uint8_t r, const uint8_t g, const uint8_t b) {
|
||||
inline void pel_set_rgb(const uint8_t r, const uint8_t g, const uint8_t b OPTARG(HAS_WHITE_LED, const uint8_t w=0)) {
|
||||
leds.set_color(
|
||||
MakeLEDColor(r, g, b, 0, neo.brightness())
|
||||
#if ENABLED(NEOPIXEL_IS_SEQUENTIAL)
|
||||
, true
|
||||
#endif
|
||||
LEDColor(r, g, b OPTARG(HAS_WHITE_LED, w) OPTARG(NEOPIXEL_LED, neo.brightness()))
|
||||
OPTARG(NEOPIXEL_IS_SEQUENTIAL, true)
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
@@ -24,7 +24,14 @@
|
||||
|
||||
#if HAS_PRUSA_MMU1
|
||||
|
||||
#include "../module/stepper.h"
|
||||
#include "../MarlinCore.h"
|
||||
#include "../module/planner.h"
|
||||
|
||||
void mmu_init() {
|
||||
SET_OUTPUT(E_MUX0_PIN);
|
||||
SET_OUTPUT(E_MUX1_PIN);
|
||||
SET_OUTPUT(E_MUX2_PIN);
|
||||
}
|
||||
|
||||
void select_multiplexed_stepper(const uint8_t e) {
|
||||
planner.synchronize();
|
||||
|
||||
@@ -21,4 +21,5 @@
|
||||
*/
|
||||
#pragma once
|
||||
|
||||
void mmu_init();
|
||||
void select_multiplexed_stepper(const uint8_t e);
|
||||
|
||||
@@ -64,7 +64,7 @@ typedef struct {
|
||||
#ifndef BTC_SAMPLE_COUNT
|
||||
#define BTC_SAMPLE_COUNT 10U
|
||||
#endif
|
||||
#ifndef BTC_SAMPLE_STEP
|
||||
#ifndef BTC_SAMPLE_RES
|
||||
#define BTC_SAMPLE_RES 5
|
||||
#endif
|
||||
#ifndef BTC_SAMPLE_START
|
||||
|
||||
+138
-73
@@ -417,6 +417,21 @@
|
||||
}
|
||||
#endif
|
||||
|
||||
#if AXIS_IS_TMC(I)
|
||||
if (monitor_tmc_driver(stepperI, need_update_error_counters, need_debug_reporting))
|
||||
step_current_down(stepperI);
|
||||
#endif
|
||||
|
||||
#if AXIS_IS_TMC(J)
|
||||
if (monitor_tmc_driver(stepperJ, need_update_error_counters, need_debug_reporting))
|
||||
step_current_down(stepperJ);
|
||||
#endif
|
||||
|
||||
#if AXIS_IS_TMC(K)
|
||||
if (monitor_tmc_driver(stepperK, need_update_error_counters, need_debug_reporting))
|
||||
step_current_down(stepperK);
|
||||
#endif
|
||||
|
||||
#if AXIS_IS_TMC(E0)
|
||||
(void)monitor_tmc_driver(stepperE0, need_update_error_counters, need_debug_reporting);
|
||||
#endif
|
||||
@@ -757,128 +772,148 @@
|
||||
}
|
||||
}
|
||||
|
||||
static void tmc_debug_loop(const TMC_debug_enum i, const bool print_x, const bool print_y, const bool print_z, const bool print_e) {
|
||||
if (print_x) {
|
||||
static void tmc_debug_loop(const TMC_debug_enum n, LOGICAL_AXIS_ARGS(const bool)) {
|
||||
if (x) {
|
||||
#if AXIS_IS_TMC(X)
|
||||
tmc_status(stepperX, i);
|
||||
tmc_status(stepperX, n);
|
||||
#endif
|
||||
#if AXIS_IS_TMC(X2)
|
||||
tmc_status(stepperX2, i);
|
||||
tmc_status(stepperX2, n);
|
||||
#endif
|
||||
}
|
||||
|
||||
if (print_y) {
|
||||
if (TERN0(HAS_Y_AXIS, y)) {
|
||||
#if AXIS_IS_TMC(Y)
|
||||
tmc_status(stepperY, i);
|
||||
tmc_status(stepperY, n);
|
||||
#endif
|
||||
#if AXIS_IS_TMC(Y2)
|
||||
tmc_status(stepperY2, i);
|
||||
tmc_status(stepperY2, n);
|
||||
#endif
|
||||
}
|
||||
|
||||
if (print_z) {
|
||||
if (TERN0(HAS_Z_AXIS, z)) {
|
||||
#if AXIS_IS_TMC(Z)
|
||||
tmc_status(stepperZ, i);
|
||||
tmc_status(stepperZ, n);
|
||||
#endif
|
||||
#if AXIS_IS_TMC(Z2)
|
||||
tmc_status(stepperZ2, i);
|
||||
tmc_status(stepperZ2, n);
|
||||
#endif
|
||||
#if AXIS_IS_TMC(Z3)
|
||||
tmc_status(stepperZ3, i);
|
||||
tmc_status(stepperZ3, n);
|
||||
#endif
|
||||
#if AXIS_IS_TMC(Z4)
|
||||
tmc_status(stepperZ4, i);
|
||||
tmc_status(stepperZ4, n);
|
||||
#endif
|
||||
}
|
||||
|
||||
if (print_e) {
|
||||
#if AXIS_IS_TMC(I)
|
||||
if (i) tmc_status(stepperI, n);
|
||||
#endif
|
||||
#if AXIS_IS_TMC(J)
|
||||
if (j) tmc_status(stepperJ, n);
|
||||
#endif
|
||||
#if AXIS_IS_TMC(K)
|
||||
if (k) tmc_status(stepperK, n);
|
||||
#endif
|
||||
|
||||
if (TERN0(HAS_EXTRUDERS, e)) {
|
||||
#if AXIS_IS_TMC(E0)
|
||||
tmc_status(stepperE0, i);
|
||||
tmc_status(stepperE0, n);
|
||||
#endif
|
||||
#if AXIS_IS_TMC(E1)
|
||||
tmc_status(stepperE1, i);
|
||||
tmc_status(stepperE1, n);
|
||||
#endif
|
||||
#if AXIS_IS_TMC(E2)
|
||||
tmc_status(stepperE2, i);
|
||||
tmc_status(stepperE2, n);
|
||||
#endif
|
||||
#if AXIS_IS_TMC(E3)
|
||||
tmc_status(stepperE3, i);
|
||||
tmc_status(stepperE3, n);
|
||||
#endif
|
||||
#if AXIS_IS_TMC(E4)
|
||||
tmc_status(stepperE4, i);
|
||||
tmc_status(stepperE4, n);
|
||||
#endif
|
||||
#if AXIS_IS_TMC(E5)
|
||||
tmc_status(stepperE5, i);
|
||||
tmc_status(stepperE5, n);
|
||||
#endif
|
||||
#if AXIS_IS_TMC(E6)
|
||||
tmc_status(stepperE6, i);
|
||||
tmc_status(stepperE6, n);
|
||||
#endif
|
||||
#if AXIS_IS_TMC(E7)
|
||||
tmc_status(stepperE7, i);
|
||||
tmc_status(stepperE7, n);
|
||||
#endif
|
||||
}
|
||||
|
||||
SERIAL_EOL();
|
||||
}
|
||||
|
||||
static void drv_status_loop(const TMC_drv_status_enum i, const bool print_x, const bool print_y, const bool print_z, const bool print_e) {
|
||||
if (print_x) {
|
||||
static void drv_status_loop(const TMC_drv_status_enum n, LOGICAL_AXIS_ARGS(const bool)) {
|
||||
if (x) {
|
||||
#if AXIS_IS_TMC(X)
|
||||
tmc_parse_drv_status(stepperX, i);
|
||||
tmc_parse_drv_status(stepperX, n);
|
||||
#endif
|
||||
#if AXIS_IS_TMC(X2)
|
||||
tmc_parse_drv_status(stepperX2, i);
|
||||
tmc_parse_drv_status(stepperX2, n);
|
||||
#endif
|
||||
}
|
||||
|
||||
if (print_y) {
|
||||
if (TERN0(HAS_Y_AXIS, y)) {
|
||||
#if AXIS_IS_TMC(Y)
|
||||
tmc_parse_drv_status(stepperY, i);
|
||||
tmc_parse_drv_status(stepperY, n);
|
||||
#endif
|
||||
#if AXIS_IS_TMC(Y2)
|
||||
tmc_parse_drv_status(stepperY2, i);
|
||||
tmc_parse_drv_status(stepperY2, n);
|
||||
#endif
|
||||
}
|
||||
|
||||
if (print_z) {
|
||||
if (TERN0(HAS_Z_AXIS, z)) {
|
||||
#if AXIS_IS_TMC(Z)
|
||||
tmc_parse_drv_status(stepperZ, i);
|
||||
tmc_parse_drv_status(stepperZ, n);
|
||||
#endif
|
||||
#if AXIS_IS_TMC(Z2)
|
||||
tmc_parse_drv_status(stepperZ2, i);
|
||||
tmc_parse_drv_status(stepperZ2, n);
|
||||
#endif
|
||||
#if AXIS_IS_TMC(Z3)
|
||||
tmc_parse_drv_status(stepperZ3, i);
|
||||
tmc_parse_drv_status(stepperZ3, n);
|
||||
#endif
|
||||
#if AXIS_IS_TMC(Z4)
|
||||
tmc_parse_drv_status(stepperZ4, i);
|
||||
tmc_parse_drv_status(stepperZ4, n);
|
||||
#endif
|
||||
}
|
||||
|
||||
if (print_e) {
|
||||
#if AXIS_IS_TMC(I)
|
||||
if (i) tmc_parse_drv_status(stepperI, n);
|
||||
#endif
|
||||
#if AXIS_IS_TMC(J)
|
||||
if (j) tmc_parse_drv_status(stepperJ, n);
|
||||
#endif
|
||||
#if AXIS_IS_TMC(K)
|
||||
if (k) tmc_parse_drv_status(stepperK, n);
|
||||
#endif
|
||||
|
||||
if (TERN0(HAS_EXTRUDERS, e)) {
|
||||
#if AXIS_IS_TMC(E0)
|
||||
tmc_parse_drv_status(stepperE0, i);
|
||||
tmc_parse_drv_status(stepperE0, n);
|
||||
#endif
|
||||
#if AXIS_IS_TMC(E1)
|
||||
tmc_parse_drv_status(stepperE1, i);
|
||||
tmc_parse_drv_status(stepperE1, n);
|
||||
#endif
|
||||
#if AXIS_IS_TMC(E2)
|
||||
tmc_parse_drv_status(stepperE2, i);
|
||||
tmc_parse_drv_status(stepperE2, n);
|
||||
#endif
|
||||
#if AXIS_IS_TMC(E3)
|
||||
tmc_parse_drv_status(stepperE3, i);
|
||||
tmc_parse_drv_status(stepperE3, n);
|
||||
#endif
|
||||
#if AXIS_IS_TMC(E4)
|
||||
tmc_parse_drv_status(stepperE4, i);
|
||||
tmc_parse_drv_status(stepperE4, n);
|
||||
#endif
|
||||
#if AXIS_IS_TMC(E5)
|
||||
tmc_parse_drv_status(stepperE5, i);
|
||||
tmc_parse_drv_status(stepperE5, n);
|
||||
#endif
|
||||
#if AXIS_IS_TMC(E6)
|
||||
tmc_parse_drv_status(stepperE6, i);
|
||||
tmc_parse_drv_status(stepperE6, n);
|
||||
#endif
|
||||
#if AXIS_IS_TMC(E7)
|
||||
tmc_parse_drv_status(stepperE7, i);
|
||||
tmc_parse_drv_status(stepperE7, n);
|
||||
#endif
|
||||
}
|
||||
|
||||
@@ -889,9 +924,10 @@
|
||||
* M122 report functions
|
||||
*/
|
||||
|
||||
void tmc_report_all(const bool print_x/*=true*/, const bool print_y/*=true*/, const bool print_z/*=true*/, const bool print_e/*=true*/) {
|
||||
#define TMC_REPORT(LABEL, ITEM) do{ SERIAL_ECHOPGM(LABEL); tmc_debug_loop(ITEM, print_x, print_y, print_z, print_e); }while(0)
|
||||
#define DRV_REPORT(LABEL, ITEM) do{ SERIAL_ECHOPGM(LABEL); drv_status_loop(ITEM, print_x, print_y, print_z, print_e); }while(0)
|
||||
void tmc_report_all(LOGICAL_AXIS_ARGS(const bool)) {
|
||||
#define TMC_REPORT(LABEL, ITEM) do{ SERIAL_ECHOPGM(LABEL); tmc_debug_loop(ITEM, LOGICAL_AXIS_ARGS()); }while(0)
|
||||
#define DRV_REPORT(LABEL, ITEM) do{ SERIAL_ECHOPGM(LABEL); drv_status_loop(ITEM, LOGICAL_AXIS_ARGS()); }while(0)
|
||||
|
||||
TMC_REPORT("\t", TMC_CODES);
|
||||
#if HAS_DRIVER(TMC2209)
|
||||
TMC_REPORT("Address\t", TMC_UART_ADDR);
|
||||
@@ -1015,72 +1051,82 @@
|
||||
}
|
||||
#endif
|
||||
|
||||
static void tmc_get_registers(TMC_get_registers_enum i, const bool print_x, const bool print_y, const bool print_z, const bool print_e) {
|
||||
if (print_x) {
|
||||
static void tmc_get_registers(TMC_get_registers_enum n, LOGICAL_AXIS_ARGS(const bool)) {
|
||||
if (x) {
|
||||
#if AXIS_IS_TMC(X)
|
||||
tmc_get_registers(stepperX, i);
|
||||
tmc_get_registers(stepperX, n);
|
||||
#endif
|
||||
#if AXIS_IS_TMC(X2)
|
||||
tmc_get_registers(stepperX2, i);
|
||||
tmc_get_registers(stepperX2, n);
|
||||
#endif
|
||||
}
|
||||
|
||||
if (print_y) {
|
||||
if (TERN0(HAS_Y_AXIS, y)) {
|
||||
#if AXIS_IS_TMC(Y)
|
||||
tmc_get_registers(stepperY, i);
|
||||
tmc_get_registers(stepperY, n);
|
||||
#endif
|
||||
#if AXIS_IS_TMC(Y2)
|
||||
tmc_get_registers(stepperY2, i);
|
||||
tmc_get_registers(stepperY2, n);
|
||||
#endif
|
||||
}
|
||||
|
||||
if (print_z) {
|
||||
if (TERN0(HAS_Z_AXIS, z)) {
|
||||
#if AXIS_IS_TMC(Z)
|
||||
tmc_get_registers(stepperZ, i);
|
||||
tmc_get_registers(stepperZ, n);
|
||||
#endif
|
||||
#if AXIS_IS_TMC(Z2)
|
||||
tmc_get_registers(stepperZ2, i);
|
||||
tmc_get_registers(stepperZ2, n);
|
||||
#endif
|
||||
#if AXIS_IS_TMC(Z3)
|
||||
tmc_get_registers(stepperZ3, i);
|
||||
tmc_get_registers(stepperZ3, n);
|
||||
#endif
|
||||
#if AXIS_IS_TMC(Z4)
|
||||
tmc_get_registers(stepperZ4, i);
|
||||
tmc_get_registers(stepperZ4, n);
|
||||
#endif
|
||||
}
|
||||
|
||||
if (print_e) {
|
||||
#if AXIS_IS_TMC(I)
|
||||
if (i) tmc_get_registers(stepperI, n);
|
||||
#endif
|
||||
#if AXIS_IS_TMC(J)
|
||||
if (j) tmc_get_registers(stepperJ, n);
|
||||
#endif
|
||||
#if AXIS_IS_TMC(K)
|
||||
if (k) tmc_get_registers(stepperK, n);
|
||||
#endif
|
||||
|
||||
if (TERN0(HAS_EXTRUDERS, e)) {
|
||||
#if AXIS_IS_TMC(E0)
|
||||
tmc_get_registers(stepperE0, i);
|
||||
tmc_get_registers(stepperE0, n);
|
||||
#endif
|
||||
#if AXIS_IS_TMC(E1)
|
||||
tmc_get_registers(stepperE1, i);
|
||||
tmc_get_registers(stepperE1, n);
|
||||
#endif
|
||||
#if AXIS_IS_TMC(E2)
|
||||
tmc_get_registers(stepperE2, i);
|
||||
tmc_get_registers(stepperE2, n);
|
||||
#endif
|
||||
#if AXIS_IS_TMC(E3)
|
||||
tmc_get_registers(stepperE3, i);
|
||||
tmc_get_registers(stepperE3, n);
|
||||
#endif
|
||||
#if AXIS_IS_TMC(E4)
|
||||
tmc_get_registers(stepperE4, i);
|
||||
tmc_get_registers(stepperE4, n);
|
||||
#endif
|
||||
#if AXIS_IS_TMC(E5)
|
||||
tmc_get_registers(stepperE5, i);
|
||||
tmc_get_registers(stepperE5, n);
|
||||
#endif
|
||||
#if AXIS_IS_TMC(E6)
|
||||
tmc_get_registers(stepperE6, i);
|
||||
tmc_get_registers(stepperE6, n);
|
||||
#endif
|
||||
#if AXIS_IS_TMC(E7)
|
||||
tmc_get_registers(stepperE7, i);
|
||||
tmc_get_registers(stepperE7, n);
|
||||
#endif
|
||||
}
|
||||
|
||||
SERIAL_EOL();
|
||||
}
|
||||
|
||||
void tmc_get_registers(bool print_x, bool print_y, bool print_z, bool print_e) {
|
||||
#define _TMC_GET_REG(LABEL, ITEM) do{ SERIAL_ECHOPGM(LABEL); tmc_get_registers(ITEM, print_x, print_y, print_z, print_e); }while(0)
|
||||
void tmc_get_registers(LOGICAL_AXIS_ARGS(bool)) {
|
||||
#define _TMC_GET_REG(LABEL, ITEM) do{ SERIAL_ECHOPGM(LABEL); tmc_get_registers(ITEM, LOGICAL_AXIS_ARGS()); }while(0)
|
||||
#define TMC_GET_REG(NAME, TABS) _TMC_GET_REG(STRINGIFY(NAME) TABS, TMC_GET_##NAME)
|
||||
_TMC_GET_REG("\t", TMC_AXIS_CODES);
|
||||
TMC_GET_REG(GCONF, "\t\t");
|
||||
@@ -1165,6 +1211,15 @@
|
||||
#if AXIS_HAS_SPI(Z4)
|
||||
SET_CS_PIN(Z4);
|
||||
#endif
|
||||
#if AXIS_HAS_SPI(I)
|
||||
SET_CS_PIN(I);
|
||||
#endif
|
||||
#if AXIS_HAS_SPI(J)
|
||||
SET_CS_PIN(J);
|
||||
#endif
|
||||
#if AXIS_HAS_SPI(K)
|
||||
SET_CS_PIN(K);
|
||||
#endif
|
||||
#if AXIS_HAS_SPI(E0)
|
||||
SET_CS_PIN(E0);
|
||||
#endif
|
||||
@@ -1214,10 +1269,10 @@ static bool test_connection(TMC &st) {
|
||||
return test_result;
|
||||
}
|
||||
|
||||
void test_tmc_connection(const bool test_x/*=true*/, const bool test_y/*=true*/, const bool test_z/*=true*/, const bool test_e/*=true*/) {
|
||||
void test_tmc_connection(LOGICAL_AXIS_ARGS(const bool)) {
|
||||
uint8_t axis_connection = 0;
|
||||
|
||||
if (test_x) {
|
||||
if (x) {
|
||||
#if AXIS_IS_TMC(X)
|
||||
axis_connection += test_connection(stepperX);
|
||||
#endif
|
||||
@@ -1226,7 +1281,7 @@ void test_tmc_connection(const bool test_x/*=true*/, const bool test_y/*=true*/,
|
||||
#endif
|
||||
}
|
||||
|
||||
if (test_y) {
|
||||
if (TERN0(HAS_Y_AXIS, y)) {
|
||||
#if AXIS_IS_TMC(Y)
|
||||
axis_connection += test_connection(stepperY);
|
||||
#endif
|
||||
@@ -1235,7 +1290,7 @@ void test_tmc_connection(const bool test_x/*=true*/, const bool test_y/*=true*/,
|
||||
#endif
|
||||
}
|
||||
|
||||
if (test_z) {
|
||||
if (TERN0(HAS_Z_AXIS, z)) {
|
||||
#if AXIS_IS_TMC(Z)
|
||||
axis_connection += test_connection(stepperZ);
|
||||
#endif
|
||||
@@ -1250,7 +1305,17 @@ void test_tmc_connection(const bool test_x/*=true*/, const bool test_y/*=true*/,
|
||||
#endif
|
||||
}
|
||||
|
||||
if (test_e) {
|
||||
#if AXIS_IS_TMC(I)
|
||||
if (i) axis_connection += test_connection(stepperI);
|
||||
#endif
|
||||
#if AXIS_IS_TMC(J)
|
||||
if (j) axis_connection += test_connection(stepperJ);
|
||||
#endif
|
||||
#if AXIS_IS_TMC(K)
|
||||
if (k) axis_connection += test_connection(stepperK);
|
||||
#endif
|
||||
|
||||
if (TERN0(HAS_EXTRUDERS, e)) {
|
||||
#if AXIS_IS_TMC(E0)
|
||||
axis_connection += test_connection(stepperE0);
|
||||
#endif
|
||||
|
||||
@@ -70,15 +70,9 @@ class TMCStorage {
|
||||
}
|
||||
|
||||
struct {
|
||||
#if ENABLED(HAS_STEALTHCHOP)
|
||||
bool stealthChop_enabled = false;
|
||||
#endif
|
||||
#if ENABLED(HYBRID_THRESHOLD)
|
||||
uint8_t hybrid_thrs = 0;
|
||||
#endif
|
||||
#if ENABLED(USE_SENSORLESS)
|
||||
int16_t homing_thrs = 0;
|
||||
#endif
|
||||
OPTCODE(HAS_STEALTHCHOP, bool stealthChop_enabled = false)
|
||||
OPTCODE(HYBRID_THRESHOLD, uint8_t hybrid_thrs = 0)
|
||||
OPTCODE(USE_SENSORLESS, int16_t homing_thrs = 0)
|
||||
} stored;
|
||||
};
|
||||
|
||||
@@ -341,14 +335,14 @@ void tmc_print_current(TMC &st) {
|
||||
#endif
|
||||
|
||||
void monitor_tmc_drivers();
|
||||
void test_tmc_connection(const bool test_x=true, const bool test_y=true, const bool test_z=true, const bool test_e=true);
|
||||
void test_tmc_connection(LOGICAL_AXIS_DECL(const bool, true));
|
||||
|
||||
#if ENABLED(TMC_DEBUG)
|
||||
#if ENABLED(MONITOR_DRIVER_STATUS)
|
||||
void tmc_set_report_interval(const uint16_t update_interval);
|
||||
#endif
|
||||
void tmc_report_all(const bool print_x=true, const bool print_y=true, const bool print_z=true, const bool print_e=true);
|
||||
void tmc_get_registers(const bool print_x, const bool print_y, const bool print_z, const bool print_e);
|
||||
void tmc_report_all(LOGICAL_AXIS_DECL(const bool, true));
|
||||
void tmc_get_registers(LOGICAL_AXIS_ARGS(const bool));
|
||||
#endif
|
||||
|
||||
/**
|
||||
@@ -361,7 +355,7 @@ void test_tmc_connection(const bool test_x=true, const bool test_y=true, const b
|
||||
#if USE_SENSORLESS
|
||||
|
||||
// Track enabled status of stealthChop and only re-enable where applicable
|
||||
struct sensorless_t { bool x, y, z, x2, y2, z2, z3, z4; };
|
||||
struct sensorless_t { bool LINEAR_AXIS_ARGS(), x2, y2, z2, z3, z4; };
|
||||
|
||||
#if ENABLED(IMPROVE_HOMING_RELIABILITY)
|
||||
extern millis_t sg_guard_period;
|
||||
|
||||
@@ -330,12 +330,8 @@ typedef struct {
|
||||
thermalManager.setTargetBed(bed_temp);
|
||||
|
||||
// Wait for the temperature to stabilize
|
||||
if (!thermalManager.wait_for_bed(true
|
||||
#if G26_CLICK_CAN_CANCEL
|
||||
, true
|
||||
#endif
|
||||
)
|
||||
) return G26_ERR;
|
||||
if (!thermalManager.wait_for_bed(true OPTARG(G26_CLICK_CAN_CANCEL, true)))
|
||||
return G26_ERR;
|
||||
}
|
||||
|
||||
#else
|
||||
@@ -352,11 +348,8 @@ typedef struct {
|
||||
thermalManager.setTargetHotend(hotend_temp, active_extruder);
|
||||
|
||||
// Wait for the temperature to stabilize
|
||||
if (!thermalManager.wait_for_hotend(active_extruder, true
|
||||
#if G26_CLICK_CAN_CANCEL
|
||||
, true
|
||||
#endif
|
||||
)) return G26_ERR;
|
||||
if (!thermalManager.wait_for_hotend(active_extruder, true OPTARG(G26_CLICK_CAN_CANCEL, true)))
|
||||
return G26_ERR;
|
||||
|
||||
#if HAS_WIRED_LCD
|
||||
ui.reset_status();
|
||||
|
||||
@@ -689,7 +689,7 @@ G29_TYPE GcodeSuite::G29() {
|
||||
TERN_(HAS_STATUS_MESSAGE, ui.status_printf_P(0, PSTR(S_FMT " %i/3"), GET_TEXT(MSG_PROBING_MESH), int(i + 1)));
|
||||
|
||||
// Retain the last probe position
|
||||
abl.probePos = points[i];
|
||||
abl.probePos = xy_pos_t(points[i]);
|
||||
abl.measured_z = faux ? 0.001 * random(-100, 101) : probe.probe_at_point(abl.probePos, raise_after, abl.verbose_level);
|
||||
if (isnan(abl.measured_z)) {
|
||||
set_bed_leveling_enabled(abl.reenable);
|
||||
@@ -795,7 +795,7 @@ G29_TYPE GcodeSuite::G29() {
|
||||
const int ind = abl.indexIntoAB[xx][yy];
|
||||
xyz_float_t tmp = { abl.eqnAMatrix[ind + 0 * abl.abl_points],
|
||||
abl.eqnAMatrix[ind + 1 * abl.abl_points], 0 };
|
||||
planner.bed_level_matrix.apply_rotation_xyz(tmp);
|
||||
planner.bed_level_matrix.apply_rotation_xyz(tmp.x, tmp.y, tmp.z);
|
||||
if (get_min) NOMORE(min_diff, abl.eqnBVector[ind] - tmp.z);
|
||||
const float subval = get_min ? abl.mean : tmp.z + min_diff,
|
||||
diff = abl.eqnBVector[ind] - subval;
|
||||
|
||||
@@ -321,33 +321,46 @@ void GcodeSuite::G28() {
|
||||
|
||||
#else
|
||||
|
||||
const bool homeZ = parser.seen_test('Z'),
|
||||
needX = homeZ && TERN0(Z_SAFE_HOMING, axes_should_home(_BV(X_AXIS))),
|
||||
needY = homeZ && TERN0(Z_SAFE_HOMING, axes_should_home(_BV(Y_AXIS))),
|
||||
homeX = needX || parser.seen_test('X'), homeY = needY || parser.seen_test('Y'),
|
||||
home_all = homeX == homeY && homeX == homeZ, // All or None
|
||||
doX = home_all || homeX, doY = home_all || homeY, doZ = home_all || homeZ;
|
||||
#define _UNSAFE(A) (homeZ && TERN0(Z_SAFE_HOMING, axes_should_home(_BV(A##_AXIS))))
|
||||
|
||||
#if ENABLED(HOME_Z_FIRST)
|
||||
|
||||
if (doZ) homeaxis(Z_AXIS);
|
||||
const bool homeZ = TERN0(HAS_Z_AXIS, parser.seen_test('Z')),
|
||||
LINEAR_AXIS_LIST( // Other axes should be homed before Z safe-homing
|
||||
needX = _UNSAFE(X), needY = _UNSAFE(Y), needZ = false, // UNUSED
|
||||
needI = _UNSAFE(I), needJ = _UNSAFE(J), needK = _UNSAFE(K)
|
||||
),
|
||||
LINEAR_AXIS_LIST( // Home each axis if needed or flagged
|
||||
homeX = needX || parser.seen_test('X'),
|
||||
homeY = needY || parser.seen_test('Y'),
|
||||
homeZZ = homeZ,
|
||||
homeI = needI || parser.seen_test(AXIS4_NAME), homeJ = needJ || parser.seen_test(AXIS5_NAME), homeK = needK || parser.seen_test(AXIS6_NAME),
|
||||
),
|
||||
home_all = LINEAR_AXIS_GANG( // Home-all if all or none are flagged
|
||||
homeX == homeX, && homeY == homeX, && homeZ == homeX,
|
||||
&& homeI == homeX, && homeJ == homeX, && homeK == homeX
|
||||
),
|
||||
LINEAR_AXIS_LIST(
|
||||
doX = home_all || homeX, doY = home_all || homeY, doZ = home_all || homeZ,
|
||||
doI = home_all || homeI, doJ = home_all || homeJ, doK = home_all || homeK
|
||||
);
|
||||
|
||||
#if HAS_Z_AXIS
|
||||
UNUSED(needZ); UNUSED(homeZZ);
|
||||
#else
|
||||
constexpr bool doZ = false;
|
||||
#endif
|
||||
|
||||
TERN_(HOME_Z_FIRST, if (doZ) homeaxis(Z_AXIS));
|
||||
|
||||
const float z_homing_height = parser.seenval('R') ? parser.value_linear_units() : Z_HOMING_HEIGHT;
|
||||
|
||||
if (z_homing_height && (doX || doY || TERN0(Z_SAFE_HOMING, doZ))) {
|
||||
if (z_homing_height && (0 LINEAR_AXIS_GANG(|| doX, || doY, || TERN0(Z_SAFE_HOMING, doZ), || doI, || doJ, || doK))) {
|
||||
// Raise Z before homing any other axes and z is not already high enough (never lower z)
|
||||
if (DEBUGGING(LEVELING)) DEBUG_ECHOLNPAIR("Raise Z (before homing) by ", z_homing_height);
|
||||
do_z_clearance(z_homing_height);
|
||||
TERN_(BLTOUCH, bltouch.init());
|
||||
}
|
||||
|
||||
#if ENABLED(QUICK_HOME)
|
||||
|
||||
if (doX && doY) quick_home_xy();
|
||||
|
||||
#endif
|
||||
TERN_(QUICK_HOME, if (doX && doY) quick_home_xy());
|
||||
|
||||
// Home Y (before X)
|
||||
if (ENABLED(HOME_Y_BEFORE_X) && (doY || TERN0(CODEPENDENT_XY_HOMING, doX)))
|
||||
@@ -386,7 +399,7 @@ void GcodeSuite::G28() {
|
||||
TERN_(IMPROVE_HOMING_RELIABILITY, end_slow_homing(slow_homing));
|
||||
|
||||
// Home Z last if homing towards the bed
|
||||
#if DISABLED(HOME_Z_FIRST)
|
||||
#if HAS_Z_AXIS && DISABLED(HOME_Z_FIRST)
|
||||
if (doZ) {
|
||||
#if EITHER(Z_MULTI_ENDSTOPS, Z_STEPPER_AUTO_ALIGN)
|
||||
stepper.set_all_z_lock(false);
|
||||
@@ -398,6 +411,16 @@ void GcodeSuite::G28() {
|
||||
}
|
||||
#endif
|
||||
|
||||
#if LINEAR_AXES >= 4
|
||||
if (doI) homeaxis(I_AXIS);
|
||||
#endif
|
||||
#if LINEAR_AXES >= 5
|
||||
if (doJ) homeaxis(J_AXIS);
|
||||
#endif
|
||||
#if LINEAR_AXES >= 6
|
||||
if (doK) homeaxis(K_AXIS);
|
||||
#endif
|
||||
|
||||
sync_plan_position();
|
||||
|
||||
#endif
|
||||
@@ -469,7 +492,16 @@ void GcodeSuite::G28() {
|
||||
#if HAS_CURRENT_HOME(Y2)
|
||||
stepperY2.rms_current(tmc_save_current_Y2);
|
||||
#endif
|
||||
#endif
|
||||
#if HAS_CURRENT_HOME(I)
|
||||
stepperI.rms_current(tmc_save_current_I);
|
||||
#endif
|
||||
#if HAS_CURRENT_HOME(J)
|
||||
stepperJ.rms_current(tmc_save_current_J);
|
||||
#endif
|
||||
#if HAS_CURRENT_HOME(K)
|
||||
stepperK.rms_current(tmc_save_current_K);
|
||||
#endif
|
||||
#endif // HAS_HOMING_CURRENT
|
||||
|
||||
ui.refresh();
|
||||
|
||||
@@ -487,11 +519,13 @@ void GcodeSuite::G28() {
|
||||
// Set L6470 absolute position registers to counts
|
||||
// constexpr *might* move this to PROGMEM.
|
||||
// If not, this will need a PROGMEM directive and an accessor.
|
||||
#define _EN_ITEM(N) , E_AXIS
|
||||
static constexpr AxisEnum L64XX_axis_xref[MAX_L64XX] = {
|
||||
X_AXIS, Y_AXIS, Z_AXIS,
|
||||
X_AXIS, Y_AXIS, Z_AXIS, Z_AXIS,
|
||||
E_AXIS, E_AXIS, E_AXIS, E_AXIS, E_AXIS, E_AXIS
|
||||
LINEAR_AXIS_LIST(X_AXIS, Y_AXIS, Z_AXIS, I_AXIS, J_AXIS, K_AXIS),
|
||||
X_AXIS, Y_AXIS, Z_AXIS, Z_AXIS, Z_AXIS
|
||||
REPEAT(E_STEPPERS, _EN_ITEM)
|
||||
};
|
||||
#undef _EN_ITEM
|
||||
for (uint8_t j = 1; j <= L64XX::chain[0]; j++) {
|
||||
const uint8_t cv = L64XX::chain[j];
|
||||
L64xxManager.set_param((L64XX_axis_t)cv, L6470_ABS_POS, stepper.position(L64XX_axis_xref[cv]));
|
||||
|
||||
@@ -48,6 +48,13 @@
|
||||
#define DEBUG_OUT ENABLED(DEBUG_LEVELING_FEATURE)
|
||||
#include "../../core/debug_out.h"
|
||||
|
||||
#if NUM_Z_STEPPER_DRIVERS >= 3
|
||||
#define TRIPLE_Z 1
|
||||
#if NUM_Z_STEPPER_DRIVERS >= 4
|
||||
#define QUAD_Z 1
|
||||
#endif
|
||||
#endif
|
||||
|
||||
/**
|
||||
* G34: Z-Stepper automatic alignment
|
||||
*
|
||||
@@ -82,9 +89,9 @@ void GcodeSuite::G34() {
|
||||
switch (parser.intval('Z')) {
|
||||
case 1: stepper.set_z1_lock(state); break;
|
||||
case 2: stepper.set_z2_lock(state); break;
|
||||
#if NUM_Z_STEPPER_DRIVERS >= 3
|
||||
#if TRIPLE_Z
|
||||
case 3: stepper.set_z3_lock(state); break;
|
||||
#if NUM_Z_STEPPER_DRIVERS >= 4
|
||||
#if QUAD_Z
|
||||
case 4: stepper.set_z4_lock(state); break;
|
||||
#endif
|
||||
#endif
|
||||
@@ -99,13 +106,6 @@ void GcodeSuite::G34() {
|
||||
#if ENABLED(Z_STEPPER_AUTO_ALIGN)
|
||||
do { // break out on error
|
||||
|
||||
#if NUM_Z_STEPPER_DRIVERS == 4
|
||||
SERIAL_ECHOLNPGM("Alignment for 4 steppers is Experimental!");
|
||||
#elif NUM_Z_STEPPER_DRIVERS > 4
|
||||
SERIAL_ECHOLNPGM("Alignment not supported for over 4 steppers");
|
||||
break;
|
||||
#endif
|
||||
|
||||
const int8_t z_auto_align_iterations = parser.intval('I', Z_STEPPER_ALIGN_ITERATIONS);
|
||||
if (!WITHIN(z_auto_align_iterations, 1, 30)) {
|
||||
SERIAL_ECHOLNPGM("?(I)teration out of bounds (1-30).");
|
||||
@@ -157,16 +157,14 @@ void GcodeSuite::G34() {
|
||||
const xy_pos_t diff = z_stepper_align.xy[i] - z_stepper_align.xy[j];
|
||||
return HYPOT2(diff.x, diff.y);
|
||||
};
|
||||
float z_probe = Z_BASIC_CLEARANCE + (G34_MAX_GRADE) * 0.01f * SQRT(
|
||||
#if NUM_Z_STEPPER_DRIVERS == 3
|
||||
_MAX(magnitude2(0, 1), magnitude2(1, 2), magnitude2(2, 0))
|
||||
#elif NUM_Z_STEPPER_DRIVERS == 4
|
||||
_MAX(magnitude2(0, 1), magnitude2(1, 2), magnitude2(2, 3),
|
||||
magnitude2(3, 0), magnitude2(0, 2), magnitude2(1, 3))
|
||||
#else
|
||||
magnitude2(0, 1)
|
||||
float z_probe = Z_BASIC_CLEARANCE + (G34_MAX_GRADE) * 0.01f * SQRT(_MAX(0, magnitude2(0, 1)
|
||||
#if TRIPLE_Z
|
||||
, magnitude2(2, 1), magnitude2(2, 0)
|
||||
#if QUAD_Z
|
||||
, magnitude2(3, 2), magnitude2(3, 1), magnitude2(3, 0)
|
||||
#endif
|
||||
#endif
|
||||
);
|
||||
));
|
||||
|
||||
// Home before the alignment procedure
|
||||
if (!all_axes_trusted()) home_all_axes();
|
||||
@@ -178,7 +176,7 @@ void GcodeSuite::G34() {
|
||||
// This hack is un-done at the end of G34 - either by re-homing, or by using the probed heights of the last iteration.
|
||||
|
||||
#if DISABLED(Z_STEPPER_ALIGN_KNOWN_STEPPER_POSITIONS)
|
||||
float last_z_align_move[NUM_Z_STEPPER_DRIVERS] = ARRAY_N(NUM_Z_STEPPER_DRIVERS, 10000.0f, 10000.0f, 10000.0f, 10000.0f);
|
||||
float last_z_align_move[NUM_Z_STEPPER_DRIVERS] = ARRAY_N_1(NUM_Z_STEPPER_DRIVERS, 10000.0f);
|
||||
#else
|
||||
float last_z_align_level_indicator = 10000.0f;
|
||||
#endif
|
||||
@@ -280,39 +278,52 @@ void GcodeSuite::G34() {
|
||||
z_measured_min = _MIN(z_measured_min, z_measured[i]);
|
||||
}
|
||||
|
||||
SERIAL_ECHOLNPAIR("CALCULATED STEPPER POSITIONS: Z1=", z_measured[0], " Z2=", z_measured[1], " Z3=", z_measured[2]);
|
||||
SERIAL_ECHOLNPAIR(
|
||||
LIST_N(DOUBLE(NUM_Z_STEPPER_DRIVERS),
|
||||
"Calculated Z1=", z_measured[0],
|
||||
" Z2=", z_measured[1],
|
||||
" Z3=", z_measured[2],
|
||||
" Z4=", z_measured[3]
|
||||
)
|
||||
);
|
||||
#endif
|
||||
|
||||
SERIAL_ECHOLNPAIR("\n"
|
||||
"DIFFERENCE Z1-Z2=", ABS(z_measured[0] - z_measured[1])
|
||||
#if NUM_Z_STEPPER_DRIVERS == 3
|
||||
, " Z2-Z3=", ABS(z_measured[1] - z_measured[2])
|
||||
"Z2-Z1=", ABS(z_measured[1] - z_measured[0])
|
||||
#if TRIPLE_Z
|
||||
, " Z3-Z2=", ABS(z_measured[2] - z_measured[1])
|
||||
, " Z3-Z1=", ABS(z_measured[2] - z_measured[0])
|
||||
#if QUAD_Z
|
||||
, " Z4-Z3=", ABS(z_measured[3] - z_measured[2])
|
||||
, " Z4-Z2=", ABS(z_measured[3] - z_measured[1])
|
||||
, " Z4-Z1=", ABS(z_measured[3] - z_measured[0])
|
||||
#endif
|
||||
#endif
|
||||
);
|
||||
|
||||
#if HAS_STATUS_MESSAGE
|
||||
char fstr1[10];
|
||||
#if NUM_Z_STEPPER_DRIVERS == 2
|
||||
char msg[6 + (6 + 5) * 1 + 1];
|
||||
#else
|
||||
char msg[6 + (6 + 5) * 3 + 1], fstr2[10], fstr3[10];
|
||||
#endif
|
||||
sprintf_P(msg,
|
||||
PSTR("Diffs Z1-Z2=%s"
|
||||
#if NUM_Z_STEPPER_DRIVERS == 3
|
||||
" Z2-Z3=%s"
|
||||
" Z3-Z1=%s"
|
||||
char msg[6 + (6 + 5) * NUM_Z_STEPPER_DRIVERS + 1]
|
||||
#if TRIPLE_Z
|
||||
, fstr2[10], fstr3[10]
|
||||
#if QUAD_Z
|
||||
, fstr4[10], fstr5[10], fstr6[10]
|
||||
#endif
|
||||
), dtostrf(ABS(z_measured[0] - z_measured[1]), 1, 3, fstr1)
|
||||
#if NUM_Z_STEPPER_DRIVERS == 3
|
||||
, dtostrf(ABS(z_measured[1] - z_measured[2]), 1, 3, fstr2)
|
||||
, dtostrf(ABS(z_measured[2] - z_measured[0]), 1, 3, fstr3)
|
||||
#endif
|
||||
;
|
||||
sprintf_P(msg,
|
||||
PSTR("1:2=%s" TERN_(TRIPLE_Z, " 3-2=%s 3-1=%s") TERN_(QUAD_Z, " 4-3=%s 4-2=%s 4-1=%s")),
|
||||
dtostrf(ABS(z_measured[1] - z_measured[0]), 1, 3, fstr1)
|
||||
OPTARG(TRIPLE_Z, dtostrf(ABS(z_measured[2] - z_measured[1]), 1, 3, fstr2))
|
||||
OPTARG(TRIPLE_Z, dtostrf(ABS(z_measured[2] - z_measured[0]), 1, 3, fstr3))
|
||||
OPTARG(QUAD_Z, dtostrf(ABS(z_measured[3] - z_measured[2]), 1, 3, fstr4))
|
||||
OPTARG(QUAD_Z, dtostrf(ABS(z_measured[3] - z_measured[1]), 1, 3, fstr5))
|
||||
OPTARG(QUAD_Z, dtostrf(ABS(z_measured[3] - z_measured[0]), 1, 3, fstr6))
|
||||
);
|
||||
ui.set_status(msg);
|
||||
#endif
|
||||
|
||||
auto decreasing_accuracy = [](const_float_t v1, const_float_t v2){
|
||||
auto decreasing_accuracy = [](const_float_t v1, const_float_t v2) {
|
||||
if (v1 < v2 * 0.7f) {
|
||||
SERIAL_ECHOLNPGM("Decreasing Accuracy Detected.");
|
||||
LCD_MESSAGEPGM(MSG_DECREASING_ACCURACY);
|
||||
@@ -437,7 +448,7 @@ void GcodeSuite::G34() {
|
||||
#endif
|
||||
|
||||
}while(0);
|
||||
#endif
|
||||
#endif // Z_STEPPER_AUTO_ALIGN
|
||||
}
|
||||
|
||||
#endif // Z_MULTI_ENDSTOPS || Z_STEPPER_AUTO_ALIGN
|
||||
|
||||
@@ -73,11 +73,23 @@
|
||||
#if BOTH(CALIBRATION_MEASURE_LEFT, CALIBRATION_MEASURE_RIGHT)
|
||||
#define HAS_X_CENTER 1
|
||||
#endif
|
||||
#if BOTH(CALIBRATION_MEASURE_FRONT, CALIBRATION_MEASURE_BACK)
|
||||
#if HAS_Y_AXIS && BOTH(CALIBRATION_MEASURE_FRONT, CALIBRATION_MEASURE_BACK)
|
||||
#define HAS_Y_CENTER 1
|
||||
#endif
|
||||
#if LINEAR_AXES >= 4 && BOTH(CALIBRATION_MEASURE_IMIN, CALIBRATION_MEASURE_IMAX)
|
||||
#define HAS_I_CENTER 1
|
||||
#endif
|
||||
#if LINEAR_AXES >= 5 && BOTH(CALIBRATION_MEASURE_JMIN, CALIBRATION_MEASURE_JMAX)
|
||||
#define HAS_J_CENTER 1
|
||||
#endif
|
||||
#if LINEAR_AXES >= 6 && BOTH(CALIBRATION_MEASURE_KMIN, CALIBRATION_MEASURE_KMAX)
|
||||
#define HAS_K_CENTER 1
|
||||
#endif
|
||||
|
||||
enum side_t : uint8_t { TOP, RIGHT, FRONT, LEFT, BACK, NUM_SIDES };
|
||||
enum side_t : uint8_t {
|
||||
TOP, RIGHT, FRONT, LEFT, BACK, NUM_SIDES,
|
||||
LIST_N(DOUBLE(SUB3(LINEAR_AXES)), IMINIMUM, IMAXIMUM, JMINIMUM, JMAXIMUM, KMINIMUM, KMAXIMUM)
|
||||
};
|
||||
|
||||
static constexpr xyz_pos_t true_center CALIBRATION_OBJECT_CENTER;
|
||||
static constexpr xyz_float_t dimensions CALIBRATION_OBJECT_DIMENSIONS;
|
||||
@@ -105,7 +117,7 @@ struct measurements_t {
|
||||
#endif
|
||||
|
||||
inline void calibration_move() {
|
||||
do_blocking_move_to(current_position, MMM_TO_MMS(CALIBRATION_FEEDRATE_TRAVEL));
|
||||
do_blocking_move_to((xyz_pos_t)current_position, MMM_TO_MMS(CALIBRATION_FEEDRATE_TRAVEL));
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -174,7 +186,7 @@ float measuring_movement(const AxisEnum axis, const int dir, const bool stop_sta
|
||||
destination = current_position;
|
||||
for (float travel = 0; travel < limit; travel += step) {
|
||||
destination[axis] += dir * step;
|
||||
do_blocking_move_to(destination, mms);
|
||||
do_blocking_move_to((xyz_pos_t)destination, mms);
|
||||
planner.synchronize();
|
||||
if (read_calibration_pin() == stop_state) break;
|
||||
}
|
||||
@@ -209,7 +221,7 @@ inline float measure(const AxisEnum axis, const int dir, const bool stop_state,
|
||||
// Move back to the starting position
|
||||
destination = current_position;
|
||||
destination[axis] = start_pos;
|
||||
do_blocking_move_to(destination, MMM_TO_MMS(CALIBRATION_FEEDRATE_TRAVEL));
|
||||
do_blocking_move_to((xyz_pos_t)destination, MMM_TO_MMS(CALIBRATION_FEEDRATE_TRAVEL));
|
||||
return measured_pos;
|
||||
}
|
||||
|
||||
@@ -230,7 +242,15 @@ inline void probe_side(measurements_t &m, const float uncertainty, const side_t
|
||||
park_above_object(m, uncertainty);
|
||||
|
||||
switch (side) {
|
||||
#if AXIS_CAN_CALIBRATE(Z)
|
||||
#if AXIS_CAN_CALIBRATE(X)
|
||||
case RIGHT: dir = -1;
|
||||
case LEFT: axis = X_AXIS; break;
|
||||
#endif
|
||||
#if LINEAR_AXES >= 2 && AXIS_CAN_CALIBRATE(Y)
|
||||
case BACK: dir = -1;
|
||||
case FRONT: axis = Y_AXIS; break;
|
||||
#endif
|
||||
#if HAS_Z_AXIS && AXIS_CAN_CALIBRATE(Z)
|
||||
case TOP: {
|
||||
const float measurement = measure(Z_AXIS, -1, true, &m.backlash[TOP], uncertainty);
|
||||
m.obj_center.z = measurement - dimensions.z / 2;
|
||||
@@ -238,13 +258,17 @@ inline void probe_side(measurements_t &m, const float uncertainty, const side_t
|
||||
return;
|
||||
}
|
||||
#endif
|
||||
#if AXIS_CAN_CALIBRATE(X)
|
||||
case RIGHT: dir = -1;
|
||||
case LEFT: axis = X_AXIS; break;
|
||||
#if LINEAR_AXES >= 4 && AXIS_CAN_CALIBRATE(I)
|
||||
case IMINIMUM: dir = -1;
|
||||
case IMAXIMUM: axis = I_AXIS; break;
|
||||
#endif
|
||||
#if AXIS_CAN_CALIBRATE(Y)
|
||||
case BACK: dir = -1;
|
||||
case FRONT: axis = Y_AXIS; break;
|
||||
#if LINEAR_AXES >= 5 && AXIS_CAN_CALIBRATE(J)
|
||||
case JMINIMUM: dir = -1;
|
||||
case JMAXIMUM: axis = J_AXIS; break;
|
||||
#endif
|
||||
#if LINEAR_AXES >= 6 && AXIS_CAN_CALIBRATE(K)
|
||||
case KMINIMUM: dir = -1;
|
||||
case KMAXIMUM: axis = K_AXIS; break;
|
||||
#endif
|
||||
default: return;
|
||||
}
|
||||
@@ -289,14 +313,23 @@ inline void probe_sides(measurements_t &m, const float uncertainty) {
|
||||
probe_side(m, uncertainty, TOP);
|
||||
#endif
|
||||
|
||||
TERN_(CALIBRATION_MEASURE_RIGHT, probe_side(m, uncertainty, RIGHT, probe_top_at_edge));
|
||||
TERN_(CALIBRATION_MEASURE_FRONT, probe_side(m, uncertainty, FRONT, probe_top_at_edge));
|
||||
TERN_(CALIBRATION_MEASURE_LEFT, probe_side(m, uncertainty, LEFT, probe_top_at_edge));
|
||||
TERN_(CALIBRATION_MEASURE_BACK, probe_side(m, uncertainty, BACK, probe_top_at_edge));
|
||||
TERN_(CALIBRATION_MEASURE_RIGHT, probe_side(m, uncertainty, RIGHT, probe_top_at_edge));
|
||||
TERN_(CALIBRATION_MEASURE_FRONT, probe_side(m, uncertainty, FRONT, probe_top_at_edge));
|
||||
TERN_(CALIBRATION_MEASURE_LEFT, probe_side(m, uncertainty, LEFT, probe_top_at_edge));
|
||||
TERN_(CALIBRATION_MEASURE_BACK, probe_side(m, uncertainty, BACK, probe_top_at_edge));
|
||||
TERN_(CALIBRATION_MEASURE_IMIN, probe_side(m, uncertainty, IMINIMUM, probe_top_at_edge));
|
||||
TERN_(CALIBRATION_MEASURE_IMAX, probe_side(m, uncertainty, IMAXIMUM, probe_top_at_edge));
|
||||
TERN_(CALIBRATION_MEASURE_JMIN, probe_side(m, uncertainty, JMINIMUM, probe_top_at_edge));
|
||||
TERN_(CALIBRATION_MEASURE_JMAX, probe_side(m, uncertainty, JMAXIMUM, probe_top_at_edge));
|
||||
TERN_(CALIBRATION_MEASURE_KMIN, probe_side(m, uncertainty, KMINIMUM, probe_top_at_edge));
|
||||
TERN_(CALIBRATION_MEASURE_KMAX, probe_side(m, uncertainty, KMAXIMUM, probe_top_at_edge));
|
||||
|
||||
// Compute the measured center of the calibration object.
|
||||
TERN_(HAS_X_CENTER, m.obj_center.x = (m.obj_side[LEFT] + m.obj_side[RIGHT]) / 2);
|
||||
TERN_(HAS_Y_CENTER, m.obj_center.y = (m.obj_side[FRONT] + m.obj_side[BACK]) / 2);
|
||||
TERN_(HAS_X_CENTER, m.obj_center.x = (m.obj_side[LEFT] + m.obj_side[RIGHT]) / 2);
|
||||
TERN_(HAS_Y_CENTER, m.obj_center.y = (m.obj_side[FRONT] + m.obj_side[BACK]) / 2);
|
||||
TERN_(HAS_I_CENTER, m.obj_center.i = (m.obj_side[IMINIMUM] + m.obj_side[IMAXIMUM]) / 2);
|
||||
TERN_(HAS_J_CENTER, m.obj_center.j = (m.obj_side[JMINIMUM] + m.obj_side[JMAXIMUM]) / 2);
|
||||
TERN_(HAS_K_CENTER, m.obj_center.k = (m.obj_side[KMINIMUM] + m.obj_side[KMAXIMUM]) / 2);
|
||||
|
||||
// Compute the outside diameter of the nozzle at the height
|
||||
// at which it makes contact with the calibration object
|
||||
@@ -307,15 +340,20 @@ inline void probe_sides(measurements_t &m, const float uncertainty) {
|
||||
|
||||
// The difference between the known and the measured location
|
||||
// of the calibration object is the positional error
|
||||
m.pos_error.x = TERN0(HAS_X_CENTER, true_center.x - m.obj_center.x);
|
||||
m.pos_error.y = TERN0(HAS_Y_CENTER, true_center.y - m.obj_center.y);
|
||||
m.pos_error.z = true_center.z - m.obj_center.z;
|
||||
LINEAR_AXIS_CODE(
|
||||
m.pos_error.x = TERN0(HAS_X_CENTER, true_center.x - m.obj_center.x),
|
||||
m.pos_error.y = TERN0(HAS_Y_CENTER, true_center.y - m.obj_center.y),
|
||||
m.pos_error.z = true_center.z - m.obj_center.z,
|
||||
m.pos_error.i = TERN0(HAS_I_CENTER, true_center.i - m.obj_center.i),
|
||||
m.pos_error.j = TERN0(HAS_J_CENTER, true_center.j - m.obj_center.j),
|
||||
m.pos_error.k = TERN0(HAS_K_CENTER, true_center.k - m.obj_center.k)
|
||||
);
|
||||
}
|
||||
|
||||
#if ENABLED(CALIBRATION_REPORTING)
|
||||
inline void report_measured_faces(const measurements_t &m) {
|
||||
SERIAL_ECHOLNPGM("Sides:");
|
||||
#if AXIS_CAN_CALIBRATE(Z)
|
||||
#if HAS_Z_AXIS && AXIS_CAN_CALIBRATE(Z)
|
||||
SERIAL_ECHOLNPAIR(" Top: ", m.obj_side[TOP]);
|
||||
#endif
|
||||
#if ENABLED(CALIBRATION_MEASURE_LEFT)
|
||||
@@ -324,11 +362,37 @@ inline void probe_sides(measurements_t &m, const float uncertainty) {
|
||||
#if ENABLED(CALIBRATION_MEASURE_RIGHT)
|
||||
SERIAL_ECHOLNPAIR(" Right: ", m.obj_side[RIGHT]);
|
||||
#endif
|
||||
#if ENABLED(CALIBRATION_MEASURE_FRONT)
|
||||
SERIAL_ECHOLNPAIR(" Front: ", m.obj_side[FRONT]);
|
||||
#if HAS_Y_AXIS
|
||||
#if ENABLED(CALIBRATION_MEASURE_FRONT)
|
||||
SERIAL_ECHOLNPAIR(" Front: ", m.obj_side[FRONT]);
|
||||
#endif
|
||||
#if ENABLED(CALIBRATION_MEASURE_BACK)
|
||||
SERIAL_ECHOLNPAIR(" Back: ", m.obj_side[BACK]);
|
||||
#endif
|
||||
#endif
|
||||
#if ENABLED(CALIBRATION_MEASURE_BACK)
|
||||
SERIAL_ECHOLNPAIR(" Back: ", m.obj_side[BACK]);
|
||||
#if LINEAR_AXES >= 4
|
||||
#if ENABLED(CALIBRATION_MEASURE_IMIN)
|
||||
SERIAL_ECHOLNPAIR(" " STR_I_MIN ": ", m.obj_side[IMINIMUM]);
|
||||
#endif
|
||||
#if ENABLED(CALIBRATION_MEASURE_IMAX)
|
||||
SERIAL_ECHOLNPAIR(" " STR_I_MAX ": ", m.obj_side[IMAXIMUM]);
|
||||
#endif
|
||||
#endif
|
||||
#if LINEAR_AXES >= 5
|
||||
#if ENABLED(CALIBRATION_MEASURE_JMIN)
|
||||
SERIAL_ECHOLNPAIR(" " STR_J_MIN ": ", m.obj_side[JMINIMUM]);
|
||||
#endif
|
||||
#if ENABLED(CALIBRATION_MEASURE_JMAX)
|
||||
SERIAL_ECHOLNPAIR(" " STR_J_MAX ": ", m.obj_side[JMAXIMUM]);
|
||||
#endif
|
||||
#endif
|
||||
#if LINEAR_AXES >= 6
|
||||
#if ENABLED(CALIBRATION_MEASURE_KMIN)
|
||||
SERIAL_ECHOLNPAIR(" " STR_K_MIN ": ", m.obj_side[KMINIMUM]);
|
||||
#endif
|
||||
#if ENABLED(CALIBRATION_MEASURE_KMAX)
|
||||
SERIAL_ECHOLNPAIR(" " STR_K_MAX ": ", m.obj_side[KMAXIMUM]);
|
||||
#endif
|
||||
#endif
|
||||
SERIAL_EOL();
|
||||
}
|
||||
@@ -342,6 +406,15 @@ inline void probe_sides(measurements_t &m, const float uncertainty) {
|
||||
SERIAL_ECHOLNPAIR_P(SP_Y_STR, m.obj_center.y);
|
||||
#endif
|
||||
SERIAL_ECHOLNPAIR_P(SP_Z_STR, m.obj_center.z);
|
||||
#if HAS_I_CENTER
|
||||
SERIAL_ECHOLNPAIR_P(SP_I_STR, m.obj_center.i);
|
||||
#endif
|
||||
#if HAS_J_CENTER
|
||||
SERIAL_ECHOLNPAIR_P(SP_J_STR, m.obj_center.j);
|
||||
#endif
|
||||
#if HAS_K_CENTER
|
||||
SERIAL_ECHOLNPAIR_P(SP_K_STR, m.obj_center.k);
|
||||
#endif
|
||||
SERIAL_EOL();
|
||||
}
|
||||
|
||||
@@ -355,7 +428,7 @@ inline void probe_sides(measurements_t &m, const float uncertainty) {
|
||||
SERIAL_ECHOLNPAIR(" Right: ", m.backlash[RIGHT]);
|
||||
#endif
|
||||
#endif
|
||||
#if AXIS_CAN_CALIBRATE(Y)
|
||||
#if HAS_Y_AXIS && AXIS_CAN_CALIBRATE(Y)
|
||||
#if ENABLED(CALIBRATION_MEASURE_FRONT)
|
||||
SERIAL_ECHOLNPAIR(" Front: ", m.backlash[FRONT]);
|
||||
#endif
|
||||
@@ -363,9 +436,33 @@ inline void probe_sides(measurements_t &m, const float uncertainty) {
|
||||
SERIAL_ECHOLNPAIR(" Back: ", m.backlash[BACK]);
|
||||
#endif
|
||||
#endif
|
||||
#if AXIS_CAN_CALIBRATE(Z)
|
||||
#if HAS_Z_AXIS && AXIS_CAN_CALIBRATE(Z)
|
||||
SERIAL_ECHOLNPAIR(" Top: ", m.backlash[TOP]);
|
||||
#endif
|
||||
#if LINEAR_AXES >= 4 AXIS_CAN_CALIBRATE(I)
|
||||
#if ENABLED(CALIBRATION_MEASURE_IMIN)
|
||||
SERIAL_ECHOLNPAIR(" " STR_I_MIN ": ", m.backlash[IMINIMUM]);
|
||||
#endif
|
||||
#if ENABLED(CALIBRATION_MEASURE_IMAX)
|
||||
SERIAL_ECHOLNPAIR(" " STR_I_MAX ": ", m.backlash[IMAXIMUM]);
|
||||
#endif
|
||||
#endif
|
||||
#if LINEAR_AXES >= 5 AXIS_CAN_CALIBRATE(J)
|
||||
#if ENABLED(CALIBRATION_MEASURE_JMIN)
|
||||
SERIAL_ECHOLNPAIR(" " STR_J_MIN ": ", m.backlash[JMINIMUM]);
|
||||
#endif
|
||||
#if ENABLED(CALIBRATION_MEASURE_JMAX)
|
||||
SERIAL_ECHOLNPAIR(" " STR_J_MAX ": ", m.backlash[JMAXIMUM]);
|
||||
#endif
|
||||
#endif
|
||||
#if LINEAR_AXES >= 6 AXIS_CAN_CALIBRATE(K)
|
||||
#if ENABLED(CALIBRATION_MEASURE_KMIN)
|
||||
SERIAL_ECHOLNPAIR(" " STR_K_MIN ": ", m.backlash[KMINIMUM]);
|
||||
#endif
|
||||
#if ENABLED(CALIBRATION_MEASURE_KMAX)
|
||||
SERIAL_ECHOLNPAIR(" " STR_K_MAX ": ", m.backlash[KMAXIMUM]);
|
||||
#endif
|
||||
#endif
|
||||
SERIAL_EOL();
|
||||
}
|
||||
|
||||
@@ -373,29 +470,37 @@ inline void probe_sides(measurements_t &m, const float uncertainty) {
|
||||
SERIAL_CHAR('T');
|
||||
SERIAL_ECHO(active_extruder);
|
||||
SERIAL_ECHOLNPGM(" Positional Error:");
|
||||
#if HAS_X_CENTER
|
||||
#if HAS_X_CENTER && AXIS_CAN_CALIBRATE(X)
|
||||
SERIAL_ECHOLNPAIR_P(SP_X_STR, m.pos_error.x);
|
||||
#endif
|
||||
#if HAS_Y_CENTER
|
||||
#if HAS_Y_CENTER && AXIS_CAN_CALIBRATE(Y)
|
||||
SERIAL_ECHOLNPAIR_P(SP_Y_STR, m.pos_error.y);
|
||||
#endif
|
||||
if (AXIS_CAN_CALIBRATE(Z)) SERIAL_ECHOLNPAIR_P(SP_Z_STR, m.pos_error.z);
|
||||
#if HAS_Z_AXIS && AXIS_CAN_CALIBRATE(Z)
|
||||
SERIAL_ECHOLNPAIR_P(SP_Z_STR, m.pos_error.z);
|
||||
#endif
|
||||
#if HAS_I_CENTER && AXIS_CAN_CALIBRATE(I)
|
||||
SERIAL_ECHOLNPAIR_P(SP_I_STR, m.pos_error.i);
|
||||
#endif
|
||||
#if HAS_J_CENTER && AXIS_CAN_CALIBRATE(J)
|
||||
SERIAL_ECHOLNPAIR_P(SP_J_STR, m.pos_error.j);
|
||||
#endif
|
||||
#if HAS_K_CENTER && AXIS_CAN_CALIBRATE(K)
|
||||
SERIAL_ECHOLNPAIR_P(SP_Z_STR, m.pos_error.z);
|
||||
#endif
|
||||
SERIAL_EOL();
|
||||
}
|
||||
|
||||
inline void report_measured_nozzle_dimensions(const measurements_t &m) {
|
||||
SERIAL_ECHOLNPGM("Nozzle Tip Outer Dimensions:");
|
||||
#if HAS_X_CENTER || HAS_Y_CENTER
|
||||
#if HAS_X_CENTER
|
||||
SERIAL_ECHOLNPAIR_P(SP_X_STR, m.nozzle_outer_dimension.x);
|
||||
#endif
|
||||
#if HAS_Y_CENTER
|
||||
SERIAL_ECHOLNPAIR_P(SP_Y_STR, m.nozzle_outer_dimension.y);
|
||||
#endif
|
||||
#else
|
||||
UNUSED(m);
|
||||
#if HAS_X_CENTER
|
||||
SERIAL_ECHOLNPAIR_P(SP_X_STR, m.nozzle_outer_dimension.x);
|
||||
#endif
|
||||
#if HAS_Y_CENTER
|
||||
SERIAL_ECHOLNPAIR_P(SP_Y_STR, m.nozzle_outer_dimension.y);
|
||||
#endif
|
||||
SERIAL_EOL();
|
||||
UNUSED(m);
|
||||
}
|
||||
|
||||
#if HAS_HOTEND_OFFSET
|
||||
@@ -444,8 +549,33 @@ inline void calibrate_backlash(measurements_t &m, const float uncertainty) {
|
||||
backlash.distance_mm.y = m.backlash[BACK];
|
||||
#endif
|
||||
|
||||
if (AXIS_CAN_CALIBRATE(Z)) backlash.distance_mm.z = m.backlash[TOP];
|
||||
#endif
|
||||
TERN_(HAS_Z_AXIS, if (AXIS_CAN_CALIBRATE(Z)) backlash.distance_mm.z = m.backlash[TOP]);
|
||||
|
||||
#if HAS_I_CENTER
|
||||
backlash.distance_mm.i = (m.backlash[IMINIMUM] + m.backlash[IMAXIMUM]) / 2;
|
||||
#elif ENABLED(CALIBRATION_MEASURE_IMIN)
|
||||
backlash.distance_mm.i = m.backlash[IMINIMUM];
|
||||
#elif ENABLED(CALIBRATION_MEASURE_IMAX)
|
||||
backlash.distance_mm.i = m.backlash[IMAXIMUM];
|
||||
#endif
|
||||
|
||||
#if HAS_J_CENTER
|
||||
backlash.distance_mm.j = (m.backlash[JMINIMUM] + m.backlash[JMAXIMUM]) / 2;
|
||||
#elif ENABLED(CALIBRATION_MEASURE_JMIN)
|
||||
backlash.distance_mm.j = m.backlash[JMINIMUM];
|
||||
#elif ENABLED(CALIBRATION_MEASURE_JMAX)
|
||||
backlash.distance_mm.j = m.backlash[JMAXIMUM];
|
||||
#endif
|
||||
|
||||
#if HAS_K_CENTER
|
||||
backlash.distance_mm.k = (m.backlash[KMINIMUM] + m.backlash[KMAXIMUM]) / 2;
|
||||
#elif ENABLED(CALIBRATION_MEASURE_KMIN)
|
||||
backlash.distance_mm.k = m.backlash[KMINIMUM];
|
||||
#elif ENABLED(CALIBRATION_MEASURE_KMAX)
|
||||
backlash.distance_mm.k = m.backlash[KMAXIMUM];
|
||||
#endif
|
||||
|
||||
#endif // BACKLASH_GCODE
|
||||
}
|
||||
|
||||
#if ENABLED(BACKLASH_GCODE)
|
||||
@@ -455,7 +585,10 @@ inline void calibrate_backlash(measurements_t &m, const float uncertainty) {
|
||||
// New scope for TEMPORARY_BACKLASH_CORRECTION
|
||||
TEMPORARY_BACKLASH_CORRECTION(all_on);
|
||||
TEMPORARY_BACKLASH_SMOOTHING(0.0f);
|
||||
const xyz_float_t move = { AXIS_CAN_CALIBRATE(X) * 3, AXIS_CAN_CALIBRATE(Y) * 3, AXIS_CAN_CALIBRATE(Z) * 3 };
|
||||
const xyz_float_t move = LINEAR_AXIS_ARRAY(
|
||||
AXIS_CAN_CALIBRATE(X) * 3, AXIS_CAN_CALIBRATE(Y) * 3, AXIS_CAN_CALIBRATE(Z) * 3,
|
||||
AXIS_CAN_CALIBRATE(I) * 3, AXIS_CAN_CALIBRATE(J) * 3, AXIS_CAN_CALIBRATE(K) * 3
|
||||
);
|
||||
current_position += move; calibration_move();
|
||||
current_position -= move; calibration_move();
|
||||
}
|
||||
@@ -483,11 +616,7 @@ inline void calibrate_toolhead(measurements_t &m, const float uncertainty, const
|
||||
TEMPORARY_BACKLASH_CORRECTION(all_on);
|
||||
TEMPORARY_BACKLASH_SMOOTHING(0.0f);
|
||||
|
||||
#if HAS_MULTI_HOTEND
|
||||
set_nozzle(m, extruder);
|
||||
#else
|
||||
UNUSED(extruder);
|
||||
#endif
|
||||
TERN(HAS_MULTI_HOTEND, set_nozzle(m, extruder), UNUSED(extruder));
|
||||
|
||||
probe_sides(m, uncertainty);
|
||||
|
||||
@@ -506,6 +635,10 @@ inline void calibrate_toolhead(measurements_t &m, const float uncertainty, const
|
||||
if (ENABLED(HAS_Y_CENTER) && AXIS_CAN_CALIBRATE(Y)) update_measurements(m, Y_AXIS);
|
||||
if (AXIS_CAN_CALIBRATE(Z)) update_measurements(m, Z_AXIS);
|
||||
|
||||
TERN_(HAS_I_CENTER, update_measurements(m, I_AXIS));
|
||||
TERN_(HAS_J_CENTER, update_measurements(m, J_AXIS));
|
||||
TERN_(HAS_K_CENTER, update_measurements(m, K_AXIS));
|
||||
|
||||
sync_plan_position();
|
||||
}
|
||||
|
||||
|
||||
@@ -48,10 +48,15 @@ void GcodeSuite::M425() {
|
||||
|
||||
auto axis_can_calibrate = [](const uint8_t a) {
|
||||
switch (a) {
|
||||
default:
|
||||
case X_AXIS: return AXIS_CAN_CALIBRATE(X);
|
||||
case Y_AXIS: return AXIS_CAN_CALIBRATE(Y);
|
||||
case Z_AXIS: return AXIS_CAN_CALIBRATE(Z);
|
||||
default: return false;
|
||||
LINEAR_AXIS_CODE(
|
||||
case X_AXIS: return AXIS_CAN_CALIBRATE(X),
|
||||
case Y_AXIS: return AXIS_CAN_CALIBRATE(Y),
|
||||
case Z_AXIS: return AXIS_CAN_CALIBRATE(Z),
|
||||
case I_AXIS: return AXIS_CAN_CALIBRATE(I),
|
||||
case J_AXIS: return AXIS_CAN_CALIBRATE(J),
|
||||
case K_AXIS: return AXIS_CAN_CALIBRATE(K),
|
||||
);
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
@@ -88,7 +88,7 @@ void GcodeSuite::M201() {
|
||||
|
||||
LOOP_LOGICAL_AXES(i) {
|
||||
if (parser.seenval(axis_codes[i])) {
|
||||
const uint8_t a = (i == E_AXIS ? uint8_t(E_AXIS_N(target_extruder)) : i);
|
||||
const uint8_t a = TERN(HAS_EXTRUDERS, (i == E_AXIS ? uint8_t(E_AXIS_N(target_extruder)) : i), i);
|
||||
planner.set_max_acceleration(a, parser.value_axis_units((AxisEnum)a));
|
||||
}
|
||||
}
|
||||
@@ -106,7 +106,7 @@ void GcodeSuite::M203() {
|
||||
|
||||
LOOP_LOGICAL_AXES(i)
|
||||
if (parser.seenval(axis_codes[i])) {
|
||||
const uint8_t a = (i == E_AXIS ? uint8_t(E_AXIS_N(target_extruder)) : i);
|
||||
const uint8_t a = TERN(HAS_EXTRUDERS, (i == E_AXIS ? uint8_t(E_AXIS_N(target_extruder)) : i), i);
|
||||
planner.set_max_feedrate(a, parser.value_axis_units((AxisEnum)a));
|
||||
}
|
||||
}
|
||||
@@ -154,6 +154,9 @@ void GcodeSuite::M205() {
|
||||
if (parser.seenval('S')) planner.settings.min_feedrate_mm_s = parser.value_linear_units();
|
||||
if (parser.seenval('T')) planner.settings.min_travel_feedrate_mm_s = parser.value_linear_units();
|
||||
#if HAS_JUNCTION_DEVIATION
|
||||
#if HAS_CLASSIC_JERK && (AXIS4_NAME == 'J' || AXIS5_NAME == 'J' || AXIS6_NAME == 'J')
|
||||
#error "Can't set_max_jerk for 'J' axis because 'J' is used for Junction Deviation."
|
||||
#endif
|
||||
if (parser.seenval('J')) {
|
||||
const float junc_dev = parser.value_linear_units();
|
||||
if (WITHIN(junc_dev, 0.01f, 0.3f)) {
|
||||
@@ -165,17 +168,19 @@ void GcodeSuite::M205() {
|
||||
}
|
||||
#endif
|
||||
#if HAS_CLASSIC_JERK
|
||||
if (parser.seenval('X')) planner.set_max_jerk(X_AXIS, parser.value_linear_units());
|
||||
if (parser.seenval('Y')) planner.set_max_jerk(Y_AXIS, parser.value_linear_units());
|
||||
if (parser.seenval('Z')) {
|
||||
planner.set_max_jerk(Z_AXIS, parser.value_linear_units());
|
||||
#if HAS_MESH && DISABLED(LIMITED_JERK_EDITING)
|
||||
if (planner.max_jerk.z <= 0.1f)
|
||||
SERIAL_ECHOLNPGM("WARNING! Low Z Jerk may lead to unwanted pauses.");
|
||||
#endif
|
||||
}
|
||||
#if HAS_CLASSIC_E_JERK
|
||||
if (parser.seenval('E')) planner.set_max_jerk(E_AXIS, parser.value_linear_units());
|
||||
bool seenZ = false;
|
||||
LOGICAL_AXIS_CODE(
|
||||
if (parser.seenval('E')) planner.set_max_jerk(E_AXIS, parser.value_linear_units()),
|
||||
if (parser.seenval('X')) planner.set_max_jerk(X_AXIS, parser.value_linear_units()),
|
||||
if (parser.seenval('Y')) planner.set_max_jerk(Y_AXIS, parser.value_linear_units()),
|
||||
if ((seenZ = parser.seenval('Z'))) planner.set_max_jerk(Z_AXIS, parser.value_linear_units()),
|
||||
if (parser.seenval(AXIS4_NAME)) planner.set_max_jerk(I_AXIS, parser.value_linear_units()),
|
||||
if (parser.seenval(AXIS5_NAME)) planner.set_max_jerk(J_AXIS, parser.value_linear_units()),
|
||||
if (parser.seenval(AXIS6_NAME)) planner.set_max_jerk(K_AXIS, parser.value_linear_units())
|
||||
);
|
||||
#if HAS_MESH && DISABLED(LIMITED_JERK_EDITING)
|
||||
if (seenZ && planner.max_jerk.z <= 0.1f)
|
||||
SERIAL_ECHOLNPGM("WARNING! Low Z Jerk may lead to unwanted pauses.");
|
||||
#endif
|
||||
#endif
|
||||
#endif // HAS_CLASSIC_JERK
|
||||
}
|
||||
|
||||
@@ -25,10 +25,15 @@
|
||||
|
||||
void report_M92(const bool echo=true, const int8_t e=-1) {
|
||||
if (echo) SERIAL_ECHO_START(); else SERIAL_CHAR(' ');
|
||||
SERIAL_ECHOPAIR_P(PSTR(" M92 X"), LINEAR_UNIT(planner.settings.axis_steps_per_mm[X_AXIS]),
|
||||
SP_Y_STR, LINEAR_UNIT(planner.settings.axis_steps_per_mm[Y_AXIS]),
|
||||
SP_Z_STR, LINEAR_UNIT(planner.settings.axis_steps_per_mm[Z_AXIS]));
|
||||
#if DISABLED(DISTINCT_E_FACTORS)
|
||||
SERIAL_ECHOPAIR_P(LIST_N(DOUBLE(LINEAR_AXES),
|
||||
PSTR(" M92 X"), LINEAR_UNIT(planner.settings.axis_steps_per_mm[X_AXIS]),
|
||||
SP_Y_STR, LINEAR_UNIT(planner.settings.axis_steps_per_mm[Y_AXIS]),
|
||||
SP_Z_STR, LINEAR_UNIT(planner.settings.axis_steps_per_mm[Z_AXIS]),
|
||||
SP_I_STR, LINEAR_UNIT(planner.settings.axis_steps_per_mm[I_AXIS]),
|
||||
SP_J_STR, LINEAR_UNIT(planner.settings.axis_steps_per_mm[J_AXIS]),
|
||||
SP_K_STR, LINEAR_UNIT(planner.settings.axis_steps_per_mm[K_AXIS]))
|
||||
);
|
||||
#if HAS_EXTRUDERS && DISABLED(DISTINCT_E_FACTORS)
|
||||
SERIAL_ECHOPAIR_P(SP_E_STR, VOLUMETRIC_UNIT(planner.settings.axis_steps_per_mm[E_AXIS]));
|
||||
#endif
|
||||
SERIAL_EOL();
|
||||
@@ -64,25 +69,28 @@ void GcodeSuite::M92() {
|
||||
if (target_extruder < 0) return;
|
||||
|
||||
// No arguments? Show M92 report.
|
||||
if (!parser.seen("XYZE" TERN_(MAGIC_NUMBERS_GCODE, "HL")))
|
||||
return report_M92(true, target_extruder);
|
||||
if (!parser.seen(
|
||||
LOGICAL_AXIS_GANG("E", "X", "Y", "Z", AXIS4_STR, AXIS5_STR, AXIS6_STR)
|
||||
TERN_(MAGIC_NUMBERS_GCODE, "HL")
|
||||
)) return report_M92(true, target_extruder);
|
||||
|
||||
LOOP_LOGICAL_AXES(i) {
|
||||
if (parser.seenval(axis_codes[i])) {
|
||||
if (i == E_AXIS) {
|
||||
const float value = parser.value_per_axis_units((AxisEnum)(E_AXIS_N(target_extruder)));
|
||||
if (value < 20) {
|
||||
float factor = planner.settings.axis_steps_per_mm[E_AXIS_N(target_extruder)] / value; // increase e constants if M92 E14 is given for netfab.
|
||||
#if HAS_CLASSIC_JERK && HAS_CLASSIC_E_JERK
|
||||
planner.max_jerk.e *= factor;
|
||||
#endif
|
||||
planner.settings.max_feedrate_mm_s[E_AXIS_N(target_extruder)] *= factor;
|
||||
planner.max_acceleration_steps_per_s2[E_AXIS_N(target_extruder)] *= factor;
|
||||
}
|
||||
planner.settings.axis_steps_per_mm[E_AXIS_N(target_extruder)] = value;
|
||||
}
|
||||
else {
|
||||
if (TERN1(HAS_EXTRUDERS, i != E_AXIS))
|
||||
planner.settings.axis_steps_per_mm[i] = parser.value_per_axis_units((AxisEnum)i);
|
||||
else {
|
||||
#if HAS_EXTRUDERS
|
||||
const float value = parser.value_per_axis_units((AxisEnum)(E_AXIS_N(target_extruder)));
|
||||
if (value < 20) {
|
||||
float factor = planner.settings.axis_steps_per_mm[E_AXIS_N(target_extruder)] / value; // increase e constants if M92 E14 is given for netfab.
|
||||
#if HAS_CLASSIC_JERK && HAS_CLASSIC_E_JERK
|
||||
planner.max_jerk.e *= factor;
|
||||
#endif
|
||||
planner.settings.max_feedrate_mm_s[E_AXIS_N(target_extruder)] *= factor;
|
||||
planner.max_acceleration_steps_per_s2[E_AXIS_N(target_extruder)] *= factor;
|
||||
}
|
||||
planner.settings.axis_steps_per_mm[E_AXIS_N(target_extruder)] = value;
|
||||
#endif
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -33,11 +33,16 @@
|
||||
* M17: Enable stepper motors
|
||||
*/
|
||||
void GcodeSuite::M17() {
|
||||
if (parser.seen("XYZE")) {
|
||||
if (parser.seen_test('X')) ENABLE_AXIS_X();
|
||||
if (parser.seen_test('Y')) ENABLE_AXIS_Y();
|
||||
if (parser.seen_test('Z')) ENABLE_AXIS_Z();
|
||||
if (TERN0(HAS_E_STEPPER_ENABLE, parser.seen_test('E'))) enable_e_steppers();
|
||||
if (parser.seen(LOGICAL_AXIS_GANG("E", "X", "Y", "Z", AXIS4_STR, AXIS5_STR, AXIS6_STR))) {
|
||||
LOGICAL_AXIS_CODE(
|
||||
if (TERN0(HAS_E_STEPPER_ENABLE, parser.seen_test('E'))) enable_e_steppers(),
|
||||
if (parser.seen_test('X')) ENABLE_AXIS_X(),
|
||||
if (parser.seen_test('Y')) ENABLE_AXIS_Y(),
|
||||
if (parser.seen_test('Z')) ENABLE_AXIS_Z(),
|
||||
if (parser.seen_test(AXIS4_NAME)) ENABLE_AXIS_I(),
|
||||
if (parser.seen_test(AXIS5_NAME)) ENABLE_AXIS_J(),
|
||||
if (parser.seen_test(AXIS6_NAME)) ENABLE_AXIS_K()
|
||||
);
|
||||
}
|
||||
else {
|
||||
LCD_MESSAGEPGM(MSG_NO_MOVE);
|
||||
@@ -54,12 +59,17 @@ void GcodeSuite::M18_M84() {
|
||||
stepper_inactive_time = parser.value_millis_from_seconds();
|
||||
}
|
||||
else {
|
||||
if (parser.seen("XYZE")) {
|
||||
if (parser.seen(LOGICAL_AXIS_GANG("E", "X", "Y", "Z", AXIS4_STR, AXIS5_STR, AXIS6_STR))) {
|
||||
planner.synchronize();
|
||||
if (parser.seen_test('X')) DISABLE_AXIS_X();
|
||||
if (parser.seen_test('Y')) DISABLE_AXIS_Y();
|
||||
if (parser.seen_test('Z')) DISABLE_AXIS_Z();
|
||||
if (TERN0(HAS_E_STEPPER_ENABLE, parser.seen_test('E'))) disable_e_steppers();
|
||||
LOGICAL_AXIS_CODE(
|
||||
if (TERN0(HAS_E_STEPPER_ENABLE, parser.seen_test('E'))) disable_e_steppers(),
|
||||
if (parser.seen_test('X')) DISABLE_AXIS_X(),
|
||||
if (parser.seen_test('Y')) DISABLE_AXIS_Y(),
|
||||
if (parser.seen_test('Z')) DISABLE_AXIS_Z(),
|
||||
if (parser.seen_test(AXIS4_NAME)) DISABLE_AXIS_I(),
|
||||
if (parser.seen_test(AXIS5_NAME)) DISABLE_AXIS_J(),
|
||||
if (parser.seen_test(AXIS6_NAME)) DISABLE_AXIS_K()
|
||||
);
|
||||
}
|
||||
else
|
||||
planner.finish_and_disable();
|
||||
|
||||
@@ -70,26 +70,12 @@
|
||||
dual_x_carriage_mode = (DualXMode)parser.value_byte();
|
||||
idex_set_mirrored_mode(false);
|
||||
|
||||
if (dual_x_carriage_mode == DXC_MIRRORED_MODE) {
|
||||
if (previous_mode != DXC_DUPLICATION_MODE) {
|
||||
SERIAL_ECHOLNPGM("Printer must be in DXC_DUPLICATION_MODE prior to ");
|
||||
SERIAL_ECHOLNPGM("specifying DXC_MIRRORED_MODE.");
|
||||
dual_x_carriage_mode = DEFAULT_DUAL_X_CARRIAGE_MODE;
|
||||
return;
|
||||
}
|
||||
idex_set_mirrored_mode(true);
|
||||
float x_jog = current_position.x - .1;
|
||||
for (uint8_t i = 2; --i;) {
|
||||
planner.buffer_line(x_jog, current_position.y, current_position.z, current_position.e, feedrate_mm_s, 0);
|
||||
x_jog += .1;
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
switch (dual_x_carriage_mode) {
|
||||
|
||||
case DXC_FULL_CONTROL_MODE:
|
||||
case DXC_AUTO_PARK_MODE:
|
||||
break;
|
||||
|
||||
case DXC_DUPLICATION_MODE:
|
||||
// Set the X offset, but no less than the safety gap
|
||||
if (parser.seen('X')) duplicate_extruder_x_offset = _MAX(parser.value_linear_units(), (X2_MIN_POS) - (X1_MIN_POS));
|
||||
@@ -97,10 +83,29 @@
|
||||
// Always switch back to tool 0
|
||||
if (active_extruder != 0) tool_change(0);
|
||||
break;
|
||||
|
||||
case DXC_MIRRORED_MODE: {
|
||||
if (previous_mode != DXC_DUPLICATION_MODE) {
|
||||
SERIAL_ECHOLNPGM("Printer must be in DXC_DUPLICATION_MODE prior to ");
|
||||
SERIAL_ECHOLNPGM("specifying DXC_MIRRORED_MODE.");
|
||||
dual_x_carriage_mode = DEFAULT_DUAL_X_CARRIAGE_MODE;
|
||||
return;
|
||||
}
|
||||
idex_set_mirrored_mode(true);
|
||||
|
||||
// Do a small 'jog' motion in the X axis
|
||||
xyze_pos_t dest = current_position; dest.x -= 0.1f;
|
||||
for (uint8_t i = 2; --i;) {
|
||||
planner.buffer_line(dest, feedrate_mm_s, 0);
|
||||
dest.x += 0.1f;
|
||||
}
|
||||
} return;
|
||||
|
||||
default:
|
||||
dual_x_carriage_mode = DEFAULT_DUAL_X_CARRIAGE_MODE;
|
||||
break;
|
||||
}
|
||||
|
||||
idex_set_parked(false);
|
||||
set_duplication_enabled(false);
|
||||
|
||||
|
||||
@@ -252,58 +252,67 @@ void GcodeSuite::M906() {
|
||||
if (index == 1) L6470_SET_KVAL_HOLD(X2);
|
||||
#endif
|
||||
break;
|
||||
case Y_AXIS:
|
||||
#if AXIS_IS_L64XX(Y)
|
||||
if (index == 0) L6470_SET_KVAL_HOLD(Y);
|
||||
#endif
|
||||
#if AXIS_IS_L64XX(Y2)
|
||||
if (index == 1) L6470_SET_KVAL_HOLD(Y2);
|
||||
#endif
|
||||
break;
|
||||
case Z_AXIS:
|
||||
#if AXIS_IS_L64XX(Z)
|
||||
if (index == 0) L6470_SET_KVAL_HOLD(Z);
|
||||
#endif
|
||||
#if AXIS_IS_L64XX(Z2)
|
||||
if (index == 1) L6470_SET_KVAL_HOLD(Z2);
|
||||
#endif
|
||||
#if AXIS_IS_L64XX(Z3)
|
||||
if (index == 2) L6470_SET_KVAL_HOLD(Z3);
|
||||
#endif
|
||||
#if AXIS_DRIVER_TYPE_Z4(L6470)
|
||||
if (index == 3) L6470_SET_KVAL_HOLD(Z4);
|
||||
#endif
|
||||
break;
|
||||
case E_AXIS: {
|
||||
const int8_t target_extruder = get_target_extruder_from_command();
|
||||
if (target_extruder < 0) return;
|
||||
switch (target_extruder) {
|
||||
#if AXIS_IS_L64XX(E0)
|
||||
case 0: L6470_SET_KVAL_HOLD(E0); break;
|
||||
|
||||
#if HAS_Y_AXIS
|
||||
case Y_AXIS:
|
||||
#if AXIS_IS_L64XX(Y)
|
||||
if (index == 0) L6470_SET_KVAL_HOLD(Y);
|
||||
#endif
|
||||
#if AXIS_IS_L64XX(E1)
|
||||
case 1: L6470_SET_KVAL_HOLD(E1); break;
|
||||
#if AXIS_IS_L64XX(Y2)
|
||||
if (index == 1) L6470_SET_KVAL_HOLD(Y2);
|
||||
#endif
|
||||
#if AXIS_IS_L64XX(E2)
|
||||
case 2: L6470_SET_KVAL_HOLD(E2); break;
|
||||
break;
|
||||
#endif
|
||||
|
||||
#if HAS_Z_AXIS
|
||||
case Z_AXIS:
|
||||
#if AXIS_IS_L64XX(Z)
|
||||
if (index == 0) L6470_SET_KVAL_HOLD(Z);
|
||||
#endif
|
||||
#if AXIS_IS_L64XX(E3)
|
||||
case 3: L6470_SET_KVAL_HOLD(E3); break;
|
||||
#if AXIS_IS_L64XX(Z2)
|
||||
if (index == 1) L6470_SET_KVAL_HOLD(Z2);
|
||||
#endif
|
||||
#if AXIS_IS_L64XX(E4)
|
||||
case 4: L6470_SET_KVAL_HOLD(E4); break;
|
||||
#if AXIS_IS_L64XX(Z3)
|
||||
if (index == 2) L6470_SET_KVAL_HOLD(Z3);
|
||||
#endif
|
||||
#if AXIS_IS_L64XX(E5)
|
||||
case 5: L6470_SET_KVAL_HOLD(E5); break;
|
||||
#if AXIS_DRIVER_TYPE_Z4(L6470)
|
||||
if (index == 3) L6470_SET_KVAL_HOLD(Z4);
|
||||
#endif
|
||||
#if AXIS_IS_L64XX(E6)
|
||||
case 6: L6470_SET_KVAL_HOLD(E6); break;
|
||||
#endif
|
||||
#if AXIS_IS_L64XX(E7)
|
||||
case 7: L6470_SET_KVAL_HOLD(E7); break;
|
||||
#endif
|
||||
}
|
||||
} break;
|
||||
break;
|
||||
#endif
|
||||
|
||||
#if HAS_EXTRUDERS
|
||||
case E_AXIS: {
|
||||
const int8_t target_extruder = get_target_extruder_from_command();
|
||||
if (target_extruder < 0) return;
|
||||
switch (target_extruder) {
|
||||
#if AXIS_IS_L64XX(E0)
|
||||
case 0: L6470_SET_KVAL_HOLD(E0); break;
|
||||
#endif
|
||||
#if AXIS_IS_L64XX(E1)
|
||||
case 1: L6470_SET_KVAL_HOLD(E1); break;
|
||||
#endif
|
||||
#if AXIS_IS_L64XX(E2)
|
||||
case 2: L6470_SET_KVAL_HOLD(E2); break;
|
||||
#endif
|
||||
#if AXIS_IS_L64XX(E3)
|
||||
case 3: L6470_SET_KVAL_HOLD(E3); break;
|
||||
#endif
|
||||
#if AXIS_IS_L64XX(E4)
|
||||
case 4: L6470_SET_KVAL_HOLD(E4); break;
|
||||
#endif
|
||||
#if AXIS_IS_L64XX(E5)
|
||||
case 5: L6470_SET_KVAL_HOLD(E5); break;
|
||||
#endif
|
||||
#if AXIS_IS_L64XX(E6)
|
||||
case 6: L6470_SET_KVAL_HOLD(E6); break;
|
||||
#endif
|
||||
#if AXIS_IS_L64XX(E7)
|
||||
case 7: L6470_SET_KVAL_HOLD(E7); break;
|
||||
#endif
|
||||
}
|
||||
} break;
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -66,12 +66,12 @@ void GcodeSuite::M150() {
|
||||
#endif
|
||||
#endif
|
||||
|
||||
const LEDColor color = MakeLEDColor(
|
||||
const LEDColor color = LEDColor(
|
||||
parser.seen('R') ? (parser.has_value() ? parser.value_byte() : 255) : 0,
|
||||
parser.seen('U') ? (parser.has_value() ? parser.value_byte() : 255) : 0,
|
||||
parser.seen('B') ? (parser.has_value() ? parser.value_byte() : 255) : 0,
|
||||
parser.seen('W') ? (parser.has_value() ? parser.value_byte() : 255) : 0,
|
||||
parser.seen('P') ? (parser.has_value() ? parser.value_byte() : 255) : brightness
|
||||
parser.seen('B') ? (parser.has_value() ? parser.value_byte() : 255) : 0
|
||||
OPTARG(HAS_WHITE_LED, parser.seen('W') ? (parser.has_value() ? parser.value_byte() : 255) : 0)
|
||||
OPTARG(NEOPIXEL_LED, parser.seen('P') ? (parser.has_value() ? parser.value_byte() : 255) : brightness)
|
||||
);
|
||||
|
||||
#if ENABLED(NEOPIXEL2_SEPARATE)
|
||||
|
||||
@@ -47,12 +47,13 @@ void GcodeSuite::G60() {
|
||||
SBI(saved_slots[slot >> 3], slot & 0x07);
|
||||
|
||||
#if ENABLED(SAVED_POSITIONS_DEBUG)
|
||||
const xyze_pos_t &pos = stored_position[slot];
|
||||
DEBUG_ECHOPAIR(STR_SAVED_POS " S", slot);
|
||||
DEBUG_ECHOPAIR_F(" : X", pos.x);
|
||||
DEBUG_ECHOPAIR_F_P(SP_Y_STR, pos.y);
|
||||
DEBUG_ECHOPAIR_F_P(SP_Z_STR, pos.z);
|
||||
DEBUG_ECHOLNPAIR_F_P(SP_E_STR, pos.e);
|
||||
const xyze_pos_t &pos = stored_position[slot];
|
||||
DEBUG_ECHOLNPAIR_F_P(
|
||||
LIST_N(DOUBLE(LOGICAL_AXES), SP_E_STR, pos.e,
|
||||
PSTR(" : X"), pos.x, SP_Y_STR, pos.y, SP_Z_STR, pos.z,
|
||||
SP_I_STR, pos.i, SP_J_STR, pos.j, SP_K_STR, pos.k)
|
||||
);
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
@@ -37,8 +37,7 @@
|
||||
*
|
||||
* F<rate> - Feedrate (optional) for the move back.
|
||||
* S<slot> - Slot # (0-based) to restore from (default 0).
|
||||
* X Y Z - Axes to restore. At least one is required.
|
||||
* E - Restore extruder position
|
||||
* X Y Z E - Axes to restore. At least one is required.
|
||||
*
|
||||
* If XYZE are not given, default restore uses the smart blocking move.
|
||||
*/
|
||||
@@ -46,7 +45,7 @@ void GcodeSuite::G61(void) {
|
||||
|
||||
const uint8_t slot = parser.byteval('S');
|
||||
|
||||
#define SYNC_E(POINT) planner.set_e_position_mm((destination.e = current_position.e = (POINT)))
|
||||
#define SYNC_E(POINT) TERN_(HAS_EXTRUDERS, planner.set_e_position_mm((destination.e = current_position.e = (POINT))))
|
||||
|
||||
#if SAVED_POSITIONS < 256
|
||||
if (slot >= SAVED_POSITIONS) {
|
||||
@@ -69,7 +68,7 @@ void GcodeSuite::G61(void) {
|
||||
SYNC_E(stored_position[slot].e);
|
||||
}
|
||||
else {
|
||||
if (parser.seen("XYZ")) {
|
||||
if (parser.seen(LINEAR_AXIS_GANG("X", "Y", "Z", AXIS4_STR, AXIS5_STR, AXIS6_STR))) {
|
||||
DEBUG_ECHOPAIR(STR_RESTORING_POS " S", slot);
|
||||
LOOP_LINEAR_AXES(i) {
|
||||
destination[i] = parser.seen(AXIS_CHAR(i))
|
||||
@@ -82,10 +81,12 @@ void GcodeSuite::G61(void) {
|
||||
// Move to the saved position
|
||||
prepare_line_to_destination();
|
||||
}
|
||||
if (parser.seen_test('E')) {
|
||||
DEBUG_ECHOLNPAIR(STR_RESTORING_POS " S", slot, " E", current_position.e, "=>", stored_position[slot].e);
|
||||
SYNC_E(stored_position[slot].e);
|
||||
}
|
||||
#if HAS_EXTRUDERS
|
||||
if (parser.seen_test('E')) {
|
||||
DEBUG_ECHOLNPAIR(STR_RESTORING_POS " S", slot, " E", current_position.e, "=>", stored_position[slot].e);
|
||||
SYNC_E(stored_position[slot].e);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
feedrate_mm_s = saved_feedrate;
|
||||
|
||||
@@ -35,7 +35,7 @@ void GcodeSuite::M122() {
|
||||
xyze_bool_t print_axis = ARRAY_N_1(LOGICAL_AXES, false);
|
||||
|
||||
bool print_all = true;
|
||||
LOOP_LOGICAL_AXES(i) if (parser.seen(axis_codes[i])) { print_axis[i] = true; print_all = false; }
|
||||
LOOP_LOGICAL_AXES(i) if (parser.seen_test(axis_codes[i])) { print_axis[i] = true; print_all = false; }
|
||||
|
||||
if (print_all) LOOP_LOGICAL_AXES(i) print_axis[i] = true;
|
||||
|
||||
@@ -50,12 +50,12 @@ void GcodeSuite::M122() {
|
||||
#endif
|
||||
|
||||
if (parser.seen_test('V'))
|
||||
tmc_get_registers(print_axis.x, print_axis.y, print_axis.z, print_axis.e);
|
||||
tmc_get_registers(LOGICAL_AXIS_ELEM(print_axis));
|
||||
else
|
||||
tmc_report_all(print_axis.x, print_axis.y, print_axis.z, print_axis.e);
|
||||
tmc_report_all(LOGICAL_AXIS_ELEM(print_axis));
|
||||
#endif
|
||||
|
||||
test_tmc_connection(print_axis.x, print_axis.y, print_axis.z, print_axis.e);
|
||||
test_tmc_connection(LOGICAL_AXIS_ELEM(print_axis));
|
||||
}
|
||||
|
||||
#endif // HAS_TRINAMIC_CONFIG
|
||||
|
||||
@@ -43,129 +43,83 @@ void tmc_set_stealthChop(TMC &st, const bool enable) {
|
||||
static void set_stealth_status(const bool enable, const int8_t target_extruder) {
|
||||
#define TMC_SET_STEALTH(Q) tmc_set_stealthChop(stepper##Q, enable)
|
||||
|
||||
#if AXIS_HAS_STEALTHCHOP(X) || AXIS_HAS_STEALTHCHOP(X2) \
|
||||
|| AXIS_HAS_STEALTHCHOP(Y) || AXIS_HAS_STEALTHCHOP(Y2) \
|
||||
|| AXIS_HAS_STEALTHCHOP(Z) || AXIS_HAS_STEALTHCHOP(Z2) \
|
||||
|| AXIS_HAS_STEALTHCHOP(Z3) || AXIS_HAS_STEALTHCHOP(Z4)
|
||||
#if X_HAS_STEALTHCHOP || Y_HAS_STEALTHCHOP || Z_HAS_STEALTHCHOP \
|
||||
|| I_HAS_STEALTHCHOP || J_HAS_STEALTHCHOP || K_HAS_STEALTHCHOP \
|
||||
|| X2_HAS_STEALTHCHOP || Y2_HAS_STEALTHCHOP || Z2_HAS_STEALTHCHOP || Z3_HAS_STEALTHCHOP || Z4_HAS_STEALTHCHOP
|
||||
const uint8_t index = parser.byteval('I');
|
||||
#endif
|
||||
|
||||
LOOP_LOGICAL_AXES(i) if (parser.seen(axis_codes[i])) {
|
||||
switch (i) {
|
||||
case X_AXIS:
|
||||
#if AXIS_HAS_STEALTHCHOP(X)
|
||||
if (index == 0) TMC_SET_STEALTH(X);
|
||||
#endif
|
||||
#if AXIS_HAS_STEALTHCHOP(X2)
|
||||
if (index == 1) TMC_SET_STEALTH(X2);
|
||||
#endif
|
||||
TERN_(X_HAS_STEALTHCHOP, if (index == 0) TMC_SET_STEALTH(X));
|
||||
TERN_(X2_HAS_STEALTHCHOP, if (index == 1) TMC_SET_STEALTH(X2));
|
||||
break;
|
||||
case Y_AXIS:
|
||||
#if AXIS_HAS_STEALTHCHOP(Y)
|
||||
if (index == 0) TMC_SET_STEALTH(Y);
|
||||
#endif
|
||||
#if AXIS_HAS_STEALTHCHOP(Y2)
|
||||
if (index == 1) TMC_SET_STEALTH(Y2);
|
||||
#endif
|
||||
break;
|
||||
case Z_AXIS:
|
||||
#if AXIS_HAS_STEALTHCHOP(Z)
|
||||
if (index == 0) TMC_SET_STEALTH(Z);
|
||||
#endif
|
||||
#if AXIS_HAS_STEALTHCHOP(Z2)
|
||||
if (index == 1) TMC_SET_STEALTH(Z2);
|
||||
#endif
|
||||
#if AXIS_HAS_STEALTHCHOP(Z3)
|
||||
if (index == 2) TMC_SET_STEALTH(Z3);
|
||||
#endif
|
||||
#if AXIS_HAS_STEALTHCHOP(Z4)
|
||||
if (index == 3) TMC_SET_STEALTH(Z4);
|
||||
#endif
|
||||
break;
|
||||
case E_AXIS: {
|
||||
if (target_extruder < 0) return;
|
||||
switch (target_extruder) {
|
||||
#if AXIS_HAS_STEALTHCHOP(E0)
|
||||
case 0: TMC_SET_STEALTH(E0); break;
|
||||
#endif
|
||||
#if AXIS_HAS_STEALTHCHOP(E1)
|
||||
case 1: TMC_SET_STEALTH(E1); break;
|
||||
#endif
|
||||
#if AXIS_HAS_STEALTHCHOP(E2)
|
||||
case 2: TMC_SET_STEALTH(E2); break;
|
||||
#endif
|
||||
#if AXIS_HAS_STEALTHCHOP(E3)
|
||||
case 3: TMC_SET_STEALTH(E3); break;
|
||||
#endif
|
||||
#if AXIS_HAS_STEALTHCHOP(E4)
|
||||
case 4: TMC_SET_STEALTH(E4); break;
|
||||
#endif
|
||||
#if AXIS_HAS_STEALTHCHOP(E5)
|
||||
case 5: TMC_SET_STEALTH(E5); break;
|
||||
#endif
|
||||
#if AXIS_HAS_STEALTHCHOP(E6)
|
||||
case 6: TMC_SET_STEALTH(E6); break;
|
||||
#endif
|
||||
#if AXIS_HAS_STEALTHCHOP(E7)
|
||||
case 7: TMC_SET_STEALTH(E7); break;
|
||||
#endif
|
||||
}
|
||||
} break;
|
||||
|
||||
#if HAS_Y_AXIS
|
||||
case Y_AXIS:
|
||||
TERN_(Y_HAS_STEALTHCHOP, if (index == 0) TMC_SET_STEALTH(Y));
|
||||
TERN_(Y2_HAS_STEALTHCHOP, if (index == 1) TMC_SET_STEALTH(Y2));
|
||||
break;
|
||||
#endif
|
||||
|
||||
#if HAS_Z_AXIS
|
||||
case Z_AXIS:
|
||||
TERN_(Z_HAS_STEALTHCHOP, if (index == 0) TMC_SET_STEALTH(Z));
|
||||
TERN_(Z2_HAS_STEALTHCHOP, if (index == 1) TMC_SET_STEALTH(Z2));
|
||||
TERN_(Z3_HAS_STEALTHCHOP, if (index == 2) TMC_SET_STEALTH(Z3));
|
||||
TERN_(Z4_HAS_STEALTHCHOP, if (index == 3) TMC_SET_STEALTH(Z4));
|
||||
break;
|
||||
#endif
|
||||
|
||||
#if I_HAS_STEALTHCHOP
|
||||
case I_AXIS: TMC_SET_STEALTH(I); break;
|
||||
#endif
|
||||
#if J_HAS_STEALTHCHOP
|
||||
case J_AXIS: TMC_SET_STEALTH(J); break;
|
||||
#endif
|
||||
#if K_HAS_STEALTHCHOP
|
||||
case K_AXIS: TMC_SET_STEALTH(K); break;
|
||||
#endif
|
||||
|
||||
#if HAS_EXTRUDERS
|
||||
case E_AXIS: {
|
||||
if (target_extruder < 0) return;
|
||||
OPTCODE(E0_HAS_STEALTHCHOP, else if (target_extruder == 0) TMC_SET_STEALTH(E0))
|
||||
OPTCODE(E1_HAS_STEALTHCHOP, else if (target_extruder == 1) TMC_SET_STEALTH(E1))
|
||||
OPTCODE(E2_HAS_STEALTHCHOP, else if (target_extruder == 2) TMC_SET_STEALTH(E2))
|
||||
OPTCODE(E3_HAS_STEALTHCHOP, else if (target_extruder == 3) TMC_SET_STEALTH(E3))
|
||||
OPTCODE(E4_HAS_STEALTHCHOP, else if (target_extruder == 4) TMC_SET_STEALTH(E4))
|
||||
OPTCODE(E5_HAS_STEALTHCHOP, else if (target_extruder == 5) TMC_SET_STEALTH(E5))
|
||||
OPTCODE(E6_HAS_STEALTHCHOP, else if (target_extruder == 6) TMC_SET_STEALTH(E6))
|
||||
OPTCODE(E7_HAS_STEALTHCHOP, else if (target_extruder == 7) TMC_SET_STEALTH(E7))
|
||||
} break;
|
||||
#endif
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static void say_stealth_status() {
|
||||
#define TMC_SAY_STEALTH_STATUS(Q) tmc_say_stealth_status(stepper##Q)
|
||||
|
||||
#if AXIS_HAS_STEALTHCHOP(X)
|
||||
TMC_SAY_STEALTH_STATUS(X);
|
||||
#endif
|
||||
#if AXIS_HAS_STEALTHCHOP(X2)
|
||||
TMC_SAY_STEALTH_STATUS(X2);
|
||||
#endif
|
||||
#if AXIS_HAS_STEALTHCHOP(Y)
|
||||
TMC_SAY_STEALTH_STATUS(Y);
|
||||
#endif
|
||||
#if AXIS_HAS_STEALTHCHOP(Y2)
|
||||
TMC_SAY_STEALTH_STATUS(Y2);
|
||||
#endif
|
||||
#if AXIS_HAS_STEALTHCHOP(Z)
|
||||
TMC_SAY_STEALTH_STATUS(Z);
|
||||
#endif
|
||||
#if AXIS_HAS_STEALTHCHOP(Z2)
|
||||
TMC_SAY_STEALTH_STATUS(Z2);
|
||||
#endif
|
||||
#if AXIS_HAS_STEALTHCHOP(Z3)
|
||||
TMC_SAY_STEALTH_STATUS(Z3);
|
||||
#endif
|
||||
#if AXIS_HAS_STEALTHCHOP(Z4)
|
||||
TMC_SAY_STEALTH_STATUS(Z4);
|
||||
#endif
|
||||
#if AXIS_HAS_STEALTHCHOP(E0)
|
||||
TMC_SAY_STEALTH_STATUS(E0);
|
||||
#endif
|
||||
#if AXIS_HAS_STEALTHCHOP(E1)
|
||||
TMC_SAY_STEALTH_STATUS(E1);
|
||||
#endif
|
||||
#if AXIS_HAS_STEALTHCHOP(E2)
|
||||
TMC_SAY_STEALTH_STATUS(E2);
|
||||
#endif
|
||||
#if AXIS_HAS_STEALTHCHOP(E3)
|
||||
TMC_SAY_STEALTH_STATUS(E3);
|
||||
#endif
|
||||
#if AXIS_HAS_STEALTHCHOP(E4)
|
||||
TMC_SAY_STEALTH_STATUS(E4);
|
||||
#endif
|
||||
#if AXIS_HAS_STEALTHCHOP(E5)
|
||||
TMC_SAY_STEALTH_STATUS(E5);
|
||||
#endif
|
||||
#if AXIS_HAS_STEALTHCHOP(E6)
|
||||
TMC_SAY_STEALTH_STATUS(E6);
|
||||
#endif
|
||||
#if AXIS_HAS_STEALTHCHOP(E7)
|
||||
TMC_SAY_STEALTH_STATUS(E7);
|
||||
#endif
|
||||
OPTCODE( X_HAS_STEALTHCHOP, TMC_SAY_STEALTH_STATUS(X))
|
||||
OPTCODE(X2_HAS_STEALTHCHOP, TMC_SAY_STEALTH_STATUS(X2))
|
||||
OPTCODE( Y_HAS_STEALTHCHOP, TMC_SAY_STEALTH_STATUS(Y))
|
||||
OPTCODE(Y2_HAS_STEALTHCHOP, TMC_SAY_STEALTH_STATUS(Y2))
|
||||
OPTCODE( Z_HAS_STEALTHCHOP, TMC_SAY_STEALTH_STATUS(Z))
|
||||
OPTCODE(Z2_HAS_STEALTHCHOP, TMC_SAY_STEALTH_STATUS(Z2))
|
||||
OPTCODE(Z3_HAS_STEALTHCHOP, TMC_SAY_STEALTH_STATUS(Z3))
|
||||
OPTCODE(Z4_HAS_STEALTHCHOP, TMC_SAY_STEALTH_STATUS(Z4))
|
||||
OPTCODE( I_HAS_STEALTHCHOP, TMC_SAY_STEALTH_STATUS(I))
|
||||
OPTCODE( J_HAS_STEALTHCHOP, TMC_SAY_STEALTH_STATUS(J))
|
||||
OPTCODE( K_HAS_STEALTHCHOP, TMC_SAY_STEALTH_STATUS(K))
|
||||
OPTCODE(E0_HAS_STEALTHCHOP, TMC_SAY_STEALTH_STATUS(E0))
|
||||
OPTCODE(E1_HAS_STEALTHCHOP, TMC_SAY_STEALTH_STATUS(E1))
|
||||
OPTCODE(E2_HAS_STEALTHCHOP, TMC_SAY_STEALTH_STATUS(E2))
|
||||
OPTCODE(E3_HAS_STEALTHCHOP, TMC_SAY_STEALTH_STATUS(E3))
|
||||
OPTCODE(E4_HAS_STEALTHCHOP, TMC_SAY_STEALTH_STATUS(E4))
|
||||
OPTCODE(E5_HAS_STEALTHCHOP, TMC_SAY_STEALTH_STATUS(E5))
|
||||
OPTCODE(E6_HAS_STEALTHCHOP, TMC_SAY_STEALTH_STATUS(E6))
|
||||
OPTCODE(E7_HAS_STEALTHCHOP, TMC_SAY_STEALTH_STATUS(E7))
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -48,7 +48,7 @@ void GcodeSuite::M906() {
|
||||
|
||||
bool report = true;
|
||||
|
||||
#if AXIS_IS_TMC(X) || AXIS_IS_TMC(X2) || AXIS_IS_TMC(Y) || AXIS_IS_TMC(Y2) || AXIS_IS_TMC(Z) || AXIS_IS_TMC(Z2) || AXIS_IS_TMC(Z3) || AXIS_IS_TMC(Z4)
|
||||
#if AXIS_IS_TMC(X) || AXIS_IS_TMC(X2) || AXIS_IS_TMC(Y) || AXIS_IS_TMC(Y2) || AXIS_IS_TMC(Z) || AXIS_IS_TMC(Z2) || AXIS_IS_TMC(Z3) || AXIS_IS_TMC(Z4) || AXIS_IS_TMC(I) || AXIS_IS_TMC(J) || AXIS_IS_TMC(K)
|
||||
const uint8_t index = parser.byteval('I');
|
||||
#endif
|
||||
|
||||
@@ -63,58 +63,77 @@ void GcodeSuite::M906() {
|
||||
if (index == 1) TMC_SET_CURRENT(X2);
|
||||
#endif
|
||||
break;
|
||||
case Y_AXIS:
|
||||
#if AXIS_IS_TMC(Y)
|
||||
if (index == 0) TMC_SET_CURRENT(Y);
|
||||
#endif
|
||||
#if AXIS_IS_TMC(Y2)
|
||||
if (index == 1) TMC_SET_CURRENT(Y2);
|
||||
#endif
|
||||
break;
|
||||
case Z_AXIS:
|
||||
#if AXIS_IS_TMC(Z)
|
||||
if (index == 0) TMC_SET_CURRENT(Z);
|
||||
#endif
|
||||
#if AXIS_IS_TMC(Z2)
|
||||
if (index == 1) TMC_SET_CURRENT(Z2);
|
||||
#endif
|
||||
#if AXIS_IS_TMC(Z3)
|
||||
if (index == 2) TMC_SET_CURRENT(Z3);
|
||||
#endif
|
||||
#if AXIS_IS_TMC(Z4)
|
||||
if (index == 3) TMC_SET_CURRENT(Z4);
|
||||
#endif
|
||||
break;
|
||||
case E_AXIS: {
|
||||
const int8_t target_extruder = get_target_extruder_from_command();
|
||||
if (target_extruder < 0) return;
|
||||
switch (target_extruder) {
|
||||
#if AXIS_IS_TMC(E0)
|
||||
case 0: TMC_SET_CURRENT(E0); break;
|
||||
|
||||
#if HAS_Y_AXIS
|
||||
case Y_AXIS:
|
||||
#if AXIS_IS_TMC(Y)
|
||||
if (index == 0) TMC_SET_CURRENT(Y);
|
||||
#endif
|
||||
#if AXIS_IS_TMC(E1)
|
||||
case 1: TMC_SET_CURRENT(E1); break;
|
||||
#if AXIS_IS_TMC(Y2)
|
||||
if (index == 1) TMC_SET_CURRENT(Y2);
|
||||
#endif
|
||||
#if AXIS_IS_TMC(E2)
|
||||
case 2: TMC_SET_CURRENT(E2); break;
|
||||
break;
|
||||
#endif
|
||||
|
||||
#if HAS_Z_AXIS
|
||||
case Z_AXIS:
|
||||
#if AXIS_IS_TMC(Z)
|
||||
if (index == 0) TMC_SET_CURRENT(Z);
|
||||
#endif
|
||||
#if AXIS_IS_TMC(E3)
|
||||
case 3: TMC_SET_CURRENT(E3); break;
|
||||
#if AXIS_IS_TMC(Z2)
|
||||
if (index == 1) TMC_SET_CURRENT(Z2);
|
||||
#endif
|
||||
#if AXIS_IS_TMC(E4)
|
||||
case 4: TMC_SET_CURRENT(E4); break;
|
||||
#if AXIS_IS_TMC(Z3)
|
||||
if (index == 2) TMC_SET_CURRENT(Z3);
|
||||
#endif
|
||||
#if AXIS_IS_TMC(E5)
|
||||
case 5: TMC_SET_CURRENT(E5); break;
|
||||
#if AXIS_IS_TMC(Z4)
|
||||
if (index == 3) TMC_SET_CURRENT(Z4);
|
||||
#endif
|
||||
#if AXIS_IS_TMC(E6)
|
||||
case 6: TMC_SET_CURRENT(E6); break;
|
||||
#endif
|
||||
#if AXIS_IS_TMC(E7)
|
||||
case 7: TMC_SET_CURRENT(E7); break;
|
||||
#endif
|
||||
}
|
||||
} break;
|
||||
break;
|
||||
#endif
|
||||
|
||||
#if AXIS_IS_TMC(I)
|
||||
case I_AXIS: TMC_SET_CURRENT(I); break;
|
||||
#endif
|
||||
#if AXIS_IS_TMC(J)
|
||||
case J_AXIS: TMC_SET_CURRENT(J); break;
|
||||
#endif
|
||||
#if AXIS_IS_TMC(K)
|
||||
case K_AXIS: TMC_SET_CURRENT(K); break;
|
||||
#endif
|
||||
|
||||
#if HAS_EXTRUDERS
|
||||
case E_AXIS: {
|
||||
const int8_t target_extruder = get_target_extruder_from_command();
|
||||
if (target_extruder < 0) return;
|
||||
switch (target_extruder) {
|
||||
#if AXIS_IS_TMC(E0)
|
||||
case 0: TMC_SET_CURRENT(E0); break;
|
||||
#endif
|
||||
#if AXIS_IS_TMC(E1)
|
||||
case 1: TMC_SET_CURRENT(E1); break;
|
||||
#endif
|
||||
#if AXIS_IS_TMC(E2)
|
||||
case 2: TMC_SET_CURRENT(E2); break;
|
||||
#endif
|
||||
#if AXIS_IS_TMC(E3)
|
||||
case 3: TMC_SET_CURRENT(E3); break;
|
||||
#endif
|
||||
#if AXIS_IS_TMC(E4)
|
||||
case 4: TMC_SET_CURRENT(E4); break;
|
||||
#endif
|
||||
#if AXIS_IS_TMC(E5)
|
||||
case 5: TMC_SET_CURRENT(E5); break;
|
||||
#endif
|
||||
#if AXIS_IS_TMC(E6)
|
||||
case 6: TMC_SET_CURRENT(E6); break;
|
||||
#endif
|
||||
#if AXIS_IS_TMC(E7)
|
||||
case 7: TMC_SET_CURRENT(E7); break;
|
||||
#endif
|
||||
}
|
||||
} break;
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
@@ -143,6 +162,15 @@ void GcodeSuite::M906() {
|
||||
#if AXIS_IS_TMC(Z4)
|
||||
TMC_SAY_CURRENT(Z4);
|
||||
#endif
|
||||
#if AXIS_IS_TMC(I)
|
||||
TMC_SAY_CURRENT(I);
|
||||
#endif
|
||||
#if AXIS_IS_TMC(J)
|
||||
TMC_SAY_CURRENT(J);
|
||||
#endif
|
||||
#if AXIS_IS_TMC(K)
|
||||
TMC_SAY_CURRENT(K);
|
||||
#endif
|
||||
#if AXIS_IS_TMC(E0)
|
||||
TMC_SAY_CURRENT(E0);
|
||||
#endif
|
||||
|
||||
@@ -38,18 +38,27 @@
|
||||
#if M91x_USE(X) || M91x_USE(X2)
|
||||
#define M91x_SOME_X 1
|
||||
#endif
|
||||
#if M91x_USE(Y) || M91x_USE(Y2)
|
||||
#if LINEAR_AXES >= 2 && (M91x_USE(Y) || M91x_USE(Y2))
|
||||
#define M91x_SOME_Y 1
|
||||
#endif
|
||||
#if M91x_USE(Z) || M91x_USE(Z2) || M91x_USE(Z3) || M91x_USE(Z4)
|
||||
#if HAS_Z_AXIS && (M91x_USE(Z) || M91x_USE(Z2) || M91x_USE(Z3) || M91x_USE(Z4))
|
||||
#define M91x_SOME_Z 1
|
||||
#endif
|
||||
#if LINEAR_AXES >= 4 && M91x_USE(I)
|
||||
#define M91x_USE_I 1
|
||||
#endif
|
||||
#if LINEAR_AXES >= 5 && M91x_USE(J)
|
||||
#define M91x_USE_J 1
|
||||
#endif
|
||||
#if LINEAR_AXES >= 6 && M91x_USE(K)
|
||||
#define M91x_USE_K 1
|
||||
#endif
|
||||
|
||||
#if M91x_USE_E(0) || M91x_USE_E(1) || M91x_USE_E(2) || M91x_USE_E(3) || M91x_USE_E(4) || M91x_USE_E(5) || M91x_USE_E(6) || M91x_USE_E(7)
|
||||
#define M91x_SOME_E 1
|
||||
#endif
|
||||
|
||||
#if !M91x_SOME_X && !M91x_SOME_Y && !M91x_SOME_Z && !M91x_SOME_E
|
||||
#if !M91x_SOME_X && !M91x_SOME_Y && !M91x_SOME_Z && !M91x_USE_I && !M91x_USE_J && !M91x_USE_K && !M91x_SOME_E
|
||||
#error "MONITOR_DRIVER_STATUS requires at least one TMC2130, 2160, 2208, 2209, 2660, 5130, or 5160."
|
||||
#endif
|
||||
|
||||
@@ -82,6 +91,9 @@
|
||||
#if M91x_USE(Z4)
|
||||
tmc_report_otpw(stepperZ4);
|
||||
#endif
|
||||
TERN_(M91x_USE_I, tmc_report_otpw(stepperI));
|
||||
TERN_(M91x_USE_J, tmc_report_otpw(stepperJ));
|
||||
TERN_(M91x_USE_K, tmc_report_otpw(stepperK));
|
||||
#if M91x_USE_E(0)
|
||||
tmc_report_otpw(stepperE0);
|
||||
#endif
|
||||
@@ -124,9 +136,12 @@
|
||||
const bool hasX = TERN0(M91x_SOME_X, parser.seen(axis_codes.x)),
|
||||
hasY = TERN0(M91x_SOME_Y, parser.seen(axis_codes.y)),
|
||||
hasZ = TERN0(M91x_SOME_Z, parser.seen(axis_codes.z)),
|
||||
hasI = TERN0(M91x_USE_I, parser.seen(axis_codes.i)),
|
||||
hasJ = TERN0(M91x_USE_J, parser.seen(axis_codes.j)),
|
||||
hasK = TERN0(M91x_USE_K, parser.seen(axis_codes.k)),
|
||||
hasE = TERN0(M91x_SOME_E, parser.seen(axis_codes.e));
|
||||
|
||||
const bool hasNone = !hasE && !hasX && !hasY && !hasZ;
|
||||
const bool hasNone = !hasE && !hasX && !hasY && !hasZ && !hasI && !hasJ && !hasK;
|
||||
|
||||
#if M91x_SOME_X
|
||||
const int8_t xval = int8_t(parser.byteval(axis_codes.x, 0xFF));
|
||||
@@ -164,6 +179,19 @@
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#if M91x_USE_I
|
||||
const int8_t ival = int8_t(parser.byteval(axis_codes.i, 0xFF));
|
||||
if (hasNone || ival == 1 || (hasI && ival < 0)) tmc_clear_otpw(stepperI);
|
||||
#endif
|
||||
#if M91x_USE_J
|
||||
const int8_t jval = int8_t(parser.byteval(axis_codes.j, 0xFF));
|
||||
if (hasNone || jval == 1 || (hasJ && jval < 0)) tmc_clear_otpw(stepperJ);
|
||||
#endif
|
||||
#if M91x_USE_K
|
||||
const int8_t kval = int8_t(parser.byteval(axis_codes.k, 0xFF));
|
||||
if (hasNone || kval == 1 || (hasK && kval < 0)) tmc_clear_otpw(stepperK);
|
||||
#endif
|
||||
|
||||
#if M91x_SOME_E
|
||||
const int8_t eval = int8_t(parser.byteval(axis_codes.e, 0xFF));
|
||||
#if M91x_USE_E(0)
|
||||
@@ -206,126 +234,76 @@
|
||||
#define TMC_SET_PWMTHRS_E(E) stepperE##E.set_pwm_thrs(value)
|
||||
|
||||
bool report = true;
|
||||
#if AXIS_IS_TMC(X) || AXIS_IS_TMC(X2) || AXIS_IS_TMC(Y) || AXIS_IS_TMC(Y2) || AXIS_IS_TMC(Z) || AXIS_IS_TMC(Z2) || AXIS_IS_TMC(Z3) || AXIS_IS_TMC(Z4)
|
||||
#if AXIS_IS_TMC(X) || AXIS_IS_TMC(X2) || AXIS_IS_TMC(Y) || AXIS_IS_TMC(Y2) || AXIS_IS_TMC(Z) || AXIS_IS_TMC(Z2) || AXIS_IS_TMC(Z3) || AXIS_IS_TMC(Z4) || AXIS_IS_TMC(I) || AXIS_IS_TMC(J) || AXIS_IS_TMC(K)
|
||||
const uint8_t index = parser.byteval('I');
|
||||
#endif
|
||||
LOOP_LOGICAL_AXES(i) if (int32_t value = parser.longval(axis_codes[i])) {
|
||||
report = false;
|
||||
switch (i) {
|
||||
case X_AXIS:
|
||||
#if AXIS_HAS_STEALTHCHOP(X)
|
||||
if (index < 2) TMC_SET_PWMTHRS(X,X);
|
||||
#endif
|
||||
#if AXIS_HAS_STEALTHCHOP(X2)
|
||||
if (!(index & 1)) TMC_SET_PWMTHRS(X,X2);
|
||||
#endif
|
||||
TERN_(X_HAS_STEALTHCHOP, if (index < 2) TMC_SET_PWMTHRS(X,X));
|
||||
TERN_(X2_HAS_STEALTHCHOP, if (!(index & 1)) TMC_SET_PWMTHRS(X,X2));
|
||||
break;
|
||||
case Y_AXIS:
|
||||
#if AXIS_HAS_STEALTHCHOP(Y)
|
||||
if (index < 2) TMC_SET_PWMTHRS(Y,Y);
|
||||
#endif
|
||||
#if AXIS_HAS_STEALTHCHOP(Y2)
|
||||
if (!(index & 1)) TMC_SET_PWMTHRS(Y,Y2);
|
||||
#endif
|
||||
TERN_(Y_HAS_STEALTHCHOP, if (index < 2) TMC_SET_PWMTHRS(Y,Y));
|
||||
TERN_(Y2_HAS_STEALTHCHOP, if (!(index & 1)) TMC_SET_PWMTHRS(Y,Y2));
|
||||
break;
|
||||
|
||||
#if I_HAS_STEALTHCHOP
|
||||
case I_AXIS: TMC_SET_PWMTHRS(I,I); break;
|
||||
#endif
|
||||
#if J_HAS_STEALTHCHOP
|
||||
case J_AXIS: TMC_SET_PWMTHRS(J,J); break;
|
||||
#endif
|
||||
#if K_HAS_STEALTHCHOP
|
||||
case K_AXIS: TMC_SET_PWMTHRS(K,K); break;
|
||||
#endif
|
||||
|
||||
case Z_AXIS:
|
||||
#if AXIS_HAS_STEALTHCHOP(Z)
|
||||
if (index < 2) TMC_SET_PWMTHRS(Z,Z);
|
||||
#endif
|
||||
#if AXIS_HAS_STEALTHCHOP(Z2)
|
||||
if (index == 0 || index == 2) TMC_SET_PWMTHRS(Z,Z2);
|
||||
#endif
|
||||
#if AXIS_HAS_STEALTHCHOP(Z3)
|
||||
if (index == 0 || index == 3) TMC_SET_PWMTHRS(Z,Z3);
|
||||
#endif
|
||||
#if AXIS_HAS_STEALTHCHOP(Z4)
|
||||
if (index == 0 || index == 4) TMC_SET_PWMTHRS(Z,Z4);
|
||||
#endif
|
||||
TERN_(Z_HAS_STEALTCHOP, if (index < 2) TMC_SET_PWMTHRS(Z,Z));
|
||||
TERN_(Z2_HAS_STEALTCHOP, if (index == 0 || index == 2) TMC_SET_PWMTHRS(Z,Z2));
|
||||
TERN_(Z3_HAS_STEALTCHOP, if (index == 0 || index == 3) TMC_SET_PWMTHRS(Z,Z3));
|
||||
TERN_(Z4_HAS_STEALTCHOP, if (index == 0 || index == 4) TMC_SET_PWMTHRS(Z,Z4));
|
||||
break;
|
||||
case E_AXIS: {
|
||||
#if E_STEPPERS
|
||||
const int8_t target_extruder = get_target_extruder_from_command();
|
||||
if (target_extruder < 0) return;
|
||||
switch (target_extruder) {
|
||||
#if AXIS_HAS_STEALTHCHOP(E0)
|
||||
case 0: TMC_SET_PWMTHRS_E(0); break;
|
||||
#endif
|
||||
#if E_STEPPERS > 1 && AXIS_HAS_STEALTHCHOP(E1)
|
||||
case 1: TMC_SET_PWMTHRS_E(1); break;
|
||||
#endif
|
||||
#if E_STEPPERS > 2 && AXIS_HAS_STEALTHCHOP(E2)
|
||||
case 2: TMC_SET_PWMTHRS_E(2); break;
|
||||
#endif
|
||||
#if E_STEPPERS > 3 && AXIS_HAS_STEALTHCHOP(E3)
|
||||
case 3: TMC_SET_PWMTHRS_E(3); break;
|
||||
#endif
|
||||
#if E_STEPPERS > 4 && AXIS_HAS_STEALTHCHOP(E4)
|
||||
case 4: TMC_SET_PWMTHRS_E(4); break;
|
||||
#endif
|
||||
#if E_STEPPERS > 5 && AXIS_HAS_STEALTHCHOP(E5)
|
||||
case 5: TMC_SET_PWMTHRS_E(5); break;
|
||||
#endif
|
||||
#if E_STEPPERS > 6 && AXIS_HAS_STEALTHCHOP(E6)
|
||||
case 6: TMC_SET_PWMTHRS_E(6); break;
|
||||
#endif
|
||||
#if E_STEPPERS > 7 && AXIS_HAS_STEALTHCHOP(E7)
|
||||
case 7: TMC_SET_PWMTHRS_E(7); break;
|
||||
#endif
|
||||
}
|
||||
TERN_(E0_HAS_STEALTHCHOP, else if (target_extruder == 0) TMC_SET_PWMTHRS_E(0));
|
||||
TERN_(E1_HAS_STEALTHCHOP, else if (target_extruder == 1) TMC_SET_PWMTHRS_E(1));
|
||||
TERN_(E2_HAS_STEALTHCHOP, else if (target_extruder == 2) TMC_SET_PWMTHRS_E(2));
|
||||
TERN_(E3_HAS_STEALTHCHOP, else if (target_extruder == 3) TMC_SET_PWMTHRS_E(3));
|
||||
TERN_(E4_HAS_STEALTHCHOP, else if (target_extruder == 4) TMC_SET_PWMTHRS_E(4));
|
||||
TERN_(E5_HAS_STEALTHCHOP, else if (target_extruder == 5) TMC_SET_PWMTHRS_E(5));
|
||||
TERN_(E6_HAS_STEALTHCHOP, else if (target_extruder == 6) TMC_SET_PWMTHRS_E(6));
|
||||
TERN_(E7_HAS_STEALTHCHOP, else if (target_extruder == 7) TMC_SET_PWMTHRS_E(7));
|
||||
#endif // E_STEPPERS
|
||||
} break;
|
||||
}
|
||||
}
|
||||
|
||||
if (report) {
|
||||
#if AXIS_HAS_STEALTHCHOP(X)
|
||||
TMC_SAY_PWMTHRS(X,X);
|
||||
#endif
|
||||
#if AXIS_HAS_STEALTHCHOP(X2)
|
||||
TMC_SAY_PWMTHRS(X,X2);
|
||||
#endif
|
||||
#if AXIS_HAS_STEALTHCHOP(Y)
|
||||
TMC_SAY_PWMTHRS(Y,Y);
|
||||
#endif
|
||||
#if AXIS_HAS_STEALTHCHOP(Y2)
|
||||
TMC_SAY_PWMTHRS(Y,Y2);
|
||||
#endif
|
||||
#if AXIS_HAS_STEALTHCHOP(Z)
|
||||
TMC_SAY_PWMTHRS(Z,Z);
|
||||
#endif
|
||||
#if AXIS_HAS_STEALTHCHOP(Z2)
|
||||
TMC_SAY_PWMTHRS(Z,Z2);
|
||||
#endif
|
||||
#if AXIS_HAS_STEALTHCHOP(Z3)
|
||||
TMC_SAY_PWMTHRS(Z,Z3);
|
||||
#endif
|
||||
#if AXIS_HAS_STEALTHCHOP(Z4)
|
||||
TMC_SAY_PWMTHRS(Z,Z4);
|
||||
#endif
|
||||
#if E_STEPPERS && AXIS_HAS_STEALTHCHOP(E0)
|
||||
TMC_SAY_PWMTHRS_E(0);
|
||||
#endif
|
||||
#if E_STEPPERS > 1 && AXIS_HAS_STEALTHCHOP(E1)
|
||||
TMC_SAY_PWMTHRS_E(1);
|
||||
#endif
|
||||
#if E_STEPPERS > 2 && AXIS_HAS_STEALTHCHOP(E2)
|
||||
TMC_SAY_PWMTHRS_E(2);
|
||||
#endif
|
||||
#if E_STEPPERS > 3 && AXIS_HAS_STEALTHCHOP(E3)
|
||||
TMC_SAY_PWMTHRS_E(3);
|
||||
#endif
|
||||
#if E_STEPPERS > 4 && AXIS_HAS_STEALTHCHOP(E4)
|
||||
TMC_SAY_PWMTHRS_E(4);
|
||||
#endif
|
||||
#if E_STEPPERS > 5 && AXIS_HAS_STEALTHCHOP(E5)
|
||||
TMC_SAY_PWMTHRS_E(5);
|
||||
#endif
|
||||
#if E_STEPPERS > 6 && AXIS_HAS_STEALTHCHOP(E6)
|
||||
TMC_SAY_PWMTHRS_E(6);
|
||||
#endif
|
||||
#if E_STEPPERS > 7 && AXIS_HAS_STEALTHCHOP(E7)
|
||||
TMC_SAY_PWMTHRS_E(7);
|
||||
#endif
|
||||
TERN_( X_HAS_STEALTHCHOP, TMC_SAY_PWMTHRS(X,X));
|
||||
TERN_(X2_HAS_STEALTHCHOP, TMC_SAY_PWMTHRS(X,X2));
|
||||
TERN_( Y_HAS_STEALTHCHOP, TMC_SAY_PWMTHRS(Y,Y));
|
||||
TERN_(Y2_HAS_STEALTHCHOP, TMC_SAY_PWMTHRS(Y,Y2));
|
||||
TERN_( Z_HAS_STEALTHCHOP, TMC_SAY_PWMTHRS(Z,Z));
|
||||
TERN_(Z2_HAS_STEALTHCHOP, TMC_SAY_PWMTHRS(Z,Z2));
|
||||
TERN_(Z3_HAS_STEALTHCHOP, TMC_SAY_PWMTHRS(Z,Z3));
|
||||
TERN_(Z4_HAS_STEALTHCHOP, TMC_SAY_PWMTHRS(Z,Z4));
|
||||
|
||||
TERN_( I_HAS_STEALTHCHOP, TMC_SAY_PWMTHRS(I,I));
|
||||
TERN_( J_HAS_STEALTHCHOP, TMC_SAY_PWMTHRS(J,J));
|
||||
TERN_( K_HAS_STEALTHCHOP, TMC_SAY_PWMTHRS(K,K));
|
||||
|
||||
TERN_(E0_HAS_STEALTHCHOP, TMC_SAY_PWMTHRS_E(0));
|
||||
TERN_(E1_HAS_STEALTHCHOP, TMC_SAY_PWMTHRS_E(1));
|
||||
TERN_(E2_HAS_STEALTHCHOP, TMC_SAY_PWMTHRS_E(2));
|
||||
TERN_(E3_HAS_STEALTHCHOP, TMC_SAY_PWMTHRS_E(3));
|
||||
TERN_(E4_HAS_STEALTHCHOP, TMC_SAY_PWMTHRS_E(4));
|
||||
TERN_(E5_HAS_STEALTHCHOP, TMC_SAY_PWMTHRS_E(5));
|
||||
TERN_(E6_HAS_STEALTHCHOP, TMC_SAY_PWMTHRS_E(6));
|
||||
TERN_(E7_HAS_STEALTHCHOP, TMC_SAY_PWMTHRS_E(7));
|
||||
}
|
||||
}
|
||||
#endif // HYBRID_THRESHOLD
|
||||
@@ -378,6 +356,15 @@
|
||||
#endif
|
||||
break;
|
||||
#endif
|
||||
#if I_SENSORLESS && AXIS_HAS_STALLGUARD(I)
|
||||
case I_AXIS: stepperI.homing_threshold(value); break;
|
||||
#endif
|
||||
#if J_SENSORLESS && AXIS_HAS_STALLGUARD(J)
|
||||
case J_AXIS: stepperJ.homing_threshold(value); break;
|
||||
#endif
|
||||
#if K_SENSORLESS && AXIS_HAS_STALLGUARD(K)
|
||||
case K_AXIS: stepperK.homing_threshold(value); break;
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
@@ -412,6 +399,15 @@
|
||||
tmc_print_sgt(stepperZ4);
|
||||
#endif
|
||||
#endif
|
||||
#if I_SENSORLESS && AXIS_HAS_STALLGUARD(I)
|
||||
tmc_print_sgt(stepperI);
|
||||
#endif
|
||||
#if J_SENSORLESS && AXIS_HAS_STALLGUARD(J)
|
||||
tmc_print_sgt(stepperJ);
|
||||
#endif
|
||||
#if K_SENSORLESS && AXIS_HAS_STALLGUARD(K)
|
||||
tmc_print_sgt(stepperK);
|
||||
#endif
|
||||
}
|
||||
}
|
||||
#endif // USE_SENSORLESS
|
||||
|
||||
+20
-13
@@ -74,11 +74,14 @@ millis_t GcodeSuite::previous_move_ms = 0,
|
||||
|
||||
// Relative motion mode for each logical axis
|
||||
static constexpr xyze_bool_t ar_init = AXIS_RELATIVE_MODES;
|
||||
uint8_t GcodeSuite::axis_relative = (
|
||||
(ar_init.x ? _BV(REL_X) : 0)
|
||||
| (ar_init.y ? _BV(REL_Y) : 0)
|
||||
| (ar_init.z ? _BV(REL_Z) : 0)
|
||||
| (ar_init.e ? _BV(REL_E) : 0)
|
||||
uint8_t GcodeSuite::axis_relative = 0 LOGICAL_AXIS_GANG(
|
||||
| (ar_init.e << REL_E),
|
||||
| (ar_init.x << REL_X),
|
||||
| (ar_init.y << REL_Y),
|
||||
| (ar_init.z << REL_Z),
|
||||
| (ar_init.i << REL_I),
|
||||
| (ar_init.j << REL_J),
|
||||
| (ar_init.k << REL_K)
|
||||
);
|
||||
|
||||
#if EITHER(HAS_AUTO_REPORTING, HOST_KEEPALIVE_FEATURE)
|
||||
@@ -161,13 +164,15 @@ void GcodeSuite::get_destination_from_command() {
|
||||
destination[i] = current_position[i];
|
||||
}
|
||||
|
||||
// Get new E position, whether absolute or relative
|
||||
if ( (seen.e = parser.seenval('E')) ) {
|
||||
const float v = parser.value_axis_units(E_AXIS);
|
||||
destination.e = axis_is_relative(E_AXIS) ? current_position.e + v : v;
|
||||
}
|
||||
else
|
||||
destination.e = current_position.e;
|
||||
#if HAS_EXTRUDERS
|
||||
// Get new E position, whether absolute or relative
|
||||
if ( (seen.e = parser.seenval('E')) ) {
|
||||
const float v = parser.value_axis_units(E_AXIS);
|
||||
destination.e = axis_is_relative(E_AXIS) ? current_position.e + v : v;
|
||||
}
|
||||
else
|
||||
destination.e = current_position.e;
|
||||
#endif
|
||||
|
||||
#if ENABLED(POWER_LOSS_RECOVERY) && !PIN_EXISTS(POWER_LOSS)
|
||||
// Only update power loss recovery on moves with E
|
||||
@@ -605,7 +610,9 @@ void GcodeSuite::process_parsed_command(const bool no_ok/*=false*/) {
|
||||
case 92: M92(); break; // M92: Set the steps-per-unit for one or more axes
|
||||
case 114: M114(); break; // M114: Report current position
|
||||
case 115: M115(); break; // M115: Report capabilities
|
||||
case 117: M117(); break; // M117: Set LCD message text, if possible
|
||||
|
||||
case 117: TERN_(HAS_STATUS_MESSAGE, M117()); break; // M117: Set LCD message text, if possible
|
||||
|
||||
case 118: M118(); break; // M118: Display a message in the host console
|
||||
case 119: M119(); break; // M119: Report endstop states
|
||||
case 120: M120(); break; // M120: Enable endstops
|
||||
|
||||
+32
-15
@@ -314,7 +314,12 @@
|
||||
#define HAS_FAST_MOVES 1
|
||||
#endif
|
||||
|
||||
enum AxisRelative : uint8_t { REL_X, REL_Y, REL_Z, REL_E, E_MODE_ABS, E_MODE_REL };
|
||||
enum AxisRelative : uint8_t {
|
||||
LOGICAL_AXIS_LIST(REL_E, REL_X, REL_Y, REL_Z, REL_I, REL_J, REL_K)
|
||||
#if HAS_EXTRUDERS
|
||||
, E_MODE_ABS, E_MODE_REL
|
||||
#endif
|
||||
};
|
||||
|
||||
extern const char G28_STR[];
|
||||
|
||||
@@ -324,23 +329,31 @@ public:
|
||||
static uint8_t axis_relative;
|
||||
|
||||
static inline bool axis_is_relative(const AxisEnum a) {
|
||||
if (a == E_AXIS) {
|
||||
if (TEST(axis_relative, E_MODE_REL)) return true;
|
||||
if (TEST(axis_relative, E_MODE_ABS)) return false;
|
||||
}
|
||||
#if HAS_EXTRUDERS
|
||||
if (a == E_AXIS) {
|
||||
if (TEST(axis_relative, E_MODE_REL)) return true;
|
||||
if (TEST(axis_relative, E_MODE_ABS)) return false;
|
||||
}
|
||||
#endif
|
||||
return TEST(axis_relative, a);
|
||||
}
|
||||
static inline void set_relative_mode(const bool rel) {
|
||||
axis_relative = rel ? _BV(REL_X) | _BV(REL_Y) | _BV(REL_Z) | _BV(REL_E) : 0;
|
||||
}
|
||||
static inline void set_e_relative() {
|
||||
CBI(axis_relative, E_MODE_ABS);
|
||||
SBI(axis_relative, E_MODE_REL);
|
||||
}
|
||||
static inline void set_e_absolute() {
|
||||
CBI(axis_relative, E_MODE_REL);
|
||||
SBI(axis_relative, E_MODE_ABS);
|
||||
axis_relative = rel ? (0 LOGICAL_AXIS_GANG(
|
||||
| _BV(REL_E),
|
||||
| _BV(REL_X), | _BV(REL_Y), | _BV(REL_Z),
|
||||
| _BV(REL_I), | _BV(REL_J), | _BV(REL_K)
|
||||
)) : 0;
|
||||
}
|
||||
#if HAS_EXTRUDERS
|
||||
static inline void set_e_relative() {
|
||||
CBI(axis_relative, E_MODE_ABS);
|
||||
SBI(axis_relative, E_MODE_REL);
|
||||
}
|
||||
static inline void set_e_absolute() {
|
||||
CBI(axis_relative, E_MODE_REL);
|
||||
SBI(axis_relative, E_MODE_ABS);
|
||||
}
|
||||
#endif
|
||||
|
||||
#if ENABLED(CNC_WORKSPACE_PLANES)
|
||||
/**
|
||||
@@ -678,7 +691,11 @@ private:
|
||||
|
||||
static void M114();
|
||||
static void M115();
|
||||
static void M117();
|
||||
|
||||
#if HAS_STATUS_MESSAGE
|
||||
static void M117();
|
||||
#endif
|
||||
|
||||
static void M118();
|
||||
static void M119();
|
||||
static void M120();
|
||||
|
||||
@@ -48,7 +48,10 @@
|
||||
*/
|
||||
void GcodeSuite::G92() {
|
||||
|
||||
bool sync_E = false, sync_XYZE = false;
|
||||
#if HAS_EXTRUDERS
|
||||
bool sync_E = false;
|
||||
#endif
|
||||
bool sync_XYZE = false;
|
||||
|
||||
#if USE_GCODE_SUBCODES
|
||||
const uint8_t subcode_G92 = parser.subcode;
|
||||
@@ -72,7 +75,11 @@ void GcodeSuite::G92() {
|
||||
case 9: // G92.9 - Set Current Position directly (like Marlin 1.0)
|
||||
LOOP_LOGICAL_AXES(i) {
|
||||
if (parser.seenval(axis_codes[i])) {
|
||||
if (i == E_AXIS) sync_E = true; else sync_XYZE = true;
|
||||
if (TERN1(HAS_EXTRUDERS, i != E_AXIS))
|
||||
sync_XYZE = true;
|
||||
else {
|
||||
TERN_(HAS_EXTRUDERS, sync_E = true);
|
||||
}
|
||||
current_position[i] = parser.value_axis_units((AxisEnum)i);
|
||||
}
|
||||
}
|
||||
@@ -83,20 +90,26 @@ void GcodeSuite::G92() {
|
||||
LOOP_LOGICAL_AXES(i) {
|
||||
if (parser.seenval(axis_codes[i])) {
|
||||
const float l = parser.value_axis_units((AxisEnum)i), // Given axis coordinate value, converted to millimeters
|
||||
v = i == E_AXIS ? l : LOGICAL_TO_NATIVE(l, i), // Axis position in NATIVE space (applying the existing offset)
|
||||
v = TERN0(HAS_EXTRUDERS, i == E_AXIS) ? l : LOGICAL_TO_NATIVE(l, i), // Axis position in NATIVE space (applying the existing offset)
|
||||
d = v - current_position[i]; // How much is the current axis position altered by?
|
||||
if (!NEAR_ZERO(d)) {
|
||||
#if HAS_POSITION_SHIFT && !IS_SCARA // When using workspaces...
|
||||
if (i == E_AXIS) {
|
||||
sync_E = true;
|
||||
current_position.e = v; // ...E is still set directly
|
||||
}
|
||||
else {
|
||||
position_shift[i] += d; // ...but other axes offset the workspace.
|
||||
if (TERN1(HAS_EXTRUDERS, i != E_AXIS)) {
|
||||
position_shift[i] += d; // ...most axes offset the workspace...
|
||||
update_workspace_offset((AxisEnum)i);
|
||||
}
|
||||
else {
|
||||
#if HAS_EXTRUDERS
|
||||
sync_E = true;
|
||||
current_position.e = v; // ...but E is set directly
|
||||
#endif
|
||||
}
|
||||
#else // Without workspaces...
|
||||
if (i == E_AXIS) sync_E = true; else sync_XYZE = true;
|
||||
if (TERN1(HAS_EXTRUDERS, i != E_AXIS))
|
||||
sync_XYZE = true;
|
||||
else {
|
||||
TERN_(HAS_EXTRUDERS, sync_E = true);
|
||||
}
|
||||
current_position[i] = v; // ...set Current Position directly (like Marlin 1.0)
|
||||
#endif
|
||||
}
|
||||
@@ -111,8 +124,10 @@ void GcodeSuite::G92() {
|
||||
coordinate_system[active_coordinate_system] = position_shift;
|
||||
#endif
|
||||
|
||||
if (sync_XYZE) sync_plan_position();
|
||||
else if (sync_E) sync_plan_position_e();
|
||||
if (sync_XYZE) sync_plan_position();
|
||||
#if HAS_EXTRUDERS
|
||||
else if (sync_E) sync_plan_position_e();
|
||||
#endif
|
||||
|
||||
IF_DISABLED(DIRECT_STEPPING, report_current_position());
|
||||
}
|
||||
|
||||
@@ -31,7 +31,16 @@
|
||||
#include "../../MarlinCore.h"
|
||||
|
||||
void M206_report() {
|
||||
SERIAL_ECHOLNPAIR_P(PSTR("M206 X"), home_offset.x, SP_Y_STR, home_offset.y, SP_Z_STR, home_offset.z);
|
||||
SERIAL_ECHOLNPAIR_P(
|
||||
LIST_N(DOUBLE(LINEAR_AXES),
|
||||
PSTR("M206 X"), home_offset.x,
|
||||
SP_Y_STR, home_offset.y,
|
||||
SP_Z_STR, home_offset.z,
|
||||
SP_I_STR, home_offset.i,
|
||||
SP_J_STR, home_offset.j,
|
||||
SP_K_STR, home_offset.k,
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -51,7 +60,7 @@ void GcodeSuite::M206() {
|
||||
if (parser.seen('P')) set_home_offset(B_AXIS, parser.value_float()); // Psi
|
||||
#endif
|
||||
|
||||
if (!parser.seen("XYZ"))
|
||||
if (!parser.seen(LINEAR_AXIS_GANG("X", "Y", "Z", "I", "J", "K")))
|
||||
M206_report();
|
||||
else
|
||||
report_current_position();
|
||||
|
||||
@@ -125,6 +125,15 @@
|
||||
#if AXIS_IS_L64XX(Z4)
|
||||
REPORT_ABSOLUTE_POS(Z4);
|
||||
#endif
|
||||
#if AXIS_IS_L64XX(I)
|
||||
REPORT_ABSOLUTE_POS(I);
|
||||
#endif
|
||||
#if AXIS_IS_L64XX(J)
|
||||
REPORT_ABSOLUTE_POS(J);
|
||||
#endif
|
||||
#if AXIS_IS_L64XX(K)
|
||||
REPORT_ABSOLUTE_POS(K);
|
||||
#endif
|
||||
#if AXIS_IS_L64XX(E0)
|
||||
REPORT_ABSOLUTE_POS(E0);
|
||||
#endif
|
||||
@@ -170,7 +179,13 @@
|
||||
|
||||
SERIAL_ECHOPGM("FromStp:");
|
||||
get_cartesian_from_steppers(); // writes 'cartes' (with forward kinematics)
|
||||
xyze_pos_t from_steppers = { cartes.x, cartes.y, cartes.z, planner.get_axis_position_mm(E_AXIS) };
|
||||
xyze_pos_t from_steppers = LOGICAL_AXIS_ARRAY(
|
||||
planner.get_axis_position_mm(E_AXIS),
|
||||
cartes.x, cartes.y, cartes.z,
|
||||
planner.get_axis_position_mm(I_AXIS),
|
||||
planner.get_axis_position_mm(J_AXIS),
|
||||
planner.get_axis_position_mm(K_AXIS)
|
||||
);
|
||||
report_all_axis_pos(from_steppers);
|
||||
|
||||
const xyze_float_t diff = from_steppers - leveled;
|
||||
|
||||
@@ -119,6 +119,9 @@ void GcodeSuite::M115() {
|
||||
// EMERGENCY_PARSER (M108, M112, M410, M876)
|
||||
cap_line(PSTR("EMERGENCY_PARSER"), ENABLED(EMERGENCY_PARSER));
|
||||
|
||||
// HOST ACTION COMMANDS (paused, resume, resumed, cancel, etc.)
|
||||
cap_line(PSTR("HOST_ACTION_COMMANDS"), ENABLED(HOST_ACTION_COMMANDS));
|
||||
|
||||
// PROMPT SUPPORT (M876)
|
||||
cap_line(PSTR("PROMPT_SUPPORT"), ENABLED(HOST_PROMPT_SUPPORT));
|
||||
|
||||
|
||||
@@ -20,6 +20,10 @@
|
||||
*
|
||||
*/
|
||||
|
||||
#include "../../inc/MarlinConfig.h"
|
||||
|
||||
#if HAS_STATUS_MESSAGE
|
||||
|
||||
#include "../gcode.h"
|
||||
#include "../../lcd/marlinui.h"
|
||||
|
||||
@@ -34,3 +38,5 @@ void GcodeSuite::M117() {
|
||||
ui.reset_status();
|
||||
|
||||
}
|
||||
|
||||
#endif // HAS_STATUS_MESSAGE
|
||||
|
||||
@@ -49,9 +49,14 @@ void GcodeSuite::G0_G1(TERN_(HAS_FAST_MOVES, const bool fast_move/*=false*/)) {
|
||||
if (IsRunning()
|
||||
#if ENABLED(NO_MOTION_BEFORE_HOMING)
|
||||
&& !homing_needed_error(
|
||||
(parser.seen_test('X') ? _BV(X_AXIS) : 0)
|
||||
| (parser.seen_test('Y') ? _BV(Y_AXIS) : 0)
|
||||
| (parser.seen_test('Z') ? _BV(Z_AXIS) : 0) )
|
||||
LINEAR_AXIS_GANG(
|
||||
(parser.seen_test('X') ? _BV(X_AXIS) : 0),
|
||||
| (parser.seen_test('Y') ? _BV(Y_AXIS) : 0),
|
||||
| (parser.seen_test('Z') ? _BV(Z_AXIS) : 0),
|
||||
| (parser.seen_test(AXIS4_NAME) ? _BV(I_AXIS) : 0),
|
||||
| (parser.seen_test(AXIS5_NAME) ? _BV(J_AXIS) : 0),
|
||||
| (parser.seen_test(AXIS6_NAME) ? _BV(K_AXIS) : 0))
|
||||
)
|
||||
#endif
|
||||
) {
|
||||
TERN_(FULL_REPORT_TO_HOST_FEATURE, set_and_report_grblstate(M_RUNNING));
|
||||
@@ -83,7 +88,9 @@ void GcodeSuite::G0_G1(TERN_(HAS_FAST_MOVES, const bool fast_move/*=false*/)) {
|
||||
|
||||
if (MIN_AUTORETRACT <= MAX_AUTORETRACT) {
|
||||
// When M209 Autoretract is enabled, convert E-only moves to firmware retract/recover moves
|
||||
if (fwretract.autoretract_enabled && parser.seen('E') && !parser.seen("XYZ")) {
|
||||
if (fwretract.autoretract_enabled && parser.seen_test('E')
|
||||
&& !parser.seen(LINEAR_AXIS_GANG("X", "Y", "Z", AXIS4_STR, AXIS5_STR, AXIS6_STR))
|
||||
) {
|
||||
const float echange = destination.e - current_position.e;
|
||||
// Is this a retract or recover move?
|
||||
if (WITHIN(ABS(echange), MIN_AUTORETRACT, MAX_AUTORETRACT) && fwretract.retracted[active_extruder] == (echange > 0.0)) {
|
||||
|
||||
@@ -63,7 +63,7 @@ void plan_arc(
|
||||
case GcodeSuite::PLANE_ZX: p_axis = Z_AXIS; q_axis = X_AXIS; l_axis = Y_AXIS; break;
|
||||
}
|
||||
#else
|
||||
constexpr AxisEnum p_axis = X_AXIS, q_axis = Y_AXIS, l_axis = Z_AXIS;
|
||||
constexpr AxisEnum p_axis = X_AXIS, q_axis = Y_AXIS OPTARG(HAS_Z_AXIS, l_axis = Z_AXIS);
|
||||
#endif
|
||||
|
||||
// Radius vector from center to current location
|
||||
@@ -73,8 +73,8 @@ void plan_arc(
|
||||
center_P = current_position[p_axis] - rvec.a,
|
||||
center_Q = current_position[q_axis] - rvec.b,
|
||||
rt_X = cart[p_axis] - center_P,
|
||||
rt_Y = cart[q_axis] - center_Q,
|
||||
start_L = current_position[l_axis];
|
||||
rt_Y = cart[q_axis] - center_Q
|
||||
OPTARG(HAS_Z_AXIS, start_L = current_position[l_axis]);
|
||||
|
||||
#ifdef MIN_ARC_SEGMENTS
|
||||
uint16_t min_segments = MIN_ARC_SEGMENTS;
|
||||
@@ -109,27 +109,37 @@ void plan_arc(
|
||||
#endif
|
||||
}
|
||||
|
||||
float linear_travel = cart[l_axis] - start_L,
|
||||
extruder_travel = cart.e - current_position.e;
|
||||
#if HAS_Z_AXIS
|
||||
float linear_travel = cart[l_axis] - start_L;
|
||||
#endif
|
||||
#if HAS_EXTRUDERS
|
||||
float extruder_travel = cart.e - current_position.e;
|
||||
#endif
|
||||
|
||||
// If circling around...
|
||||
if (ENABLED(ARC_P_CIRCLES) && circles) {
|
||||
const float total_angular = angular_travel + circles * RADIANS(360), // Total rotation with all circles and remainder
|
||||
part_per_circle = RADIANS(360) / total_angular, // Each circle's part of the total
|
||||
l_per_circle = linear_travel * part_per_circle, // L movement per circle
|
||||
e_per_circle = extruder_travel * part_per_circle; // E movement per circle
|
||||
part_per_circle = RADIANS(360) / total_angular; // Each circle's part of the total
|
||||
|
||||
#if HAS_Z_AXIS
|
||||
const float l_per_circle = linear_travel * part_per_circle; // L movement per circle
|
||||
#endif
|
||||
#if HAS_EXTRUDERS
|
||||
const float e_per_circle = extruder_travel * part_per_circle; // E movement per circle
|
||||
#endif
|
||||
|
||||
xyze_pos_t temp_position = current_position; // for plan_arc to compare to current_position
|
||||
for (uint16_t n = circles; n--;) {
|
||||
temp_position.e += e_per_circle; // Destination E axis
|
||||
temp_position[l_axis] += l_per_circle; // Destination L axis
|
||||
TERN_(HAS_EXTRUDERS, temp_position.e += e_per_circle); // Destination E axis
|
||||
TERN_(HAS_Z_AXIS, temp_position[l_axis] += l_per_circle); // Destination L axis
|
||||
plan_arc(temp_position, offset, clockwise, 0); // Plan a single whole circle
|
||||
}
|
||||
linear_travel = cart[l_axis] - current_position[l_axis];
|
||||
extruder_travel = cart.e - current_position.e;
|
||||
TERN_(HAS_Z_AXIS, linear_travel = cart[l_axis] - current_position[l_axis]);
|
||||
TERN_(HAS_EXTRUDERS, extruder_travel = cart.e - current_position.e);
|
||||
}
|
||||
|
||||
const float flat_mm = radius * angular_travel,
|
||||
mm_of_travel = linear_travel ? HYPOT(flat_mm, linear_travel) : ABS(flat_mm);
|
||||
mm_of_travel = TERN_(HAS_Z_AXIS, linear_travel ? HYPOT(flat_mm, linear_travel) :) ABS(flat_mm);
|
||||
if (mm_of_travel < 0.001f) return;
|
||||
|
||||
const feedRate_t scaled_fr_mm_s = MMS_SCALED(feedrate_mm_s);
|
||||
@@ -178,17 +188,22 @@ void plan_arc(
|
||||
// Vector rotation matrix values
|
||||
xyze_pos_t raw;
|
||||
const float theta_per_segment = angular_travel / segments,
|
||||
linear_per_segment = linear_travel / segments,
|
||||
extruder_per_segment = extruder_travel / segments,
|
||||
sq_theta_per_segment = sq(theta_per_segment),
|
||||
sin_T = theta_per_segment - sq_theta_per_segment * theta_per_segment / 6,
|
||||
cos_T = 1 - 0.5f * sq_theta_per_segment; // Small angle approximation
|
||||
|
||||
#if HAS_Z_AXIS && DISABLED(AUTO_BED_LEVELING_UBL)
|
||||
const float linear_per_segment = linear_travel / segments;
|
||||
#endif
|
||||
#if HAS_EXTRUDERS
|
||||
const float extruder_per_segment = extruder_travel / segments;
|
||||
#endif
|
||||
|
||||
// Initialize the linear axis
|
||||
raw[l_axis] = current_position[l_axis];
|
||||
TERN_(HAS_Z_AXIS, raw[l_axis] = current_position[l_axis]);
|
||||
|
||||
// Initialize the extruder axis
|
||||
raw.e = current_position.e;
|
||||
TERN_(HAS_EXTRUDERS, raw.e = current_position.e);
|
||||
|
||||
#if ENABLED(SCARA_FEEDRATE_SCALING)
|
||||
const float inv_duration = scaled_fr_mm_s / seg_length;
|
||||
@@ -234,13 +249,11 @@ void plan_arc(
|
||||
// Update raw location
|
||||
raw[p_axis] = center_P + rvec.a;
|
||||
raw[q_axis] = center_Q + rvec.b;
|
||||
#if ENABLED(AUTO_BED_LEVELING_UBL)
|
||||
raw[l_axis] = start_L;
|
||||
UNUSED(linear_per_segment);
|
||||
#else
|
||||
raw[l_axis] += linear_per_segment;
|
||||
#if HAS_Z_AXIS
|
||||
raw[l_axis] = TERN(AUTO_BED_LEVELING_UBL, start_L, raw[l_axis] + linear_per_segment);
|
||||
#endif
|
||||
raw.e += extruder_per_segment;
|
||||
|
||||
TERN_(HAS_EXTRUDERS, raw.e += extruder_per_segment);
|
||||
|
||||
apply_motion_limits(raw);
|
||||
|
||||
@@ -249,15 +262,13 @@ void plan_arc(
|
||||
#endif
|
||||
|
||||
if (!planner.buffer_line(raw, scaled_fr_mm_s, active_extruder, 0
|
||||
#if ENABLED(SCARA_FEEDRATE_SCALING)
|
||||
, inv_duration
|
||||
#endif
|
||||
OPTARG(SCARA_FEEDRATE_SCALING, inv_duration)
|
||||
)) break;
|
||||
}
|
||||
|
||||
// Ensure last segment arrives at target location.
|
||||
raw = cart;
|
||||
TERN_(AUTO_BED_LEVELING_UBL, raw[l_axis] = start_L);
|
||||
TERN_(AUTO_BED_LEVELING_UBL, TERN_(HAS_Z_AXIS, raw[l_axis] = start_L));
|
||||
|
||||
apply_motion_limits(raw);
|
||||
|
||||
@@ -266,12 +277,10 @@ void plan_arc(
|
||||
#endif
|
||||
|
||||
planner.buffer_line(raw, scaled_fr_mm_s, active_extruder, 0
|
||||
#if ENABLED(SCARA_FEEDRATE_SCALING)
|
||||
, inv_duration
|
||||
#endif
|
||||
OPTARG(SCARA_FEEDRATE_SCALING, inv_duration)
|
||||
);
|
||||
|
||||
TERN_(AUTO_BED_LEVELING_UBL, raw[l_axis] = start_L);
|
||||
TERN_(AUTO_BED_LEVELING_UBL, TERN_(HAS_Z_AXIS, raw[l_axis] = start_L));
|
||||
current_position = raw;
|
||||
|
||||
} // plan_arc
|
||||
|
||||
@@ -87,7 +87,7 @@ void GcodeSuite::M290() {
|
||||
}
|
||||
#endif
|
||||
|
||||
if (!parser.seen("XYZ") || parser.seen('R')) {
|
||||
if (!parser.seen(LINEAR_AXIS_GANG("X", "Y", "Z", AXIS4_STR, AXIS5_STR, AXIS6_STR)) || parser.seen('R')) {
|
||||
SERIAL_ECHO_START();
|
||||
|
||||
#if ENABLED(BABYSTEP_ZPROBE_OFFSET)
|
||||
|
||||
@@ -248,7 +248,8 @@ void GCodeParser::parse(char *p) {
|
||||
case 'R': if (!WITHIN(motion_mode_codenum, 2, 3)) return;
|
||||
#endif
|
||||
|
||||
case 'X' ... 'Z': case 'E' ... 'F':
|
||||
LOGICAL_AXIS_GANG(case 'E':, case 'X':, case 'Y':, case 'Z':, case AXIS4_NAME:, case AXIS5_NAME:, case AXIS6_NAME:)
|
||||
case 'F':
|
||||
if (motion_mode_codenum < 0) return;
|
||||
command_letter = 'G';
|
||||
codenum = motion_mode_codenum;
|
||||
|
||||
@@ -226,7 +226,7 @@ public:
|
||||
|
||||
// Seen any axis parameter
|
||||
static inline bool seen_axis() {
|
||||
return seen("XYZE");
|
||||
return seen(LOGICAL_AXIS_GANG("E", "X", "Y", "Z", AXIS4_STR, AXIS5_STR, AXIS6_STR));
|
||||
}
|
||||
|
||||
#if ENABLED(GCODE_QUOTED_STRINGS)
|
||||
|
||||
@@ -84,9 +84,7 @@ char GCodeQueue::injected_commands[64]; // = { 0 }
|
||||
|
||||
|
||||
void GCodeQueue::RingBuffer::commit_command(bool skip_ok
|
||||
#if HAS_MULTI_SERIAL
|
||||
, serial_index_t serial_ind/*=-1*/
|
||||
#endif
|
||||
OPTARG(HAS_MULTI_SERIAL, serial_index_t serial_ind/*=-1*/)
|
||||
) {
|
||||
commands[index_w].skip_ok = skip_ok;
|
||||
TERN_(HAS_MULTI_SERIAL, commands[index_w].port = serial_ind);
|
||||
@@ -100,9 +98,7 @@ void GCodeQueue::RingBuffer::commit_command(bool skip_ok
|
||||
* Return false for a full buffer, or if the 'command' is a comment.
|
||||
*/
|
||||
bool GCodeQueue::RingBuffer::enqueue(const char *cmd, bool skip_ok/*=true*/
|
||||
#if HAS_MULTI_SERIAL
|
||||
, serial_index_t serial_ind/*=-1*/
|
||||
#endif
|
||||
OPTARG(HAS_MULTI_SERIAL, serial_index_t serial_ind/*=-1*/)
|
||||
) {
|
||||
if (*cmd == ';' || length >= BUFSIZE) return false;
|
||||
strcpy(commands[index_w].buffer, cmd);
|
||||
|
||||
@@ -80,15 +80,11 @@ public:
|
||||
void advance_pos(uint8_t &p, const int inc) { if (++p >= BUFSIZE) p = 0; length += inc; }
|
||||
|
||||
void commit_command(bool skip_ok
|
||||
#if HAS_MULTI_SERIAL
|
||||
, serial_index_t serial_ind = serial_index_t()
|
||||
#endif
|
||||
OPTARG(HAS_MULTI_SERIAL, serial_index_t serial_ind = serial_index_t())
|
||||
);
|
||||
|
||||
bool enqueue(const char *cmd, bool skip_ok = true
|
||||
#if HAS_MULTI_SERIAL
|
||||
, serial_index_t serial_ind = serial_index_t()
|
||||
#endif
|
||||
OPTARG(HAS_MULTI_SERIAL, serial_index_t serial_ind = serial_index_t())
|
||||
);
|
||||
|
||||
void ok_to_send();
|
||||
|
||||
@@ -83,6 +83,8 @@ void GcodeSuite::M106() {
|
||||
if (!got_preset && parser.seenval('S'))
|
||||
speed = parser.value_ushort();
|
||||
|
||||
TERN_(FOAMCUTTER_XYUV, speed *= 2.55); // Get command in % of max heat
|
||||
|
||||
// Set speed, with constraint
|
||||
thermalManager.set_fan_speed(pfan, speed);
|
||||
|
||||
|
||||
@@ -83,10 +83,11 @@ void GcodeSuite::M140_M190(const bool isM190) {
|
||||
|
||||
thermalManager.setTargetBed(temp);
|
||||
|
||||
TERN_(PRINTJOB_TIMER_AUTOSTART, thermalManager.auto_job_check_timer(true, false));
|
||||
|
||||
ui.set_status_P(thermalManager.isHeatingBed() ? GET_TEXT(MSG_BED_HEATING) : GET_TEXT(MSG_BED_COOLING));
|
||||
|
||||
// with PRINTJOB_TIMER_AUTOSTART, M190 can start the timer, and M140 can stop it
|
||||
TERN_(PRINTJOB_TIMER_AUTOSTART, thermalManager.auto_job_check_timer(isM190, !isM190));
|
||||
|
||||
if (isM190)
|
||||
thermalManager.wait_for_bed(no_wait_for_cooling);
|
||||
}
|
||||
|
||||
@@ -517,7 +517,7 @@
|
||||
#define HAS_PRUSA_MMU2 1
|
||||
#define HAS_PRUSA_MMU2S 1
|
||||
#endif
|
||||
#if MMU_MODEL == EXTENDABLE_EMU_MMU2 || MMU_MODEL == EXTENDABLE_EMU_MMU2S
|
||||
#if MMU_MODEL >= EXTENDABLE_EMU_MMU2
|
||||
#define HAS_EXTENDABLE_MMU 1
|
||||
#endif
|
||||
#endif
|
||||
@@ -537,12 +537,12 @@
|
||||
* E_STEPPERS - Number of actual E stepper motors
|
||||
* E_MANUAL - Number of E steppers for LCD move options
|
||||
*/
|
||||
|
||||
#if EXTRUDERS
|
||||
#define HAS_EXTRUDERS 1
|
||||
#if EXTRUDERS > 1
|
||||
#define HAS_MULTI_EXTRUDER 1
|
||||
#endif
|
||||
#define E_AXIS_N(E) AxisEnum(E_AXIS + E_INDEX_N(E))
|
||||
#else
|
||||
#undef EXTRUDERS
|
||||
#define EXTRUDERS 0
|
||||
@@ -551,6 +551,7 @@
|
||||
#undef SWITCHING_NOZZLE
|
||||
#undef MIXING_EXTRUDER
|
||||
#undef HOTEND_IDLE_TIMEOUT
|
||||
#undef DISABLE_E
|
||||
#endif
|
||||
|
||||
#if ENABLED(SWITCHING_EXTRUDER) // One stepper for every two EXTRUDERS
|
||||
@@ -604,6 +605,56 @@
|
||||
#define E_MANUAL EXTRUDERS
|
||||
#endif
|
||||
|
||||
/**
|
||||
* Number of Linear Axes (e.g., XYZ)
|
||||
* All the logical axes except for the tool (E) axis
|
||||
*/
|
||||
#ifndef LINEAR_AXES
|
||||
#define LINEAR_AXES XYZ
|
||||
#endif
|
||||
#if LINEAR_AXES >= XY
|
||||
#define HAS_Y_AXIS 1
|
||||
#if LINEAR_AXES >= XYZ
|
||||
#define HAS_Z_AXIS 1
|
||||
#endif
|
||||
#endif
|
||||
|
||||
/**
|
||||
* Number of Logical Axes (e.g., XYZE)
|
||||
* All the logical axes that can be commanded directly by G-code.
|
||||
* Delta maps stepper-specific values to ABC steppers.
|
||||
*/
|
||||
#if HAS_EXTRUDERS
|
||||
#define LOGICAL_AXES INCREMENT(LINEAR_AXES)
|
||||
#else
|
||||
#define LOGICAL_AXES LINEAR_AXES
|
||||
#endif
|
||||
|
||||
/**
|
||||
* DISTINCT_E_FACTORS is set to give extruders (some) individual settings.
|
||||
*
|
||||
* DISTINCT_AXES is the number of distinct addressable axes (not steppers).
|
||||
* Includes all linear axes plus all distinguished extruders.
|
||||
* The default behavior is to treat all extruders as a single E axis
|
||||
* with shared motion and temperature settings.
|
||||
*
|
||||
* DISTINCT_E is the number of distinguished extruders. By default this
|
||||
* well be 1 which indicates all extruders share the same settings.
|
||||
*
|
||||
* E_INDEX_N(E) should be used to get the E index of any item that might be
|
||||
* distinguished.
|
||||
*/
|
||||
#if ENABLED(DISTINCT_E_FACTORS) && E_STEPPERS > 1
|
||||
#define DISTINCT_AXES (LINEAR_AXES + E_STEPPERS)
|
||||
#define DISTINCT_E E_STEPPERS
|
||||
#define E_INDEX_N(E) (E)
|
||||
#else
|
||||
#undef DISTINCT_E_FACTORS
|
||||
#define DISTINCT_AXES LOGICAL_AXES
|
||||
#define DISTINCT_E 1
|
||||
#define E_INDEX_N(E) 0
|
||||
#endif
|
||||
|
||||
#if HOTENDS
|
||||
#define HAS_HOTEND 1
|
||||
#ifndef HOTEND_OVERSHOOT
|
||||
@@ -624,10 +675,6 @@
|
||||
#define ARRAY_BY_HOTENDS(V...) ARRAY_N(HOTENDS, V)
|
||||
#define ARRAY_BY_HOTENDS1(v1) ARRAY_N_1(HOTENDS, v1)
|
||||
|
||||
#if ENABLED(SWITCHING_EXTRUDER) && (DISABLED(SWITCHING_NOZZLE) || SWITCHING_EXTRUDER_SERVO_NR != SWITCHING_NOZZLE_SERVO_NR)
|
||||
#define DO_SWITCH_EXTRUDER 1
|
||||
#endif
|
||||
|
||||
/**
|
||||
* Default hotend offsets, if not defined
|
||||
*/
|
||||
@@ -653,40 +700,11 @@
|
||||
#undef SINGLENOZZLE_STANDBY_FAN
|
||||
#endif
|
||||
|
||||
/**
|
||||
* Number of Linear Axes (e.g., XYZ)
|
||||
* All the logical axes except for the tool (E) axis
|
||||
*/
|
||||
#ifndef LINEAR_AXES
|
||||
#define LINEAR_AXES XYZ
|
||||
// Switching extruder has its own servo?
|
||||
#if ENABLED(SWITCHING_EXTRUDER) && (DISABLED(SWITCHING_NOZZLE) || SWITCHING_EXTRUDER_SERVO_NR != SWITCHING_NOZZLE_SERVO_NR)
|
||||
#define DO_SWITCH_EXTRUDER 1
|
||||
#endif
|
||||
|
||||
/**
|
||||
* Number of Logical Axes (e.g., XYZE)
|
||||
* All the logical axes that can be commanded directly by G-code.
|
||||
* Delta maps stepper-specific values to ABC steppers.
|
||||
*/
|
||||
#if HAS_EXTRUDERS
|
||||
#define LOGICAL_AXES INCREMENT(LINEAR_AXES)
|
||||
#else
|
||||
#define LOGICAL_AXES LINEAR_AXES
|
||||
#endif
|
||||
|
||||
/**
|
||||
* DISTINCT_E_FACTORS affects whether Extruders use different settings
|
||||
*/
|
||||
#if ENABLED(DISTINCT_E_FACTORS) && E_STEPPERS > 1
|
||||
#define DISTINCT_E E_STEPPERS
|
||||
#define DISTINCT_AXES (LINEAR_AXES + E_STEPPERS)
|
||||
#define E_INDEX_N(E) (E)
|
||||
#else
|
||||
#undef DISTINCT_E_FACTORS
|
||||
#define DISTINCT_E 1
|
||||
#define DISTINCT_AXES LOGICAL_AXES
|
||||
#define E_INDEX_N(E) 0
|
||||
#endif
|
||||
#define E_AXIS_N(E) AxisEnum(E_AXIS + E_INDEX_N(E))
|
||||
|
||||
/**
|
||||
* The BLTouch Probe emulates a servo probe
|
||||
* and uses "special" angles for its state.
|
||||
@@ -726,6 +744,9 @@
|
||||
#define HAS_BED_PROBE 1
|
||||
#endif
|
||||
|
||||
/**
|
||||
* Fill in undefined Filament Sensor options
|
||||
*/
|
||||
#if ENABLED(FILAMENT_RUNOUT_SENSOR)
|
||||
#if NUM_RUNOUT_SENSORS >= 1
|
||||
#ifndef FIL_RUNOUT1_STATE
|
||||
@@ -833,7 +854,25 @@
|
||||
#elif Z_HOME_DIR < 0
|
||||
#define Z_HOME_TO_MIN 1
|
||||
#endif
|
||||
#if I_HOME_DIR > 0
|
||||
#define I_HOME_TO_MAX 1
|
||||
#elif I_HOME_DIR < 0
|
||||
#define I_HOME_TO_MIN 1
|
||||
#endif
|
||||
#if J_HOME_DIR > 0
|
||||
#define J_HOME_TO_MAX 1
|
||||
#elif J_HOME_DIR < 0
|
||||
#define J_HOME_TO_MIN 1
|
||||
#endif
|
||||
#if K_HOME_DIR > 0
|
||||
#define K_HOME_TO_MAX 1
|
||||
#elif K_HOME_DIR < 0
|
||||
#define K_HOME_TO_MIN 1
|
||||
#endif
|
||||
|
||||
/**
|
||||
* Conditionals based on the type of Bed Probe
|
||||
*/
|
||||
#if HAS_BED_PROBE
|
||||
#if DISABLED(NOZZLE_AS_PROBE)
|
||||
#define HAS_PROBE_XY_OFFSET 1
|
||||
@@ -868,7 +907,7 @@
|
||||
#endif
|
||||
|
||||
/**
|
||||
* Set granular options based on the specific type of leveling
|
||||
* Conditionals based on the type of Bed Leveling
|
||||
*/
|
||||
#if ENABLED(AUTO_BED_LEVELING_UBL)
|
||||
#undef LCD_BED_LEVELING
|
||||
@@ -1088,13 +1127,22 @@
|
||||
#ifndef INVERT_X_DIR
|
||||
#define INVERT_X_DIR false
|
||||
#endif
|
||||
#ifndef INVERT_Y_DIR
|
||||
#if HAS_Y_AXIS && !defined(INVERT_Y_DIR)
|
||||
#define INVERT_Y_DIR false
|
||||
#endif
|
||||
#ifndef INVERT_Z_DIR
|
||||
#if HAS_Z_AXIS && !defined(INVERT_Z_DIR)
|
||||
#define INVERT_Z_DIR false
|
||||
#endif
|
||||
#ifndef INVERT_E_DIR
|
||||
#if LINEAR_AXES >= 4 && !defined(INVERT_I_DIR)
|
||||
#define INVERT_I_DIR false
|
||||
#endif
|
||||
#if LINEAR_AXES >= 5 && !defined(INVERT_J_DIR)
|
||||
#define INVERT_J_DIR false
|
||||
#endif
|
||||
#if LINEAR_AXES >= 6 && !defined(INVERT_K_DIR)
|
||||
#define INVERT_K_DIR false
|
||||
#endif
|
||||
#if HAS_EXTRUDERS && !defined(INVERT_E_DIR)
|
||||
#define INVERT_E_DIR false
|
||||
#endif
|
||||
|
||||
@@ -1303,3 +1351,10 @@
|
||||
#else
|
||||
#define COORDINATE_OKAY(N,L,H) true
|
||||
#endif
|
||||
|
||||
/**
|
||||
* LED Backlight INDEX END
|
||||
*/
|
||||
#if defined(NEOPIXEL_BKGD_INDEX_FIRST) && !defined(NEOPIXEL_BKGD_INDEX_LAST)
|
||||
#define NEOPIXEL_BKGD_INDEX_LAST NEOPIXEL_BKGD_INDEX_FIRST
|
||||
#endif
|
||||
|
||||
@@ -26,6 +26,10 @@
|
||||
* Defines that depend on advanced configuration.
|
||||
*/
|
||||
|
||||
#ifndef AXIS_RELATIVE_MODES
|
||||
#define AXIS_RELATIVE_MODES {}
|
||||
#endif
|
||||
|
||||
#ifdef SWITCHING_NOZZLE_E1_SERVO_NR
|
||||
#define SWITCHING_NOZZLE_TWO_SERVOS 1
|
||||
#endif
|
||||
@@ -103,6 +107,9 @@
|
||||
#undef THERMAL_PROTECTION_PERIOD
|
||||
#undef WATCH_TEMP_PERIOD
|
||||
#undef SHOW_TEMP_ADC_VALUES
|
||||
#undef LCD_SHOW_E_TOTAL
|
||||
#undef MANUAL_E_MOVES_RELATIVE
|
||||
#undef STEALTHCHOP_E
|
||||
#endif
|
||||
|
||||
#if TEMP_SENSOR_BED == 0
|
||||
@@ -482,6 +489,37 @@
|
||||
#endif
|
||||
#endif
|
||||
|
||||
// Remove unused STEALTHCHOP flags
|
||||
#if LINEAR_AXES < 6
|
||||
#undef STEALTHCHOP_K
|
||||
#undef CALIBRATION_MEASURE_KMIN
|
||||
#undef CALIBRATION_MEASURE_KMAX
|
||||
#if LINEAR_AXES < 5
|
||||
#undef STEALTHCHOP_J
|
||||
#undef CALIBRATION_MEASURE_JMIN
|
||||
#undef CALIBRATION_MEASURE_JMAX
|
||||
#if LINEAR_AXES < 4
|
||||
#undef STEALTHCHOP_I
|
||||
#undef CALIBRATION_MEASURE_IMIN
|
||||
#undef CALIBRATION_MEASURE_IMAX
|
||||
#if LINEAR_AXES < 3
|
||||
#undef Z_IDLE_HEIGHT
|
||||
#undef STEALTHCHOP_Z
|
||||
#undef Z_PROBE_SLED
|
||||
#undef Z_SAFE_HOMING
|
||||
#undef HOME_Z_FIRST
|
||||
#undef HOMING_Z_WITH_PROBE
|
||||
#undef ENABLE_LEVELING_FADE_HEIGHT
|
||||
#undef NUM_Z_STEPPER_DRIVERS
|
||||
#undef CNC_WORKSPACE_PLANES
|
||||
#if LINEAR_AXES < 2
|
||||
#undef STEALTHCHOP_Y
|
||||
#endif
|
||||
#endif
|
||||
#endif
|
||||
#endif
|
||||
#endif
|
||||
|
||||
//
|
||||
// SD Card connection methods
|
||||
// Defined here so pins and sanity checks can use them
|
||||
|
||||
+495
-208
@@ -78,17 +78,49 @@
|
||||
/**
|
||||
* Axis lengths and center
|
||||
*/
|
||||
#ifndef AXIS4_NAME
|
||||
#define AXIS4_NAME 'A'
|
||||
#endif
|
||||
#ifndef AXIS5_NAME
|
||||
#define AXIS5_NAME 'B'
|
||||
#endif
|
||||
#ifndef AXIS6_NAME
|
||||
#define AXIS6_NAME 'C'
|
||||
#endif
|
||||
|
||||
#define X_MAX_LENGTH (X_MAX_POS - (X_MIN_POS))
|
||||
#define Y_MAX_LENGTH (Y_MAX_POS - (Y_MIN_POS))
|
||||
#define Z_MAX_LENGTH (Z_MAX_POS - (Z_MIN_POS))
|
||||
#if HAS_Y_AXIS
|
||||
#define Y_MAX_LENGTH (Y_MAX_POS - (Y_MIN_POS))
|
||||
#endif
|
||||
#if HAS_Z_AXIS
|
||||
#define Z_MAX_LENGTH (Z_MAX_POS - (Z_MIN_POS))
|
||||
#endif
|
||||
#if LINEAR_AXES >= 4
|
||||
#define I_MAX_LENGTH (I_MAX_POS - (I_MIN_POS))
|
||||
#endif
|
||||
#if LINEAR_AXES >= 5
|
||||
#define J_MAX_LENGTH (J_MAX_POS - (J_MIN_POS))
|
||||
#endif
|
||||
#if LINEAR_AXES >= 6
|
||||
#define K_MAX_LENGTH (K_MAX_POS - (K_MIN_POS))
|
||||
#endif
|
||||
|
||||
// Defined only if the sanity-check is bypassed
|
||||
#ifndef X_BED_SIZE
|
||||
#define X_BED_SIZE X_MAX_LENGTH
|
||||
#endif
|
||||
#ifndef Y_BED_SIZE
|
||||
#if HAS_Y_AXIS && !defined(Y_BED_SIZE)
|
||||
#define Y_BED_SIZE Y_MAX_LENGTH
|
||||
#endif
|
||||
#if LINEAR_AXES >= 4 && !defined(I_BED_SIZE)
|
||||
#define I_BED_SIZE I_MAX_LENGTH
|
||||
#endif
|
||||
#if LINEAR_AXES >= 5 && !defined(J_BED_SIZE)
|
||||
#define J_BED_SIZE J_MAX_LENGTH
|
||||
#endif
|
||||
#if LINEAR_AXES >= 6 && !defined(K_BED_SIZE)
|
||||
#define K_BED_SIZE K_MAX_LENGTH
|
||||
#endif
|
||||
|
||||
// Require 0,0 bed center for Delta and SCARA
|
||||
#if IS_KINEMATIC
|
||||
@@ -97,16 +129,53 @@
|
||||
|
||||
// Define center values for future use
|
||||
#define _X_HALF_BED ((X_BED_SIZE) / 2)
|
||||
#define _Y_HALF_BED ((Y_BED_SIZE) / 2)
|
||||
#if HAS_Y_AXIS
|
||||
#define _Y_HALF_BED ((Y_BED_SIZE) / 2)
|
||||
#endif
|
||||
#if LINEAR_AXES >= 4
|
||||
#define _I_HALF_IMAX ((I_BED_SIZE) / 2)
|
||||
#endif
|
||||
#if LINEAR_AXES >= 5
|
||||
#define _J_HALF_JMAX ((J_BED_SIZE) / 2)
|
||||
#endif
|
||||
#if LINEAR_AXES >= 6
|
||||
#define _K_HALF_KMAX ((K_BED_SIZE) / 2)
|
||||
#endif
|
||||
|
||||
#define X_CENTER TERN(BED_CENTER_AT_0_0, 0, _X_HALF_BED)
|
||||
#define Y_CENTER TERN(BED_CENTER_AT_0_0, 0, _Y_HALF_BED)
|
||||
#define XY_CENTER { X_CENTER, Y_CENTER }
|
||||
#if HAS_Y_AXIS
|
||||
#define Y_CENTER TERN(BED_CENTER_AT_0_0, 0, _Y_HALF_BED)
|
||||
#define XY_CENTER { X_CENTER, Y_CENTER }
|
||||
#endif
|
||||
#if LINEAR_AXES >= 4
|
||||
#define I_CENTER TERN(BED_CENTER_AT_0_0, 0, _I_HALF_BED)
|
||||
#endif
|
||||
#if LINEAR_AXES >= 5
|
||||
#define J_CENTER TERN(BED_CENTER_AT_0_0, 0, _J_HALF_BED)
|
||||
#endif
|
||||
#if LINEAR_AXES >= 6
|
||||
#define K_CENTER TERN(BED_CENTER_AT_0_0, 0, _K_HALF_BED)
|
||||
#endif
|
||||
|
||||
// Get the linear boundaries of the bed
|
||||
#define X_MIN_BED (X_CENTER - _X_HALF_BED)
|
||||
#define X_MAX_BED (X_MIN_BED + X_BED_SIZE)
|
||||
#define Y_MIN_BED (Y_CENTER - _Y_HALF_BED)
|
||||
#define Y_MAX_BED (Y_MIN_BED + Y_BED_SIZE)
|
||||
#if HAS_Y_AXIS
|
||||
#define Y_MIN_BED (Y_CENTER - _Y_HALF_BED)
|
||||
#define Y_MAX_BED (Y_MIN_BED + Y_BED_SIZE)
|
||||
#endif
|
||||
#if LINEAR_AXES >= 4
|
||||
#define I_MINIM (I_CENTER - _I_HALF_BED_SIZE)
|
||||
#define I_MAXIM (I_MINIM + I_BED_SIZE)
|
||||
#endif
|
||||
#if LINEAR_AXES >= 5
|
||||
#define J_MINIM (J_CENTER - _J_HALF_BED_SIZE)
|
||||
#define J_MAXIM (J_MINIM + J_BED_SIZE)
|
||||
#endif
|
||||
#if LINEAR_AXES >= 6
|
||||
#define K_MINIM (K_CENTER - _K_HALF_BED_SIZE)
|
||||
#define K_MAXIM (K_MINIM + K_BED_SIZE)
|
||||
#endif
|
||||
|
||||
/**
|
||||
* Dual X Carriage
|
||||
@@ -163,14 +232,16 @@
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifdef MANUAL_Y_HOME_POS
|
||||
#define Y_HOME_POS MANUAL_Y_HOME_POS
|
||||
#else
|
||||
#define Y_END_POS TERN(Y_HOME_TO_MIN, Y_MIN_POS, Y_MAX_POS)
|
||||
#if ENABLED(BED_CENTER_AT_0_0)
|
||||
#define Y_HOME_POS TERN(DELTA, 0, Y_END_POS)
|
||||
#if HAS_Y_AXIS
|
||||
#ifdef MANUAL_Y_HOME_POS
|
||||
#define Y_HOME_POS MANUAL_Y_HOME_POS
|
||||
#else
|
||||
#define Y_HOME_POS TERN(DELTA, Y_MIN_POS + (Y_BED_SIZE) * 0.5, Y_END_POS)
|
||||
#define Y_END_POS TERN(Y_HOME_TO_MIN, Y_MIN_POS, Y_MAX_POS)
|
||||
#if ENABLED(BED_CENTER_AT_0_0)
|
||||
#define Y_HOME_POS TERN(DELTA, 0, Y_END_POS)
|
||||
#else
|
||||
#define Y_HOME_POS TERN(DELTA, Y_MIN_POS + (Y_BED_SIZE) * 0.5, Y_END_POS)
|
||||
#endif
|
||||
#endif
|
||||
#endif
|
||||
|
||||
@@ -180,6 +251,28 @@
|
||||
#define Z_HOME_POS TERN(Z_HOME_TO_MIN, Z_MIN_POS, Z_MAX_POS)
|
||||
#endif
|
||||
|
||||
#if LINEAR_AXES >= 4
|
||||
#ifdef MANUAL_I_HOME_POS
|
||||
#define I_HOME_POS MANUAL_I_HOME_POS
|
||||
#else
|
||||
#define I_HOME_POS TERN(I_HOME_TO_MIN, I_MIN_POS, I_MAX_POS)
|
||||
#endif
|
||||
#endif
|
||||
#if LINEAR_AXES >= 5
|
||||
#ifdef MANUAL_J_HOME_POS
|
||||
#define J_HOME_POS MANUAL_J_HOME_POS
|
||||
#else
|
||||
#define J_HOME_POS TERN(J_HOME_TO_MIN, J_MIN_POS, J_MAX_POS)
|
||||
#endif
|
||||
#endif
|
||||
#if LINEAR_AXES >= 6
|
||||
#ifdef MANUAL_K_HOME_POS
|
||||
#define K_HOME_POS MANUAL_K_HOME_POS
|
||||
#else
|
||||
#define K_HOME_POS TERN(K_HOME_TO_MIN, K_MIN_POS, K_MAX_POS)
|
||||
#endif
|
||||
#endif
|
||||
|
||||
/**
|
||||
* If DELTA_HEIGHT isn't defined use the old setting
|
||||
*/
|
||||
@@ -374,15 +467,24 @@
|
||||
#ifndef DISABLE_INACTIVE_X
|
||||
#define DISABLE_INACTIVE_X DISABLE_X
|
||||
#endif
|
||||
#ifndef DISABLE_INACTIVE_Y
|
||||
#if HAS_Y_AXIS && !defined(DISABLE_INACTIVE_Y)
|
||||
#define DISABLE_INACTIVE_Y DISABLE_Y
|
||||
#endif
|
||||
#ifndef DISABLE_INACTIVE_Z
|
||||
#if HAS_Z_AXIS && !defined(DISABLE_INACTIVE_Z)
|
||||
#define DISABLE_INACTIVE_Z DISABLE_Z
|
||||
#endif
|
||||
#ifndef DISABLE_INACTIVE_E
|
||||
#define DISABLE_INACTIVE_E DISABLE_E
|
||||
#endif
|
||||
#if LINEAR_AXES >= 4 && !defined(DISABLE_INACTIVE_I)
|
||||
#define DISABLE_INACTIVE_I DISABLE_I
|
||||
#endif
|
||||
#if LINEAR_AXES >= 5 && !defined(DISABLE_INACTIVE_J)
|
||||
#define DISABLE_INACTIVE_J DISABLE_J
|
||||
#endif
|
||||
#if LINEAR_AXES >= 6 && !defined(DISABLE_INACTIVE_K)
|
||||
#define DISABLE_INACTIVE_K DISABLE_K
|
||||
#endif
|
||||
|
||||
/**
|
||||
* Power Supply
|
||||
@@ -1418,6 +1520,15 @@
|
||||
#if ENABLED(USE_ZMAX_PLUG)
|
||||
#define ENDSTOPPULLUP_ZMAX
|
||||
#endif
|
||||
#if ENABLED(USE_IMAX_PLUG)
|
||||
#define ENDSTOPPULLUP_IMAX
|
||||
#endif
|
||||
#if ENABLED(USE_JMAX_PLUG)
|
||||
#define ENDSTOPPULLUP_JMAX
|
||||
#endif
|
||||
#if ENABLED(USE_KMAX_PLUG)
|
||||
#define ENDSTOPPULLUP_KMAX
|
||||
#endif
|
||||
#if ENABLED(USE_XMIN_PLUG)
|
||||
#define ENDSTOPPULLUP_XMIN
|
||||
#endif
|
||||
@@ -1427,6 +1538,15 @@
|
||||
#if ENABLED(USE_ZMIN_PLUG)
|
||||
#define ENDSTOPPULLUP_ZMIN
|
||||
#endif
|
||||
#if ENABLED(USE_IMIN_PLUG)
|
||||
#define ENDSTOPPULLUP_IMIN
|
||||
#endif
|
||||
#if ENABLED(USE_JMIN_PLUG)
|
||||
#define ENDSTOPPULLUP_JMIN
|
||||
#endif
|
||||
#if ENABLED(USE_KMIN_PLUG)
|
||||
#define ENDSTOPPULLUP_KMIN
|
||||
#endif
|
||||
#endif
|
||||
|
||||
/**
|
||||
@@ -1484,219 +1604,278 @@
|
||||
#define HAS_X2_MS_PINS 1
|
||||
#endif
|
||||
|
||||
#if PIN_EXISTS(Y_ENABLE) || (ENABLED(SOFTWARE_DRIVER_ENABLE) && AXIS_IS_TMC(Y))
|
||||
#define HAS_Y_ENABLE 1
|
||||
#endif
|
||||
#if PIN_EXISTS(Y_DIR)
|
||||
#define HAS_Y_DIR 1
|
||||
#endif
|
||||
#if PIN_EXISTS(Y_STEP)
|
||||
#define HAS_Y_STEP 1
|
||||
#endif
|
||||
#if PIN_EXISTS(Y_MS1)
|
||||
#define HAS_Y_MS_PINS 1
|
||||
#if HAS_Y_AXIS
|
||||
#if PIN_EXISTS(Y_ENABLE) || (ENABLED(SOFTWARE_DRIVER_ENABLE) && AXIS_IS_TMC(Y))
|
||||
#define HAS_Y_ENABLE 1
|
||||
#endif
|
||||
#if PIN_EXISTS(Y_DIR)
|
||||
#define HAS_Y_DIR 1
|
||||
#endif
|
||||
#if PIN_EXISTS(Y_STEP)
|
||||
#define HAS_Y_STEP 1
|
||||
#endif
|
||||
#if PIN_EXISTS(Y_MS1)
|
||||
#define HAS_Y_MS_PINS 1
|
||||
#endif
|
||||
|
||||
#if PIN_EXISTS(Y2_ENABLE) || (ENABLED(SOFTWARE_DRIVER_ENABLE) && AXIS_IS_TMC(Y2))
|
||||
#define HAS_Y2_ENABLE 1
|
||||
#endif
|
||||
#if PIN_EXISTS(Y2_DIR)
|
||||
#define HAS_Y2_DIR 1
|
||||
#endif
|
||||
#if PIN_EXISTS(Y2_STEP)
|
||||
#define HAS_Y2_STEP 1
|
||||
#endif
|
||||
#if PIN_EXISTS(Y2_MS1)
|
||||
#define HAS_Y2_MS_PINS 1
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#if PIN_EXISTS(Y2_ENABLE) || (ENABLED(SOFTWARE_DRIVER_ENABLE) && AXIS_IS_TMC(Y2))
|
||||
#define HAS_Y2_ENABLE 1
|
||||
#endif
|
||||
#if PIN_EXISTS(Y2_DIR)
|
||||
#define HAS_Y2_DIR 1
|
||||
#endif
|
||||
#if PIN_EXISTS(Y2_STEP)
|
||||
#define HAS_Y2_STEP 1
|
||||
#endif
|
||||
#if PIN_EXISTS(Y2_MS1)
|
||||
#define HAS_Y2_MS_PINS 1
|
||||
#if HAS_Z_AXIS
|
||||
#if PIN_EXISTS(Z_ENABLE) || (ENABLED(SOFTWARE_DRIVER_ENABLE) && AXIS_IS_TMC(Z))
|
||||
#define HAS_Z_ENABLE 1
|
||||
#endif
|
||||
#if PIN_EXISTS(Z_DIR)
|
||||
#define HAS_Z_DIR 1
|
||||
#endif
|
||||
#if PIN_EXISTS(Z_STEP)
|
||||
#define HAS_Z_STEP 1
|
||||
#endif
|
||||
#if PIN_EXISTS(Z_MS1)
|
||||
#define HAS_Z_MS_PINS 1
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#if PIN_EXISTS(Z_ENABLE) || (ENABLED(SOFTWARE_DRIVER_ENABLE) && AXIS_IS_TMC(Z))
|
||||
#define HAS_Z_ENABLE 1
|
||||
#endif
|
||||
#if PIN_EXISTS(Z_DIR)
|
||||
#define HAS_Z_DIR 1
|
||||
#endif
|
||||
#if PIN_EXISTS(Z_STEP)
|
||||
#define HAS_Z_STEP 1
|
||||
#endif
|
||||
#if PIN_EXISTS(Z_MS1)
|
||||
#define HAS_Z_MS_PINS 1
|
||||
#if NUM_Z_STEPPER_DRIVERS >= 2
|
||||
#if PIN_EXISTS(Z2_ENABLE) || (ENABLED(SOFTWARE_DRIVER_ENABLE) && AXIS_IS_TMC(Z2))
|
||||
#define HAS_Z2_ENABLE 1
|
||||
#endif
|
||||
#if PIN_EXISTS(Z2_DIR)
|
||||
#define HAS_Z2_DIR 1
|
||||
#endif
|
||||
#if PIN_EXISTS(Z2_STEP)
|
||||
#define HAS_Z2_STEP 1
|
||||
#endif
|
||||
#if PIN_EXISTS(Z2_MS1)
|
||||
#define HAS_Z2_MS_PINS 1
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#if PIN_EXISTS(Z2_ENABLE) || (ENABLED(SOFTWARE_DRIVER_ENABLE) && AXIS_IS_TMC(Z2))
|
||||
#define HAS_Z2_ENABLE 1
|
||||
#endif
|
||||
#if PIN_EXISTS(Z2_DIR)
|
||||
#define HAS_Z2_DIR 1
|
||||
#endif
|
||||
#if PIN_EXISTS(Z2_STEP)
|
||||
#define HAS_Z2_STEP 1
|
||||
#endif
|
||||
#if PIN_EXISTS(Z2_MS1)
|
||||
#define HAS_Z2_MS_PINS 1
|
||||
#if NUM_Z_STEPPER_DRIVERS >= 3
|
||||
#if PIN_EXISTS(Z3_ENABLE) || (ENABLED(SOFTWARE_DRIVER_ENABLE) && AXIS_IS_TMC(Z3))
|
||||
#define HAS_Z3_ENABLE 1
|
||||
#endif
|
||||
#if PIN_EXISTS(Z3_DIR)
|
||||
#define HAS_Z3_DIR 1
|
||||
#endif
|
||||
#if PIN_EXISTS(Z3_STEP)
|
||||
#define HAS_Z3_STEP 1
|
||||
#endif
|
||||
#if PIN_EXISTS(Z3_MS1)
|
||||
#define HAS_Z3_MS_PINS 1
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#if PIN_EXISTS(Z3_ENABLE) || (ENABLED(SOFTWARE_DRIVER_ENABLE) && AXIS_IS_TMC(Z3))
|
||||
#define HAS_Z3_ENABLE 1
|
||||
#endif
|
||||
#if PIN_EXISTS(Z3_DIR)
|
||||
#define HAS_Z3_DIR 1
|
||||
#endif
|
||||
#if PIN_EXISTS(Z3_STEP)
|
||||
#define HAS_Z3_STEP 1
|
||||
#endif
|
||||
#if PIN_EXISTS(Z3_MS1)
|
||||
#define HAS_Z3_MS_PINS 1
|
||||
#if NUM_Z_STEPPER_DRIVERS >= 4
|
||||
#if PIN_EXISTS(Z4_ENABLE) || (ENABLED(SOFTWARE_DRIVER_ENABLE) && AXIS_IS_TMC(Z4))
|
||||
#define HAS_Z4_ENABLE 1
|
||||
#endif
|
||||
#if PIN_EXISTS(Z4_DIR)
|
||||
#define HAS_Z4_DIR 1
|
||||
#endif
|
||||
#if PIN_EXISTS(Z4_STEP)
|
||||
#define HAS_Z4_STEP 1
|
||||
#endif
|
||||
#if PIN_EXISTS(Z4_MS1)
|
||||
#define HAS_Z4_MS_PINS 1
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#if PIN_EXISTS(Z4_ENABLE) || (ENABLED(SOFTWARE_DRIVER_ENABLE) && AXIS_IS_TMC(Z4))
|
||||
#define HAS_Z4_ENABLE 1
|
||||
#if LINEAR_AXES >= 4
|
||||
#if PIN_EXISTS(I_ENABLE) || (ENABLED(SOFTWARE_DRIVER_ENABLE) && AXIS_IS_TMC(I))
|
||||
#define HAS_I_ENABLE 1
|
||||
#endif
|
||||
#if PIN_EXISTS(I_DIR)
|
||||
#define HAS_I_DIR 1
|
||||
#endif
|
||||
#if PIN_EXISTS(I_STEP)
|
||||
#define HAS_I_STEP 1
|
||||
#endif
|
||||
#if PIN_EXISTS(I_MS1)
|
||||
#define HAS_I_MS_PINS 1
|
||||
#endif
|
||||
#endif
|
||||
#if PIN_EXISTS(Z4_DIR)
|
||||
#define HAS_Z4_DIR 1
|
||||
|
||||
#if LINEAR_AXES >= 5
|
||||
#if PIN_EXISTS(J_ENABLE) || (ENABLED(SOFTWARE_DRIVER_ENABLE) && AXIS_IS_TMC(J))
|
||||
#define HAS_J_ENABLE 1
|
||||
#endif
|
||||
#if PIN_EXISTS(J_DIR)
|
||||
#define HAS_J_DIR 1
|
||||
#endif
|
||||
#if PIN_EXISTS(J_STEP)
|
||||
#define HAS_J_STEP 1
|
||||
#endif
|
||||
#if PIN_EXISTS(J_MS1)
|
||||
#define HAS_J_MS_PINS 1
|
||||
#endif
|
||||
#endif
|
||||
#if PIN_EXISTS(Z4_STEP)
|
||||
#define HAS_Z4_STEP 1
|
||||
#endif
|
||||
#if PIN_EXISTS(Z4_MS1)
|
||||
#define HAS_Z4_MS_PINS 1
|
||||
|
||||
#if LINEAR_AXES >= 6
|
||||
#if PIN_EXISTS(K_ENABLE) || (ENABLED(SOFTWARE_DRIVER_ENABLE) && AXIS_IS_TMC(K))
|
||||
#define HAS_K_ENABLE 1
|
||||
#endif
|
||||
#if PIN_EXISTS(K_DIR)
|
||||
#define HAS_K_DIR 1
|
||||
#endif
|
||||
#if PIN_EXISTS(K_STEP)
|
||||
#define HAS_K_STEP 1
|
||||
#endif
|
||||
#if PIN_EXISTS(K_MS1)
|
||||
#define HAS_K_MS_PINS 1
|
||||
#endif
|
||||
#endif
|
||||
|
||||
// Extruder steppers and solenoids
|
||||
#if PIN_EXISTS(E0_ENABLE) || (ENABLED(SOFTWARE_DRIVER_ENABLE) && AXIS_IS_TMC(E0))
|
||||
#define HAS_E0_ENABLE 1
|
||||
#endif
|
||||
#if PIN_EXISTS(E0_DIR)
|
||||
#define HAS_E0_DIR 1
|
||||
#endif
|
||||
#if PIN_EXISTS(E0_STEP)
|
||||
#define HAS_E0_STEP 1
|
||||
#endif
|
||||
#if PIN_EXISTS(E0_MS1)
|
||||
#define HAS_E0_MS_PINS 1
|
||||
#endif
|
||||
#if PIN_EXISTS(SOL0)
|
||||
#define HAS_SOLENOID_0 1
|
||||
#endif
|
||||
#if HAS_EXTRUDERS
|
||||
|
||||
#if PIN_EXISTS(E1_ENABLE) || (ENABLED(SOFTWARE_DRIVER_ENABLE) && AXIS_IS_TMC(E1))
|
||||
#define HAS_E1_ENABLE 1
|
||||
#endif
|
||||
#if PIN_EXISTS(E1_DIR)
|
||||
#define HAS_E1_DIR 1
|
||||
#endif
|
||||
#if PIN_EXISTS(E1_STEP)
|
||||
#define HAS_E1_STEP 1
|
||||
#endif
|
||||
#if PIN_EXISTS(E1_MS1)
|
||||
#define HAS_E1_MS_PINS 1
|
||||
#endif
|
||||
#if PIN_EXISTS(SOL1)
|
||||
#define HAS_SOLENOID_1 1
|
||||
#endif
|
||||
#if PIN_EXISTS(E0_ENABLE) || (ENABLED(SOFTWARE_DRIVER_ENABLE) && AXIS_IS_TMC(E0))
|
||||
#define HAS_E0_ENABLE 1
|
||||
#endif
|
||||
#if PIN_EXISTS(E0_DIR)
|
||||
#define HAS_E0_DIR 1
|
||||
#endif
|
||||
#if PIN_EXISTS(E0_STEP)
|
||||
#define HAS_E0_STEP 1
|
||||
#endif
|
||||
#if PIN_EXISTS(E0_MS1)
|
||||
#define HAS_E0_MS_PINS 1
|
||||
#endif
|
||||
#if PIN_EXISTS(SOL0)
|
||||
#define HAS_SOLENOID_0 1
|
||||
#endif
|
||||
|
||||
#if PIN_EXISTS(E2_ENABLE) || (ENABLED(SOFTWARE_DRIVER_ENABLE) && AXIS_IS_TMC(E2))
|
||||
#define HAS_E2_ENABLE 1
|
||||
#endif
|
||||
#if PIN_EXISTS(E2_DIR)
|
||||
#define HAS_E2_DIR 1
|
||||
#endif
|
||||
#if PIN_EXISTS(E2_STEP)
|
||||
#define HAS_E2_STEP 1
|
||||
#endif
|
||||
#if PIN_EXISTS(E2_MS1)
|
||||
#define HAS_E2_MS_PINS 1
|
||||
#endif
|
||||
#if PIN_EXISTS(SOL2)
|
||||
#define HAS_SOLENOID_2 1
|
||||
#endif
|
||||
#if PIN_EXISTS(E1_ENABLE) || (ENABLED(SOFTWARE_DRIVER_ENABLE) && AXIS_IS_TMC(E1))
|
||||
#define HAS_E1_ENABLE 1
|
||||
#endif
|
||||
#if PIN_EXISTS(E1_DIR)
|
||||
#define HAS_E1_DIR 1
|
||||
#endif
|
||||
#if PIN_EXISTS(E1_STEP)
|
||||
#define HAS_E1_STEP 1
|
||||
#endif
|
||||
#if PIN_EXISTS(E1_MS1)
|
||||
#define HAS_E1_MS_PINS 1
|
||||
#endif
|
||||
#if PIN_EXISTS(SOL1)
|
||||
#define HAS_SOLENOID_1 1
|
||||
#endif
|
||||
|
||||
#if PIN_EXISTS(E3_ENABLE) || (ENABLED(SOFTWARE_DRIVER_ENABLE) && AXIS_IS_TMC(E3))
|
||||
#define HAS_E3_ENABLE 1
|
||||
#endif
|
||||
#if PIN_EXISTS(E3_DIR)
|
||||
#define HAS_E3_DIR 1
|
||||
#endif
|
||||
#if PIN_EXISTS(E3_STEP)
|
||||
#define HAS_E3_STEP 1
|
||||
#endif
|
||||
#if PIN_EXISTS(E3_MS1)
|
||||
#define HAS_E3_MS_PINS 1
|
||||
#endif
|
||||
#if PIN_EXISTS(SOL3)
|
||||
#define HAS_SOLENOID_3 1
|
||||
#endif
|
||||
#if PIN_EXISTS(E2_ENABLE) || (ENABLED(SOFTWARE_DRIVER_ENABLE) && AXIS_IS_TMC(E2))
|
||||
#define HAS_E2_ENABLE 1
|
||||
#endif
|
||||
#if PIN_EXISTS(E2_DIR)
|
||||
#define HAS_E2_DIR 1
|
||||
#endif
|
||||
#if PIN_EXISTS(E2_STEP)
|
||||
#define HAS_E2_STEP 1
|
||||
#endif
|
||||
#if PIN_EXISTS(E2_MS1)
|
||||
#define HAS_E2_MS_PINS 1
|
||||
#endif
|
||||
#if PIN_EXISTS(SOL2)
|
||||
#define HAS_SOLENOID_2 1
|
||||
#endif
|
||||
|
||||
#if PIN_EXISTS(E4_ENABLE) || (ENABLED(SOFTWARE_DRIVER_ENABLE) && AXIS_IS_TMC(E4))
|
||||
#define HAS_E4_ENABLE 1
|
||||
#endif
|
||||
#if PIN_EXISTS(E4_DIR)
|
||||
#define HAS_E4_DIR 1
|
||||
#endif
|
||||
#if PIN_EXISTS(E4_STEP)
|
||||
#define HAS_E4_STEP 1
|
||||
#endif
|
||||
#if PIN_EXISTS(E4_MS1)
|
||||
#define HAS_E4_MS_PINS 1
|
||||
#endif
|
||||
#if PIN_EXISTS(SOL4)
|
||||
#define HAS_SOLENOID_4 1
|
||||
#endif
|
||||
#if PIN_EXISTS(E3_ENABLE) || (ENABLED(SOFTWARE_DRIVER_ENABLE) && AXIS_IS_TMC(E3))
|
||||
#define HAS_E3_ENABLE 1
|
||||
#endif
|
||||
#if PIN_EXISTS(E3_DIR)
|
||||
#define HAS_E3_DIR 1
|
||||
#endif
|
||||
#if PIN_EXISTS(E3_STEP)
|
||||
#define HAS_E3_STEP 1
|
||||
#endif
|
||||
#if PIN_EXISTS(E3_MS1)
|
||||
#define HAS_E3_MS_PINS 1
|
||||
#endif
|
||||
#if PIN_EXISTS(SOL3)
|
||||
#define HAS_SOLENOID_3 1
|
||||
#endif
|
||||
|
||||
#if PIN_EXISTS(E5_ENABLE) || (ENABLED(SOFTWARE_DRIVER_ENABLE) && AXIS_IS_TMC(E5))
|
||||
#define HAS_E5_ENABLE 1
|
||||
#endif
|
||||
#if PIN_EXISTS(E5_DIR)
|
||||
#define HAS_E5_DIR 1
|
||||
#endif
|
||||
#if PIN_EXISTS(E5_STEP)
|
||||
#define HAS_E5_STEP 1
|
||||
#endif
|
||||
#if PIN_EXISTS(E5_MS1)
|
||||
#define HAS_E5_MS_PINS 1
|
||||
#endif
|
||||
#if PIN_EXISTS(SOL5)
|
||||
#define HAS_SOLENOID_5 1
|
||||
#endif
|
||||
#if PIN_EXISTS(E4_ENABLE) || (ENABLED(SOFTWARE_DRIVER_ENABLE) && AXIS_IS_TMC(E4))
|
||||
#define HAS_E4_ENABLE 1
|
||||
#endif
|
||||
#if PIN_EXISTS(E4_DIR)
|
||||
#define HAS_E4_DIR 1
|
||||
#endif
|
||||
#if PIN_EXISTS(E4_STEP)
|
||||
#define HAS_E4_STEP 1
|
||||
#endif
|
||||
#if PIN_EXISTS(E4_MS1)
|
||||
#define HAS_E4_MS_PINS 1
|
||||
#endif
|
||||
#if PIN_EXISTS(SOL4)
|
||||
#define HAS_SOLENOID_4 1
|
||||
#endif
|
||||
|
||||
#if PIN_EXISTS(E6_ENABLE) || (ENABLED(SOFTWARE_DRIVER_ENABLE) && AXIS_IS_TMC(E6))
|
||||
#define HAS_E6_ENABLE 1
|
||||
#endif
|
||||
#if PIN_EXISTS(E6_DIR)
|
||||
#define HAS_E6_DIR 1
|
||||
#endif
|
||||
#if PIN_EXISTS(E6_STEP)
|
||||
#define HAS_E6_STEP 1
|
||||
#endif
|
||||
#if PIN_EXISTS(E6_MS1)
|
||||
#define HAS_E6_MS_PINS 1
|
||||
#endif
|
||||
#if PIN_EXISTS(SOL6)
|
||||
#define HAS_SOLENOID_6 1
|
||||
#endif
|
||||
#if PIN_EXISTS(E5_ENABLE) || (ENABLED(SOFTWARE_DRIVER_ENABLE) && AXIS_IS_TMC(E5))
|
||||
#define HAS_E5_ENABLE 1
|
||||
#endif
|
||||
#if PIN_EXISTS(E5_DIR)
|
||||
#define HAS_E5_DIR 1
|
||||
#endif
|
||||
#if PIN_EXISTS(E5_STEP)
|
||||
#define HAS_E5_STEP 1
|
||||
#endif
|
||||
#if PIN_EXISTS(E5_MS1)
|
||||
#define HAS_E5_MS_PINS 1
|
||||
#endif
|
||||
#if PIN_EXISTS(SOL5)
|
||||
#define HAS_SOLENOID_5 1
|
||||
#endif
|
||||
|
||||
#if PIN_EXISTS(E7_ENABLE) || (ENABLED(SOFTWARE_DRIVER_ENABLE) && AXIS_IS_TMC(E7))
|
||||
#define HAS_E7_ENABLE 1
|
||||
#endif
|
||||
#if PIN_EXISTS(E7_DIR)
|
||||
#define HAS_E7_DIR 1
|
||||
#endif
|
||||
#if PIN_EXISTS(E7_STEP)
|
||||
#define HAS_E7_STEP 1
|
||||
#endif
|
||||
#if PIN_EXISTS(E7_MS1)
|
||||
#define HAS_E7_MS_PINS 1
|
||||
#endif
|
||||
#if PIN_EXISTS(SOL7)
|
||||
#define HAS_SOLENOID_7 1
|
||||
#endif
|
||||
#if PIN_EXISTS(E6_ENABLE) || (ENABLED(SOFTWARE_DRIVER_ENABLE) && AXIS_IS_TMC(E6))
|
||||
#define HAS_E6_ENABLE 1
|
||||
#endif
|
||||
#if PIN_EXISTS(E6_DIR)
|
||||
#define HAS_E6_DIR 1
|
||||
#endif
|
||||
#if PIN_EXISTS(E6_STEP)
|
||||
#define HAS_E6_STEP 1
|
||||
#endif
|
||||
#if PIN_EXISTS(E6_MS1)
|
||||
#define HAS_E6_MS_PINS 1
|
||||
#endif
|
||||
#if PIN_EXISTS(SOL6)
|
||||
#define HAS_SOLENOID_6 1
|
||||
#endif
|
||||
|
||||
#if PIN_EXISTS(E7_ENABLE) || (ENABLED(SOFTWARE_DRIVER_ENABLE) && AXIS_IS_TMC(E7))
|
||||
#define HAS_E7_ENABLE 1
|
||||
#endif
|
||||
#if PIN_EXISTS(E7_DIR)
|
||||
#define HAS_E7_DIR 1
|
||||
#endif
|
||||
#if PIN_EXISTS(E7_STEP)
|
||||
#define HAS_E7_STEP 1
|
||||
#endif
|
||||
#if PIN_EXISTS(E7_MS1)
|
||||
#define HAS_E7_MS_PINS 1
|
||||
#endif
|
||||
#if PIN_EXISTS(SOL7)
|
||||
#define HAS_SOLENOID_7 1
|
||||
#endif
|
||||
|
||||
#endif // HAS_EXTRUDERS
|
||||
|
||||
//
|
||||
// Trinamic Stepper Drivers
|
||||
//
|
||||
|
||||
#if HAS_TRINAMIC_CONFIG
|
||||
#if ANY(STEALTHCHOP_XY, STEALTHCHOP_Z, STEALTHCHOP_E)
|
||||
#if ANY(STEALTHCHOP_E, STEALTHCHOP_XY, STEALTHCHOP_Z, STEALTHCHOP_I, STEALTHCHOP_J, STEALTHCHOP_K)
|
||||
#define STEALTHCHOP_ENABLED 1
|
||||
#endif
|
||||
#if EITHER(SENSORLESS_HOMING, SENSORLESS_PROBING)
|
||||
@@ -1733,6 +1912,65 @@
|
||||
#if defined(Z4_STALL_SENSITIVITY) && AXIS_HAS_STALLGUARD(Z4)
|
||||
#define Z4_SENSORLESS 1
|
||||
#endif
|
||||
|
||||
#if AXIS_HAS_STEALTHCHOP(X)
|
||||
#define X_HAS_STEALTHCHOP 1
|
||||
#endif
|
||||
#if AXIS_HAS_STEALTHCHOP(X2)
|
||||
#define X2_HAS_STEALTHCHOP 1
|
||||
#endif
|
||||
#if AXIS_HAS_STEALTHCHOP(Y)
|
||||
#define Y_HAS_STEALTHCHOP 1
|
||||
#endif
|
||||
#if AXIS_HAS_STEALTHCHOP(Y2)
|
||||
#define Y2_HAS_STEALTHCHOP 1
|
||||
#endif
|
||||
#if AXIS_HAS_STEALTHCHOP(Z)
|
||||
#define Z_HAS_STEALTHCHOP 1
|
||||
#endif
|
||||
#if AXIS_HAS_STEALTHCHOP(Z2)
|
||||
#define Z2_HAS_STEALTHCHOP 1
|
||||
#endif
|
||||
#if AXIS_HAS_STEALTHCHOP(Z3)
|
||||
#define Z3_HAS_STEALTHCHOP 1
|
||||
#endif
|
||||
#if AXIS_HAS_STEALTHCHOP(Z4)
|
||||
#define Z4_HAS_STEALTHCHOP 1
|
||||
#endif
|
||||
#if AXIS_HAS_STEALTHCHOP(I)
|
||||
#define I_HAS_STEALTHCHOP 1
|
||||
#endif
|
||||
#if AXIS_HAS_STEALTHCHOP(J)
|
||||
#define J_HAS_STEALTHCHOP 1
|
||||
#endif
|
||||
#if AXIS_HAS_STEALTHCHOP(K)
|
||||
#define K_HAS_STEALTHCHOP 1
|
||||
#endif
|
||||
#if E_STEPPERS > 0 && AXIS_HAS_STEALTHCHOP(E0)
|
||||
#define E0_HAS_STEALTHCHOP 1
|
||||
#endif
|
||||
#if E_STEPPERS > 1 && AXIS_HAS_STEALTHCHOP(E1)
|
||||
#define E1_HAS_STEALTHCHOP 1
|
||||
#endif
|
||||
#if E_STEPPERS > 2 && AXIS_HAS_STEALTHCHOP(E2)
|
||||
#define E2_HAS_STEALTHCHOP 1
|
||||
#endif
|
||||
#if E_STEPPERS > 3 && AXIS_HAS_STEALTHCHOP(E3)
|
||||
#define E3_HAS_STEALTHCHOP 1
|
||||
#endif
|
||||
#if E_STEPPERS > 4 && AXIS_HAS_STEALTHCHOP(E4)
|
||||
#define E4_HAS_STEALTHCHOP 1
|
||||
#endif
|
||||
#if E_STEPPERS > 5 && AXIS_HAS_STEALTHCHOP(E5)
|
||||
#define E5_HAS_STEALTHCHOP 1
|
||||
#endif
|
||||
#if E_STEPPERS > 6 && AXIS_HAS_STEALTHCHOP(E6)
|
||||
#define E6_HAS_STEALTHCHOP 1
|
||||
#endif
|
||||
#if E_STEPPERS > 7 && AXIS_HAS_STEALTHCHOP(E7)
|
||||
#define E7_HAS_STEALTHCHOP 1
|
||||
#endif
|
||||
|
||||
#if ENABLED(SPI_ENDSTOPS)
|
||||
#define X_SPI_SENSORLESS X_SENSORLESS
|
||||
#define Y_SPI_SENSORLESS Y_SENSORLESS
|
||||
@@ -1762,6 +2000,21 @@
|
||||
#ifndef Z4_INTERPOLATE
|
||||
#define Z4_INTERPOLATE INTERPOLATE
|
||||
#endif
|
||||
#if LINEAR_AXES >= 4
|
||||
#ifndef I_INTERPOLATE
|
||||
#define I_INTERPOLATE INTERPOLATE
|
||||
#endif
|
||||
#endif
|
||||
#if LINEAR_AXES >= 5
|
||||
#ifndef J_INTERPOLATE
|
||||
#define J_INTERPOLATE INTERPOLATE
|
||||
#endif
|
||||
#endif
|
||||
#if LINEAR_AXES >= 6
|
||||
#ifndef K_INTERPOLATE
|
||||
#define K_INTERPOLATE INTERPOLATE
|
||||
#endif
|
||||
#endif
|
||||
#ifndef E0_INTERPOLATE
|
||||
#define E0_INTERPOLATE INTERPOLATE
|
||||
#endif
|
||||
@@ -1795,6 +2048,15 @@
|
||||
#ifndef Z_SLAVE_ADDRESS
|
||||
#define Z_SLAVE_ADDRESS 0
|
||||
#endif
|
||||
#ifndef I_SLAVE_ADDRESS
|
||||
#define I_SLAVE_ADDRESS 0
|
||||
#endif
|
||||
#ifndef J_SLAVE_ADDRESS
|
||||
#define J_SLAVE_ADDRESS 0
|
||||
#endif
|
||||
#ifndef K_SLAVE_ADDRESS
|
||||
#define K_SLAVE_ADDRESS 0
|
||||
#endif
|
||||
#ifndef X2_SLAVE_ADDRESS
|
||||
#define X2_SLAVE_ADDRESS 0
|
||||
#endif
|
||||
@@ -1849,6 +2111,10 @@
|
||||
#define HAS_TMC_SW_SERIAL 1
|
||||
#endif
|
||||
|
||||
#if !USE_SENSORLESS
|
||||
#undef SENSORLESS_BACKOFF_MM
|
||||
#endif
|
||||
|
||||
//
|
||||
// Set USING_HW_SERIALn flags for used Serial Ports
|
||||
//
|
||||
@@ -1968,18 +2234,36 @@
|
||||
#if _HAS_STOP(X,MAX)
|
||||
#define HAS_X_MAX 1
|
||||
#endif
|
||||
#if _HAS_STOP(Y,MIN)
|
||||
#if HAS_Y_AXIS && _HAS_STOP(Y,MIN)
|
||||
#define HAS_Y_MIN 1
|
||||
#endif
|
||||
#if _HAS_STOP(Y,MAX)
|
||||
#if HAS_Y_AXIS && _HAS_STOP(Y,MAX)
|
||||
#define HAS_Y_MAX 1
|
||||
#endif
|
||||
#if _HAS_STOP(Z,MIN)
|
||||
#if BOTH(HAS_Z_AXIS, USE_ZMIN_PLUG) && _HAS_STOP(Z,MIN)
|
||||
#define HAS_Z_MIN 1
|
||||
#endif
|
||||
#if _HAS_STOP(Z,MAX)
|
||||
#if BOTH(HAS_Z_AXIS, USE_ZMAX_PLUG) && _HAS_STOP(Z,MAX)
|
||||
#define HAS_Z_MAX 1
|
||||
#endif
|
||||
#if _HAS_STOP(I,MIN)
|
||||
#define HAS_I_MIN 1
|
||||
#endif
|
||||
#if _HAS_STOP(I,MAX)
|
||||
#define HAS_I_MAX 1
|
||||
#endif
|
||||
#if _HAS_STOP(J,MIN)
|
||||
#define HAS_J_MIN 1
|
||||
#endif
|
||||
#if _HAS_STOP(J,MAX)
|
||||
#define HAS_J_MAX 1
|
||||
#endif
|
||||
#if _HAS_STOP(K,MIN)
|
||||
#define HAS_K_MIN 1
|
||||
#endif
|
||||
#if _HAS_STOP(K,MAX)
|
||||
#define HAS_K_MAX 1
|
||||
#endif
|
||||
#if PIN_EXISTS(X2_MIN)
|
||||
#define HAS_X2_MIN 1
|
||||
#endif
|
||||
@@ -2348,7 +2632,10 @@
|
||||
#if PIN_EXISTS(DIGIPOTSS)
|
||||
#define HAS_MOTOR_CURRENT_SPI 1
|
||||
#endif
|
||||
#if ANY_PIN(MOTOR_CURRENT_PWM_X, MOTOR_CURRENT_PWM_Y, MOTOR_CURRENT_PWM_XY, MOTOR_CURRENT_PWM_Z, MOTOR_CURRENT_PWM_E)
|
||||
#if HAS_EXTRUDERS && PIN_EXISTS(MOTOR_CURRENT_PWM_E)
|
||||
#define HAS_MOTOR_CURRENT_PWM_E 1
|
||||
#endif
|
||||
#if HAS_MOTOR_CURRENT_PWM_E || ANY_PIN(MOTOR_CURRENT_PWM_X, MOTOR_CURRENT_PWM_Y, MOTOR_CURRENT_PWM_XY, MOTOR_CURRENT_PWM_Z)
|
||||
#define HAS_MOTOR_CURRENT_PWM 1
|
||||
#endif
|
||||
|
||||
@@ -2358,7 +2645,7 @@
|
||||
#if ANY(HAS_E0_MS_PINS, HAS_E1_MS_PINS, HAS_E2_MS_PINS, HAS_E3_MS_PINS, HAS_E4_MS_PINS, HAS_E5_MS_PINS, HAS_E6_MS_PINS, HAS_E7_MS_PINS)
|
||||
#define HAS_SOME_E_MS_PINS 1
|
||||
#endif
|
||||
#if ANY(HAS_X_MS_PINS, HAS_X2_MS_PINS, HAS_Y_MS_PINS, HAS_Y2_MS_PINS, HAS_SOME_Z_MS_PINS, HAS_SOME_E_MS_PINS)
|
||||
#if ANY(HAS_X_MS_PINS, HAS_X2_MS_PINS, HAS_Y_MS_PINS, HAS_Y2_MS_PINS, HAS_SOME_Z_MS_PINS, HAS_I_MS_PINS, HAS_J_MS_PINS, HAS_K_MS_PINS, HAS_SOME_E_MS_PINS)
|
||||
#define HAS_MICROSTEPS 1
|
||||
#endif
|
||||
|
||||
|
||||
+301
-48
@@ -34,6 +34,10 @@
|
||||
#error "Marlin requires C++11 support (gcc >= 4.7, Arduino IDE >= 1.6.8). Please upgrade your toolchain."
|
||||
#endif
|
||||
|
||||
// Strings for sanity check messages
|
||||
#define _LINEAR_AXES_STR LINEAR_AXIS_GANG("X ", "Y ", "Z ", "I ", "J ", "K ")
|
||||
#define _LOGICAL_AXES_STR LOGICAL_AXIS_GANG("E ", "X ", "Y ", "Z ", "I ", "J ", "K ")
|
||||
|
||||
// Make sure macros aren't borked
|
||||
#define TEST1
|
||||
#define TEST2 1
|
||||
@@ -562,8 +566,13 @@
|
||||
#error "CUSTOM_USER_MENUS has been replaced by CUSTOM_MENU_MAIN and CUSTOM_MENU_CONFIG."
|
||||
#elif defined(MKS_LCD12864)
|
||||
#error "MKS_LCD12864 is now MKS_LCD12864A or MKS_LCD12864B."
|
||||
#elif defined(NEOPIXEL_BKGD_LED_INDEX)
|
||||
#error "NEOPIXEL_BKGD_LED_INDEX is now NEOPIXEL_BKGD_INDEX_FIRST."
|
||||
#endif
|
||||
|
||||
constexpr float sbm[] = AXIS_RELATIVE_MODES;
|
||||
static_assert(COUNT(sbm) == LOGICAL_AXES, "AXIS_RELATIVE_MODES must contain " _LOGICAL_AXES_STR "elements.");
|
||||
|
||||
/**
|
||||
* Probe temp compensation requirements
|
||||
*/
|
||||
@@ -642,14 +651,18 @@
|
||||
|
||||
#if ENABLED(Y_DUAL_STEPPER_DRIVERS) && !GOOD_AXIS_PINS(Y)
|
||||
#error "Y_DUAL_STEPPER_DRIVERS requires Y2 pins to be defined."
|
||||
#elif !WITHIN(NUM_Z_STEPPER_DRIVERS, 1, 4)
|
||||
#error "NUM_Z_STEPPER_DRIVERS must be an integer from 1 to 4."
|
||||
#elif NUM_Z_STEPPER_DRIVERS == 2 && !GOOD_AXIS_PINS(Z2)
|
||||
#error "If NUM_Z_STEPPER_DRIVERS is 2, you must define stepper pins for Z2."
|
||||
#elif NUM_Z_STEPPER_DRIVERS == 3 && !(GOOD_AXIS_PINS(Z2) && GOOD_AXIS_PINS(Z3))
|
||||
#error "If NUM_Z_STEPPER_DRIVERS is 3, you must define stepper pins for Z2 and Z3."
|
||||
#elif NUM_Z_STEPPER_DRIVERS == 4 && !(GOOD_AXIS_PINS(Z2) && GOOD_AXIS_PINS(Z3) && GOOD_AXIS_PINS(Z4))
|
||||
#error "If NUM_Z_STEPPER_DRIVERS is 4, you must define stepper pins for Z2, Z3, and Z4."
|
||||
#endif
|
||||
|
||||
#if HAS_Z_AXIS
|
||||
#if !WITHIN(NUM_Z_STEPPER_DRIVERS, 1, 4)
|
||||
#error "NUM_Z_STEPPER_DRIVERS must be an integer from 1 to 4."
|
||||
#elif NUM_Z_STEPPER_DRIVERS == 2 && !GOOD_AXIS_PINS(Z2)
|
||||
#error "If NUM_Z_STEPPER_DRIVERS is 2, you must define stepper pins for Z2."
|
||||
#elif NUM_Z_STEPPER_DRIVERS == 3 && !(GOOD_AXIS_PINS(Z2) && GOOD_AXIS_PINS(Z3))
|
||||
#error "If NUM_Z_STEPPER_DRIVERS is 3, you must define stepper pins for Z2 and Z3."
|
||||
#elif NUM_Z_STEPPER_DRIVERS == 4 && !(GOOD_AXIS_PINS(Z2) && GOOD_AXIS_PINS(Z3) && GOOD_AXIS_PINS(Z4))
|
||||
#error "If NUM_Z_STEPPER_DRIVERS is 4, you must define stepper pins for Z2, Z3, and Z4."
|
||||
#endif
|
||||
#endif
|
||||
|
||||
/**
|
||||
@@ -702,6 +715,12 @@ static_assert(Y_MAX_LENGTH >= Y_BED_SIZE, "Movement bounds (Y_MIN_POS, Y_MAX_POS
|
||||
#error "Enable only one of ENDSTOPPULLUP_Y_MIN or ENDSTOPPULLDOWN_Y_MIN."
|
||||
#elif BOTH(ENDSTOPPULLUP_ZMIN, ENDSTOPPULLDOWN_ZMIN)
|
||||
#error "Enable only one of ENDSTOPPULLUP_Z_MIN or ENDSTOPPULLDOWN_Z_MIN."
|
||||
#elif BOTH(ENDSTOPPULLUP_IMIN, ENDSTOPPULLDOWN_IMIN)
|
||||
#error "Enable only one of ENDSTOPPULLUP_I_MIN or ENDSTOPPULLDOWN_I_MIN."
|
||||
#elif BOTH(ENDSTOPPULLUP_JMIN, ENDSTOPPULLDOWN_JMIN)
|
||||
#error "Enable only one of ENDSTOPPULLUP_J_MIN or ENDSTOPPULLDOWN_J_MIN."
|
||||
#elif BOTH(ENDSTOPPULLUP_KMIN, ENDSTOPPULLDOWN_KMIN)
|
||||
#error "Enable only one of ENDSTOPPULLUP_K_MIN or ENDSTOPPULLDOWN_K_MIN."
|
||||
#endif
|
||||
|
||||
/**
|
||||
@@ -924,6 +943,13 @@ static_assert(Y_MAX_LENGTH >= Y_BED_SIZE, "Movement bounds (Y_MIN_POS, Y_MAX_POS
|
||||
static_assert(WITHIN(npp_xyz.z, Z_MIN_POS, Z_MAX_POS), "NOZZLE_PARK_POINT.Z is out of bounds (Z_MIN_POS, Z_MAX_POS).");
|
||||
#endif
|
||||
|
||||
/**
|
||||
* Instant Freeze
|
||||
*/
|
||||
#if ENABLED(FREEZE_FEATURE) && !PIN_EXISTS(FREEZE)
|
||||
#error "FREEZE_FEATURE requires a FREEZE_PIN to be defined."
|
||||
#endif
|
||||
|
||||
/**
|
||||
* Individual axis homing is useless for DELTAS
|
||||
*/
|
||||
@@ -952,9 +978,11 @@ static_assert(Y_MAX_LENGTH >= Y_BED_SIZE, "Movement bounds (Y_MIN_POS, Y_MAX_POS
|
||||
* Multi-Material-Unit 2 / EXTENDABLE_EMU_MMU2 requirements
|
||||
*/
|
||||
#if HAS_PRUSA_MMU2
|
||||
#if EXTRUDERS != 5
|
||||
#if !HAS_EXTENDABLE_MMU && EXTRUDERS != 5
|
||||
#undef SINGLENOZZLE
|
||||
#error "PRUSA_MMU2(S) requires exactly 5 EXTRUDERS. Please update your Configuration."
|
||||
#elif HAS_EXTENDABLE_MMU && EXTRUDERS > 15
|
||||
#error "EXTRUDERS is too large for MMU(S) emulation mode. The maximum value is 15."
|
||||
#elif DISABLED(NOZZLE_PARK_FEATURE)
|
||||
#error "PRUSA_MMU2(S) requires NOZZLE_PARK_FEATURE. Enable it to continue."
|
||||
#elif HAS_PRUSA_MMU2S && DISABLED(FILAMENT_RUNOUT_SENSOR)
|
||||
@@ -967,18 +995,19 @@ static_assert(Y_MAX_LENGTH >= Y_BED_SIZE, "Movement bounds (Y_MIN_POS, Y_MAX_POS
|
||||
static_assert(nullptr == strstr(MMU2_FILAMENT_RUNOUT_SCRIPT, "M600"), "ADVANCED_PAUSE_FEATURE is required to use M600 with PRUSA_MMU2(S) / HAS_EXTENDABLE_MMU(S).");
|
||||
#endif
|
||||
#endif
|
||||
#if HAS_EXTENDABLE_MMU && EXTRUDERS > 15
|
||||
#error "Too many extruders for MMU(S) emulation mode. (15 maximum)."
|
||||
#endif
|
||||
|
||||
/**
|
||||
* Options only for EXTRUDERS > 1
|
||||
*/
|
||||
#if HAS_MULTI_EXTRUDER
|
||||
|
||||
#if EXTRUDERS > 8
|
||||
#error "Marlin supports a maximum of 8 EXTRUDERS."
|
||||
#if HAS_EXTENDABLE_MMU
|
||||
#define MAX_EXTRUDERS 15
|
||||
#else
|
||||
#define MAX_EXTRUDERS 8
|
||||
#endif
|
||||
static_assert(EXTRUDERS <= MAX_EXTRUDERS, "Marlin supports a maximum of " STRINGIFY(MAX_EXTRUDERS) " EXTRUDERS.");
|
||||
#undef MAX_EXTRUDERS
|
||||
|
||||
#if ENABLED(HEATERS_PARALLEL)
|
||||
#error "EXTRUDERS must be 1 with HEATERS_PARALLEL."
|
||||
@@ -1261,6 +1290,42 @@ static_assert(Y_MAX_LENGTH >= Y_BED_SIZE, "Movement bounds (Y_MIN_POS, Y_MAX_POS
|
||||
#error "To use CHAMBER_LIMIT_SWITCHING you must disable PIDTEMPCHAMBER."
|
||||
#endif
|
||||
|
||||
/**
|
||||
* Features that require a min/max/specific LINEAR_AXES
|
||||
*/
|
||||
#if HAS_LEVELING && !HAS_Z_AXIS
|
||||
#error "Leveling in Marlin requires three or more axes, with Z as the vertical axis."
|
||||
#elif ENABLED(CNC_WORKSPACE_PLANES) && !HAS_Z_AXIS
|
||||
#error "CNC_WORKSPACE_PLANES currently requires LINEAR_AXES >= 3"
|
||||
#elif ENABLED(DIRECT_STEPPING) && LINEAR_AXES > XYZ
|
||||
#error "DIRECT_STEPPING currently requires LINEAR_AXES 3"
|
||||
#elif ENABLED(FOAMCUTTER_XYUV) && LINEAR_AXES < 5
|
||||
#error "FOAMCUTTER_XYUV requires LINEAR_AXES >= 5."
|
||||
#endif
|
||||
|
||||
/**
|
||||
* Allow only extra axis codes that do not conflict with G-code parameter names
|
||||
*/
|
||||
#if LINEAR_AXES >= 4
|
||||
#if AXIS4_NAME != 'A' && AXIS4_NAME != 'B' && AXIS4_NAME != 'C' && AXIS4_NAME != 'U' && AXIS4_NAME != 'V' && AXIS4_NAME != 'W'
|
||||
#error "AXIS4_NAME can only be one of 'A', 'B', 'C', 'U', 'V', or 'W'."
|
||||
#endif
|
||||
#endif
|
||||
#if LINEAR_AXES >= 5
|
||||
#if AXIS5_NAME == AXIS4_NAME || AXIS5_NAME == AXIS6_NAME
|
||||
#error "AXIS5_NAME must be different from AXIS4_NAME and AXIS6_NAME"
|
||||
#elif AXIS5_NAME != 'A' && AXIS5_NAME != 'B' && AXIS5_NAME != 'C' && AXIS5_NAME != 'U' && AXIS5_NAME != 'V' && AXIS5_NAME != 'W'
|
||||
#error "AXIS5_NAME can only be one of 'A', 'B', 'C', 'U', 'V', or 'W'."
|
||||
#endif
|
||||
#endif
|
||||
#if LINEAR_AXES >= 6
|
||||
#if AXIS6_NAME == AXIS5_NAME || AXIS6_NAME == AXIS4_NAME
|
||||
#error "AXIS6_NAME must be different from AXIS5_NAME and AXIS4_NAME."
|
||||
#elif AXIS6_NAME != 'A' && AXIS6_NAME != 'B' && AXIS6_NAME != 'C' && AXIS6_NAME != 'U' && AXIS6_NAME != 'V' && AXIS6_NAME != 'W'
|
||||
#error "AXIS6_NAME can only be one of 'A', 'B', 'C', 'U', 'V', or 'W'."
|
||||
#endif
|
||||
#endif
|
||||
|
||||
/**
|
||||
* Kinematics
|
||||
*/
|
||||
@@ -1268,8 +1333,8 @@ static_assert(Y_MAX_LENGTH >= Y_BED_SIZE, "Movement bounds (Y_MIN_POS, Y_MAX_POS
|
||||
/**
|
||||
* Allow only one kinematic type to be defined
|
||||
*/
|
||||
#if MANY(DELTA, MORGAN_SCARA, MP_SCARA, AXEL_TPARA, COREXY, COREXZ, COREYZ, COREYX, COREZX, COREZY, MARKFORGED_XY)
|
||||
#error "Please enable only one of DELTA, MORGAN_SCARA, AXEL_TPARA, COREXY, COREYX, COREXZ, COREZX, COREYZ, COREZY, or MARKFORGED_XY."
|
||||
#if MANY(DELTA, MORGAN_SCARA, MP_SCARA, AXEL_TPARA, COREXY, COREXZ, COREYZ, COREYX, COREZX, COREZY, MARKFORGED_XY, FOAMCUTTER_XYUV)
|
||||
#error "Please enable only one of DELTA, MORGAN_SCARA, MP_SCARA, AXEL_TPARA, COREXY, COREXZ, COREYZ, COREYX, COREZX, COREZY, MARKFORGED_XY, or FOAMCUTTER_XYUV."
|
||||
#endif
|
||||
|
||||
/**
|
||||
@@ -1582,6 +1647,8 @@ static_assert(Y_MAX_LENGTH >= Y_BED_SIZE, "Movement bounds (Y_MIN_POS, Y_MAX_POS
|
||||
#error "LCD_BED_LEVELING requires a programmable LCD controller."
|
||||
#elif !(ENABLED(MESH_BED_LEVELING) || HAS_ABL_NOT_UBL)
|
||||
#error "LCD_BED_LEVELING requires MESH_BED_LEVELING or AUTO_BED_LEVELING."
|
||||
#elif ENABLED(MESH_EDIT_MENU) && !HAS_MESH
|
||||
#error "MESH_EDIT_MENU requires MESH_BED_LEVELING, AUTO_BED_LEVELING_BILINEAR or AUTO_BED_LEVELING_UBL."
|
||||
#endif
|
||||
#endif
|
||||
|
||||
@@ -1590,13 +1657,59 @@ static_assert(Y_MAX_LENGTH >= Y_BED_SIZE, "Movement bounds (Y_MIN_POS, Y_MAX_POS
|
||||
#endif
|
||||
|
||||
/**
|
||||
* Homing
|
||||
* Homing checks
|
||||
*/
|
||||
constexpr float hbm[] = HOMING_BUMP_MM;
|
||||
static_assert(COUNT(hbm) == XYZ, "HOMING_BUMP_MM requires X, Y, and Z elements.");
|
||||
static_assert(hbm[X_AXIS] >= 0, "HOMING_BUMP_MM.X must be greater than or equal to 0.");
|
||||
static_assert(hbm[Y_AXIS] >= 0, "HOMING_BUMP_MM.Y must be greater than or equal to 0.");
|
||||
static_assert(hbm[Z_AXIS] >= 0, "HOMING_BUMP_MM.Z must be greater than or equal to 0.");
|
||||
#ifndef HOMING_BUMP_MM
|
||||
#error "Required setting HOMING_BUMP_MM is missing!"
|
||||
#elif !defined(HOMING_BUMP_DIVISOR)
|
||||
#error "Required setting HOMING_BUMP_DIVISOR is missing!"
|
||||
#else
|
||||
constexpr float hbm[] = HOMING_BUMP_MM, hbd[] = HOMING_BUMP_DIVISOR;
|
||||
static_assert(COUNT(hbm) == LINEAR_AXES, "HOMING_BUMP_MM must have " _LINEAR_AXES_STR "elements (and no others).");
|
||||
LINEAR_AXIS_CODE(
|
||||
static_assert(hbm[X_AXIS] >= 0, "HOMING_BUMP_MM.X must be greater than or equal to 0."),
|
||||
static_assert(hbm[Y_AXIS] >= 0, "HOMING_BUMP_MM.Y must be greater than or equal to 0."),
|
||||
static_assert(hbm[Z_AXIS] >= 0, "HOMING_BUMP_MM.Z must be greater than or equal to 0."),
|
||||
static_assert(hbm[I_AXIS] >= 0, "HOMING_BUMP_MM.I must be greater than or equal to 0."),
|
||||
static_assert(hbm[J_AXIS] >= 0, "HOMING_BUMP_MM.J must be greater than or equal to 0."),
|
||||
static_assert(hbm[K_AXIS] >= 0, "HOMING_BUMP_MM.K must be greater than or equal to 0.")
|
||||
);
|
||||
static_assert(COUNT(hbd) == LINEAR_AXES, "HOMING_BUMP_DIVISOR must have " _LINEAR_AXES_STR "elements (and no others).");
|
||||
LINEAR_AXIS_CODE(
|
||||
static_assert(hbd[X_AXIS] >= 1, "HOMING_BUMP_DIVISOR.X must be greater than or equal to 1."),
|
||||
static_assert(hbd[Y_AXIS] >= 1, "HOMING_BUMP_DIVISOR.Y must be greater than or equal to 1."),
|
||||
static_assert(hbd[Z_AXIS] >= 1, "HOMING_BUMP_DIVISOR.Z must be greater than or equal to 1."),
|
||||
static_assert(hbd[I_AXIS] >= 1, "HOMING_BUMP_DIVISOR.I must be greater than or equal to 1."),
|
||||
static_assert(hbd[J_AXIS] >= 1, "HOMING_BUMP_DIVISOR.J must be greater than or equal to 1."),
|
||||
static_assert(hbd[K_AXIS] >= 1, "HOMING_BUMP_DIVISOR.K must be greater than or equal to 1.")
|
||||
);
|
||||
#endif
|
||||
|
||||
#ifdef HOMING_BACKOFF_POST_MM
|
||||
constexpr float hbp[] = HOMING_BACKOFF_POST_MM;
|
||||
static_assert(COUNT(hbp) == LINEAR_AXES, "HOMING_BACKOFF_POST_MM must have " _LINEAR_AXES_STR "elements (and no others).");
|
||||
LINEAR_AXIS_CODE(
|
||||
static_assert(hbp[X_AXIS] >= 0, "HOMING_BACKOFF_POST_MM.X must be greater than or equal to 0."),
|
||||
static_assert(hbp[Y_AXIS] >= 0, "HOMING_BACKOFF_POST_MM.Y must be greater than or equal to 0."),
|
||||
static_assert(hbp[Z_AXIS] >= 0, "HOMING_BACKOFF_POST_MM.Z must be greater than or equal to 0."),
|
||||
static_assert(hbp[I_AXIS] >= 0, "HOMING_BACKOFF_POST_MM.I must be greater than or equal to 0."),
|
||||
static_assert(hbp[J_AXIS] >= 0, "HOMING_BACKOFF_POST_MM.J must be greater than or equal to 0."),
|
||||
static_assert(hbp[K_AXIS] >= 0, "HOMING_BACKOFF_POST_MM.K must be greater than or equal to 0.")
|
||||
);
|
||||
#endif
|
||||
|
||||
#ifdef SENSORLESS_BACKOFF_MM
|
||||
constexpr float sbm[] = SENSORLESS_BACKOFF_MM;
|
||||
static_assert(COUNT(sbm) == LINEAR_AXES, "SENSORLESS_BACKOFF_MM must have " _LINEAR_AXES_STR "elements (and no others).");
|
||||
LINEAR_AXIS_CODE(
|
||||
static_assert(sbm[X_AXIS] >= 0, "SENSORLESS_BACKOFF_MM.X must be greater than or equal to 0."),
|
||||
static_assert(sbm[Y_AXIS] >= 0, "SENSORLESS_BACKOFF_MM.Y must be greater than or equal to 0."),
|
||||
static_assert(sbm[Z_AXIS] >= 0, "SENSORLESS_BACKOFF_MM.Z must be greater than or equal to 0."),
|
||||
static_assert(sbm[I_AXIS] >= 0, "SENSORLESS_BACKOFF_MM.I must be greater than or equal to 0."),
|
||||
static_assert(sbm[J_AXIS] >= 0, "SENSORLESS_BACKOFF_MM.J must be greater than or equal to 0."),
|
||||
static_assert(sbm[K_AXIS] >= 0, "SENSORLESS_BACKOFF_MM.K must be greater than or equal to 0.")
|
||||
);
|
||||
#endif
|
||||
|
||||
#if ENABLED(CODEPENDENT_XY_HOMING)
|
||||
#if ENABLED(QUICK_HOME)
|
||||
@@ -1617,9 +1730,9 @@ static_assert(hbm[Z_AXIS] >= 0, "HOMING_BUMP_MM.Z must be greater than or equal
|
||||
/**
|
||||
* Make sure DISABLE_[XYZ] compatible with selected homing options
|
||||
*/
|
||||
#if ANY(DISABLE_X, DISABLE_Y, DISABLE_Z)
|
||||
#if ANY(DISABLE_X, DISABLE_Y, DISABLE_Z, DISABLE_I, DISABLE_J, DISABLE_K)
|
||||
#if EITHER(HOME_AFTER_DEACTIVATE, Z_SAFE_HOMING)
|
||||
#error "DISABLE_[XYZ] is not compatible with HOME_AFTER_DEACTIVATE or Z_SAFE_HOMING."
|
||||
#error "DISABLE_[XYZIJK] is not compatible with HOME_AFTER_DEACTIVATE or Z_SAFE_HOMING."
|
||||
#endif
|
||||
#endif
|
||||
|
||||
@@ -1976,12 +2089,16 @@ static_assert(hbm[Z_AXIS] >= 0, "HOMING_BUMP_MM.Z must be greater than or equal
|
||||
#error "HEATER_0_PIN not defined for this board."
|
||||
#elif !ANY_PIN(TEMP_0, MAX6675_SS)
|
||||
#error "TEMP_0_PIN or MAX6675_SS not defined for this board."
|
||||
#elif ((defined(__AVR_ATmega644P__) || defined(__AVR_ATmega1284P__)) && !PINS_EXIST(E0_STEP, E0_DIR))
|
||||
#error "E0_STEP_PIN or E0_DIR_PIN not defined for this board."
|
||||
#elif ( !(defined(__AVR_ATmega644P__) || defined(__AVR_ATmega1284P__)) && (!PINS_EXIST(E0_STEP, E0_DIR) || !HAS_E0_ENABLE))
|
||||
#error "E0_STEP_PIN, E0_DIR_PIN, or E0_ENABLE_PIN not defined for this board."
|
||||
#elif EXTRUDERS && TEMP_SENSOR_0 == 0
|
||||
#error "TEMP_SENSOR_0 is required if there are any extruders."
|
||||
#endif
|
||||
|
||||
#if HAS_EXTRUDERS
|
||||
#if ((defined(__AVR_ATmega644P__) || defined(__AVR_ATmega1284P__)) && !PINS_EXIST(E0_STEP, E0_DIR))
|
||||
#error "E0_STEP_PIN or E0_DIR_PIN not defined for this board."
|
||||
#elif ( !(defined(__AVR_ATmega644P__) || defined(__AVR_ATmega1284P__)) && (!PINS_EXIST(E0_STEP, E0_DIR) || !HAS_E0_ENABLE))
|
||||
#error "E0_STEP_PIN, E0_DIR_PIN, or E0_ENABLE_PIN not defined for this board."
|
||||
#elif EXTRUDERS && TEMP_SENSOR_0 == 0
|
||||
#error "TEMP_SENSOR_0 is required if there are any extruders."
|
||||
#endif
|
||||
#endif
|
||||
|
||||
/**
|
||||
@@ -2073,7 +2190,7 @@ static_assert(hbm[Z_AXIS] >= 0, "HOMING_BUMP_MM.Z must be greater than or equal
|
||||
#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##_MULTI_ENDSTOPS) && WITHIN(A##2_USE_ENDSTOP, _##P##MAX_, _##P##MIN_)) )
|
||||
#define _AXIS_PLUG_UNUSED_TEST(A) (_PLUG_UNUSED_TEST(A,X) && _PLUG_UNUSED_TEST(A,Y) && _PLUG_UNUSED_TEST(A,Z))
|
||||
#define _AXIS_PLUG_UNUSED_TEST(A) (1 LINEAR_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) ) )
|
||||
|
||||
// A machine with endstops must have a minimum of 3
|
||||
#if HAS_ENDSTOPS
|
||||
@@ -2086,6 +2203,15 @@ static_assert(hbm[Z_AXIS] >= 0, "HOMING_BUMP_MM.Z must be greater than or equal
|
||||
#if _AXIS_PLUG_UNUSED_TEST(Z)
|
||||
#error "You must enable USE_ZMIN_PLUG or USE_ZMAX_PLUG."
|
||||
#endif
|
||||
#if LINEAR_AXES >= 4 && _AXIS_PLUG_UNUSED_TEST(I)
|
||||
#error "You must enable USE_IMIN_PLUG or USE_IMAX_PLUG."
|
||||
#endif
|
||||
#if LINEAR_AXES >= 5 && _AXIS_PLUG_UNUSED_TEST(J)
|
||||
#error "You must enable USE_JMIN_PLUG or USE_JMAX_PLUG."
|
||||
#endif
|
||||
#if LINEAR_AXES >= 6 && _AXIS_PLUG_UNUSED_TEST(K)
|
||||
#error "You must enable USE_KMIN_PLUG or USE_KMAX_PLUG."
|
||||
#endif
|
||||
|
||||
// Delta and Cartesian use 3 homing endstops
|
||||
#if NONE(IS_SCARA, SPI_ENDSTOPS)
|
||||
@@ -2097,6 +2223,18 @@ static_assert(hbm[Z_AXIS] >= 0, "HOMING_BUMP_MM.Z must be greater than or equal
|
||||
#error "Enable USE_YMIN_PLUG when homing Y to MIN."
|
||||
#elif Y_HOME_TO_MAX && DISABLED(USE_YMAX_PLUG)
|
||||
#error "Enable USE_YMAX_PLUG when homing Y to MAX."
|
||||
#elif LINEAR_AXES >= 4 && I_HOME_TO_MIN && DISABLED(USE_IMIN_PLUG)
|
||||
#error "Enable USE_IMIN_PLUG when homing I to MIN."
|
||||
#elif LINEAR_AXES >= 4 && I_HOME_TO_MAX && DISABLED(USE_IMAX_PLUG)
|
||||
#error "Enable USE_IMAX_PLUG when homing I to MAX."
|
||||
#elif LINEAR_AXES >= 5 && J_HOME_TO_MIN && DISABLED(USE_JMIN_PLUG)
|
||||
#error "Enable USE_JMIN_PLUG when homing J to MIN."
|
||||
#elif LINEAR_AXES >= 5 && J_HOME_TO_MAX && DISABLED(USE_JMAX_PLUG)
|
||||
#error "Enable USE_JMAX_PLUG when homing J to MAX."
|
||||
#elif LINEAR_AXES >= 6 && K_HOME_TO_MIN && DISABLED(USE_KMIN_PLUG)
|
||||
#error "Enable USE_KMIN_PLUG when homing K to MIN."
|
||||
#elif LINEAR_AXES >= 6 && K_HOME_TO_MAX && DISABLED(USE_KMAX_PLUG)
|
||||
#error "Enable USE_KMAX_PLUG when homing K to MAX."
|
||||
#endif
|
||||
#endif
|
||||
|
||||
@@ -2491,6 +2629,12 @@ static_assert(hbm[Z_AXIS] >= 0, "HOMING_BUMP_MM.Z must be greater than or equal
|
||||
#error "An SPI driven TMC driver on E6 requires E6_CS_PIN."
|
||||
#elif INVALID_TMC_SPI(E7)
|
||||
#error "An SPI driven TMC driver on E7 requires E7_CS_PIN."
|
||||
#elif INVALID_TMC_SPI(I)
|
||||
#error "An SPI driven TMC on I requires I_CS_PIN."
|
||||
#elif INVALID_TMC_SPI(J)
|
||||
#error "An SPI driven TMC on J requires J_CS_PIN."
|
||||
#elif INVALID_TMC_SPI(K)
|
||||
#error "An SPI driven TMC on K requires K_CS_PIN."
|
||||
#endif
|
||||
#undef INVALID_TMC_SPI
|
||||
|
||||
@@ -2530,6 +2674,12 @@ static_assert(hbm[Z_AXIS] >= 0, "HOMING_BUMP_MM.Z must be greater than or equal
|
||||
#error "TMC2208 or TMC2209 on E6 requires E6_HARDWARE_SERIAL or E6_SERIAL_(RX|TX)_PIN."
|
||||
#elif INVALID_TMC_UART(E7)
|
||||
#error "TMC2208 or TMC2209 on E7 requires E7_HARDWARE_SERIAL or E7_SERIAL_(RX|TX)_PIN."
|
||||
#elif LINEAR_AXES >= 4 && INVALID_TMC_UART(I)
|
||||
#error "TMC2208 or TMC2209 on I requires I_HARDWARE_SERIAL or I_SERIAL_(RX|TX)_PIN."
|
||||
#elif LINEAR_AXES >= 5 && INVALID_TMC_UART(J)
|
||||
#error "TMC2208 or TMC2209 on J requires J_HARDWARE_SERIAL or J_SERIAL_(RX|TX)_PIN."
|
||||
#elif LINEAR_AXES >= 6 && INVALID_TMC_UART(K)
|
||||
#error "TMC2208 or TMC2209 on K requires K_HARDWARE_SERIAL or K_SERIAL_(RX|TX)_PIN."
|
||||
#endif
|
||||
#undef INVALID_TMC_UART
|
||||
|
||||
@@ -2553,6 +2703,12 @@ static_assert(hbm[Z_AXIS] >= 0, "HOMING_BUMP_MM.Z must be greater than or equal
|
||||
INVALID_TMC_ADDRESS(Z3);
|
||||
#elif AXIS_DRIVER_TYPE_Z4(TMC2209)
|
||||
INVALID_TMC_ADDRESS(Z4);
|
||||
#elif AXIS_DRIVER_TYPE_I(TMC2209)
|
||||
INVALID_TMC_ADDRESS(I);
|
||||
#elif AXIS_DRIVER_TYPE_J(TMC2209)
|
||||
INVALID_TMC_ADDRESS(J);
|
||||
#elif AXIS_DRIVER_TYPE_K(TMC2209)
|
||||
INVALID_TMC_ADDRESS(K);
|
||||
#elif AXIS_DRIVER_TYPE_E0(TMC2209)
|
||||
INVALID_TMC_ADDRESS(E0);
|
||||
#elif AXIS_DRIVER_TYPE_E1(TMC2209)
|
||||
@@ -2608,6 +2764,12 @@ static_assert(hbm[Z_AXIS] >= 0, "HOMING_BUMP_MM.Z must be greater than or equal
|
||||
INVALID_TMC_MS(E6)
|
||||
#elif !TMC_MICROSTEP_IS_VALID(E7)
|
||||
INVALID_TMC_MS(E7)
|
||||
#elif LINEAR_AXES >= 4 && !TMC_MICROSTEP_IS_VALID(I)
|
||||
INVALID_TMC_MS(I)
|
||||
#elif LINEAR_AXES >= 5 && !TMC_MICROSTEP_IS_VALID(J)
|
||||
INVALID_TMC_MS(J)
|
||||
#elif LINEAR_AXES >= 6 && !TMC_MICROSTEP_IS_VALID(K)
|
||||
INVALID_TMC_MS(K)
|
||||
#endif
|
||||
#undef INVALID_TMC_MS
|
||||
#undef TMC_MICROSTEP_IS_VALID
|
||||
@@ -2628,6 +2790,15 @@ static_assert(hbm[Z_AXIS] >= 0, "HOMING_BUMP_MM.Z must be greater than or equal
|
||||
#define X_ENDSTOP_INVERTING !AXIS_DRIVER_TYPE(X,TMC2209)
|
||||
#define Y_ENDSTOP_INVERTING !AXIS_DRIVER_TYPE(Y,TMC2209)
|
||||
#define Z_ENDSTOP_INVERTING !AXIS_DRIVER_TYPE(Z,TMC2209)
|
||||
#if LINEAR_AXES >= 4
|
||||
#define I_ENDSTOP_INVERTING !AXIS_DRIVER_TYPE(I,TMC2209)
|
||||
#endif
|
||||
#if LINEAR_AXES >= 5
|
||||
#define J_ENDSTOP_INVERTING !AXIS_DRIVER_TYPE(J,TMC2209)
|
||||
#endif
|
||||
#if LINEAR_AXES >= 6
|
||||
#define K_ENDSTOP_INVERTING !AXIS_DRIVER_TYPE(K,TMC2209)
|
||||
#endif
|
||||
|
||||
#if NONE(SPI_ENDSTOPS, ONBOARD_ENDSTOPPULLUPS, ENDSTOPPULLUPS)
|
||||
#if X_SENSORLESS && X_HOME_TO_MIN && DISABLED(ENDSTOPPULLUP_XMIN)
|
||||
@@ -2642,6 +2813,12 @@ static_assert(hbm[Z_AXIS] >= 0, "HOMING_BUMP_MM.Z must be greater than or equal
|
||||
#error "SENSORLESS_HOMING requires ENDSTOPPULLUP_ZMIN (or ENDSTOPPULLUPS) when homing to Z_MIN."
|
||||
#elif Z_SENSORLESS && Z_HOME_TO_MAX && DISABLED(ENDSTOPPULLUP_ZMAX)
|
||||
#error "SENSORLESS_HOMING requires ENDSTOPPULLUP_ZMAX (or ENDSTOPPULLUPS) when homing to Z_MAX."
|
||||
#elif LINEAR_AXES >= 4 && I_SENSORLESS && I_HOME_TO_MAX && DISABLED(ENDSTOPPULLUP_IMAX)
|
||||
#error "SENSORLESS_HOMING requires ENDSTOPPULLUP_IMAX (or ENDSTOPPULLUPS) when homing to I_MAX."
|
||||
#elif LINEAR_AXES >= 5 && J_SENSORLESS && J_HOME_TO_MAX && DISABLED(ENDSTOPPULLUP_JMAX)
|
||||
#error "SENSORLESS_HOMING requires ENDSTOPPULLUP_JMAX (or ENDSTOPPULLUPS) when homing to J_MAX."
|
||||
#elif LINEAR_AXES >= 6 && K_SENSORLESS && K_HOME_TO_MAX && DISABLED(ENDSTOPPULLUP_KMAX)
|
||||
#error "SENSORLESS_HOMING requires ENDSTOPPULLUP_KMAX (or ENDSTOPPULLUPS) when homing to K_MAX."
|
||||
#endif
|
||||
#endif
|
||||
|
||||
@@ -2686,6 +2863,42 @@ static_assert(hbm[Z_AXIS] >= 0, "HOMING_BUMP_MM.Z must be greater than or equal
|
||||
#else
|
||||
#error "SENSORLESS_HOMING requires Z_MAX_ENDSTOP_INVERTING = false when homing TMC2209 to Z_MAX."
|
||||
#endif
|
||||
#elif LINEAR_AXES >= 4 && I_SENSORLESS && I_HOME_TO_MIN && I_MIN_ENDSTOP_INVERTING != I_ENDSTOP_INVERTING
|
||||
#if I_ENDSTOP_INVERTING
|
||||
#error "SENSORLESS_HOMING requires I_MIN_ENDSTOP_INVERTING = true when homing to I_MIN."
|
||||
#else
|
||||
#error "SENSORLESS_HOMING requires I_MIN_ENDSTOP_INVERTING = false when homing TMC2209 to I_MIN."
|
||||
#endif
|
||||
#elif LINEAR_AXES >= 4 && I_SENSORLESS && I_HOME_TO_MAX && I_MAX_ENDSTOP_INVERTING != I_ENDSTOP_INVERTING
|
||||
#if I_ENDSTOP_INVERTING
|
||||
#error "SENSORLESS_HOMING requires I_MAX_ENDSTOP_INVERTING = true when homing to I_MAX."
|
||||
#else
|
||||
#error "SENSORLESS_HOMING requires I_MAX_ENDSTOP_INVERTING = false when homing TMC2209 to I_MAX."
|
||||
#endif
|
||||
#elif LINEAR_AXES >= 5 && J_SENSORLESS && J_HOME_TO_MIN && J_MIN_ENDSTOP_INVERTING != J_ENDSTOP_INVERTING
|
||||
#if J_ENDSTOP_INVERTING
|
||||
#error "SENSORLESS_HOMING requires J_MIN_ENDSTOP_INVERTING = true when homing to J_MIN."
|
||||
#else
|
||||
#error "SENSORLESS_HOMING requires J_MIN_ENDSTOP_INVERTING = false when homing TMC2209 to J_MIN."
|
||||
#endif
|
||||
#elif LINEAR_AXES >= 5 && J_SENSORLESS && J_HOME_TO_MAX && J_MAX_ENDSTOP_INVERTING != J_ENDSTOP_INVERTING
|
||||
#if J_ENDSTOP_INVERTING
|
||||
#error "SENSORLESS_HOMING requires J_MAX_ENDSTOP_INVERTING = true when homing to J_MAX."
|
||||
#else
|
||||
#error "SENSORLESS_HOMING requires J_MAX_ENDSTOP_INVERTING = false when homing TMC2209 to J_MAX."
|
||||
#endif
|
||||
#elif LINEAR_AXES >= 6 && K_SENSORLESS && K_HOME_TO_MIN && K_MIN_ENDSTOP_INVERTING != K_ENDSTOP_INVERTING
|
||||
#if K_ENDSTOP_INVERTING
|
||||
#error "SENSORLESS_HOMING requires K_MIN_ENDSTOP_INVERTING = true when homing to K_MIN."
|
||||
#else
|
||||
#error "SENSORLESS_HOMING requires K_MIN_ENDSTOP_INVERTING = false when homing TMC2209 to K_MIN."
|
||||
#endif
|
||||
#elif LINEAR_AXES >= 6 && K_SENSORLESS && K_HOME_TO_MAX && K_MAX_ENDSTOP_INVERTING != K_ENDSTOP_INVERTING
|
||||
#if K_ENDSTOP_INVERTING
|
||||
#error "SENSORLESS_HOMING requires K_MAX_ENDSTOP_INVERTING = true when homing to K_MAX."
|
||||
#else
|
||||
#error "SENSORLESS_HOMING requires K_MAX_ENDSTOP_INVERTING = false when homing TMC2209 to K_MAX."
|
||||
#endif
|
||||
#endif
|
||||
#endif
|
||||
|
||||
@@ -2700,6 +2913,9 @@ static_assert(hbm[Z_AXIS] >= 0, "HOMING_BUMP_MM.Z must be greater than or equal
|
||||
#undef X_ENDSTOP_INVERTING
|
||||
#undef Y_ENDSTOP_INVERTING
|
||||
#undef Z_ENDSTOP_INVERTING
|
||||
#undef I_ENDSTOP_INVERTING
|
||||
#undef J_ENDSTOP_INVERTING
|
||||
#undef K_ENDSTOP_INVERTING
|
||||
#endif
|
||||
|
||||
// Sensorless probing requirements
|
||||
@@ -2762,6 +2978,12 @@ static_assert(hbm[Z_AXIS] >= 0, "HOMING_BUMP_MM.Z must be greater than or equal
|
||||
#define CS_COMPARE Z2_CS_PIN
|
||||
#elif IN_CHAIN(Z3)
|
||||
#define CS_COMPARE Z3_CS_PIN
|
||||
#elif IN_CHAIN(I)
|
||||
#define CS_COMPARE I_CS_PIN
|
||||
#elif IN_CHAIN(J)
|
||||
#define CS_COMPARE J_CS_PIN
|
||||
#elif IN_CHAIN(K)
|
||||
#define CS_COMPARE K_CS_PIN
|
||||
#elif IN_CHAIN(E0)
|
||||
#define CS_COMPARE E0_CS_PIN
|
||||
#elif IN_CHAIN(E1)
|
||||
@@ -2781,6 +3003,7 @@ static_assert(hbm[Z_AXIS] >= 0, "HOMING_BUMP_MM.Z must be greater than or equal
|
||||
#endif
|
||||
#define BAD_CS_PIN(A) (IN_CHAIN(A) && A##_CS_PIN != CS_COMPARE)
|
||||
#if BAD_CS_PIN(X ) || BAD_CS_PIN(Y ) || BAD_CS_PIN(Z ) || BAD_CS_PIN(X2) || BAD_CS_PIN(Y2) || BAD_CS_PIN(Z2) || BAD_CS_PIN(Z3) || BAD_CS_PIN(Z4) \
|
||||
|| BAD_CS_PIN(I) || BAD_CS_PIN(J) || BAD_CS_PIN(K) \
|
||||
|| BAD_CS_PIN(E0) || BAD_CS_PIN(E1) || BAD_CS_PIN(E2) || BAD_CS_PIN(E3) || BAD_CS_PIN(E4) || BAD_CS_PIN(E5) || BAD_CS_PIN(E6) || BAD_CS_PIN(E7)
|
||||
#error "All chained TMC drivers must use the same CS pin."
|
||||
#endif
|
||||
@@ -2791,6 +3014,13 @@ static_assert(hbm[Z_AXIS] >= 0, "HOMING_BUMP_MM.Z must be greater than or equal
|
||||
#endif
|
||||
#undef IN_CHAIN
|
||||
|
||||
/**
|
||||
* L64XX requirement
|
||||
*/
|
||||
#if HAS_L64XX && LINEAR_AXES >= 4
|
||||
#error "L64XX requires LINEAR_AXES 3. Homing with L64XX is not yet implemented for LINEAR_AXES > 3."
|
||||
#endif
|
||||
|
||||
/**
|
||||
* Digipot requirement
|
||||
*/
|
||||
@@ -2808,43 +3038,48 @@ static_assert(hbm[Z_AXIS] >= 0, "HOMING_BUMP_MM.Z must be greater than or equal
|
||||
*/
|
||||
constexpr float sanity_arr_1[] = DEFAULT_AXIS_STEPS_PER_UNIT,
|
||||
sanity_arr_2[] = DEFAULT_MAX_FEEDRATE,
|
||||
sanity_arr_3[] = DEFAULT_MAX_ACCELERATION;
|
||||
sanity_arr_3[] = DEFAULT_MAX_ACCELERATION,
|
||||
sanity_arr_7[] = HOMING_FEEDRATE_MM_M;
|
||||
|
||||
#define _ARR_TEST(N,I) (sanity_arr_##N[_MIN(I,int(COUNT(sanity_arr_##N))-1)] > 0)
|
||||
#if HAS_MULTI_EXTRUDER
|
||||
#define _EXTRA_NOTE " (Did you forget to enable DISTINCT_E_FACTORS?)"
|
||||
#elif EXTRUDERS == 0
|
||||
#define _EXTRA_NOTE " (Note: EXTRUDERS is set to 0.)"
|
||||
#else
|
||||
#define _EXTRA_NOTE ""
|
||||
#define _EXTRA_NOTE " (Should be " STRINGIFY(LINEAR_AXES) "+" STRINGIFY(E_STEPPERS) ")"
|
||||
#endif
|
||||
|
||||
static_assert(COUNT(sanity_arr_1) >= LOGICAL_AXES, "DEFAULT_AXIS_STEPS_PER_UNIT requires X, Y, Z and E elements.");
|
||||
static_assert(COUNT(sanity_arr_1) >= LOGICAL_AXES, "DEFAULT_AXIS_STEPS_PER_UNIT requires " _LOGICAL_AXES_STR "elements.");
|
||||
static_assert(COUNT(sanity_arr_1) <= DISTINCT_AXES, "DEFAULT_AXIS_STEPS_PER_UNIT has too many elements." _EXTRA_NOTE);
|
||||
static_assert( _ARR_TEST(1,0) && _ARR_TEST(1,1) && _ARR_TEST(1,2)
|
||||
&& _ARR_TEST(1,3) && _ARR_TEST(1,4) && _ARR_TEST(1,5)
|
||||
&& _ARR_TEST(1,6) && _ARR_TEST(1,7) && _ARR_TEST(1,8),
|
||||
"DEFAULT_AXIS_STEPS_PER_UNIT values must be positive.");
|
||||
|
||||
static_assert(COUNT(sanity_arr_2) >= LOGICAL_AXES, "DEFAULT_MAX_FEEDRATE requires X, Y, Z and E elements.");
|
||||
static_assert(COUNT(sanity_arr_2) >= LOGICAL_AXES, "DEFAULT_MAX_FEEDRATE requires " _LOGICAL_AXES_STR "elements.");
|
||||
static_assert(COUNT(sanity_arr_2) <= DISTINCT_AXES, "DEFAULT_MAX_FEEDRATE has too many elements." _EXTRA_NOTE);
|
||||
static_assert( _ARR_TEST(2,0) && _ARR_TEST(2,1) && _ARR_TEST(2,2)
|
||||
&& _ARR_TEST(2,3) && _ARR_TEST(2,4) && _ARR_TEST(2,5)
|
||||
&& _ARR_TEST(2,6) && _ARR_TEST(2,7) && _ARR_TEST(2,8),
|
||||
"DEFAULT_MAX_FEEDRATE values must be positive.");
|
||||
|
||||
static_assert(COUNT(sanity_arr_3) >= LOGICAL_AXES, "DEFAULT_MAX_ACCELERATION requires X, Y, Z and E elements.");
|
||||
static_assert(COUNT(sanity_arr_3) >= LOGICAL_AXES, "DEFAULT_MAX_ACCELERATION requires " _LOGICAL_AXES_STR "elements.");
|
||||
static_assert(COUNT(sanity_arr_3) <= DISTINCT_AXES, "DEFAULT_MAX_ACCELERATION has too many elements." _EXTRA_NOTE);
|
||||
static_assert( _ARR_TEST(3,0) && _ARR_TEST(3,1) && _ARR_TEST(3,2)
|
||||
&& _ARR_TEST(3,3) && _ARR_TEST(3,4) && _ARR_TEST(3,5)
|
||||
&& _ARR_TEST(3,6) && _ARR_TEST(3,7) && _ARR_TEST(3,8),
|
||||
"DEFAULT_MAX_ACCELERATION values must be positive.");
|
||||
|
||||
static_assert(COUNT(sanity_arr_7) == LINEAR_AXES, "HOMING_FEEDRATE_MM_M requires " _LINEAR_AXES_STR "elements (and no others).");
|
||||
static_assert( _ARR_TEST(3,0) && _ARR_TEST(3,1) && _ARR_TEST(3,2)
|
||||
&& _ARR_TEST(3,3) && _ARR_TEST(3,4) && _ARR_TEST(3,5)
|
||||
&& _ARR_TEST(3,6) && _ARR_TEST(3,7) && _ARR_TEST(3,8),
|
||||
"HOMING_FEEDRATE_MM_M values must be positive.");
|
||||
|
||||
#if ENABLED(LIMITED_MAX_ACCEL_EDITING)
|
||||
#ifdef MAX_ACCEL_EDIT_VALUES
|
||||
constexpr float sanity_arr_4[] = MAX_ACCEL_EDIT_VALUES;
|
||||
static_assert(COUNT(sanity_arr_4) >= LOGICAL_AXES, "MAX_ACCEL_EDIT_VALUES requires X, Y, Z and E elements.");
|
||||
static_assert(COUNT(sanity_arr_4) <= LOGICAL_AXES, "MAX_ACCEL_EDIT_VALUES has too many elements. X, Y, Z and E elements only.");
|
||||
static_assert(COUNT(sanity_arr_4) >= LOGICAL_AXES, "MAX_ACCEL_EDIT_VALUES requires " _LOGICAL_AXES_STR "elements.");
|
||||
static_assert(COUNT(sanity_arr_4) <= LOGICAL_AXES, "MAX_ACCEL_EDIT_VALUES has too many elements. " _LOGICAL_AXES_STR "elements only.");
|
||||
static_assert( _ARR_TEST(4,0) && _ARR_TEST(4,1) && _ARR_TEST(4,2)
|
||||
&& _ARR_TEST(4,3) && _ARR_TEST(4,4) && _ARR_TEST(4,5)
|
||||
&& _ARR_TEST(4,6) && _ARR_TEST(4,7) && _ARR_TEST(4,8),
|
||||
@@ -2855,8 +3090,8 @@ static_assert( _ARR_TEST(3,0) && _ARR_TEST(3,1) && _ARR_TEST(3,2)
|
||||
#if ENABLED(LIMITED_MAX_FR_EDITING)
|
||||
#ifdef MAX_FEEDRATE_EDIT_VALUES
|
||||
constexpr float sanity_arr_5[] = MAX_FEEDRATE_EDIT_VALUES;
|
||||
static_assert(COUNT(sanity_arr_5) >= LOGICAL_AXES, "MAX_FEEDRATE_EDIT_VALUES requires X, Y, Z and E elements.");
|
||||
static_assert(COUNT(sanity_arr_5) <= LOGICAL_AXES, "MAX_FEEDRATE_EDIT_VALUES has too many elements. X, Y, Z and E elements only.");
|
||||
static_assert(COUNT(sanity_arr_5) >= LOGICAL_AXES, "MAX_FEEDRATE_EDIT_VALUES requires " _LOGICAL_AXES_STR "elements.");
|
||||
static_assert(COUNT(sanity_arr_5) <= LOGICAL_AXES, "MAX_FEEDRATE_EDIT_VALUES has too many elements. " _LOGICAL_AXES_STR "elements only.");
|
||||
static_assert( _ARR_TEST(5,0) && _ARR_TEST(5,1) && _ARR_TEST(5,2)
|
||||
&& _ARR_TEST(5,3) && _ARR_TEST(5,4) && _ARR_TEST(5,5)
|
||||
&& _ARR_TEST(5,6) && _ARR_TEST(5,7) && _ARR_TEST(5,8),
|
||||
@@ -2867,8 +3102,8 @@ static_assert( _ARR_TEST(3,0) && _ARR_TEST(3,1) && _ARR_TEST(3,2)
|
||||
#if ENABLED(LIMITED_JERK_EDITING)
|
||||
#ifdef MAX_JERK_EDIT_VALUES
|
||||
constexpr float sanity_arr_6[] = MAX_JERK_EDIT_VALUES;
|
||||
static_assert(COUNT(sanity_arr_6) >= LOGICAL_AXES, "MAX_JERK_EDIT_VALUES requires X, Y, Z and E elements.");
|
||||
static_assert(COUNT(sanity_arr_6) <= LOGICAL_AXES, "MAX_JERK_EDIT_VALUES has too many elements. X, Y, Z and E elements only.");
|
||||
static_assert(COUNT(sanity_arr_6) >= LOGICAL_AXES, "MAX_JERK_EDIT_VALUES requires " _LOGICAL_AXES_STR "elements.");
|
||||
static_assert(COUNT(sanity_arr_6) <= LOGICAL_AXES, "MAX_JERK_EDIT_VALUES has too many elements. " _LOGICAL_AXES_STR "elements only.");
|
||||
static_assert( _ARR_TEST(6,0) && _ARR_TEST(6,1) && _ARR_TEST(6,2)
|
||||
&& _ARR_TEST(6,3) && _ARR_TEST(6,4) && _ARR_TEST(6,5)
|
||||
&& _ARR_TEST(6,6) && _ARR_TEST(6,7) && _ARR_TEST(6,8),
|
||||
@@ -2947,6 +3182,10 @@ static_assert( _ARR_TEST(3,0) && _ARR_TEST(3,1) && _ARR_TEST(3,2)
|
||||
#error "MECHANICAL_GANTRY_CALIBRATION Requires GANTRY_CALIBRATION_EXTRA_HEIGHT to be set."
|
||||
#elif !defined(GANTRY_CALIBRATION_FEEDRATE)
|
||||
#error "MECHANICAL_GANTRY_CALIBRATION Requires GANTRY_CALIBRATION_FEEDRATE to be set."
|
||||
#elif ENABLED(Z_MULTI_ENDSTOPS)
|
||||
#error "Sorry! MECHANICAL_GANTRY_CALIBRATION cannot be used with Z_MULTI_ENDSTOPS."
|
||||
#elif ENABLED(Z_STEPPER_AUTO_ALIGN)
|
||||
#error "Sorry! MECHANICAL_GANTRY_CALIBRATION cannot be used with Z_STEPPER_AUTO_ALIGN."
|
||||
#endif
|
||||
#if defined(GANTRY_CALIBRATION_SAFE_POSITION) && !defined(GANTRY_CALIBRATION_XY_PARK_FEEDRATE)
|
||||
#error "GANTRY_CALIBRATION_SAFE_POSITION Requires GANTRY_CALIBRATION_XY_PARK_FEEDRATE to be set."
|
||||
@@ -3264,6 +3503,22 @@ static_assert( _ARR_TEST(3,0) && _ARR_TEST(3,1) && _ARR_TEST(3,2)
|
||||
#if _BAD_DRIVER(Z)
|
||||
#error "Z_DRIVER_TYPE is not recognized."
|
||||
#endif
|
||||
#if LINEAR_AXES >= 4
|
||||
#if _BAD_DRIVER(I)
|
||||
#error "I_DRIVER_TYPE is not recognized."
|
||||
#endif
|
||||
#endif
|
||||
#if LINEAR_AXES >= 5
|
||||
#if _BAD_DRIVER(J)
|
||||
#error "J_DRIVER_TYPE is not recognized."
|
||||
#endif
|
||||
#endif
|
||||
#if LINEAR_AXES >= 6
|
||||
#if _BAD_DRIVER(K)
|
||||
#error "K_DRIVER_TYPE is not recognized."
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#if _BAD_DRIVER(X2)
|
||||
#error "X2_DRIVER_TYPE is not recognized."
|
||||
#endif
|
||||
@@ -3307,7 +3562,5 @@ static_assert( _ARR_TEST(3,0) && _ARR_TEST(3,1) && _ARR_TEST(3,2)
|
||||
|
||||
// Misc. Cleanup
|
||||
#undef _TEST_PWM
|
||||
|
||||
#if ENABLED(FREEZE_FEATURE) && !PIN_EXISTS(FREEZE)
|
||||
#error "FREEZE_FEATURE requires a FREEZE_PIN to be defined."
|
||||
#endif
|
||||
#undef _LINEAR_AXES_STR
|
||||
#undef _LOGICAL_AXES_STR
|
||||
|
||||
@@ -42,7 +42,7 @@
|
||||
* version was tagged.
|
||||
*/
|
||||
#ifndef STRING_DISTRIBUTION_DATE
|
||||
#define STRING_DISTRIBUTION_DATE "2021-05-23"
|
||||
#define STRING_DISTRIBUTION_DATE "2021-06-05"
|
||||
#endif
|
||||
|
||||
/**
|
||||
@@ -52,7 +52,7 @@
|
||||
* to alert users to major changes.
|
||||
*/
|
||||
|
||||
#define MARLIN_HEX_VERSION 02000801
|
||||
#define MARLIN_HEX_VERSION 02000900
|
||||
#ifndef REQUIRED_CONFIGURATION_H_VERSION
|
||||
#define REQUIRED_CONFIGURATION_H_VERSION MARLIN_HEX_VERSION
|
||||
#endif
|
||||
|
||||
@@ -856,8 +856,10 @@ void MarlinUI::draw_status_screen() {
|
||||
#else
|
||||
|
||||
if (show_e_total) {
|
||||
_draw_axis_value(E_AXIS, xstring, true);
|
||||
lcd_put_u8str_P(PSTR(" "));
|
||||
#if ENABLED(LCD_SHOW_E_TOTAL)
|
||||
_draw_axis_value(E_AXIS, xstring, true);
|
||||
lcd_put_u8str_P(PSTR(" "));
|
||||
#endif
|
||||
}
|
||||
else {
|
||||
_draw_axis_value(X_AXIS, xstring, blink);
|
||||
|
||||
@@ -1235,7 +1235,7 @@ inline ENCODER_DiffState get_encoder_state() {
|
||||
void HMI_Plan_Move(const feedRate_t fr_mm_s) {
|
||||
if (!planner.is_full()) {
|
||||
planner.synchronize();
|
||||
planner.buffer_line(current_position, fr_mm_s, active_extruder);
|
||||
planner.buffer_line(current_position, fr_mm_s);
|
||||
DWIN_UpdateLCD();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -666,10 +666,10 @@ const struct DGUS_VP_Variable ListOfVP[] PROGMEM = {
|
||||
VPHELPER(VP_Z_MAX_SPEED, &planner.settings.max_feedrate_mm_s[Z_AXIS], ScreenHandler.HandleMaxSpeedChange_MKS, ScreenHandler.DGUSLCD_SendFloatAsIntValueToDisplay<0>),
|
||||
|
||||
#if HOTENDS >= 1
|
||||
VPHELPER(VP_E0_MAX_SPEED, &planner.settings.max_feedrate_mm_s[E0_AXIS], ScreenHandler.HandleExtruderMaxSpeedChange_MKS, ScreenHandler.DGUSLCD_SendFloatAsIntValueToDisplay<0>),
|
||||
VPHELPER(VP_E0_MAX_SPEED, &planner.settings.max_feedrate_mm_s[E_AXIS_N(0)], ScreenHandler.HandleExtruderMaxSpeedChange_MKS, ScreenHandler.DGUSLCD_SendFloatAsIntValueToDisplay<0>),
|
||||
#endif
|
||||
#if HOTENDS >= 2
|
||||
VPHELPER(VP_E1_MAX_SPEED, &planner.settings.max_feedrate_mm_s[E1_AXIS], ScreenHandler.HandleExtruderMaxSpeedChange_MKS, ScreenHandler.DGUSLCD_SendFloatAsIntValueToDisplay<0>),
|
||||
VPHELPER(VP_E1_MAX_SPEED, &planner.settings.max_feedrate_mm_s[E_AXIS_N(1)], ScreenHandler.HandleExtruderMaxSpeedChange_MKS, ScreenHandler.DGUSLCD_SendFloatAsIntValueToDisplay<0>),
|
||||
#endif
|
||||
|
||||
VPHELPER(VP_X_ACC_MAX_SPEED, (uint16_t *)&planner.settings.max_acceleration_mm_per_s2[X_AXIS], ScreenHandler.HandleMaxAccChange_MKS, ScreenHandler.DGUSLCD_SendWordValueToDisplay),
|
||||
@@ -677,10 +677,10 @@ const struct DGUS_VP_Variable ListOfVP[] PROGMEM = {
|
||||
VPHELPER(VP_Z_ACC_MAX_SPEED, (uint16_t *)&planner.settings.max_acceleration_mm_per_s2[Z_AXIS], ScreenHandler.HandleMaxAccChange_MKS, ScreenHandler.DGUSLCD_SendWordValueToDisplay),
|
||||
|
||||
#if HOTENDS >= 1
|
||||
VPHELPER(VP_E0_ACC_MAX_SPEED, (uint16_t *)&planner.settings.max_acceleration_mm_per_s2[E0_AXIS], ScreenHandler.HandleExtruderAccChange_MKS, ScreenHandler.DGUSLCD_SendWordValueToDisplay),
|
||||
VPHELPER(VP_E0_ACC_MAX_SPEED, (uint16_t *)&planner.settings.max_acceleration_mm_per_s2[E_AXIS_N(0)], ScreenHandler.HandleExtruderAccChange_MKS, ScreenHandler.DGUSLCD_SendWordValueToDisplay),
|
||||
#endif
|
||||
#if HOTENDS >= 2
|
||||
VPHELPER(VP_E1_ACC_MAX_SPEED, (uint16_t *)&planner.settings.max_acceleration_mm_per_s2[E1_AXIS], ScreenHandler.HandleExtruderAccChange_MKS, ScreenHandler.DGUSLCD_SendWordValueToDisplay),
|
||||
VPHELPER(VP_E1_ACC_MAX_SPEED, (uint16_t *)&planner.settings.max_acceleration_mm_per_s2[E_AXIS_N(1)], ScreenHandler.HandleExtruderAccChange_MKS, ScreenHandler.DGUSLCD_SendWordValueToDisplay),
|
||||
#endif
|
||||
|
||||
VPHELPER(VP_TRAVEL_SPEED, (uint16_t *)&planner.settings.travel_acceleration, ScreenHandler.HandleTravelAccChange_MKS, ScreenHandler.DGUSLCD_SendFloatAsIntValueToDisplay<0>),
|
||||
@@ -697,13 +697,13 @@ const struct DGUS_VP_Variable ListOfVP[] PROGMEM = {
|
||||
#endif
|
||||
|
||||
#if ENABLED(SENSORLESS_HOMING) // TMC SENSORLESS Setting
|
||||
#if AXIS_HAS_STEALTHCHOP(X)
|
||||
#if X_HAS_STEALTHCHOP
|
||||
VPHELPER(VP_TMC_X_STEP, &tmc_step.x, ScreenHandler.TMC_ChangeConfig, ScreenHandler.DGUSLCD_SendTMCStepValue),
|
||||
#endif
|
||||
#if AXIS_HAS_STEALTHCHOP(Y)
|
||||
#if Y_HAS_STEALTHCHOP
|
||||
VPHELPER(VP_TMC_Y_STEP, &tmc_step.y, ScreenHandler.TMC_ChangeConfig, ScreenHandler.DGUSLCD_SendTMCStepValue),
|
||||
#endif
|
||||
#if AXIS_HAS_STEALTHCHOP(Z)
|
||||
#if Z_HAS_STEALTHCHOP
|
||||
VPHELPER(VP_TMC_Z_STEP, &tmc_step.z, ScreenHandler.TMC_ChangeConfig, ScreenHandler.DGUSLCD_SendTMCStepValue),
|
||||
#endif
|
||||
#endif
|
||||
|
||||
@@ -59,19 +59,19 @@ extern xyz_int_t tmc_step;
|
||||
|
||||
extern uint16_t lcd_default_light;
|
||||
|
||||
#if AXIS_HAS_STEALTHCHOP(X)
|
||||
#if X_HAS_STEALTHCHOP
|
||||
extern uint16_t tmc_x_current;
|
||||
#endif
|
||||
#if AXIS_HAS_STEALTHCHOP(Y)
|
||||
#if Y_HAS_STEALTHCHOP
|
||||
extern uint16_t tmc_y_current;
|
||||
#endif
|
||||
#if AXIS_HAS_STEALTHCHOP(Z)
|
||||
#if Z_HAS_STEALTHCHOP
|
||||
extern uint16_t tmc_z_current;
|
||||
#endif
|
||||
#if AXIS_HAS_STEALTHCHOP(E0)
|
||||
#if E0_HAS_STEALTHCHOP
|
||||
extern uint16_t tmc_e0_current;
|
||||
#endif
|
||||
#if AXIS_HAS_STEALTHCHOP(E1)
|
||||
#if E1_HAS_STEALTHCHOP
|
||||
extern uint16_t tmc_e1_current;
|
||||
#endif
|
||||
|
||||
|
||||
@@ -134,15 +134,15 @@ void DGUSScreenHandler::DGUSLCD_SendStringToDisplay_Language_MKS(DGUS_VP_Variabl
|
||||
|
||||
void DGUSScreenHandler::DGUSLCD_SendTMCStepValue(DGUS_VP_Variable &var) {
|
||||
#if ENABLED(SENSORLESS_HOMING)
|
||||
#if AXIS_HAS_STEALTHCHOP(X)
|
||||
#if X_HAS_STEALTHCHOP
|
||||
tmc_step.x = stepperX.homing_threshold();
|
||||
dgusdisplay.WriteVariable(var.VP, *(int16_t*)var.memadr);
|
||||
#endif
|
||||
#if AXIS_HAS_STEALTHCHOP(Y)
|
||||
#if Y_HAS_STEALTHCHOP
|
||||
tmc_step.y = stepperY.homing_threshold();
|
||||
dgusdisplay.WriteVariable(var.VP, *(int16_t*)var.memadr);
|
||||
#endif
|
||||
#if AXIS_HAS_STEALTHCHOP(Z)
|
||||
#if Z_HAS_STEALTHCHOP
|
||||
tmc_step.z = stepperZ.homing_threshold();
|
||||
dgusdisplay.WriteVariable(var.VP, *(int16_t*)var.memadr);
|
||||
#endif
|
||||
@@ -659,7 +659,7 @@ void DGUSScreenHandler::TMC_ChangeConfig(DGUS_VP_Variable &var, void *val_ptr) {
|
||||
switch (var.VP) {
|
||||
case VP_TMC_X_STEP:
|
||||
#if USE_SENSORLESS
|
||||
#if AXIS_HAS_STEALTHCHOP(X)
|
||||
#if X_HAS_STEALTHCHOP
|
||||
stepperX.homing_threshold(mks_min(tmc_value, 255));
|
||||
settings.save();
|
||||
//tmc_step.x = stepperX.homing_threshold();
|
||||
@@ -668,7 +668,7 @@ void DGUSScreenHandler::TMC_ChangeConfig(DGUS_VP_Variable &var, void *val_ptr) {
|
||||
break;
|
||||
case VP_TMC_Y_STEP:
|
||||
#if USE_SENSORLESS
|
||||
#if AXIS_HAS_STEALTHCHOP(Y)
|
||||
#if Y_HAS_STEALTHCHOP
|
||||
stepperY.homing_threshold(mks_min(tmc_value, 255));
|
||||
settings.save();
|
||||
//tmc_step.y = stepperY.homing_threshold();
|
||||
@@ -677,7 +677,7 @@ void DGUSScreenHandler::TMC_ChangeConfig(DGUS_VP_Variable &var, void *val_ptr) {
|
||||
break;
|
||||
case VP_TMC_Z_STEP:
|
||||
#if USE_SENSORLESS
|
||||
#if AXIS_HAS_STEALTHCHOP(Z)
|
||||
#if Z_HAS_STEALTHCHOP
|
||||
stepperZ.homing_threshold(mks_min(tmc_value, 255));
|
||||
settings.save();
|
||||
//tmc_step.z = stepperZ.homing_threshold();
|
||||
@@ -737,15 +737,9 @@ void DGUSScreenHandler::TMC_ChangeConfig(DGUS_VP_Variable &var, void *val_ptr) {
|
||||
break;
|
||||
}
|
||||
#if USE_SENSORLESS
|
||||
#if AXIS_HAS_STEALTHCHOP(X)
|
||||
tmc_step.x = stepperX.homing_threshold();
|
||||
#endif
|
||||
#if AXIS_HAS_STEALTHCHOP(Y)
|
||||
tmc_step.y = stepperY.homing_threshold();
|
||||
#endif
|
||||
#if AXIS_HAS_STEALTHCHOP(Z)
|
||||
tmc_step.z = stepperZ.homing_threshold();
|
||||
#endif
|
||||
TERN_(X_HAS_STEALTHCHOP, tmc_step.x = stepperX.homing_threshold());
|
||||
TERN_(Y_HAS_STEALTHCHOP, tmc_step.y = stepperY.homing_threshold());
|
||||
TERN_(Z_HAS_STEALTHCHOP, tmc_step.z = stepperZ.homing_threshold());
|
||||
#endif
|
||||
}
|
||||
|
||||
@@ -1419,15 +1413,9 @@ bool DGUSScreenHandler::loop() {
|
||||
if (!booted && ELAPSED(ms, TERN(USE_MKS_GREEN_UI, 1000, BOOTSCREEN_TIMEOUT))) {
|
||||
booted = true;
|
||||
#if USE_SENSORLESS
|
||||
#if AXIS_HAS_STEALTHCHOP(X)
|
||||
tmc_step.x = stepperX.homing_threshold();
|
||||
#endif
|
||||
#if AXIS_HAS_STEALTHCHOP(Y)
|
||||
tmc_step.y = stepperY.homing_threshold();
|
||||
#endif
|
||||
#if AXIS_HAS_STEALTHCHOP(Z)
|
||||
tmc_step.z = stepperZ.homing_threshold();
|
||||
#endif
|
||||
TERN_(X_HAS_STEALTHCHOP, tmc_step.x = stepperX.homing_threshold());
|
||||
TERN_(Y_HAS_STEALTHCHOP, tmc_step.y = stepperY.homing_threshold());
|
||||
TERN_(Z_HAS_STEALTHCHOP, tmc_step.z = stepperZ.homing_threshold());
|
||||
#endif
|
||||
|
||||
#if ENABLED(PREVENT_COLD_EXTRUSION)
|
||||
|
||||
@@ -95,6 +95,7 @@ namespace FTDI_FT810 {
|
||||
namespace FTDI {
|
||||
constexpr uint8_t ARGB1555 = 0;
|
||||
constexpr uint8_t L1 = 1;
|
||||
constexpr uint8_t L2 = 17;
|
||||
constexpr uint8_t L4 = 2;
|
||||
constexpr uint8_t L8 = 3;
|
||||
constexpr uint8_t RGB332 = 4;
|
||||
|
||||
@@ -64,14 +64,14 @@ namespace FTDI {
|
||||
inline uint32_t CLEAR_COLOR_A(uint8_t alpha) {return DL::CLEAR_COLOR_A|(alpha&255UL);}
|
||||
inline uint32_t CLEAR_COLOR_RGB(uint8_t red, uint8_t green, uint8_t blue)
|
||||
{return DL::CLEAR_COLOR_RGB|((red&255UL)<<16)|((green&255UL)<<8)|(blue&255UL);}
|
||||
inline uint32_t CLEAR_COLOR_RGB(uint32_t rgb) {return DL::CLEAR_COLOR_RGB|rgb;}
|
||||
inline uint32_t CLEAR_COLOR_RGB(uint32_t rgb) {return DL::CLEAR_COLOR_RGB|(rgb&0xFFFFFF);}
|
||||
inline uint32_t CLEAR_STENCIL(uint8_t s) {return DL::CLEAR_STENCIL|(s&255UL);}
|
||||
inline uint32_t CLEAR_TAG(uint8_t s) {return DL::CLEAR_TAG|(s&255UL);}
|
||||
inline uint32_t COLOR_A(uint8_t alpha) {return DL::COLOR_A|(alpha&255UL);}
|
||||
inline uint32_t COLOR_MASK(bool r, bool g, bool b, bool a) {return DL::COLOR_MASK|((r?1UL:0UL)<<3)|((g?1UL:0UL)<<2)|((b?1UL:0UL)<<1)|(a?1UL:0UL);}
|
||||
inline uint32_t COLOR_RGB(uint8_t red,uint8_t green,uint8_t blue)
|
||||
{return DL::COLOR_RGB|((red&255UL)<<16)|((green&255UL)<<8)|(blue&255UL);}
|
||||
inline uint32_t COLOR_RGB(uint32_t rgb) {return DL::COLOR_RGB|rgb;}
|
||||
inline uint32_t COLOR_RGB(uint32_t rgb) {return DL::COLOR_RGB|(rgb&0xFFFFFF);}
|
||||
/* inline uint32_t DISPLAY() {return (0UL<<24)) */
|
||||
inline uint32_t END() {return DL::END;}
|
||||
inline uint32_t JUMP(uint16_t dest) {return DL::JUMP|(dest&65535UL);}
|
||||
|
||||
@@ -195,11 +195,31 @@
|
||||
#define pgm_read_ptr_far pgm_read_ptr
|
||||
#endif
|
||||
|
||||
// Use NUM_ARGS(__VA_ARGS__) to get the number of variadic arguments
|
||||
#define _NUM_ARGS(_,Z,Y,X,W,V,U,T,S,R,Q,P,O,N,M,L,K,J,I,H,G,F,E,D,C,B,A,OUT,...) OUT
|
||||
#define NUM_ARGS(V...) _NUM_ARGS(0,V,26,25,24,23,22,21,20,19,18,17,16,15,14,13,12,11,10,9,8,7,6,5,4,3,2,1,0)
|
||||
|
||||
// SERIAL_ECHOPAIR / SERIAL_ECHOPAIR_P is used to output a key value pair. The key must be a string and the value can be anything
|
||||
// Print up to 12 pairs of values. Odd elements auto-wrapped in PSTR().
|
||||
#define __SEP_N(N,V...) _SEP_##N(V)
|
||||
#define _SEP_N(N,V...) __SEP_N(N,V)
|
||||
#define _SEP_1(PRE) SERIAL_ECHOPGM(PRE)
|
||||
#define _SEP_2(PRE,V) do{ Serial.print(F(PRE)); Serial.print(V); }while(0)
|
||||
#define _SEP_3(a,b,c) do{ _SEP_2(a,b); SERIAL_ECHOPGM(c); }while(0)
|
||||
#define _SEP_4(a,b,V...) do{ _SEP_2(a,b); _SEP_2(V); }while(0)
|
||||
|
||||
// Print up to 1 pairs of values followed by newline
|
||||
#define __SELP_N(N,V...) _SELP_##N(V)
|
||||
#define _SELP_N(N,V...) __SELP_N(N,V)
|
||||
#define _SELP_1(PRE) SERIAL_ECHOLNPGM(PRE)
|
||||
#define _SELP_2(PRE,V) do{ Serial.print(F(PRE)); Serial.println(V); }while(0)
|
||||
#define _SELP_3(a,b,c) do{ _SEP_2(a,b); SERIAL_ECHOLNPGM(c); }while(0)
|
||||
#define _SELP_4(a,b,V...) do{ _SEP_2(a,b); _SELP_2(V); }while(0)
|
||||
#define SERIAL_ECHO_START()
|
||||
#define SERIAL_ECHOLNPGM(str) Serial.println(F(str))
|
||||
#define SERIAL_ECHOPGM(str) Serial.print(F(str))
|
||||
#define SERIAL_ECHO_MSG(str) Serial.println(str)
|
||||
#define SERIAL_ECHOLNPAIR(str, val) do{ Serial.print(F(str)); Serial.println(val); }while(0)
|
||||
#define SERIAL_ECHO_MSG(V...) SERIAL_ECHOLNPAIR(V)
|
||||
#define SERIAL_ECHOLNPAIR(V...) _SELP_N(NUM_ARGS(V),V)
|
||||
#define SERIAL_ECHOPAIR(str, val) do{ Serial.print(F(str)); Serial.print(val); }while(0)
|
||||
|
||||
#define safe_delay delay
|
||||
|
||||
@@ -26,4 +26,16 @@
|
||||
CommandProcessor::btn_style_func_t *CommandProcessor::_btn_style_callback = CommandProcessor::default_button_style_func;
|
||||
bool CommandProcessor::is_tracking = false;
|
||||
|
||||
uint32_t CommandProcessor::memcrc(uint32_t ptr, uint32_t num) {
|
||||
const uint16_t x = CLCD::mem_read_16(CLCD::REG::CMD_WRITE);
|
||||
memcrc(ptr, num, 0);
|
||||
wait();
|
||||
return CLCD::mem_read_32(CLCD::MAP::RAM_CMD + x + 12);
|
||||
}
|
||||
|
||||
bool CommandProcessor::wait() {
|
||||
while (is_processing() && !has_fault()) { /* nada */ }
|
||||
return !has_fault();
|
||||
}
|
||||
|
||||
#endif // FTDI_EXTENDED
|
||||
|
||||
@@ -146,6 +146,9 @@ class CommandProcessor : public CLCD::CommandFifo {
|
||||
return *this;
|
||||
}
|
||||
|
||||
bool wait();
|
||||
uint32_t memcrc(uint32_t ptr, uint32_t num);
|
||||
|
||||
// Wrap all the CommandFifo routines to allow method chaining
|
||||
|
||||
inline CommandProcessor& cmd (uint32_t cmd32) {CLCD::CommandFifo::cmd(cmd32); return *this;}
|
||||
|
||||
@@ -47,23 +47,25 @@
|
||||
#define MARGIN_DEFAULT 3
|
||||
#endif
|
||||
|
||||
// EDGE_R adds some black space on the right edge of the display
|
||||
// This shifts some of the screens left to visually center them.
|
||||
// The EDGE variables adds some space on the edges of the display
|
||||
|
||||
#define EDGE_T 0
|
||||
#define EDGE_B 0
|
||||
#define EDGE_L 0
|
||||
#define EDGE_R 0
|
||||
|
||||
// GRID_X and GRID_Y computes the positions of the divisions on
|
||||
// the layout grid.
|
||||
#define GRID_X(x) ((x)*(FTDI::display_width-EDGE_R)/GRID_COLS)
|
||||
#define GRID_Y(y) ((y)*FTDI::display_height/GRID_ROWS)
|
||||
#define GRID_X(x) ((x)*(FTDI::display_width-EDGE_R-EDGE_L)/GRID_COLS+EDGE_L)
|
||||
#define GRID_Y(y) ((y)*(FTDI::display_height-EDGE_B-EDGE_T)/GRID_ROWS+EDGE_T)
|
||||
|
||||
// BTN_X, BTN_Y, BTN_W and BTN_X returns the top-left and width
|
||||
// and height of a button, taking into account the button margins.
|
||||
|
||||
#define BTN_X(x) (GRID_X((x)-1) + MARGIN_L)
|
||||
#define BTN_Y(y) (GRID_Y((y)-1) + MARGIN_T)
|
||||
#define BTN_W(w) (GRID_X(w) - MARGIN_L - MARGIN_R)
|
||||
#define BTN_H(h) (GRID_Y(h) - MARGIN_T - MARGIN_B)
|
||||
#define BTN_W(w) (GRID_X(w) - GRID_X(0) - MARGIN_L - MARGIN_R)
|
||||
#define BTN_H(h) (GRID_Y(h) - GRID_Y(0) - MARGIN_T - MARGIN_B)
|
||||
|
||||
// Abbreviations for common phrases, to allow a button to be
|
||||
// defined in one line of source.
|
||||
|
||||
@@ -86,8 +86,10 @@ namespace FTDI {
|
||||
if (font == 26) break;
|
||||
}
|
||||
|
||||
const uint16_t dx = (options & OPT_RIGHTX) ? w : (options & OPT_CENTERX) ? w/2 : 0;
|
||||
const uint16_t dy = (options & OPT_CENTERY) ? (h - box_height)/2 : 0;
|
||||
const uint16_t dx = (options & OPT_RIGHTX) ? w :
|
||||
(options & OPT_CENTERX) ? w/2 : 0;
|
||||
const uint16_t dy = (options & OPT_BOTTOMY) ? (h - box_height) :
|
||||
(options & OPT_CENTERY) ? (h - box_height)/2 : 0;
|
||||
|
||||
const char *line_start = str;
|
||||
const char *line_end;
|
||||
@@ -105,11 +107,11 @@ namespace FTDI {
|
||||
|
||||
#if ENABLED(TOUCH_UI_USE_UTF8)
|
||||
if (has_utf8_chars(line)) {
|
||||
draw_utf8_text(cmd, x + dx, y + dy, line, fm.fs, options & ~OPT_CENTERY);
|
||||
draw_utf8_text(cmd, x + dx, y + dy, line, fm.fs, options & ~(OPT_CENTERY | OPT_BOTTOMY));
|
||||
} else
|
||||
#endif
|
||||
{
|
||||
cmd.CLCD::CommandFifo::text(x + dx, y + dy, font, options & ~OPT_CENTERY);
|
||||
cmd.CLCD::CommandFifo::text(x + dx, y + dy, font, options & ~(OPT_CENTERY | OPT_BOTTOMY));
|
||||
cmd.CLCD::CommandFifo::str(line);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -25,6 +25,8 @@
|
||||
* This function draws text inside a bounding box, doing word wrapping and using the largest font that will fit.
|
||||
*/
|
||||
namespace FTDI {
|
||||
constexpr uint16_t OPT_BOTTOMY = 0x1000; // Non-standard
|
||||
|
||||
void draw_text_box(class CommandProcessor& cmd, int x, int y, int w, int h, progmem_str str, uint16_t options = 0, uint8_t font = 31);
|
||||
void draw_text_box(class CommandProcessor& cmd, int x, int y, int w, int h, const char *str, uint16_t options = 0, uint8_t font = 31);
|
||||
}
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user