Compare commits
70 Commits
EBAB_22IDEX
...
CR-6Devel
| Author | SHA1 | Date | |
|---|---|---|---|
| 6118d41baa | |||
| 09dcc85328 | |||
| a11f88a44a | |||
| c639e9fcc6 | |||
| bfb81d8c92 | |||
| fbb5a5baf2 | |||
| 83872e7b67 | |||
| 7d4870fb4d | |||
| 3cacab40da | |||
| b8d900b70d | |||
| b4ede61682 | |||
| 7e8e06fe2f | |||
| 0d0beea222 | |||
| f34a9cc66c | |||
| c4e0d50ad8 | |||
| bcc28b118c | |||
| 2e59150dbe | |||
| 60278bfd75 | |||
| a77735d69a | |||
| d03227d564 | |||
| 6305bda964 | |||
| e082d40d32 | |||
| c4963d3d77 | |||
| 70740fa7b1 | |||
| 226f077a9a | |||
| 241c27e636 | |||
| b7d5374020 | |||
| 30e0d36bc3 | |||
| 057764766e | |||
| b5e131b523 | |||
| 92c60cd22e | |||
| dd42b65980 | |||
| f6627c0352 | |||
| 2dcdbf6f36 | |||
| 41ccd4a81b | |||
| 5f20f8f9c7 | |||
| a4c2e21329 | |||
| e4714e4d29 | |||
| af9d36ae6d | |||
| c393153243 | |||
| 88613ca7e0 | |||
| 88f1e635ac | |||
| 0c0f7adfaf | |||
| 49b53a04b5 | |||
| 72cdf4a11d | |||
| 647f776309 | |||
| 524eae8e86 | |||
| 6ce0f3dafb | |||
| 61a1fb7478 | |||
| d8fa698b25 | |||
| 5ed93ec18a | |||
| a870ebdf9f | |||
| 0bf9f04a4d | |||
| 0653027c98 | |||
| 5ccfbd44a6 | |||
| 26e61f6814 | |||
| e3982ca308 | |||
| 62b81dc2be | |||
| 1c0770ea5c | |||
| cfb1c4c9f2 | |||
| 438bae5f38 | |||
| 3a7f17d782 | |||
| 8394f0c3f4 | |||
| e8e4a742b0 | |||
| 48b61b7cbd | |||
| bbdd481dab | |||
| 1570559bba | |||
| ae24cfa655 | |||
| f583d933eb | |||
| 750bc64202 |
Binary file not shown.
+120
-174
@@ -70,8 +70,8 @@
|
||||
// @section info
|
||||
|
||||
// Author info of this build printed to the host during boot and M115
|
||||
#define STRING_CONFIG_H_AUTHOR "(none, default config)" // Who made the changes.
|
||||
//#define CUSTOM_VERSION_FILE Version.h // Path from the root directory (no quotes)
|
||||
#define STRING_CONFIG_H_AUTHOR "Tinymachines" // Who made the changes.
|
||||
#define CUSTOM_VERSION_FILE Version.h // Path from the root directory (no quotes)
|
||||
|
||||
/**
|
||||
* *** VENDORS PLEASE READ ***
|
||||
@@ -103,14 +103,14 @@
|
||||
*
|
||||
* :[-1, 0, 1, 2, 3, 4, 5, 6, 7]
|
||||
*/
|
||||
#define SERIAL_PORT 0
|
||||
#define SERIAL_PORT 1
|
||||
|
||||
/**
|
||||
* Select a secondary serial port on the board to use for communication with the host.
|
||||
* Currently Ethernet (-2) is only supported on Teensy 4.1 boards.
|
||||
* :[-2, -1, 0, 1, 2, 3, 4, 5, 6, 7]
|
||||
*/
|
||||
//#define SERIAL_PORT_2 -1
|
||||
//#define SERIAL_PORT_2 3
|
||||
|
||||
/**
|
||||
* This setting determines the communication speed of the printer.
|
||||
@@ -121,14 +121,14 @@
|
||||
*
|
||||
* :[2400, 9600, 19200, 38400, 57600, 115200, 250000, 500000, 1000000]
|
||||
*/
|
||||
#define BAUDRATE 250000
|
||||
#define BAUDRATE 115200
|
||||
|
||||
// Enable the Bluetooth serial interface on AT90USB devices
|
||||
//#define BLUETOOTH
|
||||
|
||||
// Choose the name from boards.h that matches your setup
|
||||
#ifndef MOTHERBOARD
|
||||
#define MOTHERBOARD BOARD_RAMPS_14_EFB
|
||||
#define MOTHERBOARD BOARD_CREALITY_V453
|
||||
#endif
|
||||
|
||||
// Name displayed in the LCD "Ready" message and Info menu
|
||||
@@ -321,9 +321,6 @@
|
||||
//#define PSU_DEFAULT_OFF // Keep power off until enabled directly with M80
|
||||
//#define PSU_POWERUP_DELAY 250 // (ms) Delay for the PSU to warm up to full power
|
||||
|
||||
//#define PSU_POWERUP_GCODE "M355 S1" // G-code to run after power-on (e.g., case light on)
|
||||
//#define PSU_POWEROFF_GCODE "M355 S0" // G-code to run before power-off (e.g., case light off)
|
||||
|
||||
//#define AUTO_POWER_CONTROL // Enable automatic control of the PS_ON pin
|
||||
#if ENABLED(AUTO_POWER_CONTROL)
|
||||
#define AUTO_POWER_FANS // Turn on PSU if fans need power
|
||||
@@ -416,7 +413,7 @@
|
||||
#define TEMP_SENSOR_5 0
|
||||
#define TEMP_SENSOR_6 0
|
||||
#define TEMP_SENSOR_7 0
|
||||
#define TEMP_SENSOR_BED 0
|
||||
#define TEMP_SENSOR_BED 1
|
||||
#define TEMP_SENSOR_PROBE 0
|
||||
#define TEMP_SENSOR_CHAMBER 0
|
||||
|
||||
@@ -445,7 +442,7 @@
|
||||
|
||||
// Below this temperature the heater will be switched off
|
||||
// because it probably indicates a broken thermistor wire.
|
||||
#define HEATER_0_MINTEMP 5
|
||||
#define HEATER_0_MINTEMP 0
|
||||
#define HEATER_1_MINTEMP 5
|
||||
#define HEATER_2_MINTEMP 5
|
||||
#define HEATER_3_MINTEMP 5
|
||||
@@ -453,12 +450,12 @@
|
||||
#define HEATER_5_MINTEMP 5
|
||||
#define HEATER_6_MINTEMP 5
|
||||
#define HEATER_7_MINTEMP 5
|
||||
#define BED_MINTEMP 5
|
||||
#define BED_MINTEMP 0
|
||||
|
||||
// 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 300
|
||||
#define HEATER_1_MAXTEMP 275
|
||||
#define HEATER_2_MAXTEMP 275
|
||||
#define HEATER_3_MAXTEMP 275
|
||||
@@ -466,7 +463,7 @@
|
||||
#define HEATER_5_MAXTEMP 275
|
||||
#define HEATER_6_MAXTEMP 275
|
||||
#define HEATER_7_MAXTEMP 275
|
||||
#define BED_MAXTEMP 150
|
||||
#define BED_MAXTEMP 120
|
||||
|
||||
//===========================================================================
|
||||
//============================= PID Settings ================================
|
||||
@@ -492,9 +489,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 14.32
|
||||
#define DEFAULT_Ki 0.81
|
||||
#define DEFAULT_Kd 63.12
|
||||
#endif
|
||||
#endif // PIDTEMP
|
||||
|
||||
@@ -515,7 +512,7 @@
|
||||
* heater. If your configuration is significantly different than this and you don't understand
|
||||
* the issues involved, don't use bed PID until someone else verifies that your hardware works.
|
||||
*/
|
||||
//#define PIDTEMPBED
|
||||
#define PIDTEMPBED
|
||||
|
||||
//#define BED_LIMIT_SWITCHING
|
||||
|
||||
@@ -531,11 +528,11 @@
|
||||
//#define MIN_BED_POWER 0
|
||||
//#define PID_BED_DEBUG // Sends debug data to the serial port.
|
||||
|
||||
// 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 10.00
|
||||
#define DEFAULT_bedKi .023
|
||||
#define DEFAULT_bedKd 305.4
|
||||
//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 79.49
|
||||
#define DEFAULT_bedKi 1.17
|
||||
#define DEFAULT_bedKd 1349.52
|
||||
|
||||
// FIND YOUR OWN: "M303 E-1 C8 S90" to run autotune on the bed at 90 degreesC for 8 cycles.
|
||||
#endif // PIDTEMPBED
|
||||
@@ -565,7 +562,7 @@
|
||||
* Note: For Bowden Extruders make this large enough to allow load/unload.
|
||||
*/
|
||||
#define PREVENT_LENGTHY_EXTRUDE
|
||||
#define EXTRUDE_MAXLENGTH 200
|
||||
#define EXTRUDE_MAXLENGTH 1000
|
||||
|
||||
//===========================================================================
|
||||
//======================== Thermal Runaway Protection =======================
|
||||
@@ -586,7 +583,7 @@
|
||||
|
||||
#define THERMAL_PROTECTION_HOTENDS // Enable thermal protection for all extruders
|
||||
#define THERMAL_PROTECTION_BED // Enable thermal protection for the heated bed
|
||||
#define THERMAL_PROTECTION_CHAMBER // Enable thermal protection for the heated chamber
|
||||
//#define THERMAL_PROTECTION_CHAMBER // Enable thermal protection for the heated chamber
|
||||
|
||||
//===========================================================================
|
||||
//============================= Mechanical Settings =========================
|
||||
@@ -663,8 +660,6 @@
|
||||
*
|
||||
* A4988 is assumed for unspecified drivers.
|
||||
*
|
||||
* Use TMC2208/TMC2208_STANDALONE for TMC2225 drivers and TMC2209/TMC2209_STANDALONE for TMC2226 drivers.
|
||||
*
|
||||
* Options: A4988, A5984, DRV8825, LV8729, L6470, L6474, POWERSTEP01,
|
||||
* TB6560, TB6600, TMC2100,
|
||||
* TMC2130, TMC2130_STANDALONE, TMC2160, TMC2160_STANDALONE,
|
||||
@@ -673,15 +668,15 @@
|
||||
* TMC5130, TMC5130_STANDALONE, TMC5160, TMC5160_STANDALONE
|
||||
* :['A4988', 'A5984', 'DRV8825', 'LV8729', 'L6470', 'L6474', 'POWERSTEP01', 'TB6560', 'TB6600', 'TMC2100', 'TMC2130', 'TMC2130_STANDALONE', 'TMC2160', 'TMC2160_STANDALONE', 'TMC2208', 'TMC2208_STANDALONE', 'TMC2209', 'TMC2209_STANDALONE', 'TMC26X', 'TMC26X_STANDALONE', 'TMC2660', 'TMC2660_STANDALONE', 'TMC5130', 'TMC5130_STANDALONE', 'TMC5160', 'TMC5160_STANDALONE']
|
||||
*/
|
||||
#define X_DRIVER_TYPE A4988
|
||||
#define Y_DRIVER_TYPE A4988
|
||||
#define Z_DRIVER_TYPE A4988
|
||||
#define X_DRIVER_TYPE TMC2209_STANDALONE
|
||||
#define Y_DRIVER_TYPE TMC2209_STANDALONE
|
||||
#define Z_DRIVER_TYPE TMC2209_STANDALONE
|
||||
//#define X2_DRIVER_TYPE A4988
|
||||
//#define Y2_DRIVER_TYPE A4988
|
||||
//#define Z2_DRIVER_TYPE A4988
|
||||
//#define Z3_DRIVER_TYPE A4988
|
||||
//#define Z4_DRIVER_TYPE A4988
|
||||
#define E0_DRIVER_TYPE A4988
|
||||
#define E0_DRIVER_TYPE TMC2209_STANDALONE
|
||||
//#define E1_DRIVER_TYPE A4988
|
||||
//#define E2_DRIVER_TYPE A4988
|
||||
//#define E3_DRIVER_TYPE A4988
|
||||
@@ -736,14 +731,14 @@
|
||||
* Override with M92
|
||||
* X, Y, Z, E0 [, E1[, E2...]]
|
||||
*/
|
||||
#define DEFAULT_AXIS_STEPS_PER_UNIT { 80, 80, 400, 500 }
|
||||
#define DEFAULT_AXIS_STEPS_PER_UNIT { 80, 80, 400, 93 }
|
||||
|
||||
/**
|
||||
* Default Max Feed Rate (mm/s)
|
||||
* Override with M203
|
||||
* X, Y, Z, E0 [, E1[, E2...]]
|
||||
*/
|
||||
#define DEFAULT_MAX_FEEDRATE { 300, 300, 5, 25 }
|
||||
#define DEFAULT_MAX_FEEDRATE { 500, 500, 5, 25 }
|
||||
|
||||
//#define LIMITED_MAX_FR_EDITING // Limit edit via M203 or LCD to DEFAULT_MAX_FEEDRATE * 2
|
||||
#if ENABLED(LIMITED_MAX_FR_EDITING)
|
||||
@@ -756,7 +751,7 @@
|
||||
* Override with M201
|
||||
* X, Y, Z, E0 [, E1[, E2...]]
|
||||
*/
|
||||
#define DEFAULT_MAX_ACCELERATION { 3000, 3000, 100, 10000 }
|
||||
#define DEFAULT_MAX_ACCELERATION { 500, 500, 100, 1000 }
|
||||
|
||||
//#define LIMITED_MAX_ACCEL_EDITING // Limit edit via M201 or LCD to DEFAULT_MAX_ACCELERATION * 2
|
||||
#if ENABLED(LIMITED_MAX_ACCEL_EDITING)
|
||||
@@ -771,9 +766,9 @@
|
||||
* M204 R Retract Acceleration
|
||||
* M204 T Travel Acceleration
|
||||
*/
|
||||
#define DEFAULT_ACCELERATION 3000 // X, Y, Z and E acceleration for printing moves
|
||||
#define DEFAULT_RETRACT_ACCELERATION 3000 // E acceleration for retracts
|
||||
#define DEFAULT_TRAVEL_ACCELERATION 3000 // X, Y, Z acceleration for travel (non printing) moves
|
||||
#define DEFAULT_ACCELERATION 500 // X, Y, Z and E acceleration for printing moves
|
||||
#define DEFAULT_RETRACT_ACCELERATION 1000 // E acceleration for retracts
|
||||
#define DEFAULT_TRAVEL_ACCELERATION 1000 // X, Y, Z acceleration for travel (non printing) moves
|
||||
|
||||
/**
|
||||
* Default Jerk limits (mm/s)
|
||||
@@ -783,7 +778,7 @@
|
||||
* When changing speed and direction, if the difference is less than the
|
||||
* value set here, it may happen instantaneously.
|
||||
*/
|
||||
//#define CLASSIC_JERK
|
||||
#define CLASSIC_JERK
|
||||
#if ENABLED(CLASSIC_JERK)
|
||||
#define DEFAULT_XJERK 10.0
|
||||
#define DEFAULT_YJERK 10.0
|
||||
@@ -807,7 +802,7 @@
|
||||
* https://blog.kyneticcnc.com/2018/10/computing-junction-deviation-for-marlin.html
|
||||
*/
|
||||
#if DISABLED(CLASSIC_JERK)
|
||||
#define JUNCTION_DEVIATION_MM 0.013 // (mm) Distance from real junction edge
|
||||
#define JUNCTION_DEVIATION_MM 0.05 // (mm) Distance from real junction edge
|
||||
#define JD_HANDLE_SMALL_SEGMENTS // Use curvature estimation instead of just the junction angle
|
||||
// for small segments (< 1mm) with large junction angles (> 135°).
|
||||
#endif
|
||||
@@ -820,7 +815,7 @@
|
||||
*
|
||||
* See https://github.com/synthetos/TinyG/wiki/Jerk-Controlled-Motion-Explained
|
||||
*/
|
||||
//#define S_CURVE_ACCELERATION
|
||||
#define S_CURVE_ACCELERATION
|
||||
|
||||
//===========================================================================
|
||||
//============================= Z Probe Options =============================
|
||||
@@ -839,7 +834,7 @@
|
||||
#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
|
||||
#define USE_PROBE_FOR_Z_HOMING
|
||||
|
||||
/**
|
||||
* Z_MIN_PROBE_PIN
|
||||
@@ -883,7 +878,7 @@
|
||||
* Use the nozzle as the probe, as with a conductive
|
||||
* nozzle system or a piezo-electric smart effector.
|
||||
*/
|
||||
//#define NOZZLE_AS_PROBE
|
||||
#define NOZZLE_AS_PROBE
|
||||
|
||||
/**
|
||||
* Z Servo Probe, such as an endstop switch on a rotating arm.
|
||||
@@ -986,21 +981,30 @@
|
||||
* | [-] |
|
||||
* O-- FRONT --+
|
||||
*/
|
||||
#define NOZZLE_TO_PROBE_OFFSET { 10, 10, 0 }
|
||||
#define NOZZLE_TO_PROBE_OFFSET { 0, 0, 0.2 }
|
||||
|
||||
// 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 10
|
||||
#define PROBING_MARGIN 5
|
||||
|
||||
// X and Y axis travel speed (mm/min) between probes
|
||||
#define XY_PROBE_SPEED (133*60)
|
||||
|
||||
// Feedrate (mm/min) for the first approach when double-probing (MULTIPLE_PROBING == 2)
|
||||
#define Z_PROBE_SPEED_FAST (4*60)
|
||||
#define Z_PROBE_SPEED_FAST ((4 * 60) / 2)
|
||||
|
||||
// Feedrate (mm/min) for the "accurate" probe of each point
|
||||
#define Z_PROBE_SPEED_SLOW (Z_PROBE_SPEED_FAST / 2)
|
||||
|
||||
// Fail to probe if the probe does not indicate itself as active.
|
||||
// This may be a switch indicating proper deployment, or an optical switch to report the carriage is near the bed.
|
||||
#define PROBE_ACTIVE_INPUT
|
||||
#if ENABLED(PROBE_ACTIVE_INPUT)
|
||||
#define PROBE_ACTIVE_INPUT_STATE LOW // State indicating probe is active
|
||||
//#define PROBE_ENABLE_PIN PC6 // Override default pin
|
||||
#endif
|
||||
|
||||
|
||||
/**
|
||||
* Probe Activation Switch
|
||||
* A switch indicating proper deployment, or an optical
|
||||
@@ -1012,19 +1016,18 @@
|
||||
//#define PROBE_ACTIVATION_SWITCH_PIN PC6 // Override default pin
|
||||
#endif
|
||||
|
||||
/**
|
||||
* Tare Probe (determine zero-point) prior to each probe.
|
||||
* Useful for a strain gauge or piezo sensor that needs to factor out
|
||||
* elements such as cables pulling on the carriage.
|
||||
*/
|
||||
//#define PROBE_TARE
|
||||
// Probe should be tared prior to each probe
|
||||
// Useful for strain or piezo sensors which must exclude strain such
|
||||
// as that from cables or bowden cables pulling on the carriage.
|
||||
#define PROBE_TARE
|
||||
#if ENABLED(PROBE_TARE)
|
||||
#define PROBE_TARE_TIME 200 // (ms) Time to hold tare pin
|
||||
#define PROBE_TARE_DELAY 200 // (ms) Delay after tare before
|
||||
#define PROBE_TARE_TIME 200 // Time to hold tare pin (milliseconds)
|
||||
#define PROBE_TARE_DELAY 200 // Delay after tare before (milliseconds)
|
||||
#define PROBE_TARE_STATE HIGH // State to write pin for tare
|
||||
//#define PROBE_TARE_PIN PA5 // Override default pin
|
||||
#if ENABLED(PROBE_ACTIVATION_SWITCH)
|
||||
//#define PROBE_TARE_ONLY_WHILE_INACTIVE // Fail to tare/probe if PROBE_ACTIVATION_SWITCH is active
|
||||
#if ENABLED(PROBE_ACTIVE_INPUT)
|
||||
// Fail to tare/probe if PROBE_ACTIVE_INPUT reports the probe to be active
|
||||
//#define PROBE_TARE_ONLY_WHILE_INACTIVE
|
||||
#endif
|
||||
#endif
|
||||
|
||||
@@ -1037,7 +1040,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
|
||||
|
||||
/**
|
||||
@@ -1055,18 +1058,18 @@
|
||||
* But: `M851 Z+1` with a CLEARANCE of 2 => 2mm from bed to nozzle.
|
||||
*/
|
||||
#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_CLEARANCE_BETWEEN_PROBES 3 // Z Clearance between probe points
|
||||
#define Z_CLEARANCE_MULTI_PROBE 3 // Z Clearance between multiple probes
|
||||
//#define Z_AFTER_PROBING 5 // Z position after probing is done
|
||||
|
||||
#define Z_PROBE_LOW_POINT -2 // Farthest distance below the trigger-point to go before stopping
|
||||
#define Z_PROBE_LOW_POINT -3 // 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 -20
|
||||
#define Z_PROBE_OFFSET_RANGE_MAX 20
|
||||
#define Z_PROBE_OFFSET_RANGE_MIN -10
|
||||
#define Z_PROBE_OFFSET_RANGE_MAX 10
|
||||
|
||||
// Enable the M48 repeatability test to test probe accuracy
|
||||
//#define Z_MIN_PROBE_REPEATABILITY_TEST
|
||||
#define Z_MIN_PROBE_REPEATABILITY_TEST
|
||||
|
||||
// Before deploy/stow pause for user confirmation
|
||||
//#define PAUSE_BEFORE_DEPLOY_STOW
|
||||
@@ -1081,18 +1084,18 @@
|
||||
* These options are most useful for the BLTouch probe, but may also improve
|
||||
* readings with inductive probes and piezo sensors.
|
||||
*/
|
||||
//#define PROBING_HEATERS_OFF // Turn heaters off when probing
|
||||
#define PROBING_HEATERS_OFF // Turn heaters off when probing
|
||||
#if ENABLED(PROBING_HEATERS_OFF)
|
||||
//#define WAIT_FOR_BED_HEATER // Wait for bed to heat back up between probes (to improve accuracy)
|
||||
#define WAIT_FOR_BED_HEATER // Wait for bed to heat back up between probes (to improve accuracy)
|
||||
#endif
|
||||
//#define PROBING_FANS_OFF // Turn fans off when probing
|
||||
//#define PROBING_STEPPERS_OFF // Turn steppers off (unless needed to hold position) when probing
|
||||
#define PROBING_STEPPERS_OFF // Turn steppers off (unless needed to hold position) when probing
|
||||
//#define DELAY_BEFORE_PROBING 200 // (ms) To prevent vibrations from triggering piezo sensors
|
||||
|
||||
// Require minimum nozzle and/or bed temperature for probing
|
||||
//#define PREHEAT_BEFORE_PROBING
|
||||
#define PREHEAT_BEFORE_PROBING
|
||||
#if ENABLED(PREHEAT_BEFORE_PROBING)
|
||||
#define PROBING_NOZZLE_TEMP 120 // (°C) Only applies to E0 at this time
|
||||
#define PROBING_NOZZLE_TEMP 170 // (°C) Only applies to E0 at this time
|
||||
#define PROBING_BED_TEMP 50
|
||||
#endif
|
||||
|
||||
@@ -1120,14 +1123,14 @@
|
||||
// @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_Y_DIR true
|
||||
#define INVERT_Z_DIR false
|
||||
#define INVERT_X_DIR true
|
||||
#define INVERT_Y_DIR false
|
||||
#define INVERT_Z_DIR true
|
||||
|
||||
// @section extruder
|
||||
|
||||
// For direct drive extruder v9 set to true, for geared extruder set to false.
|
||||
#define INVERT_E0_DIR false
|
||||
#define INVERT_E0_DIR true
|
||||
#define INVERT_E1_DIR false
|
||||
#define INVERT_E2_DIR false
|
||||
#define INVERT_E3_DIR false
|
||||
@@ -1138,14 +1141,14 @@
|
||||
|
||||
// @section homing
|
||||
|
||||
//#define NO_MOTION_BEFORE_HOMING // Inhibit movement until all axes have been homed. Also enable HOME_AFTER_DEACTIVATE for extra safety.
|
||||
//#define HOME_AFTER_DEACTIVATE // Require rehoming after steppers are deactivated. Also enable NO_MOTION_BEFORE_HOMING for extra safety.
|
||||
//#define NO_MOTION_BEFORE_HOMING // Inhibit movement until all axes have been homed
|
||||
|
||||
//#define UNKNOWN_Z_NO_RAISE // Don't raise Z (lower the bed) if Z is "unknown." For beds that fall when Z is powered off.
|
||||
|
||||
//#define Z_HOMING_HEIGHT 4 // (mm) Minimal Z height before homing (G28) for Z clearance above the bed, clamps, ...
|
||||
#define Z_HOMING_HEIGHT 15 // (mm) Minimal Z height before homing (G28) for Z clearance above the bed, clamps, ...
|
||||
// Be sure to have this much clearance over your Z_MAX_POS to prevent grinding.
|
||||
|
||||
//#define Z_AFTER_HOMING 10 // (mm) Height to move to after homing Z
|
||||
#define Z_AFTER_HOMING 5 // (mm) Height to move to after homing Z
|
||||
|
||||
// Direction of endstops when homing; 1=MAX, -1=MIN
|
||||
// :[-1,1]
|
||||
@@ -1156,16 +1159,16 @@
|
||||
// @section machine
|
||||
|
||||
// The size of the print bed
|
||||
#define X_BED_SIZE 200
|
||||
#define Y_BED_SIZE 200
|
||||
#define X_BED_SIZE 235
|
||||
#define Y_BED_SIZE 235
|
||||
|
||||
// Travel limits (mm) after homing, corresponding to endstop positions.
|
||||
#define X_MIN_POS 0
|
||||
#define Y_MIN_POS 0
|
||||
#define X_MIN_POS -5
|
||||
#define Y_MIN_POS -2
|
||||
#define Z_MIN_POS 0
|
||||
#define X_MAX_POS X_BED_SIZE
|
||||
#define Y_MAX_POS Y_BED_SIZE
|
||||
#define Z_MAX_POS 200
|
||||
#define Z_MAX_POS 250
|
||||
|
||||
/**
|
||||
* Software Endstops
|
||||
@@ -1200,56 +1203,16 @@
|
||||
* Filament Runout Sensors
|
||||
* Mechanical or opto endstops are used to check for the presence of filament.
|
||||
*
|
||||
* IMPORTANT: Runout will only trigger if Marlin is aware that a print job is running.
|
||||
* Marlin knows a print job is running when:
|
||||
* 1. Running a print job from media started with M24.
|
||||
* 2. The Print Job Timer has been started with M75.
|
||||
* 3. The heaters were turned on and PRINTJOB_TIMER_AUTOSTART is enabled.
|
||||
*
|
||||
* RAMPS-based boards use SERVO3_PIN for the first runout sensor.
|
||||
* For other boards you may need to define FIL_RUNOUT_PIN, FIL_RUNOUT2_PIN, etc.
|
||||
*/
|
||||
//#define FILAMENT_RUNOUT_SENSOR
|
||||
#define FILAMENT_RUNOUT_SENSOR
|
||||
#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_STATE LOW // Pin state indicating that filament is NOT present.
|
||||
#define FIL_RUNOUT_PULLUP // Use internal pullup for filament runout pins.
|
||||
//#define FIL_RUNOUT_PULLDOWN // Use internal pulldown for filament runout pins.
|
||||
|
||||
// Override individually if the runout sensors vary
|
||||
//#define FIL_RUNOUT1_STATE LOW
|
||||
//#define FIL_RUNOUT1_PULLUP
|
||||
//#define FIL_RUNOUT1_PULLDOWN
|
||||
|
||||
//#define FIL_RUNOUT2_STATE LOW
|
||||
//#define FIL_RUNOUT2_PULLUP
|
||||
//#define FIL_RUNOUT2_PULLDOWN
|
||||
|
||||
//#define FIL_RUNOUT3_STATE LOW
|
||||
//#define FIL_RUNOUT3_PULLUP
|
||||
//#define FIL_RUNOUT3_PULLDOWN
|
||||
|
||||
//#define FIL_RUNOUT4_STATE LOW
|
||||
//#define FIL_RUNOUT4_PULLUP
|
||||
//#define FIL_RUNOUT4_PULLDOWN
|
||||
|
||||
//#define FIL_RUNOUT5_STATE LOW
|
||||
//#define FIL_RUNOUT5_PULLUP
|
||||
//#define FIL_RUNOUT5_PULLDOWN
|
||||
|
||||
//#define FIL_RUNOUT6_STATE LOW
|
||||
//#define FIL_RUNOUT6_PULLUP
|
||||
//#define FIL_RUNOUT6_PULLDOWN
|
||||
|
||||
//#define FIL_RUNOUT7_STATE LOW
|
||||
//#define FIL_RUNOUT7_PULLUP
|
||||
//#define FIL_RUNOUT7_PULLDOWN
|
||||
|
||||
//#define FIL_RUNOUT8_STATE LOW
|
||||
//#define FIL_RUNOUT8_PULLUP
|
||||
//#define FIL_RUNOUT8_PULLDOWN
|
||||
#define FIL_RUNOUT_STATE HIGH // Pin state indicating that filament is NOT present.
|
||||
#define FIL_RUNOUT_PULLUP // Use internal pullup for filament runout pins.
|
||||
//#define FIL_RUNOUT_PULLDOWN // Use internal pulldown for filament runout pins.
|
||||
|
||||
// Set one or more commands to execute on filament runout.
|
||||
// (After 'M412 H' Marlin will ask the host to handle the process.)
|
||||
@@ -1258,7 +1221,7 @@
|
||||
// After a runout is detected, continue printing this length of filament
|
||||
// before executing the runout script. Useful for a sensor at the end of
|
||||
// a feed tube. Requires 4 bytes SRAM per sensor, plus 4 bytes overhead.
|
||||
//#define FILAMENT_RUNOUT_DISTANCE_MM 25
|
||||
#define FILAMENT_RUNOUT_DISTANCE_MM 5
|
||||
|
||||
#ifdef FILAMENT_RUNOUT_DISTANCE_MM
|
||||
// Enable this option to use an encoder disc that toggles the runout pin
|
||||
@@ -1308,7 +1271,7 @@
|
||||
*/
|
||||
//#define AUTO_BED_LEVELING_3POINT
|
||||
//#define AUTO_BED_LEVELING_LINEAR
|
||||
//#define AUTO_BED_LEVELING_BILINEAR
|
||||
#define AUTO_BED_LEVELING_BILINEAR
|
||||
//#define AUTO_BED_LEVELING_UBL
|
||||
//#define MESH_BED_LEVELING
|
||||
|
||||
@@ -1317,7 +1280,7 @@
|
||||
* these options to restore the prior leveling state or to always enable
|
||||
* leveling immediately after G28.
|
||||
*/
|
||||
//#define RESTORE_LEVELING_AFTER_G28
|
||||
#define RESTORE_LEVELING_AFTER_G28
|
||||
//#define ENABLE_LEVELING_AFTER_G28
|
||||
|
||||
/**
|
||||
@@ -1334,16 +1297,13 @@
|
||||
* Turn on with the command 'M111 S32'.
|
||||
* NOTE: Requires a lot of PROGMEM!
|
||||
*/
|
||||
//#define DEBUG_LEVELING_FEATURE
|
||||
#define DEBUG_LEVELING_FEATURE
|
||||
|
||||
#if ANY(MESH_BED_LEVELING, AUTO_BED_LEVELING_BILINEAR, AUTO_BED_LEVELING_UBL)
|
||||
// Gradually reduce leveling correction until a set height is reached,
|
||||
// at which point movement will be level to the machine's XY plane.
|
||||
// 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 10.0 // (mm) Default fade height.
|
||||
#endif
|
||||
|
||||
// For Cartesian machines, instead of dividing moves on mesh boundaries,
|
||||
// split up moves into short segments like a Delta. This follows the
|
||||
@@ -1354,7 +1314,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.
|
||||
@@ -1370,17 +1330,17 @@
|
||||
#if EITHER(AUTO_BED_LEVELING_LINEAR, AUTO_BED_LEVELING_BILINEAR)
|
||||
|
||||
// Set the number of grid points per dimension.
|
||||
#define GRID_MAX_POINTS_X 3
|
||||
#define GRID_MAX_POINTS_X 5
|
||||
#define GRID_MAX_POINTS_Y GRID_MAX_POINTS_X
|
||||
|
||||
// Probe along the Y axis, advancing X after each column
|
||||
//#define PROBE_Y_FIRST
|
||||
#define PROBE_Y_FIRST
|
||||
|
||||
#if ENABLED(AUTO_BED_LEVELING_BILINEAR)
|
||||
|
||||
// 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.
|
||||
@@ -1446,12 +1406,6 @@
|
||||
#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
|
||||
#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
|
||||
#endif
|
||||
|
||||
/**
|
||||
* Corner Leveling Order
|
||||
@@ -1499,7 +1453,7 @@
|
||||
// - Move the Z probe (or nozzle) to a defined XY point before Z Homing.
|
||||
// - Prevent Z homing when the Z probe is outside bed area.
|
||||
//
|
||||
//#define Z_SAFE_HOMING
|
||||
#define Z_SAFE_HOMING
|
||||
|
||||
#if ENABLED(Z_SAFE_HOMING)
|
||||
#define Z_SAFE_HOMING_X_POINT X_CENTER // X point for Z homing
|
||||
@@ -1507,7 +1461,7 @@
|
||||
#endif
|
||||
|
||||
// Homing speeds (mm/min)
|
||||
#define HOMING_FEEDRATE_MM_M { (50*60), (50*60), (4*60) }
|
||||
#define HOMING_FEEDRATE_MM_M { (50*60), (50*60), (10*60) }
|
||||
|
||||
// Validate that endstops are triggered on homing moves
|
||||
#define VALIDATE_HOMING_ENDSTOPS
|
||||
@@ -1584,12 +1538,12 @@
|
||||
* M501 - Read settings from EEPROM. (i.e., Throw away unsaved changes)
|
||||
* M502 - Revert settings to "factory" defaults. (Follow with M500 to init the EEPROM.)
|
||||
*/
|
||||
//#define EEPROM_SETTINGS // Persistent storage with M500 and M501
|
||||
#define EEPROM_SETTINGS // Persistent storage with M500 and M501
|
||||
//#define DISABLE_M503 // Saves ~2700 bytes of PROGMEM. Disable for release!
|
||||
#define EEPROM_CHITCHAT // Give feedback on EEPROM commands. Disable to save PROGMEM.
|
||||
//#define EEPROM_CHITCHAT // Give feedback on EEPROM commands. Disable to save PROGMEM.
|
||||
#define EEPROM_BOOT_SILENT // Keep M503 quiet and only give errors during first load
|
||||
#if ENABLED(EEPROM_SETTINGS)
|
||||
//#define EEPROM_AUTO_INIT // Init EEPROM automatically on any errors.
|
||||
#define EEPROM_AUTO_INIT // Init EEPROM automatically on any errors.
|
||||
#endif
|
||||
|
||||
//
|
||||
@@ -1618,14 +1572,14 @@
|
||||
// Preheat Constants - Up to 5 are supported without changes
|
||||
//
|
||||
#define PREHEAT_1_LABEL "PLA"
|
||||
#define PREHEAT_1_TEMP_HOTEND 180
|
||||
#define PREHEAT_1_TEMP_BED 70
|
||||
#define PREHEAT_1_FAN_SPEED 0 // Value from 0 to 255
|
||||
#define PREHEAT_1_TEMP_HOTEND 200
|
||||
#define PREHEAT_1_TEMP_BED 60
|
||||
#define PREHEAT_1_FAN_SPEED 255 // Value from 0 to 255
|
||||
|
||||
#define PREHEAT_2_LABEL "ABS"
|
||||
#define PREHEAT_2_TEMP_HOTEND 240
|
||||
#define PREHEAT_2_TEMP_BED 110
|
||||
#define PREHEAT_2_FAN_SPEED 0 // Value from 0 to 255
|
||||
#define PREHEAT_2_TEMP_BED 70
|
||||
#define PREHEAT_2_FAN_SPEED 255 // Value from 0 to 255
|
||||
|
||||
/**
|
||||
* Nozzle Park
|
||||
@@ -1638,12 +1592,12 @@
|
||||
* P1 Raise the nozzle always to Z-park height.
|
||||
* P2 Raise the nozzle by Z-park amount, limited to Z_MAX_POS.
|
||||
*/
|
||||
//#define NOZZLE_PARK_FEATURE
|
||||
#define NOZZLE_PARK_FEATURE
|
||||
|
||||
#if ENABLED(NOZZLE_PARK_FEATURE)
|
||||
// Specify a park position as { X, Y, Z_raise }
|
||||
#define NOZZLE_PARK_POINT { (X_MIN_POS + 10), (Y_MAX_POS - 10), 20 }
|
||||
//#define NOZZLE_PARK_X_ONLY // X move only is required to park
|
||||
#define NOZZLE_PARK_X_ONLY // X move only is required to park
|
||||
//#define NOZZLE_PARK_Y_ONLY // Y move only is required to park
|
||||
#define NOZZLE_PARK_Z_RAISE_MIN 2 // (mm) Always raise Z by at least this distance
|
||||
#define NOZZLE_PARK_XY_FEEDRATE 100 // (mm/s) X and Y axes feedrate (also used for delta Z axis)
|
||||
@@ -1755,7 +1709,7 @@
|
||||
*
|
||||
* View the current statistics with M78.
|
||||
*/
|
||||
//#define PRINTCOUNTER
|
||||
#define PRINTCOUNTER
|
||||
#if ENABLED(PRINTCOUNTER)
|
||||
#define PRINTCOUNTER_SAVE_INTERVAL 60 // (minutes) EEPROM save interval during print
|
||||
#endif
|
||||
@@ -1846,7 +1800,7 @@
|
||||
* SD Card support is disabled by default. If your controller has an SD slot,
|
||||
* you must uncomment the following option or it won't work.
|
||||
*/
|
||||
//#define SDSUPPORT
|
||||
#define SDSUPPORT
|
||||
|
||||
/**
|
||||
* SD CARD: ENABLE CRC
|
||||
@@ -1870,13 +1824,13 @@
|
||||
// This option overrides the default number of encoder pulses needed to
|
||||
// produce one step. Should be increased for high-resolution encoders.
|
||||
//
|
||||
//#define ENCODER_PULSES_PER_STEP 4
|
||||
//#define ENCODER_PULSES_PER_STEP 4 // SD: I don't think this is needed, Ender 3 V2 used probably same codebase
|
||||
|
||||
//
|
||||
// Use this option to override the number of step signals required to
|
||||
// move between next/prev menu items.
|
||||
//
|
||||
//#define ENCODER_STEPS_PER_MENU_ITEM 1
|
||||
//#define ENCODER_STEPS_PER_MENU_ITEM 1 // SD: I don't think this is needed, Ender 3 V2 used probably same codebase
|
||||
|
||||
/**
|
||||
* Encoder Direction Options
|
||||
@@ -1924,7 +1878,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.
|
||||
@@ -1933,8 +1887,8 @@
|
||||
// Note: Test audio output with the G-Code:
|
||||
// M300 S<frequency Hz> P<duration ms>
|
||||
//
|
||||
//#define LCD_FEEDBACK_FREQUENCY_DURATION_MS 2
|
||||
//#define LCD_FEEDBACK_FREQUENCY_HZ 5000
|
||||
#define LCD_FEEDBACK_FREQUENCY_DURATION_MS 2
|
||||
#define LCD_FEEDBACK_FREQUENCY_HZ 5000
|
||||
|
||||
//=============================================================================
|
||||
//======================== LCD / Controller Selection =========================
|
||||
@@ -2198,7 +2152,6 @@
|
||||
// different pins/wiring (see pins_ANET_10.h). Enable one of these.
|
||||
//
|
||||
//#define ANET_FULL_GRAPHICS_LCD
|
||||
//#define ANET_FULL_GRAPHICS_LCD_ALT_WIRING
|
||||
|
||||
//
|
||||
// AZSMZ 12864 LCD with SD
|
||||
@@ -2279,6 +2232,12 @@
|
||||
//#define DGUS_LCD_UI_FYSETC
|
||||
//#define DGUS_LCD_UI_HIPRECY
|
||||
|
||||
//
|
||||
// CR-6 OEM touch screen. A DWIN display with touch.
|
||||
//
|
||||
|
||||
#define DGUS_LCD_UI_CREALITY_TOUCH
|
||||
|
||||
//
|
||||
// Touch-screen LCD for Malyan M200/M300 printers
|
||||
//
|
||||
@@ -2392,19 +2351,6 @@
|
||||
// Generic TFT with detailed options
|
||||
//
|
||||
//#define TFT_GENERIC
|
||||
#if ENABLED(TFT_GENERIC)
|
||||
// :[ 'AUTO', 'ST7735', 'ST7789', 'ST7796', 'R61505', 'ILI9328', 'ILI9341', 'ILI9488' ]
|
||||
#define TFT_DRIVER AUTO
|
||||
|
||||
// Interface. Enable one of the following options:
|
||||
//#define TFT_INTERFACE_FSMC
|
||||
//#define TFT_INTERFACE_SPI
|
||||
|
||||
// TFT Resolution. Enable one of the following options:
|
||||
//#define TFT_RES_320x240
|
||||
//#define TFT_RES_480x272
|
||||
//#define TFT_RES_480x320
|
||||
#endif
|
||||
|
||||
/**
|
||||
* TFT UI - User Interface Selection. Enable one of the following options:
|
||||
|
||||
+52
-55
@@ -192,12 +192,12 @@
|
||||
* THERMAL_PROTECTION_HYSTERESIS and/or THERMAL_PROTECTION_PERIOD
|
||||
*/
|
||||
#if ENABLED(THERMAL_PROTECTION_HOTENDS)
|
||||
#define THERMAL_PROTECTION_PERIOD 40 // Seconds
|
||||
#define THERMAL_PROTECTION_HYSTERESIS 4 // Degrees Celsius
|
||||
#define THERMAL_PROTECTION_PERIOD 60 // Seconds
|
||||
#define THERMAL_PROTECTION_HYSTERESIS 12 // Degrees Celsius
|
||||
|
||||
//#define ADAPTIVE_FAN_SLOWING // Slow part cooling fan if temperature drops
|
||||
#define ADAPTIVE_FAN_SLOWING // Slow part cooling fan if temperature drops
|
||||
#if BOTH(ADAPTIVE_FAN_SLOWING, PIDTEMP)
|
||||
//#define NO_FAN_SLOWING_IN_PID_TUNING // Don't slow fan speed during M303
|
||||
#define NO_FAN_SLOWING_IN_PID_TUNING // Don't slow fan speed during M303
|
||||
#endif
|
||||
|
||||
/**
|
||||
@@ -212,7 +212,7 @@
|
||||
* and/or decrease WATCH_TEMP_INCREASE. WATCH_TEMP_INCREASE should not be set
|
||||
* below 2.
|
||||
*/
|
||||
#define WATCH_TEMP_PERIOD 20 // Seconds
|
||||
#define WATCH_TEMP_PERIOD 60 // Seconds
|
||||
#define WATCH_TEMP_INCREASE 2 // Degrees Celsius
|
||||
#endif
|
||||
|
||||
@@ -220,13 +220,13 @@
|
||||
* Thermal Protection parameters for the bed are just as above for hotends.
|
||||
*/
|
||||
#if ENABLED(THERMAL_PROTECTION_BED)
|
||||
#define THERMAL_PROTECTION_BED_PERIOD 20 // Seconds
|
||||
#define THERMAL_PROTECTION_BED_PERIOD 180 // Seconds
|
||||
#define THERMAL_PROTECTION_BED_HYSTERESIS 2 // Degrees Celsius
|
||||
|
||||
/**
|
||||
* As described above, except for the bed (M140/M190/M303).
|
||||
*/
|
||||
#define WATCH_BED_TEMP_PERIOD 60 // Seconds
|
||||
#define WATCH_BED_TEMP_PERIOD 180 // Seconds
|
||||
#define WATCH_BED_TEMP_INCREASE 2 // Degrees Celsius
|
||||
#endif
|
||||
|
||||
@@ -377,9 +377,9 @@
|
||||
* Hotend Idle Timeout
|
||||
* Prevent filament in the nozzle from charring and causing a critical jam.
|
||||
*/
|
||||
//#define HOTEND_IDLE_TIMEOUT
|
||||
#define HOTEND_IDLE_TIMEOUT
|
||||
#if ENABLED(HOTEND_IDLE_TIMEOUT)
|
||||
#define HOTEND_IDLE_TIMEOUT_SEC (5*60) // (seconds) Time without extruder movement to trigger protection
|
||||
#define HOTEND_IDLE_TIMEOUT_SEC (15*60) // (seconds) Time without extruder movement to trigger protection
|
||||
#define HOTEND_IDLE_MIN_TRIGGER 180 // (°C) Minimum temperature to enable hotend protection
|
||||
#define HOTEND_IDLE_NOZZLE_TARGET 0 // (°C) Safe temperature for the nozzle after timeout
|
||||
#define HOTEND_IDLE_BED_TARGET 0 // (°C) Safe temperature for the bed after timeout
|
||||
@@ -436,7 +436,7 @@
|
||||
*
|
||||
* Define one or both of these to override the default 0-255 range.
|
||||
*/
|
||||
//#define FAN_MIN_PWM 50
|
||||
#define FAN_MIN_PWM 50
|
||||
//#define FAN_MAX_PWM 128
|
||||
|
||||
/**
|
||||
@@ -509,7 +509,7 @@
|
||||
/**
|
||||
* M355 Case Light on-off / brightness
|
||||
*/
|
||||
//#define CASE_LIGHT_ENABLE
|
||||
#define CASE_LIGHT_ENABLE
|
||||
#if ENABLED(CASE_LIGHT_ENABLE)
|
||||
//#define CASE_LIGHT_PIN 4 // Override the default pin if needed
|
||||
#define INVERT_CASE_LIGHT false // Set true if Case Light is ON when pin is LOW
|
||||
@@ -672,7 +672,7 @@
|
||||
|
||||
//#define HOMING_BACKOFF_POST_MM { 2, 2, 2 } // (mm) Backoff from endstops after homing
|
||||
|
||||
//#define QUICK_HOME // If G28 contains XY do a diagonal move first
|
||||
#define QUICK_HOME // If G28 contains XY do a diagonal move first
|
||||
//#define HOME_Y_BEFORE_X // If G28 contains XY home Y before X
|
||||
//#define HOME_Z_FIRST // Home Z first. Requires a Z-MIN endstop (not a probe).
|
||||
//#define CODEPENDENT_XY_HOMING // If X/Y can't home without homing Y/X first
|
||||
@@ -876,7 +876,7 @@
|
||||
// Increase the slowdown divisor for larger buffer sizes.
|
||||
#define SLOWDOWN
|
||||
#if ENABLED(SLOWDOWN)
|
||||
#define SLOWDOWN_DIVISOR 2
|
||||
#define SLOWDOWN_DIVISOR 8
|
||||
#endif
|
||||
|
||||
/**
|
||||
@@ -899,19 +899,19 @@
|
||||
// Backlash Compensation
|
||||
// Adds extra movement to axes on direction-changes to account for backlash.
|
||||
//
|
||||
//#define BACKLASH_COMPENSATION
|
||||
#define BACKLASH_COMPENSATION
|
||||
#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.0 // 0.0 = no correction; 1.0 = full correction
|
||||
#define BACKLASH_CORRECTION 0.1 // 0.0 = no correction; 1.0 = full correction
|
||||
|
||||
// Set BACKLASH_SMOOTHING_MM to spread backlash correction over multiple segments
|
||||
// to reduce print artifacts. (Enabling this is costly in memory and computation!)
|
||||
//#define BACKLASH_SMOOTHING_MM 3 // (mm)
|
||||
|
||||
// Add runtime configuration and tuning of backlash values (M425)
|
||||
//#define BACKLASH_GCODE
|
||||
#define BACKLASH_GCODE
|
||||
|
||||
#if ENABLED(BACKLASH_GCODE)
|
||||
// Measure the Z backlash when probing (G29) and set with "M425 Z"
|
||||
@@ -1163,7 +1163,7 @@
|
||||
//#define LCD_DECIMAL_SMALL_XY
|
||||
|
||||
// Add an 'M73' G-code to set the current percentage
|
||||
//#define LCD_SET_PROGRESS_MANUALLY
|
||||
#define LCD_SET_PROGRESS_MANUALLY
|
||||
|
||||
// Show the E position (filament used) during printing
|
||||
//#define LCD_SHOW_E_TOTAL
|
||||
@@ -1227,9 +1227,7 @@
|
||||
//#define NO_SD_AUTOSTART // Remove auto#.g file support completely to save some Flash, SRAM
|
||||
//#define MENU_ADDAUTOSTART // Add a menu option to run auto#.g files
|
||||
|
||||
//#define BROWSE_MEDIA_ON_INSERT // Open the file browser when media is inserted
|
||||
|
||||
#define EVENT_GCODE_SD_ABORT "G28XY" // G-code to run on SD Abort Print (e.g., "G28XY" or "G27")
|
||||
#define EVENT_GCODE_SD_ABORT "G27\nM84" // 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
|
||||
@@ -1243,7 +1241,7 @@
|
||||
* an option on the LCD screen to continue the print from the last-known
|
||||
* point in the file.
|
||||
*/
|
||||
//#define POWER_LOSS_RECOVERY
|
||||
#define POWER_LOSS_RECOVERY
|
||||
#if ENABLED(POWER_LOSS_RECOVERY)
|
||||
#define PLR_ENABLED_DEFAULT false // Power Loss Recovery enabled by default. (Set with 'M413 Sn' & M500)
|
||||
//#define BACKUP_POWER_SUPPLY // Backup power / UPS to move the steppers on power loss
|
||||
@@ -1251,8 +1249,7 @@
|
||||
//#define POWER_LOSS_ZRAISE 2 // (mm) Z axis raise on resume (on power loss with UPS)
|
||||
//#define POWER_LOSS_PIN 44 // Pin to detect power loss. Set to -1 to disable default pin on boards without module.
|
||||
//#define POWER_LOSS_STATE HIGH // State of pin indicating power loss
|
||||
//#define POWER_LOSS_PULLUP // Set pullup / pulldown as appropriate for your sensor
|
||||
//#define POWER_LOSS_PULLDOWN
|
||||
//#define POWER_LOSS_PULL // Set pullup / pulldown as appropriate
|
||||
//#define POWER_LOSS_PURGE_LEN 20 // (mm) Length of filament to purge on resume
|
||||
//#define POWER_LOSS_RETRACT_LEN 10 // (mm) Length of filament to retract on fail. Requires backup power.
|
||||
|
||||
@@ -1284,7 +1281,7 @@
|
||||
* - SDSORT_CACHE_NAMES will retain the sorted file listing in RAM. (Expensive!)
|
||||
* - SDSORT_DYNAMIC_RAM only uses RAM when the SD menu is visible. (Use with caution!)
|
||||
*/
|
||||
//#define SDCARD_SORT_ALPHA
|
||||
#define SDCARD_SORT_ALPHA
|
||||
|
||||
// SD Card Sorting options
|
||||
#if ENABLED(SDCARD_SORT_ALPHA)
|
||||
@@ -1304,7 +1301,7 @@
|
||||
//#define UTF_FILENAME_SUPPORT
|
||||
|
||||
// This allows hosts to request long names for files and folders with M33
|
||||
//#define LONG_FILENAME_HOST_SUPPORT
|
||||
#define LONG_FILENAME_HOST_SUPPORT
|
||||
|
||||
// Enable this option to scroll long filenames in the SD card menu
|
||||
//#define SCROLL_LONG_FILENAMES
|
||||
@@ -1329,7 +1326,7 @@
|
||||
/**
|
||||
* Auto-report SdCard status with M27 S<seconds>
|
||||
*/
|
||||
//#define AUTO_REPORT_SD_STATUS
|
||||
#define AUTO_REPORT_SD_STATUS
|
||||
|
||||
/**
|
||||
* Support for USB thumb drives using an Arduino USB Host Shield or
|
||||
@@ -1498,7 +1495,7 @@
|
||||
//
|
||||
// Additional options for DGUS / DWIN displays
|
||||
//
|
||||
#if HAS_DGUS_LCD
|
||||
#if HAS_DGUS_LCD || ENABLED(DGUS_LCD_UI_CREALITY_TOUCH)
|
||||
#define LCD_SERIAL_PORT 3
|
||||
#define LCD_BAUDRATE 115200
|
||||
|
||||
@@ -1661,7 +1658,7 @@
|
||||
* NOTE: This method is less reliable as it can only catch hangups while
|
||||
* interrupts are enabled.
|
||||
*/
|
||||
#define USE_WATCHDOG
|
||||
//#define USE_WATCHDOG
|
||||
#if ENABLED(USE_WATCHDOG)
|
||||
//#define WATCHDOG_RESET_MANUAL
|
||||
#endif
|
||||
@@ -1675,15 +1672,15 @@
|
||||
*
|
||||
* Warning: Does not respect endstops!
|
||||
*/
|
||||
//#define BABYSTEPPING
|
||||
#define BABYSTEPPING
|
||||
#if ENABLED(BABYSTEPPING)
|
||||
//#define INTEGRATED_BABYSTEPPING // EXPERIMENTAL integration of babystepping into the Stepper ISR
|
||||
#define INTEGRATED_BABYSTEPPING // EXPERIMENTAL integration of babystepping into the Stepper ISR
|
||||
//#define BABYSTEP_WITHOUT_HOMING
|
||||
//#define BABYSTEP_ALWAYS_AVAILABLE // Allow babystepping at all times (not just during movement).
|
||||
#define BABYSTEP_ALWAYS_AVAILABLE // Allow babystepping at all times (not just during movement).
|
||||
//#define BABYSTEP_XY // Also enable X/Y Babystepping. Not supported on DELTA!
|
||||
#define BABYSTEP_INVERT_Z false // Change if Z babysteps should go the other way
|
||||
//#define BABYSTEP_MILLIMETER_UNITS // Specify BABYSTEP_MULTIPLICATOR_(XY|Z) in mm instead of micro-steps
|
||||
#define BABYSTEP_MULTIPLICATOR_Z 1 // (steps or mm) Steps or millimeter distance for each Z babystep
|
||||
#define BABYSTEP_MULTIPLICATOR_Z 40 // (steps or mm) Steps or millimeter distance for each Z babystep
|
||||
#define BABYSTEP_MULTIPLICATOR_XY 1 // (steps or mm) Steps or millimeter distance for each XY babystep
|
||||
|
||||
//#define DOUBLECLICK_FOR_Z_BABYSTEPPING // Double-click on the Status Screen for Z Babystepping.
|
||||
@@ -1698,7 +1695,7 @@
|
||||
|
||||
//#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
|
||||
@@ -1725,9 +1722,9 @@
|
||||
//#define LIN_ADVANCE
|
||||
#if ENABLED(LIN_ADVANCE)
|
||||
//#define EXTRA_LIN_ADVANCE_K // Enable for second linear advance constants
|
||||
#define LIN_ADVANCE_K 0.22 // Unit: mm compression per 1mm/s extruder speed
|
||||
#define LIN_ADVANCE_K 0 // Unit: mm compression per 1mm/s extruder speed
|
||||
//#define LA_DEBUG // If enabled, this will generate debug information output over USB.
|
||||
//#define EXPERIMENTAL_SCURVE // Enable this option to permit S-Curve Acceleration
|
||||
#define EXPERIMENTAL_SCURVE // Enable this option to permit S-Curve Acceleration
|
||||
#endif
|
||||
|
||||
// @section leveling
|
||||
@@ -1967,7 +1964,7 @@
|
||||
#if BOTH(SDSUPPORT, DIRECT_STEPPING)
|
||||
#define BLOCK_BUFFER_SIZE 8
|
||||
#elif ENABLED(SDSUPPORT)
|
||||
#define BLOCK_BUFFER_SIZE 16
|
||||
#define BLOCK_BUFFER_SIZE 64
|
||||
#else
|
||||
#define BLOCK_BUFFER_SIZE 16
|
||||
#endif
|
||||
@@ -1976,7 +1973,7 @@
|
||||
|
||||
// The ASCII buffer for serial input
|
||||
#define MAX_CMD_SIZE 96
|
||||
#define BUFSIZE 4
|
||||
#define BUFSIZE 32
|
||||
|
||||
// Transmission to Host Buffer Size
|
||||
// To save 386 bytes of PROGMEM (and TX_BUFFER_SIZE+3 bytes of RAM) set to 0.
|
||||
@@ -1985,7 +1982,7 @@
|
||||
// For debug-echo: 128 bytes for the optimal speed.
|
||||
// Other output doesn't need to be that speedy.
|
||||
// :[0, 2, 4, 8, 16, 32, 64, 128, 256]
|
||||
#define TX_BUFFER_SIZE 0
|
||||
#define TX_BUFFER_SIZE 128
|
||||
|
||||
// Host Receive Buffer Size
|
||||
// Without XON/XOFF flow control (see SERIAL_XON_XOFF below) 32 bytes should be enough.
|
||||
@@ -2020,16 +2017,16 @@
|
||||
* Currently handles M108, M112, M410, M876
|
||||
* NOTE: Not yet implemented for all platforms.
|
||||
*/
|
||||
//#define EMERGENCY_PARSER
|
||||
#define EMERGENCY_PARSER
|
||||
|
||||
// Bad Serial-connections can miss a received command by sending an 'ok'
|
||||
// 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
|
||||
#define ADVANCED_OK
|
||||
|
||||
// Printrun may have trouble receiving long strings all at once.
|
||||
// This option inserts short delays between lines of serial output.
|
||||
@@ -2063,7 +2060,7 @@
|
||||
*
|
||||
* Note that M207 / M208 / M209 settings are saved to EEPROM.
|
||||
*/
|
||||
//#define FWRETRACT
|
||||
#define FWRETRACT
|
||||
#if ENABLED(FWRETRACT)
|
||||
#define FWRETRACT_AUTORETRACT // Override slicer retractions
|
||||
#if ENABLED(FWRETRACT_AUTORETRACT)
|
||||
@@ -2163,7 +2160,7 @@
|
||||
* Requires NOZZLE_PARK_FEATURE.
|
||||
* This feature is required for the default FILAMENT_RUNOUT_SCRIPT.
|
||||
*/
|
||||
//#define ADVANCED_PAUSE_FEATURE
|
||||
#define ADVANCED_PAUSE_FEATURE
|
||||
#if ENABLED(ADVANCED_PAUSE_FEATURE)
|
||||
#define PAUSE_PARK_RETRACT_FEEDRATE 60 // (mm/s) Initial retract feedrate.
|
||||
#define PAUSE_PARK_RETRACT_LENGTH 2 // (mm) Initial retract.
|
||||
@@ -2184,7 +2181,7 @@
|
||||
// For direct drive, the full length of the nozzle.
|
||||
//#define ADVANCED_PAUSE_CONTINUOUS_PURGE // Purge continuously up to the purge length until interrupted.
|
||||
#define ADVANCED_PAUSE_PURGE_FEEDRATE 3 // (mm/s) Extrude feedrate (after loading). Should be slower than load feedrate.
|
||||
#define ADVANCED_PAUSE_PURGE_LENGTH 50 // (mm) Length to extrude after loading.
|
||||
#define ADVANCED_PAUSE_PURGE_LENGTH 2 // (mm) Length to extrude after loading.
|
||||
// Set to 0 for manual extrusion.
|
||||
// Filament can be extruded repeatedly from the Filament Change menu
|
||||
// until extrusion is consistent, and to purge old filament.
|
||||
@@ -2192,19 +2189,19 @@
|
||||
//#define ADVANCED_PAUSE_FANS_PAUSE // Turn off print-cooling fans while the machine is paused.
|
||||
|
||||
// Filament Unload does a Retract, Delay, and Purge first:
|
||||
#define FILAMENT_UNLOAD_PURGE_RETRACT 13 // (mm) Unload initial retract length.
|
||||
#define FILAMENT_UNLOAD_PURGE_RETRACT 3 // (mm) Unload initial retract length.
|
||||
#define FILAMENT_UNLOAD_PURGE_DELAY 5000 // (ms) Delay for the filament to cool after retract.
|
||||
#define FILAMENT_UNLOAD_PURGE_LENGTH 8 // (mm) An unretract is done, then this length is purged.
|
||||
#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 10 // Number of alert beeps to play when a response is needed.
|
||||
#define PAUSE_PARK_NOZZLE_TIMEOUT 90 // (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 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.
|
||||
#define PARK_HEAD_ON_PAUSE // Park the nozzle during pause and filament change.
|
||||
//#define HOME_BEFORE_FILAMENT_CHANGE // If needed, home before parking for filament change
|
||||
|
||||
//#define FILAMENT_LOAD_UNLOAD_GCODES // Add M701/M702 Load/Unload G-codes, plus Load/Unload in the LCD Prepare menu.
|
||||
#define FILAMENT_LOAD_UNLOAD_GCODES // Add M701/M702 Load/Unload G-codes, plus Load/Unload in the LCD Prepare menu.
|
||||
//#define FILAMENT_UNLOAD_ALL_EXTRUDERS // Allow M702 to unload all extruders above a minimum target temp (as set by M302)
|
||||
#endif
|
||||
|
||||
@@ -3228,7 +3225,7 @@
|
||||
/**
|
||||
* Auto-report temperatures with M155 S<seconds>
|
||||
*/
|
||||
#define AUTO_REPORT_TEMPERATURES
|
||||
//#define AUTO_REPORT_TEMPERATURES
|
||||
|
||||
/**
|
||||
* Include capabilities in M115 output
|
||||
@@ -3388,9 +3385,9 @@
|
||||
* Host Prompt Support enables Marlin to use the host for user prompts so
|
||||
* filament runout and other processes can be managed from the host side.
|
||||
*/
|
||||
//#define HOST_ACTION_COMMANDS
|
||||
#define HOST_ACTION_COMMANDS
|
||||
#if ENABLED(HOST_ACTION_COMMANDS)
|
||||
//#define HOST_PROMPT_SUPPORT
|
||||
#define HOST_PROMPT_SUPPORT
|
||||
//#define HOST_START_MENU_ITEM // Add a menu item that tells the host to start
|
||||
#endif
|
||||
|
||||
@@ -3399,7 +3396,7 @@
|
||||
*
|
||||
* Implement M486 to allow Marlin to skip objects
|
||||
*/
|
||||
//#define CANCEL_OBJECTS
|
||||
#define CANCEL_OBJECTS
|
||||
|
||||
/**
|
||||
* I2C position encoders for closed loop control.
|
||||
@@ -3723,12 +3720,12 @@
|
||||
//
|
||||
// M42 - Set pin states
|
||||
//
|
||||
//#define DIRECT_PIN_CONTROL
|
||||
#define DIRECT_PIN_CONTROL
|
||||
|
||||
//
|
||||
// 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 "TM3D2.0.7.2-CR6-C"
|
||||
|
||||
/**
|
||||
* 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 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 "2020-12-28"
|
||||
|
||||
/**
|
||||
* Defines a generic printer name to be output to the LCD after booting Marlin.
|
||||
*/
|
||||
//#define MACHINE_NAME "3D Printer"
|
||||
#define MACHINE_NAME "TM3D CR-6"
|
||||
|
||||
/**
|
||||
* 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 "https://github.com/InsanityAutomation/Marlin/tree/CR-6Devel"
|
||||
|
||||
/**
|
||||
* 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 "tinymachines3d.com"
|
||||
|
||||
/**
|
||||
* Set the vendor info the serial USB interface, if changable
|
||||
|
||||
@@ -117,7 +117,7 @@ typedef int8_t pin_t;
|
||||
#error "LCD_SERIAL_PORT must be from -1 to 3. Please update your configuration."
|
||||
#endif
|
||||
#define LCD_SERIAL lcdSerial
|
||||
#if HAS_DGUS_LCD
|
||||
#if HAS_DGUS_LCD || ENABLED(DGUS_LCD_UI_CREALITY_TOUCH)
|
||||
#define SERIAL_GET_TX_BUFFER_FREE() LCD_SERIAL.get_tx_buffer_free()
|
||||
#endif
|
||||
#endif
|
||||
|
||||
@@ -612,7 +612,7 @@ MSerialT customizedSerial1(MSerialT::HasEmergencyParser);
|
||||
template class MarlinSerial< LCDSerialCfg<LCD_SERIAL_PORT> >;
|
||||
MSerialT4 lcdSerial(MSerialT4::HasEmergencyParser);
|
||||
|
||||
#if HAS_DGUS_LCD
|
||||
#if HAS_DGUS_LCD || ENABLED(DGUS_LCD_UI_CREALITY_TOUCH)
|
||||
template<typename Cfg>
|
||||
typename MarlinSerial<Cfg>::ring_buffer_pos_t MarlinSerial<Cfg>::get_tx_buffer_free() {
|
||||
const ring_buffer_pos_t t = tx_buffer.tail, // next byte to send.
|
||||
|
||||
@@ -212,7 +212,7 @@
|
||||
static ring_buffer_pos_t available();
|
||||
static size_t write(const uint8_t c);
|
||||
static void flushTX();
|
||||
#if HAS_DGUS_LCD
|
||||
#if HAS_DGUS_LCD || ENABLED(DGUS_LCD_UI_CREALITY_TOUCH)
|
||||
static ring_buffer_pos_t get_tx_buffer_free();
|
||||
#endif
|
||||
|
||||
@@ -276,7 +276,7 @@
|
||||
static constexpr bool DROPPED_RX = false;
|
||||
static constexpr bool RX_FRAMING_ERRORS = false;
|
||||
static constexpr bool MAX_RX_QUEUED = false;
|
||||
#if HAS_DGUS_LCD
|
||||
#if HAS_DGUS_LCD || ENABLED(DGUS_LCD_UI_CREALITY_TOUCH)
|
||||
static constexpr unsigned int RX_SIZE = DGUS_RX_BUFFER_SIZE;
|
||||
static constexpr unsigned int TX_SIZE = DGUS_TX_BUFFER_SIZE;
|
||||
static constexpr bool RX_OVERRUNS = ENABLED(SERIAL_STATS_RX_BUFFER_OVERRUNS);
|
||||
|
||||
@@ -86,7 +86,7 @@
|
||||
#else
|
||||
#error "LCD_SERIAL_PORT must be -1 or from 1 to 6. Please update your configuration."
|
||||
#endif
|
||||
#if HAS_DGUS_LCD
|
||||
#if HAS_DGUS_LCD || ENABLED(DGUS_LCD_UI_CREALITY_TOUCH)
|
||||
#define SERIAL_GET_TX_BUFFER_FREE() LCD_SERIAL.availableForWrite()
|
||||
#endif
|
||||
#endif
|
||||
|
||||
@@ -124,7 +124,7 @@
|
||||
#else
|
||||
#error "LCD_SERIAL_PORT must be -1 or from 1 to 3. Please update your configuration."
|
||||
#endif
|
||||
#if HAS_DGUS_LCD
|
||||
#if HAS_DGUS_LCD || ENABLED(DGUS_LCD_UI_CREALITY_TOUCH)
|
||||
#define SERIAL_GET_TX_BUFFER_FREE() LCD_SERIAL.availableForWrite()
|
||||
#endif
|
||||
#endif
|
||||
|
||||
@@ -82,6 +82,12 @@
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#if ENABLED(PROBING_HEATERS_OFF)
|
||||
#include "../../../module/temperature.h"
|
||||
#include "../../../module/printcounter.h"
|
||||
#endif
|
||||
|
||||
|
||||
#define G29_RETURN(b) return TERN_(G29_RETRY_AND_RECOVER, b)
|
||||
|
||||
/**
|
||||
@@ -895,6 +901,17 @@ G29_TYPE GcodeSuite::G29() {
|
||||
|
||||
report_current_position();
|
||||
|
||||
#if ENABLED(PROBING_HEATERS_OFF)
|
||||
// If we're going to print then we must ensure we are back on temperature before we continue
|
||||
if (queue.has_commands_queued() || planner.has_blocks_queued() || print_job_timer.isRunning()) {
|
||||
SERIAL_ECHOLN("Waiting to heat-up again before continueing");
|
||||
ui.set_status("Waiting for heat-up...");
|
||||
|
||||
thermalManager.wait_for_hotend(0);
|
||||
thermalManager.wait_for_bed_heating();
|
||||
}
|
||||
#endif
|
||||
|
||||
G29_RETURN(isnan(measured_z));
|
||||
}
|
||||
|
||||
|
||||
@@ -452,7 +452,7 @@
|
||||
#endif
|
||||
|
||||
// Extensible UI serial touch screens. (See src/lcd/extui)
|
||||
#if ANY(HAS_DGUS_LCD, MALYAN_LCD, TOUCH_UI_FTDI_EVE, ANYCUBIC_LCD_I3MEGA, ANYCUBIC_LCD_CHIRON)
|
||||
#if ANY(HAS_DGUS_LCD, MALYAN_LCD, TOUCH_UI_FTDI_EVE, ANYCUBIC_LCD_I3MEGA, ANYCUBIC_LCD_CHIRON, DGUS_LCD_UI_CREALITY_TOUCH)
|
||||
#define IS_EXTUI 1
|
||||
#define EXTENSIBLE_UI
|
||||
#endif
|
||||
|
||||
@@ -2359,7 +2359,7 @@
|
||||
#define HAS_TEMPERATURE 1
|
||||
#endif
|
||||
|
||||
#if HAS_TEMPERATURE && EITHER(HAS_LCD_MENU, DWIN_CREALITY_LCD)
|
||||
#if HAS_TEMPERATURE && ANY(HAS_LCD_MENU, DWIN_CREALITY_LCD, DGUS_LCD_UI_CREALITY_TOUCH)
|
||||
#ifdef PREHEAT_5_LABEL
|
||||
#define PREHEAT_COUNT 5
|
||||
#elif defined(PREHEAT_4_LABEL)
|
||||
|
||||
@@ -2305,7 +2305,7 @@ static_assert(hbm[Z_AXIS] >= 0, "HOMING_BUMP_MM.Z must be greater than or equal
|
||||
+ (DISABLED(IS_LEGACY_TFT) && ENABLED(TFT_GENERIC)) \
|
||||
+ (ENABLED(IS_LEGACY_TFT) && COUNT_ENABLED(TFT_320x240, TFT_320x240_SPI, TFT_480x320, TFT_480x320_SPI)) \
|
||||
+ COUNT_ENABLED(ANYCUBIC_LCD_I3MEGA, ANYCUBIC_LCD_CHIRON, ANYCUBIC_TFT35) \
|
||||
+ COUNT_ENABLED(DGUS_LCD_UI_ORIGIN, DGUS_LCD_UI_FYSETC, DGUS_LCD_UI_HIPRECY) \
|
||||
+ COUNT_ENABLED(DGUS_LCD_UI_ORIGIN, DGUS_LCD_UI_FYSETC, DGUS_LCD_UI_HIPRECY, DGUS_LCD_UI_CREALITY_TOUCH) \
|
||||
+ COUNT_ENABLED(ENDER2_STOCKDISPLAY, CR10_STOCKDISPLAY, DWIN_CREALITY_LCD) \
|
||||
+ COUNT_ENABLED(FYSETC_MINI_12864_X_X, FYSETC_MINI_12864_1_2, FYSETC_MINI_12864_2_0, FYSETC_MINI_12864_2_1, FYSETC_GENERIC_12864_1_1) \
|
||||
+ COUNT_ENABLED(LCD_SAINSMART_I2C_1602, LCD_SAINSMART_I2C_2004) \
|
||||
|
||||
@@ -89,10 +89,10 @@
|
||||
#define MACHINE_SIZE STRINGIFY(X_BED_SIZE) "x" STRINGIFY(Y_BED_SIZE) "x" STRINGIFY(Z_MAX_POS)
|
||||
#endif
|
||||
#ifndef CORP_WEBSITE_C
|
||||
#define CORP_WEBSITE_C "www.cxsw3d.com"
|
||||
#define CORP_WEBSITE_C WEBSITE_URL
|
||||
#endif
|
||||
#ifndef CORP_WEBSITE_E
|
||||
#define CORP_WEBSITE_E "www.creality.com"
|
||||
#define CORP_WEBSITE_E WEBSITE_URL
|
||||
#endif
|
||||
|
||||
#define PAUSE_HEAT
|
||||
|
||||
@@ -0,0 +1,251 @@
|
||||
/**
|
||||
* 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/>.
|
||||
*
|
||||
*/
|
||||
|
||||
/**
|
||||
* dgus_creality_lcd.cpp
|
||||
*
|
||||
* DGUS implementation written by coldtobi in 2019 for Marlin
|
||||
*/
|
||||
|
||||
#include "../../inc/MarlinConfigPre.h"
|
||||
|
||||
#if ENABLED(DGUS_LCD_UI_CREALITY_TOUCH)
|
||||
|
||||
#include "ui_api.h"
|
||||
#include "../marlinui.h"
|
||||
#include "lib/dgus_creality/DGUSDisplay.h"
|
||||
#include "lib/dgus_creality/DGUSDisplayDef.h"
|
||||
#include "lib/dgus_creality/DGUSScreenHandler.h"
|
||||
#include "lib/dgus_creality/creality_touch/PIDHandler.h"
|
||||
|
||||
#if ENABLED(POWER_LOSS_RECOVERY)
|
||||
#include "../../feature/powerloss.h"
|
||||
#endif
|
||||
|
||||
extern const char NUL_STR[];
|
||||
|
||||
namespace ExtUI {
|
||||
|
||||
void onStartup() {
|
||||
ScreenHandler.Init();
|
||||
ScreenHandler.UpdateScreenVPData();
|
||||
}
|
||||
|
||||
void onIdle() { ScreenHandler.loop(); }
|
||||
|
||||
void onPrinterKilled(PGM_P const error, PGM_P const component) {
|
||||
ScreenHandler.sendinfoscreen(GET_TEXT(MSG_HALTED), error, GET_TEXT(MSG_PLEASE_RESET), GET_TEXT(MSG_PLEASE_RESET), true, true, true, true);
|
||||
|
||||
if (strcmp_P(error, GET_TEXT(MSG_ERR_MAXTEMP)) == 0 || strcmp_P(error, GET_TEXT(MSG_THERMAL_RUNAWAY)) == 0) {
|
||||
ScreenHandler.GotoScreen(DGUSLCD_SCREEN_THERMAL_RUNAWAY);
|
||||
} else if (strcmp_P(error, GET_TEXT(MSG_HEATING_FAILED_LCD)) == 0) {
|
||||
ScreenHandler.GotoScreen(DGUSLCD_SCREEN_HEATING_FAILED);
|
||||
}else if (strcmp_P(error, GET_TEXT(MSG_ERR_MINTEMP)) == 0) {
|
||||
ScreenHandler.GotoScreen(DGUSLCD_SCREEN_THERMISTOR_ERROR);
|
||||
} else {
|
||||
ScreenHandler.GotoScreen(DGUSLCD_SCREEN_KILL);
|
||||
}
|
||||
|
||||
ScreenHandler.KillScreenCalled();
|
||||
while (!ScreenHandler.loop()); // Wait while anything is left to be sent
|
||||
}
|
||||
|
||||
void onMediaInserted() { TERN_(SDSUPPORT, ScreenHandler.SDCardInserted()); }
|
||||
void onMediaError() { TERN_(SDSUPPORT, ScreenHandler.SDCardError()); }
|
||||
void onMediaRemoved() { TERN_(SDSUPPORT, ScreenHandler.SDCardRemoved()); }
|
||||
|
||||
void onPlayTone(const uint16_t frequency, const uint16_t duration) {
|
||||
if (ScreenHandler.getCurrentScreen() == DGUSLCD_SCREEN_FEED) {
|
||||
// We're in the feed (load filament) workflow - no beep - there is no confirmation
|
||||
return;
|
||||
}
|
||||
|
||||
ScreenHandler.Buzzer(frequency, duration);
|
||||
}
|
||||
|
||||
bool hasPrintTimer = false;
|
||||
|
||||
void onPrintTimerStarted() {
|
||||
hasPrintTimer = true;
|
||||
|
||||
if (!ExtUI::isPrintingFromMedia() && !(PrintJobRecovery::valid() && PrintJobRecovery::exists())) {
|
||||
ScreenHandler.SetPrintingFromHost();
|
||||
|
||||
}
|
||||
|
||||
#if ENABLED(LCD_SET_PROGRESS_MANUALLY)
|
||||
ui.progress_reset();
|
||||
#endif
|
||||
|
||||
ScreenHandler.GotoScreen(DGUSLCD_SCREEN_PRINT_RUNNING);
|
||||
}
|
||||
|
||||
void onPrintTimerPaused() {
|
||||
// Handle M28 Pause SD print - But only if we're not waiting on a user
|
||||
if (ExtUI::isPrintingFromMediaPaused() && ScreenHandler.getCurrentScreen() == DGUSLCD_SCREEN_PRINT_RUNNING && !ExtUI::isWaitingOnUser()) {
|
||||
ScreenHandler.GotoScreen(DGUSLCD_SCREEN_PRINT_PAUSED);
|
||||
}
|
||||
}
|
||||
|
||||
void onPrintTimerStopped() {
|
||||
hasPrintTimer = false;
|
||||
|
||||
ScreenHandler.GotoScreen(DGUSLCD_SCREEN_PRINT_FINISH);
|
||||
}
|
||||
|
||||
void onFilamentRunout(const extruder_t extruder) {
|
||||
// Only navigate to filament runout screen when we don't use M600 for changing the filament - otherwise it gets confusing for the user
|
||||
if (strcmp_P(FILAMENT_RUNOUT_SCRIPT, PSTR("M600")) != 0) {
|
||||
ScreenHandler.FilamentRunout();
|
||||
}
|
||||
}
|
||||
|
||||
void onUserConfirmed() {
|
||||
DEBUG_ECHOLN("User confirmation invoked");
|
||||
|
||||
ExtUI::setUserConfirmed();
|
||||
}
|
||||
|
||||
void onUserConfirmRequired(const char * const msg) {
|
||||
if (msg) {
|
||||
DEBUG_ECHOLNPAIR("User confirmation requested: ", msg);
|
||||
|
||||
if (ScreenHandler.getCurrentScreen() == DGUSLCD_SCREEN_FEED) {
|
||||
// We're in the feed (load filament) workflow - immediately assume confirmed
|
||||
onUserConfirmed();
|
||||
return;
|
||||
}
|
||||
|
||||
ScreenHandler.setstatusmessagePGM(msg);
|
||||
ScreenHandler.sendinfoscreen(PSTR("Confirmation required"), msg, NUL_STR, PSTR("Ok"), true, true, false, true);
|
||||
|
||||
if (ExtUI::isPrinting()) {
|
||||
ScreenHandler.GotoScreen(DGUSLCD_SCREEN_DIALOG_PAUSE);
|
||||
} else {
|
||||
ScreenHandler.GotoScreen(DGUSLCD_SCREEN_POPUP);
|
||||
}
|
||||
}
|
||||
else if (ScreenHandler.getCurrentScreen() == DGUSLCD_SCREEN_POPUP) {
|
||||
DEBUG_ECHOLNPAIR("User confirmation canceled");
|
||||
|
||||
ScreenHandler.setstatusmessagePGM(nullptr);
|
||||
ScreenHandler.PopToOldScreen();
|
||||
}
|
||||
}
|
||||
|
||||
void onStatusChanged(const char * const msg) { ScreenHandler.setstatusmessage(msg); }
|
||||
|
||||
void onFactoryReset() {
|
||||
ScreenHandler.OnFactoryReset();
|
||||
}
|
||||
|
||||
void onHomingStart() {
|
||||
ScreenHandler.OnHomingStart();
|
||||
}
|
||||
|
||||
void onHomingComplete() {
|
||||
ScreenHandler.OnHomingComplete();
|
||||
}
|
||||
|
||||
void onPrintFinished() {
|
||||
ScreenHandler.OnPrintFinished();
|
||||
}
|
||||
|
||||
void onStoreSettings(char *buff) {
|
||||
ScreenHandler.StoreSettings(buff);
|
||||
}
|
||||
|
||||
void onLoadSettings(const char *buff) {
|
||||
ScreenHandler.LoadSettings(buff);
|
||||
}
|
||||
|
||||
void onConfigurationStoreWritten(bool success) {
|
||||
// Called after the entire EEPROM has been written,
|
||||
// whether successful or not.
|
||||
}
|
||||
|
||||
void onConfigurationStoreRead(bool success) {
|
||||
// Called after the entire EEPROM has been read,
|
||||
// whether successful or not.
|
||||
}
|
||||
|
||||
#if HAS_MESH
|
||||
void onMeshLevelingStart() {
|
||||
ScreenHandler.OnMeshLevelingStart();
|
||||
}
|
||||
|
||||
void onMeshUpdate(const int8_t xpos, const int8_t ypos, const float zval) {
|
||||
ScreenHandler.OnMeshLevelingUpdate(xpos, ypos);
|
||||
}
|
||||
|
||||
void onMeshUpdate(const int8_t xpos, const int8_t ypos, const ExtUI::probe_state_t state) {
|
||||
// Only called for UBL
|
||||
if (state == MESH_START) {
|
||||
ScreenHandler.OnMeshLevelingStart();
|
||||
}
|
||||
|
||||
ScreenHandler.OnMeshLevelingUpdate(xpos, ypos);
|
||||
}
|
||||
|
||||
|
||||
#endif
|
||||
|
||||
#if ENABLED(POWER_LOSS_RECOVERY)
|
||||
void onPowerLossResume() {
|
||||
// Called on resume from power-loss
|
||||
ScreenHandler.OnPowerlossResume();
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
#if HAS_PID_HEATING
|
||||
void onPidTuning(const result_t rst) {
|
||||
// Called for temperature PID tuning result
|
||||
switch (rst) {
|
||||
case PID_BAD_EXTRUDER_NUM:
|
||||
PIDHandler::result_message = GET_TEXT(MSG_PID_BAD_EXTRUDER_NUM);
|
||||
ScreenHandler.setstatusmessagePGM(PIDHandler::result_message);
|
||||
break;
|
||||
case PID_TEMP_TOO_HIGH:
|
||||
PIDHandler::result_message = GET_TEXT(MSG_PID_TEMP_TOO_HIGH);
|
||||
ScreenHandler.setstatusmessagePGM(PIDHandler::result_message);
|
||||
break;
|
||||
case PID_TUNING_TIMEOUT:
|
||||
PIDHandler::result_message = GET_TEXT(MSG_PID_TIMEOUT);
|
||||
ScreenHandler.setstatusmessagePGM(PIDHandler::result_message);
|
||||
break;
|
||||
case PID_DONE:
|
||||
PIDHandler::result_message = GET_TEXT(MSG_PID_AUTOTUNE_DONE);
|
||||
ScreenHandler.setstatusmessagePGM(PIDHandler::result_message);
|
||||
break;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
void onSteppersDisabled() {
|
||||
}
|
||||
|
||||
void onSteppersEnabled() {
|
||||
}
|
||||
|
||||
}
|
||||
#endif // HAS_DGUS_LCD
|
||||
@@ -0,0 +1,350 @@
|
||||
/**
|
||||
* 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/>.
|
||||
*
|
||||
*/
|
||||
|
||||
/* DGUS implementation written by coldtobi in 2019 for Marlin */
|
||||
|
||||
#include "../../../../inc/MarlinConfigPre.h"
|
||||
|
||||
#if ENABLED(DGUS_LCD_UI_CREALITY_TOUCH)
|
||||
|
||||
#if HOTENDS > 2
|
||||
#error "More than 2 hotends not implemented on the Display UI design."
|
||||
#endif
|
||||
|
||||
#include "../../ui_api.h"
|
||||
|
||||
#include "../../../../MarlinCore.h"
|
||||
#include "../../../../module/temperature.h"
|
||||
#include "../../../../module/motion.h"
|
||||
#include "../../../../gcode/queue.h"
|
||||
#include "../../../../module/planner.h"
|
||||
#include "../../../../sd/cardreader.h"
|
||||
#include "../../../../libs/duration_t.h"
|
||||
#include "../../../../module/printcounter.h"
|
||||
#if ENABLED(POWER_LOSS_RECOVERY)
|
||||
#include "../../../../feature/powerloss.h"
|
||||
#endif
|
||||
|
||||
#include "DGUSDisplay.h"
|
||||
#include "../dgus/DGUSVPVariable.h"
|
||||
#include "DGUSDisplayDef.h"
|
||||
|
||||
// Preamble... 2 Bytes, usually 0x5A 0xA5, but configurable
|
||||
constexpr uint8_t DGUS_HEADER1 = 0x5A;
|
||||
constexpr uint8_t DGUS_HEADER2 = 0xA5;
|
||||
|
||||
constexpr uint8_t DGUS_CMD_WRITEVAR = 0x82;
|
||||
constexpr uint8_t DGUS_CMD_READVAR = 0x83;
|
||||
|
||||
#if ENABLED(DEBUG_DGUSLCD)
|
||||
bool dguslcd_local_debug; // = false;
|
||||
#endif
|
||||
|
||||
#define dgusserial LCD_SERIAL
|
||||
|
||||
void DGUSDisplay::InitDisplay() {
|
||||
dgusserial.begin(LCD_BAUDRATE);
|
||||
|
||||
/*delay(500); // Attempt to fix possible handshake error
|
||||
|
||||
ResetDisplay(); // Reset for firmware update
|
||||
|
||||
delay(500); // Attempt to fix possible handshake error
|
||||
*/
|
||||
if (true
|
||||
#if ENABLED(POWER_LOSS_RECOVERY)
|
||||
&& !recovery.valid()
|
||||
#endif
|
||||
)
|
||||
RequestScreen(
|
||||
#if ENABLED(SHOW_BOOTSCREEN)
|
||||
DGUSLCD_SCREEN_BOOT
|
||||
#else
|
||||
DGUSLCD_SCREEN_MAIN
|
||||
#endif
|
||||
);
|
||||
}
|
||||
|
||||
void DGUSDisplay::ResetDisplay() {
|
||||
SERIAL_ECHOLN("ResetDisplay");
|
||||
const unsigned char resetCommand[] = { 0x55, 0xAA, 0x5A, 0xA5 };
|
||||
WriteVariable(0x04, resetCommand, sizeof(resetCommand));
|
||||
}
|
||||
|
||||
void DGUSDisplay::ReadVariable(uint16_t adr) {
|
||||
WriteHeader(adr, DGUS_CMD_READVAR, sizeof(uint8_t));
|
||||
|
||||
// Specify to read one byte
|
||||
dgusserial.write(static_cast<uint8_t>(1));
|
||||
}
|
||||
|
||||
void DGUSDisplay::WriteVariable(uint16_t adr, const void* values, uint8_t valueslen, bool isstr) {
|
||||
const char* myvalues = static_cast<const char*>(values);
|
||||
bool strend = !myvalues;
|
||||
WriteHeader(adr, DGUS_CMD_WRITEVAR, valueslen);
|
||||
while (valueslen--) {
|
||||
char x;
|
||||
if (!strend) x = *myvalues++;
|
||||
if ((isstr && !x) || strend) {
|
||||
strend = true;
|
||||
x = ' ';
|
||||
}
|
||||
dgusserial.write(x);
|
||||
}
|
||||
}
|
||||
|
||||
void DGUSDisplay::WriteVariable(uint16_t adr, uint16_t value) {
|
||||
value = (value & 0xffU) << 8U | (value >> 8U);
|
||||
WriteVariable(adr, static_cast<const void*>(&value), sizeof(uint16_t));
|
||||
}
|
||||
|
||||
void DGUSDisplay::WriteVariable(uint16_t adr, int16_t value) {
|
||||
value = (value & 0xffU) << 8U | (value >> 8U);
|
||||
WriteVariable(adr, static_cast<const void*>(&value), sizeof(uint16_t));
|
||||
}
|
||||
|
||||
void DGUSDisplay::WriteVariable(uint16_t adr, uint8_t value) {
|
||||
WriteVariable(adr, static_cast<const void*>(&value), sizeof(uint8_t));
|
||||
}
|
||||
|
||||
void DGUSDisplay::WriteVariable(uint16_t adr, int8_t value) {
|
||||
WriteVariable(adr, static_cast<const void*>(&value), sizeof(int8_t));
|
||||
}
|
||||
|
||||
void DGUSDisplay::WriteVariable(uint16_t adr, long value) {
|
||||
union { long l; char lb[4]; } endian;
|
||||
char tmp[4];
|
||||
endian.l = value;
|
||||
tmp[0] = endian.lb[3];
|
||||
tmp[1] = endian.lb[2];
|
||||
tmp[2] = endian.lb[1];
|
||||
tmp[3] = endian.lb[0];
|
||||
WriteVariable(adr, static_cast<const void*>(&tmp), sizeof(long));
|
||||
}
|
||||
|
||||
void DGUSDisplay::WriteVariablePGM(uint16_t adr, const void* values, uint8_t valueslen, bool isstr) {
|
||||
const char* myvalues = static_cast<const char*>(values);
|
||||
bool strend = !myvalues;
|
||||
WriteHeader(adr, DGUS_CMD_WRITEVAR, valueslen);
|
||||
while (valueslen--) {
|
||||
char x;
|
||||
if (!strend) x = pgm_read_byte(myvalues++);
|
||||
if ((isstr && !x) || strend) {
|
||||
strend = true;
|
||||
x = ' ';
|
||||
}
|
||||
dgusserial.write(x);
|
||||
}
|
||||
}
|
||||
|
||||
void DGUSDisplay::SetVariableDisplayColor(uint16_t sp, uint16_t color) {
|
||||
WriteVariable(sp + 0x03, color);
|
||||
}
|
||||
|
||||
void DGUSDisplay::SetVariableAppendText(uint16_t sp, PGM_P appendText) {
|
||||
// High byte is length, low byte is first char
|
||||
if (!appendText) {
|
||||
WriteVariable(sp + 0x07, static_cast<uint8_t>(0));
|
||||
return;
|
||||
}
|
||||
|
||||
uint8_t lengthFirstChar = strlen_P(appendText);// << 8;
|
||||
WriteVariable(sp + 0x07, lengthFirstChar);
|
||||
WriteVariablePGM(sp + 0x08, appendText, strlen_P(appendText));
|
||||
}
|
||||
|
||||
void DGUSDisplay::ProcessRx() {
|
||||
|
||||
#if ENABLED(DGUS_SERIAL_STATS_RX_BUFFER_OVERRUNS)
|
||||
if (!dgusserial.available() && dgusserial.buffer_overruns()) {
|
||||
// Overrun, but reset the flag only when the buffer is empty
|
||||
// We want to extract as many as valid datagrams possible...
|
||||
DEBUG_ECHOPGM("OVFL");
|
||||
rx_datagram_state = DGUS_IDLE;
|
||||
//dgusserial.reset_rx_overun();
|
||||
dgusserial.flush();
|
||||
}
|
||||
#endif
|
||||
|
||||
uint8_t receivedbyte;
|
||||
while (dgusserial.available()) {
|
||||
switch (rx_datagram_state) {
|
||||
|
||||
case DGUS_IDLE: // Waiting for the first header byte
|
||||
receivedbyte = dgusserial.read();
|
||||
//DEBUGLCDCOMM_ECHOPAIR("< ",receivedbyte);
|
||||
if (DGUS_HEADER1 == receivedbyte) rx_datagram_state = DGUS_HEADER1_SEEN;
|
||||
break;
|
||||
|
||||
case DGUS_HEADER1_SEEN: // Waiting for the second header byte
|
||||
receivedbyte = dgusserial.read();
|
||||
//DEBUGLCDCOMM_ECHOPAIR(" ", receivedbyte);
|
||||
rx_datagram_state = (DGUS_HEADER2 == receivedbyte) ? DGUS_HEADER2_SEEN : DGUS_IDLE;
|
||||
break;
|
||||
|
||||
case DGUS_HEADER2_SEEN: // Waiting for the length byte
|
||||
rx_datagram_len = dgusserial.read();
|
||||
//DEBUGLCDCOMM_ECHOPAIR(" (", rx_datagram_len, ") ");
|
||||
|
||||
// Telegram min len is 3 (command and one word of payload)
|
||||
rx_datagram_state = WITHIN(rx_datagram_len, 3, DGUS_RX_BUFFER_SIZE) ? DGUS_WAIT_TELEGRAM : DGUS_IDLE;
|
||||
break;
|
||||
|
||||
case DGUS_WAIT_TELEGRAM: // wait for complete datagram to arrive.
|
||||
if (dgusserial.available() < rx_datagram_len) return;
|
||||
|
||||
Initialized = true; // We've talked to it, so we defined it as initialized.
|
||||
uint8_t command = dgusserial.read();
|
||||
|
||||
// DEBUGLCDCOMM_ECHOPAIR("# ", command);
|
||||
|
||||
uint8_t readlen = rx_datagram_len - 1; // command is part of len.
|
||||
unsigned char tmp[rx_datagram_len - 1];
|
||||
unsigned char *ptmp = tmp;
|
||||
while (readlen--) {
|
||||
receivedbyte = dgusserial.read();
|
||||
//DEBUGLCDCOMM_ECHOPAIR(" ", receivedbyte);
|
||||
*ptmp++ = receivedbyte;
|
||||
}
|
||||
//DEBUGLCDCOMM_ECHOPGM(" # ");
|
||||
// mostly we'll get this: 5A A5 03 82 4F 4B -- ACK on 0x82, so discard it.
|
||||
if (command == DGUS_CMD_WRITEVAR && 'O' == tmp[0] && 'K' == tmp[1]) {
|
||||
//DEBUG_ECHOLNPGM(">");
|
||||
rx_datagram_state = DGUS_IDLE;
|
||||
break;
|
||||
}
|
||||
|
||||
/* AutoUpload, (and answer to) Command 0x83 :
|
||||
| tmp[0 1 2 3 4 ... ]
|
||||
| Example 5A A5 06 83 20 01 01 78 01 ……
|
||||
| / / | | \ / | \ \
|
||||
| Header | | | | \_____\_ DATA (Words!)
|
||||
| DatagramLen / VPAdr |
|
||||
| Command DataLen (in Words) */
|
||||
if (command == DGUS_CMD_READVAR) {
|
||||
const uint16_t vp = tmp[0] << 8 | tmp[1];
|
||||
|
||||
if (vp == 0x14 /*PIC_Now*/) {
|
||||
const uint16_t screen_id = tmp[3] << 8 | tmp[4];
|
||||
|
||||
// A display was requested. If the screen didn't yet switch to that display, we won't give that value back, otherwise the code gets confused.
|
||||
// The DWIN display mostly honours the PIC_SET requests from the firmware, so after a while we may want to nudge it to the correct screen
|
||||
DEBUG_ECHOPAIR(" Got a response on the current screen: ", screen_id);
|
||||
DEBUG_ECHOLNPAIR(" - however, we've requested screen ", displayRequest);
|
||||
UNUSED(screen_id);
|
||||
} else {
|
||||
//const uint8_t dlen = tmp[2] << 1; // Convert to Bytes. (Display works with words)
|
||||
//DEBUG_ECHOPAIR(" vp=", vp, " dlen=", dlen);
|
||||
DGUS_VP_Variable ramcopy;
|
||||
DEBUG_ECHOLNPAIR("VP received: ", vp , " - val ", tmp[3]);
|
||||
if (populate_VPVar(vp, &ramcopy)) {
|
||||
if (ramcopy.set_by_display_handler)
|
||||
ramcopy.set_by_display_handler(ramcopy, &tmp[3]);
|
||||
else
|
||||
DEBUG_ECHOLNPGM(" VPVar found, no handler.");
|
||||
}
|
||||
else
|
||||
DEBUG_ECHOLNPAIR(" VPVar not found:", vp);
|
||||
}
|
||||
|
||||
rx_datagram_state = DGUS_IDLE;
|
||||
break;
|
||||
}
|
||||
|
||||
// discard anything else
|
||||
rx_datagram_state = DGUS_IDLE;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
size_t DGUSDisplay::GetFreeTxBuffer() { return SERIAL_GET_TX_BUFFER_FREE(); }
|
||||
|
||||
void DGUSDisplay::WriteHeader(uint16_t adr, uint8_t cmd, uint8_t payloadlen) {
|
||||
dgusserial.write(DGUS_HEADER1);
|
||||
dgusserial.write(DGUS_HEADER2);
|
||||
dgusserial.write(payloadlen + 3);
|
||||
dgusserial.write(cmd);
|
||||
dgusserial.write(adr >> 8);
|
||||
dgusserial.write(adr & 0xFF);
|
||||
}
|
||||
|
||||
void DGUSDisplay::WritePGM(const char str[], uint8_t len) {
|
||||
while (len--) dgusserial.write(pgm_read_byte(str++));
|
||||
}
|
||||
|
||||
void DGUSDisplay::loop() {
|
||||
// protect against recursion… ProcessRx() may indirectly call idle() when injecting gcode commands.
|
||||
if (!no_reentrance) {
|
||||
no_reentrance = true;
|
||||
ProcessRx();
|
||||
no_reentrance = false;
|
||||
}
|
||||
}
|
||||
|
||||
void DGUSDisplay::RequestScreen(DGUSLCD_Screens screen) {
|
||||
displayRequest = screen;
|
||||
|
||||
DEBUG_ECHOLNPAIR("GotoScreen ", screen);
|
||||
const unsigned char gotoscreen[] = { 0x5A, 0x01, (unsigned char) (screen >> 8U), (unsigned char) (screen & 0xFFU) };
|
||||
WriteVariable(0x84, gotoscreen, sizeof(gotoscreen));
|
||||
}
|
||||
|
||||
void DGUSDisplay::SetTouchScreenConfiguration(bool enable_standby, bool enable_sound, uint8_t standby_brightness) {
|
||||
// Main configuration (System_Config)
|
||||
unsigned char cfg_bits = 0x0;
|
||||
cfg_bits |= 1UL << 5; // 5: load 22 touch file
|
||||
cfg_bits |= 1UL << 4; // 4: auto-upload should always be enabled
|
||||
if (enable_sound) cfg_bits |= 1UL << 3; // 3: audio
|
||||
if (enable_standby) cfg_bits |= 1UL << 2; // 2: backlight on standby
|
||||
cfg_bits |= 1UL << 1; // 1 & 0: 270 degrees orientation of display
|
||||
cfg_bits |= 1UL << 0;
|
||||
|
||||
DEBUG_ECHOLNPAIR("Update touch screen config - standby ", enable_standby);
|
||||
DEBUG_ECHOLNPAIR("Update touch screen config - sound ", enable_sound);
|
||||
|
||||
const unsigned char config_set[] = { 0x5A, 0x00, (unsigned char) (cfg_bits >> 8U), (unsigned char) (cfg_bits & 0xFFU) };
|
||||
WriteVariable(0x80 /*System_Config*/, config_set, sizeof(config_set));
|
||||
|
||||
// Standby brightness (LED_Config)
|
||||
const unsigned char brightness_set[] = { 100 /*% active*/, standby_brightness /*% standby*/ };
|
||||
WriteVariable(0x82 /*LED_Config*/, brightness_set, sizeof(brightness_set));
|
||||
}
|
||||
|
||||
rx_datagram_state_t DGUSDisplay::rx_datagram_state = DGUS_IDLE;
|
||||
uint8_t DGUSDisplay::rx_datagram_len = 0;
|
||||
bool DGUSDisplay::Initialized = false;
|
||||
bool DGUSDisplay::no_reentrance = false;
|
||||
DGUSLCD_Screens DGUSDisplay::displayRequest = DGUSLCD_SCREEN_BOOT;
|
||||
|
||||
// A SW memory barrier, to ensure GCC does not overoptimize loops
|
||||
#define sw_barrier() asm volatile("": : :"memory");
|
||||
|
||||
bool populate_VPVar(const uint16_t VP, DGUS_VP_Variable * const ramcopy) {
|
||||
//DEBUG_ECHOLNPAIR("populate_VPVar ", VP);
|
||||
const DGUS_VP_Variable *pvp = DGUSLCD_FindVPVar(VP);
|
||||
// DEBUG_ECHOLNPAIR(" pvp ", (uint16_t )pvp);
|
||||
if (!pvp) return false;
|
||||
memcpy_P(ramcopy, pvp, sizeof(DGUS_VP_Variable));
|
||||
return true;
|
||||
}
|
||||
|
||||
#endif // HAS_DGUS_LCD
|
||||
@@ -0,0 +1,131 @@
|
||||
/**
|
||||
* Marlin 3D Printer Firmware
|
||||
* Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
|
||||
*
|
||||
* Based on Sprinter and grbl.
|
||||
* Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*
|
||||
*/
|
||||
#pragma once
|
||||
|
||||
//#define DEBUG_DGUSLCD
|
||||
//#define DEBUG_DGUSLCD_OUTGOING_COMM
|
||||
|
||||
|
||||
/* Creality DGUS implementation written by Sebastiaan Dammann in 2020 for Marlin */
|
||||
|
||||
#include "../../../../inc/MarlinConfigPre.h"
|
||||
|
||||
#include "../../../../MarlinCore.h"
|
||||
#if HAS_BED_PROBE
|
||||
#include "../../../../module/probe.h"
|
||||
#endif
|
||||
#include "../dgus/DGUSVPVariable.h"
|
||||
|
||||
enum DGUSLCD_Screens : uint8_t;
|
||||
|
||||
#define DEBUG_OUT ENABLED(DEBUG_DGUSLCD)
|
||||
#include "../../../../core/debug_out.h"
|
||||
|
||||
|
||||
typedef enum : uint8_t {
|
||||
DGUS_IDLE, //< waiting for DGUS_HEADER1.
|
||||
DGUS_HEADER1_SEEN, //< DGUS_HEADER1 received
|
||||
DGUS_HEADER2_SEEN, //< DGUS_HEADER2 received
|
||||
DGUS_WAIT_TELEGRAM, //< LEN received, Waiting for to receive all bytes.
|
||||
} rx_datagram_state_t;
|
||||
|
||||
typedef void (*UPDATE_CURRENT_SCREEN_CALLBACK)(DGUSLCD_Screens screen);
|
||||
|
||||
// Low-Level access to the display.
|
||||
class DGUSDisplay {
|
||||
public:
|
||||
|
||||
DGUSDisplay() = default;
|
||||
|
||||
static void InitDisplay();
|
||||
static void ResetDisplay();
|
||||
|
||||
// Variable access.
|
||||
static void WriteVariable(uint16_t adr, const void* values, uint8_t valueslen, bool isstr=false);
|
||||
static void WriteVariablePGM(uint16_t adr, const void* values, uint8_t valueslen, bool isstr=false);
|
||||
static void WriteVariable(uint16_t adr, int16_t value);
|
||||
static void WriteVariable(uint16_t adr, uint16_t value);
|
||||
static void WriteVariable(uint16_t adr, uint8_t value);
|
||||
static void WriteVariable(uint16_t adr, int8_t value);
|
||||
static void WriteVariable(uint16_t adr, long value);
|
||||
|
||||
static void SetVariableDisplayColor(uint16_t sp, uint16_t color);
|
||||
static void SetVariableAppendText(uint16_t sp, PGM_P appendText);
|
||||
|
||||
static void ReadVariable(uint16_t adr);
|
||||
|
||||
// Utility functions for bridging ui_api and dgus
|
||||
template<typename T, float(*Getter)(const T), T selector, typename WireType=uint16_t>
|
||||
static void SetVariable(DGUS_VP_Variable &var) {
|
||||
WriteVariable(var.VP, (WireType)Getter(selector));
|
||||
}
|
||||
|
||||
template<typename T, void(*Setter)(const float V, const T), T selector>
|
||||
static void GetVariable(DGUS_VP_Variable &var, void *val_ptr) {
|
||||
uint16_t newvalue = swap16(*(uint16_t*)val_ptr);
|
||||
Setter(newvalue, selector);
|
||||
}
|
||||
|
||||
// Force display into another screen.
|
||||
// (And trigger update of containing VPs)
|
||||
// (to implement a pop up message, which may not be nested)
|
||||
static void RequestScreen(DGUSLCD_Screens screen);
|
||||
|
||||
static void SetTouchScreenConfiguration(bool enable_standby, bool enable_sound, uint8_t standby_brightness);
|
||||
|
||||
// Periodic tasks, eg. Rx-Queue handling.
|
||||
static void loop();
|
||||
|
||||
public:
|
||||
// Helper for users of this class to estimate if an interaction would be blocking.
|
||||
static size_t GetFreeTxBuffer();
|
||||
|
||||
// Checks two things: Can we confirm the presence of the display and has we initiliazed it.
|
||||
// (both boils down that the display answered to our chatting)
|
||||
static inline bool isInitialized() { return Initialized; }
|
||||
|
||||
private:
|
||||
static void WriteHeader(uint16_t adr, uint8_t cmd, uint8_t payloadlen);
|
||||
static void WritePGM(const char str[], uint8_t len);
|
||||
static void ProcessRx();
|
||||
|
||||
static inline uint16_t swap16(const uint16_t value) { return (value & 0xffU) << 8U | (value >> 8U); }
|
||||
static rx_datagram_state_t rx_datagram_state;
|
||||
static uint8_t rx_datagram_len;
|
||||
static bool Initialized, no_reentrance;
|
||||
|
||||
static DGUSLCD_Screens displayRequest;
|
||||
};
|
||||
|
||||
#define GET_VARIABLE(f, t, V...) (&DGUSDisplay::GetVariable<decltype(t), f, t, ##V>)
|
||||
#define SET_VARIABLE(f, t, V...) (&DGUSDisplay::SetVariable<decltype(t), f, t, ##V>)
|
||||
|
||||
extern DGUSDisplay dgusdisplay;
|
||||
|
||||
// compile-time x^y
|
||||
constexpr float cpow(const float x, const int y) { return y == 0 ? 1.0 : x * cpow(x, y - 1); }
|
||||
|
||||
/// Find the flash address of a DGUS_VP_Variable for the VP.
|
||||
extern const DGUS_VP_Variable* DGUSLCD_FindVPVar(const uint16_t vp);
|
||||
|
||||
/// Helper to populate a DGUS_VP_Variable for a given VP. Return false if not found.
|
||||
extern bool populate_VPVar(const uint16_t VP, DGUS_VP_Variable * const ramcopy);
|
||||
@@ -0,0 +1,50 @@
|
||||
/**
|
||||
* 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/>.
|
||||
*
|
||||
*/
|
||||
#pragma once
|
||||
|
||||
/* DGUS implementation written by Sebastiaan Dammann in 2020 for Marlin */
|
||||
|
||||
#include "../dgus/DGUSVPVariable.h"
|
||||
|
||||
#include <stdint.h>
|
||||
|
||||
// This file defines the interaction between Marlin and the display firmware.
|
||||
|
||||
// information on which screen which VP is displayed
|
||||
// As this is a sparse table, two arrays are needed:
|
||||
// one to list the VPs of one screen and one to map screens to the lists.
|
||||
// (Strictly this would not be necessary, but allows to only send data the display needs and reducing load on Marlin)
|
||||
struct VPMapping {
|
||||
const uint8_t screen;
|
||||
const uint16_t *VPList; // The list is null-terminated.
|
||||
};
|
||||
|
||||
extern const struct VPMapping VPMap[];
|
||||
|
||||
// List of VPs handled by Marlin / The Display.
|
||||
extern const struct DGUS_VP_Variable ListOfVP[];
|
||||
|
||||
#include "../../../../inc/MarlinConfig.h"
|
||||
|
||||
#if ENABLED(DGUS_LCD_UI_CREALITY_TOUCH)
|
||||
#include "creality_touch/DGUSDisplayDef.h"
|
||||
#endif
|
||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,363 @@
|
||||
/**
|
||||
* 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/>.
|
||||
*
|
||||
*/
|
||||
#pragma once
|
||||
|
||||
#include "DGUSDisplay.h"
|
||||
#include "../dgus/DGUSVPVariable.h"
|
||||
|
||||
#include "../../../../inc/MarlinConfig.h"
|
||||
|
||||
enum DGUSLCD_Screens : uint8_t;
|
||||
|
||||
struct creality_dwin_settings_t {
|
||||
size_t settings_size;
|
||||
bool led_state;
|
||||
bool display_standby;
|
||||
bool display_sound;
|
||||
int16_t standby_screen_brightness;
|
||||
};
|
||||
|
||||
// endianness swap
|
||||
inline uint16_t swap16(const uint16_t value) { return (value & 0xffU) << 8U | (value >> 8U); }
|
||||
|
||||
class DGUSScreenHandler {
|
||||
public:
|
||||
DGUSScreenHandler() = default;
|
||||
|
||||
static bool loop();
|
||||
|
||||
static void Init();
|
||||
static void DefaultSettings();
|
||||
static void LoadSettings(const char* buff);
|
||||
static void StoreSettings(char* buff);
|
||||
static void SetTouchScreenConfiguration();
|
||||
static void KillScreenCalled();
|
||||
|
||||
static void OnPowerlossResume();
|
||||
|
||||
static void RequestSaveSettings();
|
||||
|
||||
/// Send all 4 strings that are displayed on the infoscreen, confirmation screen and kill screen
|
||||
/// The bools specifing whether the strings are in RAM or FLASH.
|
||||
static void sendinfoscreen(const char* line1, const char* line2, const char* line3, const char* line4, bool l1inflash, bool l2inflash, bool l3inflash, bool liinflash);
|
||||
|
||||
static void HandleUserConfirmationPopUp(uint16_t ConfirmVP, const char* line1, const char* line2, const char* line3, const char* line4, bool l1inflash, bool l2inflash, bool l3inflash, bool liinflash);
|
||||
|
||||
/// "M117" Message -- msg is a RAM ptr.
|
||||
static void setstatusmessage(const char* msg);
|
||||
/// The same for messages from Flash
|
||||
static void setstatusmessagePGM(PGM_P const msg);
|
||||
// Callback for VP "Display wants to change screen on idle printer"
|
||||
static void ScreenChangeHookIfIdle(DGUS_VP_Variable &var, void *val_ptr);
|
||||
// Callback for VP "Screen has been changed"
|
||||
static void ScreenChangeHook(DGUS_VP_Variable &var, void *val_ptr);
|
||||
// Callback for VP "All Heaters Off"
|
||||
static void HandleAllHeatersOff(DGUS_VP_Variable &var, void *val_ptr);
|
||||
// Hook for "Change this temperature"
|
||||
static void HandleTemperatureChanged(DGUS_VP_Variable &var, void *val_ptr);
|
||||
static void HandleFanSpeedChanged(DGUS_VP_Variable &var, void *val_ptr);
|
||||
// Hook for "Change Flowrate"
|
||||
static void HandleFlowRateChanged(DGUS_VP_Variable &var, void *val_ptr);
|
||||
// Hook for manual extrude.
|
||||
static void HandleManualExtrude(DGUS_VP_Variable &var, void *val_ptr);
|
||||
// Hook for motor lock and unlook
|
||||
static void HandleMotorLockUnlock(DGUS_VP_Variable &var, void *val_ptr);
|
||||
#if ENABLED(POWER_LOSS_RECOVERY)
|
||||
// Hook for power loss recovery.
|
||||
static void HandlePowerLossRecovery(DGUS_VP_Variable &var, void *val_ptr);
|
||||
#endif
|
||||
// Hook for settings
|
||||
static void HandleSettings(DGUS_VP_Variable &var, void *val_ptr);
|
||||
static void HandleStepPerMMChanged(DGUS_VP_Variable &var, void *val_ptr);
|
||||
static void HandleStepPerMMExtruderChanged(DGUS_VP_Variable &var, void *val_ptr);
|
||||
static void HandleFeedAmountChanged(DGUS_VP_Variable &var, void *val_ptr);
|
||||
|
||||
// Hook for move to position
|
||||
static void HandlePositionChange(DGUS_VP_Variable &var, void *val_ptr);
|
||||
|
||||
static void HandleToggleTouchScreenMute(DGUS_VP_Variable &var, void *val_ptr);
|
||||
static void HandleToggleTouchScreenStandbySetting(DGUS_VP_Variable &var, void *val_ptr);
|
||||
static void HandleTouchScreenStandbyBrightnessSetting(DGUS_VP_Variable &var, void *val_ptr);
|
||||
|
||||
#if HAS_PROBE_SETTINGS
|
||||
static void HandleToggleProbeHeaters(DGUS_VP_Variable &var, void *val_ptr);
|
||||
static void HandleToggleProbePreheatTemp(DGUS_VP_Variable &var, void *val_ptr);
|
||||
#endif
|
||||
|
||||
#if HAS_PID_HEATING
|
||||
// Hook for "Change this temperature PID para"
|
||||
static void HandleTemperaturePIDChanged(DGUS_VP_Variable &var, void *val_ptr);
|
||||
// Hook for PID autotune
|
||||
static void HandlePIDAutotune(DGUS_VP_Variable &var, void *val_ptr);
|
||||
#endif
|
||||
#if HAS_BED_PROBE
|
||||
// Hook for "Change probe offset z"
|
||||
static void HandleZoffsetChange(DGUS_VP_Variable &var, void *val_ptr);
|
||||
|
||||
static void OnMeshLevelingStart();
|
||||
|
||||
static void OnMeshLevelingUpdate(const int8_t xpos, const int8_t ypos);
|
||||
#endif
|
||||
|
||||
// Hook for live z adjust action
|
||||
static void HandleLiveAdjustZ(DGUS_VP_Variable &var, void *val_ptr);
|
||||
|
||||
// Hook for heater control
|
||||
static void HandleHeaterControl(DGUS_VP_Variable &var, void *val_ptr);
|
||||
#if ENABLED(DGUS_PREHEAT_UI)
|
||||
// Hook for preheat
|
||||
static void HandlePreheat(DGUS_VP_Variable &var, void *val_ptr);
|
||||
#endif
|
||||
#if ENABLED(DGUS_FILAMENT_LOADUNLOAD)
|
||||
// Hook for filament load and unload filament option
|
||||
static void HandleFilamentOption(DGUS_VP_Variable &var, void *val_ptr);
|
||||
// Hook for filament load and unload
|
||||
static void HandleFilamentLoadUnload(DGUS_VP_Variable &var);
|
||||
#endif
|
||||
|
||||
#if ENABLED(SDSUPPORT)
|
||||
// Callback for VP "Display wants to change screen when there is a SD card"
|
||||
static void ScreenChangeHookIfSD(DGUS_VP_Variable &var, void *val_ptr);
|
||||
/// Scroll buttons on the file listing screen.
|
||||
static void DGUSLCD_SD_ScrollFilelist(DGUS_VP_Variable &var, void *val_ptr);
|
||||
/// File touched.
|
||||
static void DGUSLCD_SD_FileSelected(DGUS_VP_Variable &var, void *val_ptr);
|
||||
/// start print after confirmation received.
|
||||
static void DGUSLCD_SD_StartPrint(DGUS_VP_Variable &var, void *val_ptr);
|
||||
/// User hit the pause, resume or abort button.
|
||||
static void DGUSLCD_SD_ResumePauseAbort(DGUS_VP_Variable &var, void *val_ptr);
|
||||
/// User confirmed the abort action
|
||||
static void DGUSLCD_SD_ReallyAbort(DGUS_VP_Variable &var, void *val_ptr);
|
||||
/// User hit the tune button
|
||||
static void DGUSLCD_SD_PrintTune(DGUS_VP_Variable &var, void *val_ptr);
|
||||
/// Send a single filename to the display.
|
||||
static void DGUSLCD_SD_SendFilename(DGUS_VP_Variable &var);
|
||||
/// Marlin informed us that a new SD has been inserted.
|
||||
static void SDCardInserted();
|
||||
/// Marlin informed us that the SD Card has been removed().
|
||||
static void SDCardRemoved();
|
||||
/// Marlin informed us about a bad SD Card.
|
||||
static void SDCardError();
|
||||
|
||||
static void SetPrintingFromHost();
|
||||
#endif
|
||||
|
||||
static void HandleLEDToggle();
|
||||
|
||||
static void HandleFanToggle();
|
||||
|
||||
static void FilamentRunout();
|
||||
|
||||
static void OnFactoryReset();
|
||||
|
||||
#if HAS_BUZZER || ENABLED(SPEAKER)
|
||||
static void Buzzer(const uint16_t frequency, const uint16_t duration);
|
||||
#endif
|
||||
|
||||
static void OnHomingStart();
|
||||
static void OnHomingComplete();
|
||||
static void OnPrintFinished();
|
||||
|
||||
// OK Button the Confirm screen.
|
||||
static void ScreenConfirmedOK(DGUS_VP_Variable &var, void *val_ptr);
|
||||
|
||||
// Update data after went to new screen (by display or by GotoScreen)
|
||||
// remember: store the last-displayed screen, so it can get returned to.
|
||||
// (e.g for pop up messages)
|
||||
static void UpdateNewScreen(DGUSLCD_Screens newscreen, bool save_current_screen=true);
|
||||
|
||||
// Recall the remembered screen.
|
||||
static void PopToOldScreen();
|
||||
static void OnBackButton(DGUS_VP_Variable &var, void *val_ptr);
|
||||
|
||||
// Make the display show the screen and update all VPs in it.
|
||||
static void GotoScreen(DGUSLCD_Screens screen, bool save_current_screen = true);
|
||||
|
||||
static void UpdateScreenVPData();
|
||||
|
||||
// Helpers to convert and transfer data to the display.
|
||||
static void DGUSLCD_SendWordValueToDisplay(DGUS_VP_Variable &var);
|
||||
static void DGUSLCD_SendStringToDisplay(DGUS_VP_Variable &var);
|
||||
static void DGUSLCD_SendStringToDisplayPGM(DGUS_VP_Variable &var);
|
||||
static void DGUSLCD_SendTemperaturePID(DGUS_VP_Variable &var);
|
||||
static void DGUSLCD_SendPercentageToDisplay(DGUS_VP_Variable &var);
|
||||
static void DGUSLCD_SendPrintProgressToDisplay(DGUS_VP_Variable &var);
|
||||
static void DGUSLCD_SendPrintTimeToDisplay(DGUS_VP_Variable &var);
|
||||
#if ENABLED(PRINTCOUNTER)
|
||||
static void DGUSLCD_SendPrintAccTimeToDisplay(DGUS_VP_Variable &var);
|
||||
static void DGUSLCD_SendPrintsTotalToDisplay(DGUS_VP_Variable &var);
|
||||
#endif
|
||||
#if HAS_FAN
|
||||
static void DGUSLCD_SendFanStatusToDisplay(DGUS_VP_Variable &var);
|
||||
static void DGUSLCD_SendFanSpeedToDisplay(DGUS_VP_Variable &var);
|
||||
#endif
|
||||
static void DGUSLCD_SendHeaterStatusToDisplay(DGUS_VP_Variable &var);
|
||||
#if ENABLED(DGUS_UI_WAITING)
|
||||
static void DGUSLCD_SendWaitingStatusToDisplay(DGUS_VP_Variable &var);
|
||||
#endif
|
||||
|
||||
static void DGUSLCD_SendAboutFirmwareWebsite(DGUS_VP_Variable &var);
|
||||
static void DGUSLCD_SendAboutFirmwareVersion(DGUS_VP_Variable &var);
|
||||
static void DGUSLCD_SendAboutPrintSize(DGUS_VP_Variable &var);
|
||||
|
||||
/// Send a value from 0..100 to a variable with a range from 0..255
|
||||
static void DGUSLCD_PercentageToUint8(DGUS_VP_Variable &var, void *val_ptr);
|
||||
|
||||
template<typename T>
|
||||
static void DGUSLCD_SetValueDirectly(DGUS_VP_Variable &var, void *val_ptr) {
|
||||
if (!var.memadr) return;
|
||||
union { unsigned char tmp[sizeof(T)]; T t; } x;
|
||||
unsigned char *ptr = (unsigned char*)val_ptr;
|
||||
LOOP_L_N(i, sizeof(T)) x.tmp[i] = ptr[sizeof(T) - i - 1];
|
||||
*(T*)var.memadr = x.t;
|
||||
}
|
||||
|
||||
template<DGUSLCD_Screens TPage>
|
||||
static void DGUSLCD_NavigateToPage(DGUS_VP_Variable &var, void *val_ptr) {
|
||||
GotoScreen(TPage);
|
||||
}
|
||||
|
||||
template<DGUSLCD_Screens TPage, typename Handler>
|
||||
static void DGUSLCD_NavigateToPage(DGUS_VP_Variable &var, void *val_ptr) {
|
||||
GotoScreen(TPage);
|
||||
Handler::Init();
|
||||
}
|
||||
|
||||
/// Send a float value to the display.
|
||||
/// Display will get a 4-byte integer scaled to the number of digits:
|
||||
/// Tell the display the number of digits and it cheats by displaying a dot between...
|
||||
template<unsigned int decimals>
|
||||
static void DGUSLCD_SendFloatAsLongValueToDisplay(DGUS_VP_Variable &var) {
|
||||
if (var.memadr) {
|
||||
float f = *(float *)var.memadr;
|
||||
f *= cpow(10, decimals);
|
||||
|
||||
// Round - truncated values look like skipped numbers
|
||||
long roundedValue = static_cast<long>(round(f));
|
||||
dgusdisplay.WriteVariable(var.VP, roundedValue);
|
||||
}
|
||||
}
|
||||
|
||||
template<unsigned int decimals>
|
||||
static void DGUSLCD_SendFloatAsLongValueToDisplay(uint16_t vp, float var) {
|
||||
var *= cpow(10, decimals);
|
||||
dgusdisplay.WriteVariable(vp, (long)var);
|
||||
}
|
||||
|
||||
// Receive a float from the display - Display will send a 2-byte integer scaled to the number of digits
|
||||
template<unsigned int decimals>
|
||||
static void DGUSLCD_SetFloatAsIntFromDisplay(DGUS_VP_Variable &var, void *val_ptr) {
|
||||
if (var.memadr) {
|
||||
uint16_t value_raw = swap16(*(uint16_t*)val_ptr);
|
||||
float value = (float)value_raw/10;
|
||||
*(float *)var.memadr = value;
|
||||
}
|
||||
}
|
||||
|
||||
// Toggle a boolean at the specified memory address
|
||||
static void DGUSLCD_ToggleBoolean(DGUS_VP_Variable &var, void *val_ptr) {
|
||||
if (var.memadr) {
|
||||
bool* val = (bool *)var.memadr;
|
||||
*val = !*val;
|
||||
}
|
||||
}
|
||||
|
||||
// Send an icon to the display, depending on whether it is true or false
|
||||
template<unsigned int value_if_true, unsigned int value_if_false>
|
||||
static void DGUSLCD_SendIconValue(DGUS_VP_Variable &var) {
|
||||
if (var.memadr) {
|
||||
bool value = *(bool *)var.memadr;
|
||||
uint16_t valueToSend = value ? value_if_true : value_if_false;
|
||||
dgusdisplay.WriteVariable(var.VP, valueToSend);
|
||||
}
|
||||
}
|
||||
|
||||
/// Send a float value to the display.
|
||||
/// Display will get a 2-byte integer scaled to the number of digits:
|
||||
/// Tell the display the number of digits and it cheats by displaying a dot between...
|
||||
template<unsigned int decimals>
|
||||
static void DGUSLCD_SendFloatAsIntValueToDisplay(DGUS_VP_Variable &var) {
|
||||
if (var.memadr) {
|
||||
float f = *(float *)var.memadr;
|
||||
f *= cpow(10, decimals);
|
||||
|
||||
// Round - truncated values look like skipped numbers
|
||||
int16_t roundedValue = static_cast<int16_t>(round(f));
|
||||
dgusdisplay.WriteVariable(var.VP, roundedValue);
|
||||
}
|
||||
}
|
||||
|
||||
template<unsigned int decimals>
|
||||
static void DGUSLCD_SendFloatAsIntValueToDisplay(uint16_t vp, float var) {
|
||||
DEBUG_ECHOLNPAIR_F(" >> ", var, 6);
|
||||
var *= cpow(10, decimals);
|
||||
dgusdisplay.WriteVariable(vp, (int16_t)var);
|
||||
}
|
||||
|
||||
template<AxisEnum Axis>
|
||||
static void SendAxisTrustValue(DGUS_VP_Variable &var) {
|
||||
bool trust = axis_is_trusted(Axis);
|
||||
|
||||
uint16_t color = trust ? 0xFFFF /*White*/ : 0XF800 /*Red*/;
|
||||
dgusdisplay.SetVariableDisplayColor(var.VP, color);
|
||||
|
||||
//PGM_P suffix = trust ? nullptr : "???";
|
||||
//dgusdisplay.SetVariableAppendText(var.VP, suffix);
|
||||
}
|
||||
|
||||
|
||||
/// Force an update of all VP on the current screen.
|
||||
static inline void ForceCompleteUpdate() { update_ptr = 0; ScreenComplete = false; }
|
||||
/// Has all VPs sent to the screen
|
||||
static inline bool IsScreenComplete() { return ScreenComplete; }
|
||||
|
||||
static inline DGUSLCD_Screens getCurrentScreen() { return current_screen; }
|
||||
|
||||
static bool HandlePendingUserConfirmation();
|
||||
|
||||
static float feed_amount;
|
||||
static bool fwretract_available;
|
||||
|
||||
private:
|
||||
static DGUSLCD_Screens current_screen; ///< currently on screen
|
||||
static constexpr uint8_t NUM_PAST_SCREENS = 4;
|
||||
static DGUSLCD_Screens past_screens[NUM_PAST_SCREENS]; ///< LIFO with past screens for the "back" button.
|
||||
|
||||
static uint8_t update_ptr; ///< Last sent entry in the VPList for the actual screen.
|
||||
static uint16_t skipVP; ///< When updating the screen data, skip this one, because the user is interacting with it.
|
||||
static bool ScreenComplete; ///< All VPs sent to screen?
|
||||
|
||||
static uint16_t ConfirmVP; ///< context for confirm screen (VP that will be emulated-sent on "OK").
|
||||
|
||||
static uint8_t MeshLevelIndex;
|
||||
static bool SaveSettingsRequested;
|
||||
|
||||
#if ENABLED(SDSUPPORT)
|
||||
static int16_t top_file; ///< file on top of file chooser
|
||||
static int16_t file_to_print; ///< touched file to be confirmed
|
||||
#endif
|
||||
|
||||
public: // Needed for VP auto-upload
|
||||
static creality_dwin_settings_t Settings;
|
||||
};
|
||||
|
||||
extern DGUSScreenHandler ScreenHandler;
|
||||
@@ -0,0 +1,657 @@
|
||||
/**
|
||||
* 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/>.
|
||||
*
|
||||
*/
|
||||
|
||||
/* DGUS implementation written by Sebastiaan Dammann in 2020 for Marlin */
|
||||
|
||||
#include "../../../../../inc/MarlinConfigPre.h"
|
||||
|
||||
#if ENABLED(DGUS_LCD_UI_CREALITY_TOUCH)
|
||||
|
||||
#include "../DGUSDisplayDef.h"
|
||||
#include "../DGUSDisplay.h"
|
||||
#include "../DGUSScreenHandler.h"
|
||||
#include "../creality_touch/EstepsHandler.h"
|
||||
#include "../creality_touch/PIDHandler.h"
|
||||
|
||||
#include "../../../../../module/temperature.h"
|
||||
#include "../../../../../module/motion.h"
|
||||
#include "../../../../../module/planner.h"
|
||||
|
||||
#include "../../../../../feature/caselight.h"
|
||||
|
||||
#if ENABLED(FWRETRACT)
|
||||
#include "../../../../../feature/fwretract.h"
|
||||
#endif
|
||||
|
||||
#include "../../../ui_api.h"
|
||||
#include "../../../../marlinui.h"
|
||||
|
||||
#include "PageHandlers.h"
|
||||
|
||||
#if ENABLED(DGUS_UI_MOVE_DIS_OPTION)
|
||||
uint16_t distanceToMove = 10;
|
||||
#endif
|
||||
using namespace ExtUI;
|
||||
|
||||
|
||||
const char MarlinVersion[] PROGMEM = SHORT_BUILD_VERSION;
|
||||
|
||||
// ----- Which variables to auto-update on which screens
|
||||
const uint16_t VPList_None[] PROGMEM = {
|
||||
0x0000
|
||||
};
|
||||
|
||||
const uint16_t VPList_DialogStop[] PROGMEM = {
|
||||
0x0000
|
||||
};
|
||||
|
||||
const uint16_t VPList_Main[] PROGMEM = {
|
||||
#if HOTENDS >= 1
|
||||
VP_T_E0_Is, VP_T_E0_Set,// VP_E0_STATUS,
|
||||
#endif
|
||||
#if HAS_HEATED_BED
|
||||
VP_T_Bed_Is, VP_T_Bed_Set,// VP_BED_STATUS,
|
||||
#endif
|
||||
VP_Z_OFFSET,
|
||||
//VP_Fan0_Percentage,
|
||||
VP_Feedrate_Percentage,
|
||||
#if ENABLED(LCD_SET_PROGRESS_MANUALLY)
|
||||
VP_PrintProgress_Percentage,
|
||||
#endif
|
||||
0x0000
|
||||
};
|
||||
|
||||
const uint16_t VPList_SDFileList[] PROGMEM = {
|
||||
#if HOTENDS >= 1
|
||||
VP_T_E0_Is, VP_T_E0_Set,// VP_E0_STATUS,
|
||||
#endif
|
||||
#if HAS_HEATED_BED
|
||||
VP_T_Bed_Is, VP_T_Bed_Set,// VP_BED_STATUS,
|
||||
#endif
|
||||
VP_Z_OFFSET,
|
||||
//VP_Fan0_Percentage,
|
||||
VP_Feedrate_Percentage,
|
||||
#if ENABLED(LCD_SET_PROGRESS_MANUALLY)
|
||||
VP_PrintProgress_Percentage,
|
||||
#endif
|
||||
|
||||
VP_SD_FileName0,
|
||||
VP_SD_FileName1,
|
||||
VP_SD_FileName2,
|
||||
VP_SD_FileName3,
|
||||
VP_SD_FileName4,
|
||||
VP_SD_FileName5,
|
||||
|
||||
0x0000
|
||||
};
|
||||
|
||||
const uint16_t VPList_Control[] PROGMEM = {
|
||||
#if HOTENDS >= 1
|
||||
VP_T_E0_Is, VP_T_E0_Set,// VP_E0_STATUS,
|
||||
#endif
|
||||
#if HAS_HEATED_BED
|
||||
VP_T_Bed_Is, VP_T_Bed_Set,// VP_BED_STATUS,
|
||||
#endif
|
||||
VP_Z_OFFSET,
|
||||
//VP_Fan0_Percentage,
|
||||
VP_Feedrate_Percentage,
|
||||
#if ENABLED(LCD_SET_PROGRESS_MANUALLY)
|
||||
VP_PrintProgress_Percentage,
|
||||
#endif
|
||||
|
||||
VP_LED_TOGGLE,
|
||||
VP_MUTE_ICON,
|
||||
VP_STANDBY_BACKLIGHT_ICON,
|
||||
VP_SCREEN_BACKLIGHT_STANDBY,
|
||||
|
||||
0x0000
|
||||
};
|
||||
|
||||
const uint16_t VPList_Feed[] PROGMEM = {
|
||||
#if HOTENDS >= 1
|
||||
VP_T_E0_Is, VP_T_E0_Set,// VP_E0_STATUS,
|
||||
#endif
|
||||
#if HAS_HEATED_BED
|
||||
VP_T_Bed_Is, VP_T_Bed_Set,// VP_BED_STATUS,
|
||||
#endif
|
||||
VP_Z_OFFSET,
|
||||
//VP_Fan0_Percentage,
|
||||
VP_Feedrate_Percentage,
|
||||
|
||||
VP_FEED_AMOUNT,
|
||||
|
||||
0x0000
|
||||
};
|
||||
|
||||
const uint16_t VPList_Temp[] PROGMEM = {
|
||||
#if HOTENDS >= 1
|
||||
VP_T_E0_Is, VP_T_E0_Set,// VP_E0_STATUS,
|
||||
#endif
|
||||
#if HAS_HEATED_BED
|
||||
VP_T_Bed_Is, VP_T_Bed_Set,// VP_BED_STATUS,
|
||||
#endif
|
||||
VP_Z_OFFSET,
|
||||
//VP_Fan0_Percentage,
|
||||
VP_Feedrate_Percentage,
|
||||
#if ENABLED(LCD_SET_PROGRESS_MANUALLY)
|
||||
VP_PrintProgress_Percentage,
|
||||
#endif
|
||||
|
||||
VP_FAN_TOGGLE,
|
||||
|
||||
0x0000
|
||||
};
|
||||
|
||||
|
||||
const uint16_t VPList_PreheatPLASettings[] PROGMEM = {
|
||||
#if HOTENDS >= 1
|
||||
VP_T_E0_Is, VP_T_E0_Set,// VP_E0_STATUS,
|
||||
#endif
|
||||
#if HAS_HEATED_BED
|
||||
VP_T_Bed_Is, VP_T_Bed_Set,// VP_BED_STATUS,
|
||||
#endif
|
||||
VP_Z_OFFSET,
|
||||
//VP_Fan0_Percentage,
|
||||
VP_Feedrate_Percentage,
|
||||
|
||||
VP_PREHEAT_PLA_HOTEND_TEMP,
|
||||
VP_PREHEAT_PLA_BED_TEMP,
|
||||
|
||||
0x0000
|
||||
};
|
||||
|
||||
const uint16_t VPList_PreheatABSSettings[] PROGMEM = {
|
||||
#if HOTENDS >= 1
|
||||
VP_T_E0_Is, VP_T_E0_Set,// VP_E0_STATUS,
|
||||
#endif
|
||||
#if HAS_HEATED_BED
|
||||
VP_T_Bed_Is, VP_T_Bed_Set,// VP_BED_STATUS,
|
||||
#endif
|
||||
VP_Z_OFFSET,
|
||||
//VP_Fan0_Percentage,
|
||||
VP_Feedrate_Percentage,
|
||||
|
||||
VP_PREHEAT_ABS_HOTEND_TEMP,
|
||||
VP_PREHEAT_ABS_BED_TEMP,
|
||||
|
||||
0x0000
|
||||
};
|
||||
|
||||
|
||||
const uint16_t VPList_PrintPausingError[] PROGMEM = {
|
||||
#if HOTENDS >= 1
|
||||
VP_T_E0_Is, VP_T_E0_Set,// VP_E0_STATUS,
|
||||
#endif
|
||||
#if HAS_HEATED_BED
|
||||
VP_T_Bed_Is, VP_T_Bed_Set,// VP_BED_STATUS,
|
||||
#endif
|
||||
|
||||
VP_X_POSITION,
|
||||
VP_Y_POSITION,
|
||||
VP_Z_POSITION,
|
||||
VP_Z_OFFSET,
|
||||
VP_Fan0_Percentage,
|
||||
VP_Feedrate_Percentage,
|
||||
|
||||
VP_PrintProgress_Percentage,
|
||||
VP_PrintTimeProgressBar,
|
||||
VP_PrintTime,
|
||||
|
||||
0x0000
|
||||
};
|
||||
|
||||
const uint16_t VPList_PrintScreen[] PROGMEM = {
|
||||
VP_PrintTime,
|
||||
|
||||
#if HOTENDS >= 1
|
||||
VP_T_E0_Is, VP_T_E0_Set,// VP_E0_STATUS,
|
||||
#endif
|
||||
#if HAS_HEATED_BED
|
||||
VP_T_Bed_Is, VP_T_Bed_Set,// VP_BED_STATUS,
|
||||
#endif
|
||||
|
||||
VP_X_POSITION, VP_Y_POSITION, VP_Z_POSITION,
|
||||
SP_X_POSITION, SP_Y_POSITION, SP_Z_POSITION,
|
||||
|
||||
VP_Z_OFFSET,
|
||||
VP_Flowrate_E0,
|
||||
VP_Fan0_Percentage,
|
||||
VP_Feedrate_Percentage,
|
||||
|
||||
VP_PrintProgress_Percentage,
|
||||
VP_PrintTimeProgressBar,
|
||||
VP_PrintTime,
|
||||
|
||||
VP_FWRETRACT_INDICATOR_ICON,
|
||||
|
||||
0x0000
|
||||
};
|
||||
|
||||
const uint16_t VPList_Leveling[] PROGMEM = {
|
||||
#if HOTENDS >= 1
|
||||
VP_T_E0_Is, VP_T_E0_Set,// VP_E0_STATUS,
|
||||
#endif
|
||||
#if HAS_HEATED_BED
|
||||
VP_T_Bed_Is, VP_T_Bed_Set,// VP_BED_STATUS,
|
||||
#endif
|
||||
VP_Z_OFFSET,
|
||||
//VP_Fan0_Percentage,
|
||||
VP_Feedrate_Percentage,
|
||||
|
||||
VP_MESH_LEVEL_TEMP,
|
||||
|
||||
0x0000
|
||||
};
|
||||
|
||||
const uint16_t VPList_ZOffsetLevel[] PROGMEM = {
|
||||
#if HOTENDS >= 1
|
||||
VP_T_E0_Is, VP_T_E0_Set,// VP_E0_STATUS,
|
||||
#endif
|
||||
#if HAS_HEATED_BED
|
||||
VP_T_Bed_Is, VP_T_Bed_Set,// VP_BED_STATUS,
|
||||
#endif
|
||||
VP_Z_OFFSET,
|
||||
//VP_Fan0_Percentage,
|
||||
VP_Feedrate_Percentage,
|
||||
|
||||
0x0000
|
||||
};
|
||||
|
||||
const uint16_t VPList_TuneScreen[] PROGMEM = {
|
||||
VP_PrintTime,
|
||||
|
||||
VP_Flowrate_E0,
|
||||
|
||||
#if HOTENDS >= 1
|
||||
VP_T_E0_Is, VP_T_E0_Set,// VP_E0_STATUS,
|
||||
#endif
|
||||
#if HAS_HEATED_BED
|
||||
VP_T_Bed_Is, VP_T_Bed_Set,// VP_BED_STATUS,
|
||||
#endif
|
||||
VP_Z_OFFSET,
|
||||
VP_Feedrate_Percentage,
|
||||
|
||||
VP_LED_TOGGLE,
|
||||
VP_FAN_TOGGLE,
|
||||
VP_Fan0_Percentage,
|
||||
|
||||
VP_LINEAR_ADVANCE_FACTOR,
|
||||
|
||||
0x0000
|
||||
};
|
||||
|
||||
const uint16_t VPList_Prepare[] PROGMEM = {
|
||||
VP_PrintTime,
|
||||
|
||||
#if HOTENDS >= 1
|
||||
VP_T_E0_Is, VP_T_E0_Set,// VP_E0_STATUS,
|
||||
#endif
|
||||
#if HAS_HEATED_BED
|
||||
VP_T_Bed_Is, VP_T_Bed_Set,// VP_BED_STATUS,
|
||||
#endif
|
||||
VP_Z_OFFSET,
|
||||
//VP_Fan0_Percentage,
|
||||
VP_Feedrate_Percentage,
|
||||
|
||||
0x0000
|
||||
};
|
||||
|
||||
const uint16_t VPList_Info[] PROGMEM = {
|
||||
VP_PrintTime,
|
||||
|
||||
#if HOTENDS >= 1
|
||||
VP_T_E0_Is, VP_T_E0_Set,// VP_E0_STATUS,
|
||||
#endif
|
||||
#if HAS_HEATED_BED
|
||||
VP_T_Bed_Is, VP_T_Bed_Set,// VP_BED_STATUS,
|
||||
#endif
|
||||
VP_Z_OFFSET,
|
||||
//VP_Fan0_Percentage,
|
||||
VP_Feedrate_Percentage,
|
||||
|
||||
VP_PRINTER_BEDSIZE,
|
||||
VP_MARLIN_WEBSITE,
|
||||
VP_MARLIN_VERSION,
|
||||
|
||||
0x0000
|
||||
};
|
||||
|
||||
const uint16_t VPList_EstepsCalibration[] PROGMEM = {
|
||||
VP_ESTEPS_CURRENT,
|
||||
VP_ESTEPS_CALIBRATION_TEMP,
|
||||
VP_ESTEPS_CALIBRATION_LENGTH,
|
||||
VP_ESTEPS_CALIBRATION_LEFTOVER_LENGTH,
|
||||
VP_ESTEPS_CALIBRATION_MARK_LENGTH,
|
||||
VP_ESTEPS_CALCULATED_ESTEPS,
|
||||
|
||||
#if HOTENDS >= 1
|
||||
VP_T_E0_Is, VP_T_E0_Set,// VP_E0_STATUS,
|
||||
#endif
|
||||
#if HAS_HEATED_BED
|
||||
VP_T_Bed_Is, VP_T_Bed_Set,// VP_BED_STATUS,
|
||||
#endif
|
||||
|
||||
0x0000
|
||||
};
|
||||
|
||||
const uint16_t VPList_PidTune[] PROGMEM = {
|
||||
VP_PIDTUNE_TARGET_TEMP,
|
||||
VP_PIDTUNE_CYCLES,
|
||||
|
||||
#if HOTENDS >= 1
|
||||
VP_T_E0_Is, VP_T_E0_Set,// VP_E0_STATUS,
|
||||
#endif
|
||||
#if HAS_HEATED_BED
|
||||
VP_T_Bed_Is, VP_T_Bed_Set,// VP_BED_STATUS,
|
||||
#endif
|
||||
|
||||
0x0000
|
||||
};
|
||||
|
||||
const uint16_t VPList_FWRetractTune[] PROGMEM = {
|
||||
#if HOTENDS >= 1
|
||||
VP_T_E0_Is, VP_T_E0_Set,// VP_E0_STATUS,
|
||||
#endif
|
||||
#if HAS_HEATED_BED
|
||||
VP_T_Bed_Is, VP_T_Bed_Set,// VP_BED_STATUS,
|
||||
#endif
|
||||
VP_Z_OFFSET,
|
||||
VP_Feedrate_Percentage,
|
||||
|
||||
VP_FWRETRACT_RETRACT_LENGTH,
|
||||
VP_FWRETRACT_RETRACT_FEEDRATE,
|
||||
VP_FWRETRACT_RETRACT_ZHOP,
|
||||
VP_FWRETRACT_RESTART_LENGTH,
|
||||
VP_FWRETRACT_RESTART_FEEDRATE,
|
||||
|
||||
VP_FWRETRACT_TOGGLE_BUTTON_ICON,
|
||||
|
||||
0x0000
|
||||
};
|
||||
|
||||
const uint16_t VPList_LevelingSettings[] PROGMEM = {
|
||||
#if HOTENDS >= 1
|
||||
VP_T_E0_Is, VP_T_E0_Set,// VP_E0_STATUS,
|
||||
#endif
|
||||
#if HAS_HEATED_BED
|
||||
VP_T_Bed_Is, VP_T_Bed_Set,// VP_BED_STATUS,
|
||||
#endif
|
||||
VP_Z_OFFSET,
|
||||
//VP_Fan0_Percentage,
|
||||
VP_Feedrate_Percentage,
|
||||
|
||||
VP_TOGGLE_PROBE_HEATERS_OFF_ONOFF_ICON,
|
||||
VP_TOGGLE_PROBE_PREHEAT_HOTEND_TEMP,
|
||||
VP_TOGGLE_PROBE_PREHEAT_BED_TEMP,
|
||||
|
||||
0x0000
|
||||
};
|
||||
|
||||
// Toggle button handler
|
||||
void DGUSCrealityDisplay_HandleToggleButton(DGUS_VP_Variable &var, void *val_ptr) {
|
||||
switch (*(uint16_t*)var.memadr) {
|
||||
case ICON_TOGGLE_ON:
|
||||
*((bool*)var.memadr) = true;
|
||||
break;
|
||||
|
||||
case ICON_TOGGLE_OFF:
|
||||
*((bool*)var.memadr) = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
void DGUSCrealityDisplay_SendToggleButton(DGUS_VP_Variable &var) {
|
||||
dgusdisplay.WriteVariable(var.VP, *(bool*)var.memadr ? ICON_TOGGLE_ON : ICON_TOGGLE_OFF);
|
||||
}
|
||||
|
||||
// -- Mapping from screen to variable list
|
||||
const struct VPMapping VPMap[] PROGMEM = {
|
||||
{ DGUSLCD_SCREEN_BOOT, VPList_None },
|
||||
{ DGUSLCD_SCREEN_MAIN, VPList_Main },
|
||||
|
||||
{ DGUSLCD_SCREEN_SDFILELIST, VPList_SDFileList },
|
||||
|
||||
{ DGUSLCD_SCREEN_FILAMENTRUNOUT1, VPList_PrintPausingError },
|
||||
{ DGUSLCD_SCREEN_FILAMENTRUNOUT2, VPList_PrintPausingError },
|
||||
|
||||
{ DGUSLCD_SCREEN_PRINT_FINISH, VPList_PrintScreen },
|
||||
{ DGUSLCD_SCREEN_PRINT_RUNNING, VPList_PrintScreen },
|
||||
{ DGUSLCD_SCREEN_PRINT_PAUSED, VPList_PrintScreen },
|
||||
|
||||
{ DGUSLCD_SCREEN_TUNING, VPList_TuneScreen },
|
||||
{ DGUSLCD_SCREEN_PREPARE, VPList_Prepare },
|
||||
|
||||
{ DGUSLCD_SCREEN_INFO, VPList_Info },
|
||||
|
||||
{ DGUSLCD_SCREEN_MOVE1MM, VPList_PrintScreen },
|
||||
{ DGUSLCD_SCREEN_MOVE10MM, VPList_PrintScreen },
|
||||
{ DGUSLCD_SCREEN_MOVE01MM, VPList_PrintScreen },
|
||||
|
||||
{ DGUSLCD_SCREEN_FEED, VPList_Feed },
|
||||
{ DGUSLCD_SCREEN_CONTROL, VPList_Control },
|
||||
|
||||
{ DGUSLCD_SCREEN_TEMP, VPList_Temp },
|
||||
{ DGUSLCD_SCREEN_TEMP_PLA, VPList_PreheatPLASettings },
|
||||
{ DGUSLCD_SCREEN_TEMP_ABS, VPList_PreheatABSSettings },
|
||||
|
||||
{ DGUSLCD_SCREEN_INFO, VPList_PrintScreen },
|
||||
{ DGUSLCD_SCREEN_ZOFFSET_LEVEL, VPList_ZOffsetLevel },
|
||||
{ DGUSLCD_SCREEN_LEVELING, VPList_Leveling },
|
||||
|
||||
{ DGUSLCD_SCREEN_POWER_LOSS, VPList_None },
|
||||
{ DGUSLCD_SCREEN_THERMAL_RUNAWAY, VPList_None },
|
||||
{ DGUSLCD_SCREEN_HEATING_FAILED, VPList_None },
|
||||
{ DGUSLCD_SCREEN_THERMISTOR_ERROR, VPList_None },
|
||||
|
||||
{ DGUSLCD_SCREEN_AUTOHOME, VPList_PrintScreen },
|
||||
|
||||
{ DGUSLCD_SCREEN_DIALOG_PAUSE, VPList_None },
|
||||
{ DGUSLCD_SCREEN_DIALOG_STOP, VPList_DialogStop },
|
||||
|
||||
{ DGUSLCD_SCREEN_CONFIRM, VPList_None },
|
||||
{ DGUSLCD_SCREEN_POPUP, VPList_None },
|
||||
|
||||
{ DGUSLCD_SCREEN_ESTEPS_CALIBRATION, VPList_EstepsCalibration },
|
||||
{ DGUSLCD_SCREEN_PIDTUNE_CALIBRATION, VPList_PidTune },
|
||||
|
||||
{ DGUSLCD_SCREEN_TUNEFWRETRACT, VPList_FWRetractTune },
|
||||
|
||||
{ DGUSLCD_SCREEN_ESTEPS_CALIBRATION_RESULTS, VPList_EstepsCalibration },
|
||||
{ DGUSLCD_SCREEN_LEVELING_SETTINGS, VPList_LevelingSettings },
|
||||
|
||||
{ 0 , nullptr } // List is terminated with an nullptr as table entry.
|
||||
};
|
||||
|
||||
// Helper to define a DGUS_VP_Variable for common use cases.
|
||||
#define VPHELPER(VPADR, VPADRVAR, RXFPTR, TXFPTR ) { .VP=VPADR, .memadr=VPADRVAR, .size=sizeof(VPADRVAR), \
|
||||
.set_by_display_handler = RXFPTR, .send_to_display_handler = TXFPTR }
|
||||
|
||||
// Helper to define a DGUS_VP_Variable when the sizeo of the var cannot be determined automaticalyl (eg. a string)
|
||||
#define VPHELPER_STR(VPADR, VPADRVAR, STRLEN, RXFPTR, TXFPTR ) { .VP=VPADR, .memadr=VPADRVAR, .size=STRLEN, \
|
||||
.set_by_display_handler = RXFPTR, .send_to_display_handler = TXFPTR }
|
||||
|
||||
const struct DGUS_VP_Variable ListOfVP[] PROGMEM = {
|
||||
#if HOTENDS >= 1
|
||||
VPHELPER(VP_Flowrate_E0, &planner.flow_percentage[ExtUI::extruder_t::E0], ScreenHandler.HandleFlowRateChanged, &ScreenHandler.DGUSLCD_SendWordValueToDisplay),
|
||||
VPHELPER(VP_T_E0_Is, &thermalManager.temp_hotend[0].celsius, nullptr, ScreenHandler.DGUSLCD_SendFloatAsIntValueToDisplay<0>),
|
||||
VPHELPER(VP_T_E0_Set, &thermalManager.temp_hotend[0].target, ScreenHandler.HandleTemperatureChanged, &ScreenHandler.DGUSLCD_SendWordValueToDisplay),
|
||||
#endif
|
||||
|
||||
#if HAS_HEATED_BED
|
||||
VPHELPER(VP_T_Bed_Is, &thermalManager.temp_bed.celsius, nullptr, ScreenHandler.DGUSLCD_SendFloatAsIntValueToDisplay<0>),
|
||||
VPHELPER(VP_T_Bed_Set, &thermalManager.temp_bed.target, ScreenHandler.HandleTemperatureChanged, &ScreenHandler.DGUSLCD_SendWordValueToDisplay),
|
||||
#endif
|
||||
|
||||
VPHELPER(VP_MESH_LEVEL_TEMP, &thermalManager.temp_hotend[0].target, nullptr, &ScreenHandler.DGUSLCD_SendWordValueToDisplay),
|
||||
VPHELPER(VP_MESH_LEVEL_STATUS, nullptr, nullptr, nullptr),
|
||||
|
||||
// Feedrate
|
||||
VPHELPER(VP_Feedrate_Percentage, &feedrate_percentage, ScreenHandler.DGUSLCD_SetValueDirectly<int16_t>, &ScreenHandler.DGUSLCD_SendWordValueToDisplay),
|
||||
|
||||
VPHELPER(VP_PrintProgress_Percentage, nullptr, nullptr, ScreenHandler.DGUSLCD_SendPrintProgressToDisplay),
|
||||
VPHELPER(VP_PrintTimeProgressBar, nullptr, nullptr, ScreenHandler.DGUSLCD_SendPrintProgressToDisplay),
|
||||
|
||||
// Calibration
|
||||
// ... e-steps
|
||||
VPHELPER(VP_ESTEPS_CURRENT, &EstepsHandler::set_esteps, ScreenHandler.DGUSLCD_SetFloatAsIntFromDisplay<1>, ScreenHandler.DGUSLCD_SendFloatAsIntValueToDisplay<1>),
|
||||
VPHELPER(VP_ESTEPS_CALIBRATION_TEMP, &EstepsHandler::calibration_temperature, ScreenHandler.DGUSLCD_SetValueDirectly<uint16_t>, ScreenHandler.DGUSLCD_SendWordValueToDisplay),
|
||||
VPHELPER(VP_ESTEPS_CALIBRATION_LENGTH, &EstepsHandler::filament_to_extrude, ScreenHandler.DGUSLCD_SetFloatAsIntFromDisplay<1>, ScreenHandler.DGUSLCD_SendFloatAsIntValueToDisplay<1>),
|
||||
VPHELPER(VP_ESTEPS_CALIBRATION_MARK_LENGTH, &EstepsHandler::mark_filament_mm, ScreenHandler.DGUSLCD_SetFloatAsIntFromDisplay<1>, ScreenHandler.DGUSLCD_SendFloatAsIntValueToDisplay<1>),
|
||||
VPHELPER(VP_ESTEPS_CALIBRATION_LEFTOVER_LENGTH, &EstepsHandler::remaining_filament, EstepsHandler::HandleRemainingFilament, ScreenHandler.DGUSLCD_SendFloatAsIntValueToDisplay<1>),
|
||||
VPHELPER(VP_ESTEPS_CALCULATED_ESTEPS, &EstepsHandler::calculated_esteps, ScreenHandler.DGUSLCD_SetFloatAsIntFromDisplay<1>, ScreenHandler.DGUSLCD_SendFloatAsIntValueToDisplay<1>),
|
||||
|
||||
VPHELPER(VP_ESTEPS_CALIBRATESTART_BUTTON, nullptr, EstepsHandler::HandleStartButton, nullptr),
|
||||
VPHELPER(VP_ESTEPS_APPLY_BUTTON, nullptr, EstepsHandler::HandleApplyButton, nullptr),
|
||||
|
||||
VPHELPER(VP_ESTEP_NAV_BUTTON, nullptr, (ScreenHandler.DGUSLCD_NavigateToPage<DGUSLCD_SCREEN_ESTEPS_CALIBRATION, EstepsHandler>), nullptr),
|
||||
|
||||
// ... PID
|
||||
VPHELPER(VP_PIDTUNE_TARGET_TEMP, &PIDHandler::calibration_temperature, ScreenHandler.DGUSLCD_SetValueDirectly<uint16_t>, ScreenHandler.DGUSLCD_SendWordValueToDisplay),
|
||||
VPHELPER(VP_PIDTUNE_CYCLES, &PIDHandler::cycles, ScreenHandler.DGUSLCD_SetValueDirectly<uint16_t>, ScreenHandler.DGUSLCD_SendWordValueToDisplay),
|
||||
VPHELPER(VP_PIDTUNE_START_BUTTON, nullptr, PIDHandler::HandleStartButton, nullptr),
|
||||
|
||||
VPHELPER(VP_PIDTUNE_NAV_BUTTON, nullptr, (ScreenHandler.DGUSLCD_NavigateToPage<DGUSLCD_SCREEN_PIDTUNE_CALIBRATION, PIDHandler>), nullptr),
|
||||
|
||||
VPHELPER(VP_GENERIC_BACK_BUTTON, nullptr, ScreenHandler.OnBackButton, nullptr),
|
||||
|
||||
// Preheat settings
|
||||
#ifdef PREHEAT_1_LABEL
|
||||
VPHELPER(VP_PREHEAT_PLA_HOTEND_TEMP, &ui.material_preset[0].hotend_temp, ScreenHandler.DGUSLCD_SetValueDirectly<int16_t>, &ScreenHandler.DGUSLCD_SendWordValueToDisplay),
|
||||
VPHELPER(VP_PREHEAT_PLA_BED_TEMP, &ui.material_preset[0].bed_temp, ScreenHandler.DGUSLCD_SetValueDirectly<int16_t>, &ScreenHandler.DGUSLCD_SendWordValueToDisplay),
|
||||
#endif
|
||||
|
||||
#ifdef PREHEAT_2_LABEL
|
||||
VPHELPER(VP_PREHEAT_ABS_HOTEND_TEMP, &ui.material_preset[1].hotend_temp, ScreenHandler.DGUSLCD_SetValueDirectly<int16_t>, &ScreenHandler.DGUSLCD_SendWordValueToDisplay),
|
||||
VPHELPER(VP_PREHEAT_ABS_BED_TEMP, &ui.material_preset[1].bed_temp, ScreenHandler.DGUSLCD_SetValueDirectly<int16_t>, &ScreenHandler.DGUSLCD_SendWordValueToDisplay),
|
||||
#endif
|
||||
|
||||
// About info
|
||||
VPHELPER(VP_MARLIN_WEBSITE, nullptr, nullptr, ScreenHandler.DGUSLCD_SendAboutFirmwareWebsite),
|
||||
VPHELPER(VP_MARLIN_VERSION, nullptr, nullptr, ScreenHandler.DGUSLCD_SendAboutFirmwareVersion),
|
||||
VPHELPER(VP_PRINTER_BEDSIZE, nullptr, nullptr, ScreenHandler.DGUSLCD_SendAboutPrintSize),
|
||||
|
||||
// Position Data
|
||||
VPHELPER(VP_X_POSITION, ¤t_position.x, ScreenHandler.HandlePositionChange, ScreenHandler.DGUSLCD_SendFloatAsIntValueToDisplay<1>),
|
||||
VPHELPER(VP_Y_POSITION, ¤t_position.y, ScreenHandler.HandlePositionChange, ScreenHandler.DGUSLCD_SendFloatAsIntValueToDisplay<1>),
|
||||
VPHELPER(VP_Z_POSITION, ¤t_position.z, ScreenHandler.HandlePositionChange, ScreenHandler.DGUSLCD_SendFloatAsIntValueToDisplay<1>),
|
||||
|
||||
VPHELPER(SP_X_POSITION, nullptr, nullptr, ScreenHandler.SendAxisTrustValue<X_AXIS>),
|
||||
VPHELPER(SP_Y_POSITION, nullptr, nullptr, ScreenHandler.SendAxisTrustValue<Y_AXIS>),
|
||||
VPHELPER(SP_Z_POSITION, nullptr, nullptr, ScreenHandler.SendAxisTrustValue<Z_AXIS>),
|
||||
|
||||
VPHELPER(VP_Z_OFFSET, &probe.offset.z, ScreenHandler.HandleZoffsetChange, ScreenHandler.DGUSLCD_SendFloatAsIntValueToDisplay<2>),
|
||||
|
||||
VPHELPER(VP_FAN_TOGGLE, &thermalManager.fan_speed[0], nullptr, ScreenHandler.DGUSLCD_SendFanStatusToDisplay),
|
||||
VPHELPER(VP_Fan0_Percentage, &thermalManager.fan_speed[0], ScreenHandler.HandleFanSpeedChanged, ScreenHandler.DGUSLCD_SendFanSpeedToDisplay),
|
||||
|
||||
#if ENABLED(POWER_LOSS_RECOVERY)
|
||||
VPHELPER(VP_POWER_LOSS_RECOVERY, nullptr, &ScreenHandler.HandlePowerLossRecovery, nullptr),
|
||||
#endif
|
||||
|
||||
VPHELPER_STR(VP_PrintTime, nullptr, VP_PrintTime_LEN, nullptr, ScreenHandler.DGUSLCD_SendPrintTimeToDisplay),
|
||||
VPHELPER(VP_SCREENCHANGE, nullptr, ScreenHandler.ScreenChangeHook, nullptr),
|
||||
VPHELPER(VP_CONFIRMED, nullptr, ScreenHandler.ScreenConfirmedOK, nullptr),
|
||||
|
||||
#if HAS_PROBE_SETTINGS
|
||||
VPHELPER(VP_TOGGLE_PROBE_HEATERS_OFF_ONOFF_BUTTON, nullptr, ScreenHandler.HandleToggleProbeHeaters, nullptr),
|
||||
VPHELPER(VP_TOGGLE_PROBE_HEATERS_OFF_ONOFF_ICON, &probe.settings.turn_heaters_off, nullptr, (ScreenHandler.DGUSLCD_SendIconValue<ICON_TOGGLE_ON, ICON_TOGGLE_OFF>)),
|
||||
|
||||
VPHELPER(VP_TOGGLE_PROBE_PREHEAT_HOTEND_TEMP, &probe.settings.preheat_hotend_temp, ScreenHandler.HandleToggleProbePreheatTemp, ScreenHandler.DGUSLCD_SendWordValueToDisplay),
|
||||
VPHELPER(VP_TOGGLE_PROBE_PREHEAT_BED_TEMP, &probe.settings.preheat_bed_temp, ScreenHandler.HandleToggleProbePreheatTemp, ScreenHandler.DGUSLCD_SendWordValueToDisplay),
|
||||
|
||||
VPHELPER(VP_TOGGLE_PROBE_SETTINGS_NAV_BUTTON, nullptr, (ScreenHandler.DGUSLCD_NavigateToPage<DGUSLCD_SCREEN_LEVELING_SETTINGS>), nullptr),
|
||||
|
||||
#endif
|
||||
|
||||
// Feed
|
||||
VPHELPER(VP_FEED_AMOUNT, &ScreenHandler.feed_amount, ScreenHandler.HandleFeedAmountChanged, ScreenHandler.DGUSLCD_SendFloatAsIntValueToDisplay<1>),
|
||||
|
||||
// Creality has the same button ID mapped all over the place, so let the generic handler figure it out
|
||||
VPHELPER(VP_BUTTON_MAINENTERKEY, nullptr, DGUSCrealityDisplay_HandleReturnKeyEvent, nullptr),
|
||||
VPHELPER(VP_BUTTON_ADJUSTENTERKEY, nullptr, DGUSCrealityDisplay_HandleReturnKeyEvent, nullptr),
|
||||
VPHELPER(VP_BUTTON_PREPAREENTERKEY, nullptr, DGUSCrealityDisplay_HandleReturnKeyEvent, nullptr),
|
||||
VPHELPER(VP_BUTTON_RESUMEPRINTKEY, nullptr, DGUSCrealityDisplay_HandleReturnKeyEvent, nullptr),
|
||||
VPHELPER(VP_BUTTON_SELECTFILEKEY, nullptr, DGUSCrealityDisplay_HandleReturnKeyEvent, nullptr),
|
||||
VPHELPER(VP_BUTTON_STARTPRINTKEY, nullptr, DGUSCrealityDisplay_HandleReturnKeyEvent, nullptr),
|
||||
VPHELPER(VP_BUTTON_STOPPRINTKEY, nullptr, DGUSCrealityDisplay_HandleReturnKeyEvent, nullptr),
|
||||
VPHELPER(VP_BUTTON_PAUSEPRINTKEY, nullptr, DGUSCrealityDisplay_HandleReturnKeyEvent, nullptr),
|
||||
VPHELPER(VP_BUTTON_COOLDOWN, nullptr, DGUSCrealityDisplay_HandleReturnKeyEvent, nullptr),
|
||||
VPHELPER(VP_BUTTON_TEMPCONTROL, nullptr, DGUSCrealityDisplay_HandleReturnKeyEvent, nullptr),
|
||||
VPHELPER(VP_BUTTON_BEDLEVELKEY, nullptr, DGUSCrealityDisplay_HandleReturnKeyEvent, nullptr),
|
||||
VPHELPER(VP_BUTTON_HEATLOADSTARTKEY, nullptr, DGUSCrealityDisplay_HandleReturnKeyEvent, nullptr),
|
||||
VPHELPER(VP_BUTTON_MOVEKEY, nullptr, DGUSCrealityDisplay_HandleReturnKeyEvent, nullptr),
|
||||
|
||||
// File listing
|
||||
VPHELPER(VP_SD_ScrollEvent, nullptr, ScreenHandler.DGUSLCD_SD_ScrollFilelist, nullptr),
|
||||
VPHELPER(VP_SD_FileSelected, nullptr, ScreenHandler.DGUSLCD_SD_FileSelected, nullptr),
|
||||
VPHELPER(VP_SD_FileSelectConfirm, nullptr, ScreenHandler.DGUSLCD_SD_StartPrint, nullptr),
|
||||
VPHELPER_STR(VP_SD_FileName0, nullptr, VP_SD_FileName_LEN, nullptr, ScreenHandler.DGUSLCD_SD_SendFilename),
|
||||
VPHELPER_STR(VP_SD_FileName1, nullptr, VP_SD_FileName_LEN, nullptr, ScreenHandler.DGUSLCD_SD_SendFilename),
|
||||
VPHELPER_STR(VP_SD_FileName2, nullptr, VP_SD_FileName_LEN, nullptr, ScreenHandler.DGUSLCD_SD_SendFilename),
|
||||
VPHELPER_STR(VP_SD_FileName3, nullptr, VP_SD_FileName_LEN, nullptr, ScreenHandler.DGUSLCD_SD_SendFilename),
|
||||
VPHELPER_STR(VP_SD_FileName4, nullptr, VP_SD_FileName_LEN, nullptr, ScreenHandler.DGUSLCD_SD_SendFilename),
|
||||
VPHELPER_STR(VP_SD_FileName5, nullptr, VP_SD_FileName_LEN, nullptr, ScreenHandler.DGUSLCD_SD_SendFilename),
|
||||
|
||||
// Firmware retract
|
||||
VPHELPER(VP_FWRETRACT_NAV_BUTTON, nullptr, ScreenHandler.DGUSLCD_NavigateToPage<DGUSLCD_SCREEN_TUNEFWRETRACT>, nullptr),
|
||||
|
||||
VPHELPER(VP_FWRETRACT_RETRACT_LENGTH, &fwretract.settings.retract_length, ScreenHandler.DGUSLCD_SetFloatAsIntFromDisplay<1>, ScreenHandler.DGUSLCD_SendFloatAsIntValueToDisplay<1>),
|
||||
VPHELPER(VP_FWRETRACT_RETRACT_FEEDRATE, &fwretract.settings.retract_feedrate_mm_s, ScreenHandler.DGUSLCD_SetFloatAsIntFromDisplay<1>, ScreenHandler.DGUSLCD_SendFloatAsIntValueToDisplay<1>),
|
||||
VPHELPER(VP_FWRETRACT_RETRACT_ZHOP, &fwretract.settings.retract_zraise, ScreenHandler.DGUSLCD_SetFloatAsIntFromDisplay<1>, ScreenHandler.DGUSLCD_SendFloatAsIntValueToDisplay<1>),
|
||||
|
||||
VPHELPER(VP_FWRETRACT_RESTART_LENGTH, &fwretract.settings.retract_recover_extra, ScreenHandler.DGUSLCD_SetFloatAsIntFromDisplay<1>, ScreenHandler.DGUSLCD_SendFloatAsIntValueToDisplay<1>),
|
||||
VPHELPER(VP_FWRETRACT_RESTART_FEEDRATE, &fwretract.settings.retract_recover_feedrate_mm_s, ScreenHandler.DGUSLCD_SetFloatAsIntFromDisplay<1>, ScreenHandler.DGUSLCD_SendFloatAsIntValueToDisplay<1>),
|
||||
|
||||
VPHELPER(VP_FWRETRACT_INDICATOR_ICON, &fwretract.autoretract_enabled, nullptr, (ScreenHandler.DGUSLCD_SendIconValue<ICON_FWRETRACT_AUTO_ENGAGED, ICON_FWRETRACT_AUTO_DISENGAGED>)),
|
||||
VPHELPER(VP_FWRETRACT_TOGGLE_BUTTON_ICON, &fwretract.autoretract_enabled, nullptr, (ScreenHandler.DGUSLCD_SendIconValue<ICON_FWRETRACT_AUTO_TOGGLE_ON, ICON_FWRETRACT_AUTO_TOGGLE_OFF>)),
|
||||
VPHELPER(VP_FWRETRACT_TOGGLE_BUTTON, &fwretract.autoretract_enabled, ScreenHandler.DGUSLCD_ToggleBoolean, nullptr),
|
||||
|
||||
#if ENABLED(LIN_ADVANCE)
|
||||
VPHELPER(VP_LINEAR_ADVANCE_FACTOR, &planner.extruder_advance_K[0], ScreenHandler.DGUSLCD_SetFloatAsIntFromDisplay<2>, ScreenHandler.DGUSLCD_SendFloatAsIntValueToDisplay<2>),
|
||||
#endif
|
||||
|
||||
|
||||
// Additional buttons
|
||||
VPHELPER(VP_MUTE_TOGGLE, nullptr, ScreenHandler.HandleToggleTouchScreenMute, nullptr),
|
||||
VPHELPER(VP_STANDBY_BACKLIGHT_TOGGLE, nullptr, ScreenHandler.HandleToggleTouchScreenStandbySetting, nullptr),
|
||||
|
||||
// Additional settings
|
||||
VPHELPER(VP_SCREEN_BACKLIGHT_STANDBY, &ScreenHandler.Settings.standby_screen_brightness, ScreenHandler.HandleTouchScreenStandbyBrightnessSetting, ScreenHandler.DGUSLCD_SendWordValueToDisplay),
|
||||
|
||||
// Icons
|
||||
VPHELPER(VP_LED_TOGGLE, &caselight.on, nullptr, (ScreenHandler.DGUSLCD_SendIconValue<ICON_LED_TOGGLE_ON, ICON_LED_TOGGLE_OFF>)),
|
||||
VPHELPER(VP_STANDBY_BACKLIGHT_ICON, &ScreenHandler.Settings.display_standby, nullptr, (ScreenHandler.DGUSLCD_SendIconValue<ICON_STANDBY_TOGGLE_ON, ICON_STANDBY_TOGGLE_OFF>)),
|
||||
VPHELPER(VP_MUTE_ICON, &ScreenHandler.Settings.display_sound, nullptr, (ScreenHandler.DGUSLCD_SendIconValue<ICON_SOUND_TOGGLE_ON, ICON_SOUND_TOGGLE_OFF>)),
|
||||
|
||||
// M117 LCD String (We don't need the string in memory but "just" push it to the display on demand, hence the nullptr
|
||||
{ .VP = VP_M117, .memadr = nullptr, .size = VP_M117_LEN, .set_by_display_handler = nullptr, .send_to_display_handler =&ScreenHandler.DGUSLCD_SendStringToDisplay },
|
||||
|
||||
// Messages for the User, shared by the popup and the kill screen. They cant be autouploaded as we do not buffer content.
|
||||
{ .VP = VP_MSGSTR1, .memadr = nullptr, .size = VP_MSGSTR1_LEN, .set_by_display_handler = nullptr, .send_to_display_handler = &ScreenHandler.DGUSLCD_SendStringToDisplayPGM },
|
||||
{ .VP = VP_MSGSTR2, .memadr = nullptr, .size = VP_MSGSTR2_LEN, .set_by_display_handler = nullptr, .send_to_display_handler = &ScreenHandler.DGUSLCD_SendStringToDisplayPGM },
|
||||
{ .VP = VP_MSGSTR3, .memadr = nullptr, .size = VP_MSGSTR3_LEN, .set_by_display_handler = nullptr, .send_to_display_handler = &ScreenHandler.DGUSLCD_SendStringToDisplayPGM },
|
||||
//{ .VP = VP_MSGSTR4, .memadr = nullptr, .size = VP_MSGSTR4_LEN, .set_by_display_handler = nullptr, .send_to_display_handler = &ScreenHandler.DGUSLCD_SendStringToDisplayPGM },
|
||||
|
||||
VPHELPER(0, 0, 0, 0) // must be last entry.
|
||||
};
|
||||
|
||||
#endif // DGUS_LCD_UI_ORIGIN
|
||||
@@ -0,0 +1,437 @@
|
||||
/**
|
||||
* 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/>.
|
||||
*
|
||||
*/
|
||||
#pragma once
|
||||
|
||||
enum DGUSLCD_Screens : uint8_t {
|
||||
DGUSLCD_SCREEN_BOOT = 0,
|
||||
|
||||
DGUSLCD_SCREEN_MAIN = 28,
|
||||
|
||||
DGUSLCD_SCREEN_CONFIRM = 66,
|
||||
DGUSLCD_SCREEN_SDPRINTMANIPULATION = 37 ,
|
||||
DGUSLCD_SCREEN_SDPRINTTUNE = 41,
|
||||
DGUSLCD_SCREEN_SDFILELIST = 67,
|
||||
|
||||
DGUSLCD_SCREEN_FILAMENTRUNOUT1 = 34, // DWINTouchPage::ERR_FILAMENTRUNOUT_HOTEND_COLD
|
||||
DGUSLCD_SCREEN_FILAMENTRUNOUT2 = 35, // DWINTouchPage::ERR_FILAMENTRUNOUT_FILAMENT_LOADED
|
||||
|
||||
DGUSLCD_SCREEN_PRINT_FINISH = 36, // DWINTouchPage::PRINT_FINISHED
|
||||
DGUSLCD_SCREEN_PRINT_RUNNING = 37, // DWINTouchPage::PRINT_PROGRESS_RUNNING
|
||||
DGUSLCD_SCREEN_PRINT_PAUSED = 39, // DWINTouchPage::PRINT_PROGRESS_PAUSED
|
||||
|
||||
DGUSLCD_SCREEN_DIALOG_PAUSE = 38, // DWINTouchPage::DIALOG_PAUSE_PRINTING
|
||||
DGUSLCD_SCREEN_DIALOG_STOP = 40, // DWINTouchPage::DIALOG_STOP_PRINTING
|
||||
|
||||
DGUSLCD_SCREEN_TUNING = 41, // DWINTouchPage::MENU_TUNING
|
||||
DGUSLCD_SCREEN_PREPARE = 42, // DWINTouchPage::MENU_PREPARE
|
||||
|
||||
DGUSLCD_SCREEN_MOVE10MM = 43, // DWINTouchPage::MOVE_1MM
|
||||
DGUSLCD_SCREEN_MOVE1MM = 44, // DWINTouchPage::MOVE_10MM
|
||||
DGUSLCD_SCREEN_MOVE01MM = 45, // DWINTouchPage::MOVE_01MM
|
||||
|
||||
DGUSLCD_SCREEN_FEED = 46, // DWINTouchPage::FEED
|
||||
DGUSLCD_SCREEN_CONTROL = 47, // DWINTouchPage::MENU_CONTROL
|
||||
|
||||
DGUSLCD_SCREEN_TEMP = 48, // DWINTouchPage::MENU_TEMP
|
||||
DGUSLCD_SCREEN_TEMP_PLA = 49, // DWINTouchPage::MENU_PLA_TEMP
|
||||
DGUSLCD_SCREEN_TEMP_ABS = 50, // DWINTouchPage::MENU_ABS_TEMP
|
||||
|
||||
DGUSLCD_SCREEN_INFO = 51, // DWINTouchPage::MENU_ABOUT
|
||||
|
||||
DGUSLCD_SCREEN_ZOFFSET_LEVEL = 52, // DWINTouchPage::MENU_ZOFFSET_LEVELING
|
||||
DGUSLCD_SCREEN_LEVELING = 53, // DWINTouchPage::LEVELING
|
||||
|
||||
DGUSLCD_SCREEN_POWER_LOSS = 54, // DWINTouchPage::DIALOG_POWER_FAILURE
|
||||
DGUSLCD_SCREEN_THERMAL_RUNAWAY = 57, // DWINTouchPage::ERR_THERMAL_RUNAWAY
|
||||
DGUSLCD_SCREEN_HEATING_FAILED = 58, // DWINTouchPage::ERR_HEATING_FAILED
|
||||
DGUSLCD_SCREEN_THERMISTOR_ERROR = 59, // DWINTouchPage::ERR_THERMISTOR
|
||||
|
||||
DGUSLCD_SCREEN_AUTOHOME = 61, // DWINTouchPage::AUTOHOME_IN_PROGRESS
|
||||
|
||||
DGUSLCD_SCREEN_POPUP = 63, // NEW - does not exist in original display
|
||||
DGUSLCD_SCREEN_KILL = 64, // NEW - does not exist in original display
|
||||
|
||||
DGUSLCD_SCREEN_PIDTUNE_CALIBRATION = 68,
|
||||
DGUSLCD_SCREEN_ESTEPS_CALIBRATION = 69,
|
||||
|
||||
DGUSLCD_SCREEN_TUNEFWRETRACT = 70,
|
||||
|
||||
DGUSLCD_SCREEN_ESTEPS_CALIBRATION_RESULTS = 71,
|
||||
DGUSLCD_SCREEN_LEVELING_SETTINGS = 72
|
||||
};
|
||||
|
||||
// Display Memory layout used (T5UID)
|
||||
// Except system variables this is arbitrary, just to organize stuff....
|
||||
|
||||
// 0x0000 .. 0x0FFF -- System variables and reserved by the display
|
||||
// 0x1000 .. 0x1FFF -- Variables to never change location, regardless of UI Version
|
||||
// 0x2000 .. 0x2FFF -- Controls (VPs that will trigger some action)
|
||||
// 0x3000 .. 0x4FFF -- Marlin Data to be displayed
|
||||
// 0x5000 .. -- SPs (if we want to modify display elements, e.g change color or like) -- currently unused
|
||||
|
||||
// As there is plenty of space (at least most displays have >8k RAM), we do not pack them too tight,
|
||||
// so that we can keep variables nicely together in the address space.
|
||||
|
||||
// UI Version always on 0x1000...0x1002 so that the firmware can check this and bail out.
|
||||
// constexpr uint16_t VP_UI_VERSION_MAJOR = 0x1000; // Major -- incremented when incompatible
|
||||
// constexpr uint16_t VP_UI_VERSION_MINOR = 0x1001; // Minor -- incremented on new features, but compatible
|
||||
// constexpr uint16_t VP_UI_VERSION_PATCH = 0x1002; // Patch -- fixed which do not change functionality.
|
||||
// constexpr uint16_t VP_UI_FLAVOUR = 0x1010; // lets reserve 16 bytes here to determine if UI is suitable for this Marlin. tbd.
|
||||
|
||||
#define VP_STARTPROGRESSBAR 0x1000
|
||||
|
||||
// // Storage space for the Killscreen messages. Reused for the popup.
|
||||
constexpr uint16_t VP_MSGSTR1 = 0x2010;
|
||||
constexpr uint8_t VP_MSGSTR1_LEN = 0x20; // might be more place for it...
|
||||
constexpr uint16_t VP_MSGSTR2 = 0x2030;
|
||||
constexpr uint8_t VP_MSGSTR2_LEN = 0x40;
|
||||
constexpr uint16_t VP_MSGSTR3 = 0x2070;
|
||||
constexpr uint8_t VP_MSGSTR3_LEN = 0x40;
|
||||
constexpr uint16_t VP_MSGSTR4 = 0x2080;
|
||||
constexpr uint8_t VP_MSGSTR4_LEN = 0x20;
|
||||
|
||||
// // Screenchange request for screens that only make sense when printer is idle.
|
||||
// // e.g movement is only allowed if printer is not printing.
|
||||
// // Marlin must confirm by setting the screen manually.
|
||||
// constexpr uint16_t VP_SCREENCHANGE_ASK = 0x2000;
|
||||
constexpr uint16_t VP_SCREENCHANGE = 0x219f; // Key-Return button to new menu pressed. Data contains target screen in low byte and info in high byte.
|
||||
// constexpr uint16_t VP_TEMP_ALL_OFF = 0x2002; // Turn all heaters off. Value arbitrary ;)=
|
||||
// constexpr uint16_t VP_SCREENCHANGE_WHENSD = 0x2003; // "Print" Button touched -- go only there if there is an SD Card.
|
||||
|
||||
constexpr uint16_t VP_CONFIRMED = 0x219E; // OK on confirm screen.
|
||||
|
||||
// // Buttons on the SD-Card File listing.
|
||||
// constexpr uint16_t VP_SD_ScrollEvent = 0x2020; // Data: 0 for "up a directory", numbers are the amount to scroll, e.g -1 one up, 1 one down
|
||||
// constexpr uint16_t VP_SD_FileSelected = 0x2022; // Number of file field selected.
|
||||
constexpr uint16_t VP_SD_FileSelectConfirm = 0x2024; // (This is a virtual VP and emulated by the Confirm Screen when a file has been confirmed)
|
||||
|
||||
// constexpr uint16_t VP_SD_ResumePauseAbort = 0x2026; // Resume(Data=0), Pause(Data=1), Abort(Data=2) SD Card prints
|
||||
constexpr uint16_t VP_SD_AbortPrintConfirmed = 0x2028; // Abort print confirmation (virtual, will be injected by the confirm dialog)
|
||||
// constexpr uint16_t VP_SD_Print_Setting = 0x2040;
|
||||
// constexpr uint16_t VP_SD_Print_LiveAdjustZ = 0x2050; // Data: 0 down, 1 up
|
||||
|
||||
// // Controls for movement (we can't use the incremental / decremental feature of the display at this feature works only with 16 bit values
|
||||
// // (which would limit us to 655.35mm, which is likely not a problem for common setups, but i don't want to rule out hangprinters support)
|
||||
// // A word about the coding: The VP will be per axis and the return code will be an signed 16 bit value in 0.01 mm resolution, telling us
|
||||
// // the relative travel amount t he user wants to do. So eg. if the display sends us VP=2100 with value 100, the user wants us to move X by +1 mm.
|
||||
constexpr uint16_t VP_MOVE_X = 0x2100;
|
||||
constexpr uint16_t VP_MOVE_Y = 0x2102;
|
||||
constexpr uint16_t VP_MOVE_Z = 0x2104;
|
||||
constexpr uint16_t VP_MOVE_E0 = 0x2110;
|
||||
// constexpr uint16_t VP_MOVE_E1 = 0x2112;
|
||||
// //constexpr uint16_t VP_MOVE_E2 = 0x2114;
|
||||
// //constexpr uint16_t VP_MOVE_E3 = 0x2116;
|
||||
// //constexpr uint16_t VP_MOVE_E4 = 0x2118;
|
||||
// //constexpr uint16_t VP_MOVE_E5 = 0x211A;
|
||||
constexpr uint16_t VP_HOME_ALL = 0x2120;
|
||||
// constexpr uint16_t VP_MOTOR_LOCK_UNLOK = 0x2130;
|
||||
|
||||
// // Power loss recovery
|
||||
// constexpr uint16_t VP_POWER_LOSS_RECOVERY = 0x2180;
|
||||
|
||||
// // Fan Control Buttons , switch between "off" and "on"
|
||||
// constexpr uint16_t VP_FAN0_CONTROL = 0x2200;
|
||||
// constexpr uint16_t VP_FAN1_CONTROL = 0x2202;
|
||||
// //constexpr uint16_t VP_FAN2_CONTROL = 0x2204;
|
||||
// //constexpr uint16_t VP_FAN3_CONTROL = 0x2206;
|
||||
|
||||
// // Heater Control Buttons , triged between "cool down" and "heat PLA" state
|
||||
constexpr uint16_t VP_E0_CONTROL = 0x2210;
|
||||
// constexpr uint16_t VP_E1_CONTROL = 0x2212;
|
||||
// //constexpr uint16_t VP_E2_CONTROL = 0x2214;
|
||||
// //constexpr uint16_t VP_E3_CONTROL = 0x2216;
|
||||
// //constexpr uint16_t VP_E4_CONTROL = 0x2218;
|
||||
// //constexpr uint16_t VP_E5_CONTROL = 0x221A;
|
||||
constexpr uint16_t VP_BED_CONTROL = 0x221C;
|
||||
|
||||
// // Preheat
|
||||
// constexpr uint16_t VP_E0_BED_PREHEAT = 0x2220;
|
||||
// constexpr uint16_t VP_E1_BED_CONTROL = 0x2222;
|
||||
// //constexpr uint16_t VP_E2_BED_CONTROL = 0x2224;
|
||||
// //constexpr uint16_t VP_E3_BED_CONTROL = 0x2226;
|
||||
// //constexpr uint16_t VP_E4_BED_CONTROL = 0x2228;
|
||||
// //constexpr uint16_t VP_E5_BED_CONTROL = 0x222A;
|
||||
|
||||
// // Filament load and unload
|
||||
// constexpr uint16_t VP_E0_FILAMENT_LOAD_UNLOAD = 0x2300;
|
||||
// constexpr uint16_t VP_E1_FILAMENT_LOAD_UNLOAD = 0x2302;
|
||||
|
||||
// // Settings store , reset
|
||||
// constexpr uint16_t VP_SETTINGS = 0x2400;
|
||||
|
||||
// // PID autotune
|
||||
constexpr uint16_t VP_PID_AUTOTUNE_E0 = 0x2410;
|
||||
// //constexpr uint16_t VP_PID_AUTOTUNE_E1 = 0x2412;
|
||||
// //constexpr uint16_t VP_PID_AUTOTUNE_E2 = 0x2414;
|
||||
// //constexpr uint16_t VP_PID_AUTOTUNE_E3 = 0x2416;
|
||||
// //constexpr uint16_t VP_PID_AUTOTUNE_E4 = 0x2418;
|
||||
// //constexpr uint16_t VP_PID_AUTOTUNE_E5 = 0x241A;
|
||||
constexpr uint16_t VP_PID_AUTOTUNE_BED = 0x2420;
|
||||
|
||||
// // Firmware version on the boot screen.
|
||||
constexpr uint16_t VP_PRINTER_BEDSIZE = 0x1074;
|
||||
constexpr uint16_t VP_PRINTER_BEDSIZE_LEN = 12;
|
||||
constexpr uint16_t VP_MARLIN_VERSION = 0x2222;
|
||||
constexpr uint8_t VP_MARLIN_VERSION_LEN = 20; // there is more space on the display, if needed.
|
||||
|
||||
constexpr uint16_t VP_MARLIN_WEBSITE = 0x2242;
|
||||
constexpr uint8_t VP_MARLIN_WEBSITE_LEN = 32;
|
||||
|
||||
constexpr uint16_t VP_STANDBY_BACKLIGHT_ICON = 0x2280;
|
||||
constexpr uint16_t VP_STANDBY_BACKLIGHT_TOGGLE = 0x2282;
|
||||
|
||||
constexpr uint16_t VP_MUTE_ICON = 0x2284;
|
||||
constexpr uint16_t VP_MUTE_TOGGLE = 0x2286;
|
||||
|
||||
constexpr uint16_t VP_SCREEN_BACKLIGHT_STANDBY = 0x228D;
|
||||
|
||||
|
||||
// Material preheat settings
|
||||
constexpr uint16_t VP_PREHEAT_PLA_HOTEND_TEMP = 0x1102;
|
||||
constexpr uint16_t VP_PREHEAT_PLA_BED_TEMP = 0x1104;
|
||||
|
||||
constexpr uint16_t VP_PREHEAT_ABS_HOTEND_TEMP = 0x1108;
|
||||
constexpr uint16_t VP_PREHEAT_ABS_BED_TEMP = 0x110a;
|
||||
|
||||
// // Place for status messages.
|
||||
constexpr uint16_t VP_M117 = 0x21B3;
|
||||
constexpr uint8_t VP_M117_LEN = 40;
|
||||
|
||||
// // Temperatures.
|
||||
constexpr uint16_t VP_T_E0_Is = 0x1036; // 4 Byte Integer - HEAD_CURRENT_TEMP_VP
|
||||
constexpr uint16_t VP_T_E0_Set = 0x1034; // 2 Byte Integer - HEAD_SET_TEMP_VP
|
||||
// constexpr uint16_t VP_T_E1_Is = 0x3064; // 4 Byte Integer
|
||||
|
||||
// // reserved to support up to 6 Extruders:
|
||||
// //constexpr uint16_t VP_T_E1_Set = 0x3066; // 2 Byte Integer
|
||||
// //constexpr uint16_t VP_T_E2_Is = 0x3068; // 4 Byte Integer
|
||||
// //constexpr uint16_t VP_T_E2_Set = 0x306A; // 2 Byte Integer
|
||||
// //constexpr uint16_t VP_T_E3_Is = 0x306C; // 4 Byte Integer
|
||||
// //constexpr uint16_t VP_T_E3_Set = 0x306E; // 2 Byte Integer
|
||||
// //constexpr uint16_t VP_T_E4_Is = 0x3070; // 4 Byte Integer
|
||||
// //constexpr uint16_t VP_T_E4_Set = 0x3072; // 2 Byte Integer
|
||||
// //constexpr uint16_t VP_T_E4_Is = 0x3074; // 4 Byte Integer
|
||||
// //constexpr uint16_t VP_T_E4_Set = 0x3076; // 2 Byte Integer
|
||||
// //constexpr uint16_t VP_T_E5_Is = 0x3078; // 4 Byte Integer
|
||||
// //constexpr uint16_t VP_T_E5_Set = 0x307A; // 2 Byte Integer
|
||||
|
||||
constexpr uint16_t VP_T_Bed_Is = 0x103c; // 4 Byte Integer - BED_SET_TEMP_VP
|
||||
constexpr uint16_t VP_T_Bed_Set = 0x103A; // 2 Byte Integer - BED_CURRENT_TEMP_VP
|
||||
|
||||
constexpr uint16_t VP_Flowrate_E0 = 0x228A; // 2 Byte Integer
|
||||
|
||||
constexpr uint16_t VP_Fan0_Percentage = 0x228F; // 2 Byte Integer (0..100)
|
||||
// constexpr uint16_t VP_Fan1_Percentage = 0x33A2; // 2 Byte Integer (0..100)
|
||||
// //constexpr uint16_t VP_Fan2_Percentage = 0x33A4; // 2 Byte Integer (0..100)
|
||||
// //constexpr uint16_t VP_Fan3_Percentage = 0x33A6; // 2 Byte Integer (0..100)
|
||||
|
||||
constexpr uint16_t VP_Feedrate_Percentage = 0x1006; // 2 Byte Integer (0..100) - PRINT_SPEED_RATE_VP
|
||||
constexpr uint16_t VP_PrintProgress_Percentage = 0x1016; // 2 Byte Integer (0..100)
|
||||
|
||||
constexpr uint16_t VP_PrintTimeProgressBar = 0x100E;
|
||||
|
||||
constexpr uint16_t VP_PrintTime = 0x21a0;
|
||||
constexpr uint16_t VP_PrintTime_LEN = 6;
|
||||
|
||||
// constexpr uint16_t VP_PrintAccTime = 0x3160;
|
||||
// constexpr uint16_t VP_PrintAccTime_LEN = 32;
|
||||
|
||||
// constexpr uint16_t VP_PrintsTotal = 0x3180;
|
||||
// constexpr uint16_t VP_PrintsTotal_LEN = 16;
|
||||
|
||||
constexpr uint16_t VP_Z_OFFSET = 0x1026;
|
||||
|
||||
// // SDCard File Listing
|
||||
constexpr uint16_t VP_SD_ScrollEvent = 0x20D4; // Data: 0 for "up a directory", numbers are the amount to scroll, e.g -1 one up, 1 one down
|
||||
constexpr uint16_t VP_SD_FileSelected = 0x2200; // Number of file field selected.
|
||||
constexpr uint16_t VP_SD_FileName_LEN = 21; // LEN is shared for all entries.
|
||||
constexpr uint16_t VP_SD_FileName_CNT = 5; // LEN is shared for all entries.
|
||||
constexpr uint16_t DGUS_SD_FILESPERSCREEN = VP_SD_FileName_CNT; // FIXME move that info to the display and read it from there.
|
||||
constexpr uint16_t VP_SD_FileName0 = 0x20D5;
|
||||
constexpr uint16_t VP_SD_FileName1 = VP_SD_FileName0 + VP_SD_FileName_LEN;
|
||||
constexpr uint16_t VP_SD_FileName2 = VP_SD_FileName1 + VP_SD_FileName_LEN;
|
||||
constexpr uint16_t VP_SD_FileName3 = VP_SD_FileName2 + VP_SD_FileName_LEN;
|
||||
constexpr uint16_t VP_SD_FileName4 = VP_SD_FileName3 + VP_SD_FileName_LEN;
|
||||
constexpr uint16_t VP_SD_FileName5 = VP_SD_FileName4 + VP_SD_FileName_LEN;
|
||||
|
||||
constexpr uint16_t VP_SD_Print_ProbeOffsetZ = 0x32A0; //
|
||||
constexpr uint16_t VP_SD_Print_Filename = 0x2000; //
|
||||
|
||||
constexpr uint16_t VP_ICON_OVERLAY_CLEAR = 10;
|
||||
constexpr uint16_t VP_ICON_OVERLAY_SELECTED = 6;
|
||||
|
||||
// // Fan status
|
||||
// constexpr uint16_t VP_FAN0_STATUS = 0x3300;
|
||||
// constexpr uint16_t VP_FAN1_STATUS = 0x3302;
|
||||
// //constexpr uint16_t VP_FAN2_STATUS = 0x3304;
|
||||
// //constexpr uint16_t VP_FAN3_STATUS = 0x3306;
|
||||
|
||||
// // Heater status
|
||||
// constexpr uint16_t VP_E0_STATUS = 0x3310;
|
||||
// //constexpr uint16_t VP_E1_STATUS = 0x3312;
|
||||
// //constexpr uint16_t VP_E2_STATUS = 0x3314;
|
||||
// //constexpr uint16_t VP_E3_STATUS = 0x3316;
|
||||
// //constexpr uint16_t VP_E4_STATUS = 0x3318;
|
||||
// //constexpr uint16_t VP_E5_STATUS = 0x331A;
|
||||
// constexpr uint16_t VP_BED_STATUS = 0x331C;
|
||||
|
||||
// constexpr uint16_t VP_MOVE_OPTION = 0x3400;
|
||||
|
||||
// // Step per mm
|
||||
constexpr uint16_t VP_X_STEP_PER_MM = 0x3600; // at the moment , 2 byte unsigned int , 0~1638.4
|
||||
// //constexpr uint16_t VP_X2_STEP_PER_MM = 0x3602;
|
||||
constexpr uint16_t VP_Y_STEP_PER_MM = 0x3604;
|
||||
// //constexpr uint16_t VP_Y2_STEP_PER_MM = 0x3606;
|
||||
constexpr uint16_t VP_Z_STEP_PER_MM = 0x3608;
|
||||
// //constexpr uint16_t VP_Z2_STEP_PER_MM = 0x360A;
|
||||
constexpr uint16_t VP_E0_STEP_PER_MM = 0x3610;
|
||||
// //constexpr uint16_t VP_E1_STEP_PER_MM = 0x3612;
|
||||
// //constexpr uint16_t VP_E2_STEP_PER_MM = 0x3614;
|
||||
// //constexpr uint16_t VP_E3_STEP_PER_MM = 0x3616;
|
||||
// //constexpr uint16_t VP_E4_STEP_PER_MM = 0x3618;
|
||||
// //constexpr uint16_t VP_E5_STEP_PER_MM = 0x361A;
|
||||
|
||||
// // PIDs
|
||||
constexpr uint16_t VP_E0_PID_P = 0x3700; // at the moment , 2 byte unsigned int , 0~1638.4
|
||||
constexpr uint16_t VP_E0_PID_I = 0x3702;
|
||||
constexpr uint16_t VP_E0_PID_D = 0x3704;
|
||||
constexpr uint16_t VP_BED_PID_P = 0x3710;
|
||||
constexpr uint16_t VP_BED_PID_I = 0x3712;
|
||||
constexpr uint16_t VP_BED_PID_D = 0x3714;
|
||||
|
||||
// // Wating screen status
|
||||
// constexpr uint16_t VP_WAITING_STATUS = 0x3800;
|
||||
|
||||
// // SPs for certain variables...
|
||||
|
||||
// // located at 0x5000 and up
|
||||
// // Not used yet!
|
||||
// // This can be used e.g to make controls / data display invisible
|
||||
// constexpr uint16_t SP_T_E0_Is = 0x5000;
|
||||
// constexpr uint16_t SP_T_E0_Set = 0x5010;
|
||||
// constexpr uint16_t SP_T_E1_Is = 0x5020;
|
||||
// constexpr uint16_t SP_T_Bed_Is = 0x5030;
|
||||
// constexpr uint16_t SP_T_Bed_Set = 0x5040;
|
||||
|
||||
// Power loss recovery
|
||||
constexpr uint16_t VP_POWER_LOSS_RECOVERY = 0x105F;
|
||||
|
||||
// Buttons defined by Creality - Don't worry if you're confused by the naming, so am I
|
||||
constexpr uint16_t VP_BUTTON_MAINENTERKEY = 0x1002;
|
||||
constexpr uint16_t VP_BUTTON_ADJUSTENTERKEY = 0x1004;
|
||||
constexpr uint16_t VP_BUTTON_PAUSEPRINTKEY = 0x100A;
|
||||
constexpr uint16_t VP_BUTTON_TEMPCONTROL = 0x1030;
|
||||
constexpr uint16_t VP_BUTTON_COOLDOWN = 0x1032;
|
||||
constexpr uint16_t VP_BUTTON_PREPAREENTERKEY = 0x103E;
|
||||
|
||||
constexpr uint16_t VP_BUTTON_SELECTFILEKEY = 0x20D3;
|
||||
constexpr uint16_t VP_BUTTON_STARTPRINTKEY = 0x20D2;
|
||||
constexpr uint16_t VP_BUTTON_STOPPRINTKEY = 0x1008;
|
||||
constexpr uint16_t VP_BUTTON_RESUMEPRINTKEY = 0x100C;
|
||||
constexpr uint16_t VP_BUTTON_BEDLEVELKEY = 0x1044;
|
||||
|
||||
constexpr uint16_t VP_BUTTON_HEATLOADSTARTKEY = 0x1056;
|
||||
|
||||
// Additional stuff defined by Creality
|
||||
constexpr uint16_t VP_FAN_TOGGLE = 0x101E;
|
||||
constexpr uint16_t VP_LED_TOGGLE = 0x101F;
|
||||
constexpr uint16_t VP_MESH_LEVEL_TEMP = 0x108A;
|
||||
constexpr uint16_t VP_MESH_LEVEL_STATUS = 0x108D;
|
||||
constexpr uint16_t VP_FEED_AMOUNT = 0x1054;
|
||||
constexpr uint16_t VP_FEED_PROGRESS = 0x108e;
|
||||
|
||||
// Movement screen
|
||||
constexpr uint16_t VP_X_POSITION = 0x1048;
|
||||
constexpr uint16_t SP_X_POSITION = 0x4000;
|
||||
constexpr uint16_t VP_Y_POSITION = 0x104A;
|
||||
constexpr uint16_t SP_Y_POSITION = 0x4030;
|
||||
constexpr uint16_t VP_Z_POSITION = 0x104C;
|
||||
constexpr uint16_t SP_Z_POSITION = 0x4060;
|
||||
constexpr uint16_t VP_BUTTON_MOVEKEY = 0x1046;
|
||||
|
||||
// Buttons
|
||||
constexpr uint16_t VP_ESTEP_NAV_BUTTON = 0x2291;
|
||||
constexpr uint16_t VP_PIDTUNE_NAV_BUTTON = 0x2293;
|
||||
constexpr uint16_t VP_GENERIC_BACK_BUTTON = 0x2295; // Generic button for popping back to the old display
|
||||
|
||||
// PID tuning
|
||||
constexpr uint16_t VP_PIDTUNE_TARGET_TEMP = 0x2297;
|
||||
constexpr uint16_t VP_PIDTUNE_CYCLES = 0x2299;
|
||||
constexpr uint16_t VP_PIDTUNE_START_BUTTON = 0x229B;
|
||||
|
||||
// FWRetract
|
||||
constexpr uint16_t VP_FWRETRACT_NAV_BUTTON = 0x22AD;
|
||||
|
||||
constexpr uint16_t VP_FWRETRACT_RETRACT_LENGTH = 0x22B1;
|
||||
constexpr uint16_t VP_FWRETRACT_RETRACT_FEEDRATE = 0x22B3;
|
||||
constexpr uint16_t VP_FWRETRACT_RETRACT_ZHOP = 0x22B5;
|
||||
|
||||
constexpr uint16_t VP_FWRETRACT_RESTART_LENGTH = 0x22B7;
|
||||
constexpr uint16_t VP_FWRETRACT_RESTART_FEEDRATE = 0x22B9;
|
||||
|
||||
constexpr uint16_t VP_FWRETRACT_TOGGLE_BUTTON = 0x22BB;
|
||||
constexpr uint16_t VP_FWRETRACT_TOGGLE_BUTTON_ICON = 0x22BD;
|
||||
constexpr uint16_t VP_FWRETRACT_INDICATOR_ICON = 0x22BF;
|
||||
|
||||
// Other tuning
|
||||
constexpr uint16_t VP_LINEAR_ADVANCE_FACTOR = 0x22AF;
|
||||
|
||||
// Leveling settings
|
||||
constexpr uint16_t VP_TOGGLE_PROBE_HEATERS_OFF_ONOFF_BUTTON = 0x22C1;
|
||||
constexpr uint16_t VP_TOGGLE_PROBE_HEATERS_OFF_ONOFF_ICON = 0x22C3;
|
||||
|
||||
constexpr uint16_t VP_TOGGLE_PROBE_PREHEAT_HOTEND_TEMP = 0x22C5;
|
||||
constexpr uint16_t VP_TOGGLE_PROBE_PREHEAT_BED_TEMP = 0x22C7;
|
||||
|
||||
constexpr uint16_t VP_TOGGLE_PROBE_SETTINGS_NAV_BUTTON = 0x22C9;
|
||||
|
||||
constexpr uint16_t VP_MESH_VALUE_START = 0x1300;
|
||||
|
||||
// E-steps calibration
|
||||
constexpr uint16_t VP_ESTEPS_CURRENT = 0x229d;
|
||||
constexpr uint16_t VP_ESTEPS_CALIBRATION_TEMP = 0x229f;
|
||||
constexpr uint16_t VP_ESTEPS_CALIBRATION_LENGTH = 0x22a1;
|
||||
constexpr uint16_t VP_ESTEPS_CALIBRATION_MARK_LENGTH = 0x22ab;
|
||||
constexpr uint16_t VP_ESTEPS_CALIBRATION_LEFTOVER_LENGTH = 0x22a3;
|
||||
constexpr uint16_t VP_ESTEPS_CALCULATED_ESTEPS = 0x22a5;
|
||||
constexpr uint16_t VP_ESTEPS_CALIBRATESTART_BUTTON = 0x22a7;
|
||||
constexpr uint16_t VP_ESTEPS_APPLY_BUTTON = 0x22a9;
|
||||
|
||||
// Icons
|
||||
constexpr uint16_t ICON_TOGGLE_ON = 1;
|
||||
constexpr uint16_t ICON_TOGGLE_OFF = 2;
|
||||
|
||||
// Toggles
|
||||
constexpr uint16_t ICON_FAN_TOGGLE_ON = 1;
|
||||
constexpr uint16_t ICON_FAN_TOGGLE_OFF = 2;
|
||||
constexpr uint16_t ICON_LED_TOGGLE_ON = 3;
|
||||
constexpr uint16_t ICON_LED_TOGGLE_OFF = 4;
|
||||
constexpr uint16_t ICON_SOUND_TOGGLE_ON = 5;
|
||||
constexpr uint16_t ICON_SOUND_TOGGLE_OFF = 6;
|
||||
constexpr uint16_t ICON_STANDBY_TOGGLE_ON = 7;
|
||||
constexpr uint16_t ICON_STANDBY_TOGGLE_OFF = 8;
|
||||
|
||||
constexpr uint16_t ICON_FWRETRACT_AUTO_TOGGLE_ON = 9;
|
||||
constexpr uint16_t ICON_FWRETRACT_AUTO_TOGGLE_OFF = 10;
|
||||
|
||||
constexpr uint16_t ICON_FWRETRACT_AUTO_DISENGAGED = 4; // This icon deliberately does not exist
|
||||
constexpr uint16_t ICON_FWRETRACT_AUTO_ENGAGED = 3;
|
||||
@@ -0,0 +1,163 @@
|
||||
|
||||
#include "../../../../../inc/MarlinConfigPre.h"
|
||||
|
||||
#if ENABLED(DGUS_LCD_UI_CREALITY_TOUCH)
|
||||
|
||||
#include "../DGUSDisplayDef.h"
|
||||
#include "../DGUSDisplay.h"
|
||||
#include "../DGUSScreenHandler.h"
|
||||
|
||||
#include "EstepsHandler.h"
|
||||
|
||||
#include "../../../ui_api.h"
|
||||
#include "../../../../marlinui.h"
|
||||
|
||||
#include "../../../../../module/temperature.h"
|
||||
#include "../../../../../module/settings.h"
|
||||
#include "../../../../../module/planner.h"
|
||||
#include "../../../../../gcode/gcode.h"
|
||||
|
||||
// Storage init
|
||||
float EstepsHandler::set_esteps = 0;
|
||||
float EstepsHandler::calculated_esteps = 0;
|
||||
float EstepsHandler::remaining_filament = 0;
|
||||
float EstepsHandler::mark_filament_mm = 0;
|
||||
float EstepsHandler::filament_to_extrude = 0;
|
||||
uint16_t EstepsHandler::calibration_temperature = 0;
|
||||
|
||||
void EstepsHandler::Init() {
|
||||
// Use steps
|
||||
set_esteps = ExtUI::getAxisSteps_per_mm(ExtUI::E0);
|
||||
calculated_esteps = 0;
|
||||
|
||||
// Reset
|
||||
filament_to_extrude = 100;
|
||||
mark_filament_mm = 120;
|
||||
remaining_filament = 0;
|
||||
|
||||
// Use configured PLA temps + 10 degrees
|
||||
calibration_temperature = ui.material_preset[0].hotend_temp + 10;
|
||||
|
||||
// Welcome message
|
||||
SetStatusMessage(PSTR("Ready"));
|
||||
}
|
||||
|
||||
|
||||
void EstepsHandler::HandleStartButton(DGUS_VP_Variable &var, void *val_ptr) {
|
||||
//static_assert(ADVANCED_PAUSE_PURGE_LENGTH == 0, "Assuming PURGE_LENGTH is 0 so we can use M701");
|
||||
|
||||
// Validate
|
||||
if (calibration_temperature < EXTRUDE_MINTEMP) {
|
||||
SetStatusMessage(PSTR("Invalid temperature set"));
|
||||
return;
|
||||
}
|
||||
|
||||
if (filament_to_extrude < 10) {
|
||||
SetStatusMessage(PSTR("Invalid extrusion length set"));
|
||||
return;
|
||||
}
|
||||
|
||||
if (mark_filament_mm < filament_to_extrude) {
|
||||
SetStatusMessage(PSTR("Invalid mark length set"));
|
||||
return;
|
||||
}
|
||||
|
||||
// Prepare
|
||||
bool zAxisWasRelative = GcodeSuite::axis_is_relative(Z_AXIS);
|
||||
bool eAxisWasRelative = GcodeSuite::axis_is_relative(E_AXIS);
|
||||
|
||||
GcodeSuite::set_e_relative();
|
||||
GcodeSuite::set_relative_mode(true);
|
||||
|
||||
ExtUI::injectCommands_P("G0 Z5 F150");
|
||||
queue.advance();
|
||||
|
||||
// Heat up if necessary
|
||||
if (ExtUI::getActualTemp_celsius(ExtUI::E0) < calibration_temperature && abs(ExtUI::getActualTemp_celsius(ExtUI::E0) - calibration_temperature) > 2) {
|
||||
thermalManager.setTargetHotend(calibration_temperature, ExtUI::H0);
|
||||
|
||||
SetStatusMessage(PSTR("Heating up..."));
|
||||
thermalManager.wait_for_hotend(ExtUI::H0, false);
|
||||
}
|
||||
|
||||
planner.synchronize();
|
||||
|
||||
// Set-up command
|
||||
SetStatusMessage(PSTR("Extruding..."));
|
||||
|
||||
char cmd[64];
|
||||
sprintf_P(cmd, PSTR("G1 E%f F50"), filament_to_extrude);
|
||||
|
||||
ExtUI::injectCommands(cmd);
|
||||
queue.advance();
|
||||
planner.synchronize();
|
||||
|
||||
// Restore position
|
||||
ExtUI::injectCommands_P("G0 Z-5 F150");
|
||||
queue.advance();
|
||||
planner.synchronize();
|
||||
|
||||
// Restore defaults
|
||||
if (!zAxisWasRelative) GcodeSuite::set_relative_mode(false);
|
||||
if (!eAxisWasRelative) GcodeSuite::set_e_absolute();
|
||||
|
||||
// Done
|
||||
ScreenHandler.GotoScreen(DGUSLCD_SCREEN_ESTEPS_CALIBRATION_RESULTS, false);
|
||||
ScreenHandler.Buzzer(0, 250);
|
||||
SetStatusMessage(PSTR("Measure remaining filament"));
|
||||
}
|
||||
|
||||
void EstepsHandler::HandleApplyButton(DGUS_VP_Variable &var, void *val_ptr) {
|
||||
if (abs(calculated_esteps) < 1) {
|
||||
// User intented to set e-steps directly
|
||||
ExtUI::setAxisSteps_per_mm(set_esteps, ExtUI::E0);
|
||||
} else {
|
||||
ExtUI::setAxisSteps_per_mm(calculated_esteps, ExtUI::E0);
|
||||
}
|
||||
|
||||
// Save & reset
|
||||
settings.save();
|
||||
|
||||
ScreenHandler.Buzzer(0, 250);
|
||||
|
||||
ScreenHandler.PopToOldScreen();
|
||||
ScreenHandler.GotoScreen(DGUSLCD_SCREEN_MAIN, false);
|
||||
|
||||
SetStatusMessage(PSTR("New e-steps value saved"));
|
||||
}
|
||||
|
||||
void EstepsHandler::HandleRemainingFilament(DGUS_VP_Variable &var, void *val_ptr) {
|
||||
ScreenHandler.DGUSLCD_SetFloatAsIntFromDisplay<1>(var, val_ptr);
|
||||
|
||||
// Calculate
|
||||
constexpr float precision = 0.01;
|
||||
float actualExtrusion = mark_filament_mm - remaining_filament;
|
||||
if (actualExtrusion < (-precision)) {
|
||||
SetStatusMessage(PSTR("Mark filament further"));
|
||||
return;
|
||||
}
|
||||
|
||||
if (actualExtrusion < precision) {
|
||||
SetStatusMessage(PSTR("E-steps are correct"));
|
||||
calculated_esteps = set_esteps;
|
||||
return;
|
||||
}
|
||||
|
||||
float current_steps = ExtUI::getAxisSteps_per_mm(ExtUI::E0);
|
||||
SERIAL_ECHOLNPAIR("Current steps: ", current_steps);
|
||||
SERIAL_ECHOLNPAIR("Actual extrusion: ", actualExtrusion);
|
||||
|
||||
float new_steps = (current_steps * filament_to_extrude) / actualExtrusion;
|
||||
SERIAL_ECHOLNPAIR("New steps: ", new_steps);
|
||||
|
||||
calculated_esteps = new_steps;
|
||||
|
||||
// Status update
|
||||
SetStatusMessage(PSTR("Calculated new e-steps"));
|
||||
}
|
||||
|
||||
void EstepsHandler::SetStatusMessage(PGM_P statusMessage) {
|
||||
ScreenHandler.setstatusmessagePGM(statusMessage);
|
||||
}
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,28 @@
|
||||
#pragma once
|
||||
|
||||
#include <cstdint>
|
||||
|
||||
class EstepsHandler {
|
||||
public:
|
||||
static void Init();
|
||||
|
||||
static void HandleStartButton(DGUS_VP_Variable &var, void *val_ptr);
|
||||
static void HandleApplyButton(DGUS_VP_Variable &var, void *val_ptr);
|
||||
|
||||
static void HandleRemainingFilament(DGUS_VP_Variable &var, void *val_ptr);
|
||||
|
||||
public:
|
||||
static float set_esteps;
|
||||
static float calculated_esteps;
|
||||
|
||||
static float mark_filament_mm;
|
||||
static float remaining_filament;
|
||||
|
||||
static float filament_to_extrude;
|
||||
static uint16_t calibration_temperature;
|
||||
|
||||
private:
|
||||
|
||||
static void SetStatusMessage(PGM_P statusMessage);
|
||||
};
|
||||
|
||||
@@ -0,0 +1,72 @@
|
||||
|
||||
#include "../../../../../inc/MarlinConfigPre.h"
|
||||
|
||||
#if ENABLED(DGUS_LCD_UI_CREALITY_TOUCH)
|
||||
|
||||
#include "../DGUSDisplayDef.h"
|
||||
#include "../DGUSDisplay.h"
|
||||
#include "../DGUSScreenHandler.h"
|
||||
|
||||
#include "PIDHandler.h"
|
||||
|
||||
#include "../../../ui_api.h"
|
||||
#include "../../../../marlinui.h"
|
||||
|
||||
#include "../../../../../module/temperature.h"
|
||||
#include "../../../../../module/settings.h"
|
||||
#include "../../../../../module/planner.h"
|
||||
#include "../../../../../gcode/gcode.h"
|
||||
|
||||
// Storage init
|
||||
uint16_t PIDHandler::cycles = 0;
|
||||
uint16_t PIDHandler::calibration_temperature = 0;
|
||||
PGM_P PIDHandler::result_message = nullptr;
|
||||
|
||||
void PIDHandler::Init() {
|
||||
// Reset
|
||||
cycles = 3;
|
||||
|
||||
// Use configured PLA temps + 10 degrees
|
||||
calibration_temperature = ui.material_preset[0].hotend_temp + 15;
|
||||
|
||||
// Welcome message
|
||||
SetStatusMessage(PSTR("Ready"));
|
||||
}
|
||||
|
||||
|
||||
void PIDHandler::HandleStartButton(DGUS_VP_Variable &var, void *val_ptr) {
|
||||
//static_assert(ADVANCED_PAUSE_PURGE_LENGTH == 0, "Assuming PURGE_LENGTH is 0 so we can use M701");
|
||||
|
||||
// Validate
|
||||
if (calibration_temperature < EXTRUDE_MINTEMP) {
|
||||
SetStatusMessage(PSTR("Invalid temperature set"));
|
||||
return;
|
||||
}
|
||||
|
||||
if (cycles < 1) {
|
||||
SetStatusMessage(PSTR("Invalid number of cycles"));
|
||||
return;
|
||||
}
|
||||
|
||||
// Set-up command
|
||||
SetStatusMessage(PSTR("PID tuning. Please wait..."));
|
||||
|
||||
char cmd[64];
|
||||
sprintf_P(cmd, PSTR("M303 S%d C%d U1"), calibration_temperature, cycles);
|
||||
|
||||
ExtUI::injectCommands(cmd);
|
||||
queue.advance();
|
||||
planner.synchronize();
|
||||
|
||||
// Done
|
||||
ScreenHandler.Buzzer(0, 250);
|
||||
settings.save();
|
||||
|
||||
SetStatusMessage(result_message);
|
||||
}
|
||||
|
||||
void PIDHandler::SetStatusMessage(PGM_P statusMessage) {
|
||||
ScreenHandler.setstatusmessagePGM(statusMessage);
|
||||
}
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,20 @@
|
||||
#pragma once
|
||||
|
||||
#include <cstdint>
|
||||
|
||||
class PIDHandler {
|
||||
public:
|
||||
static void Init();
|
||||
|
||||
static void HandleStartButton(DGUS_VP_Variable &var, void *val_ptr);
|
||||
|
||||
public:
|
||||
static uint16_t cycles;
|
||||
static uint16_t calibration_temperature;
|
||||
static PGM_P result_message;
|
||||
|
||||
private:
|
||||
|
||||
static void SetStatusMessage(PGM_P statusMessage);
|
||||
};
|
||||
|
||||
@@ -0,0 +1,529 @@
|
||||
#include "../../../../../inc/MarlinConfigPre.h"
|
||||
|
||||
#include "../DGUSDisplayDef.h"
|
||||
#include "../DGUSDisplay.h"
|
||||
#include "../DGUSScreenHandler.h"
|
||||
|
||||
#include "../../../../../module/temperature.h"
|
||||
#include "../../../../../module/motion.h"
|
||||
#include "../../../../../module/planner.h"
|
||||
#include "../../../../../feature/pause.h"
|
||||
#include "../../../../../gcode/gcode.h"
|
||||
|
||||
#if ENABLED(FILAMENT_RUNOUT_SENSOR)
|
||||
#include "../../../../../feature/runout.h"
|
||||
#endif
|
||||
|
||||
#include "../../../../../module/settings.h"
|
||||
|
||||
#include "../../../ui_api.h"
|
||||
#include "../../../../marlinui.h"
|
||||
|
||||
#include "PageHandlers.h"
|
||||
|
||||
#if ENABLED(DGUS_LCD_UI_CREALITY_TOUCH)
|
||||
|
||||
// Definitions of page handlers
|
||||
|
||||
void MainMenuHandler(DGUS_VP_Variable &var, unsigned short buttonValue) {
|
||||
switch (var.VP) {
|
||||
case VP_BUTTON_MAINENTERKEY:
|
||||
switch (buttonValue) {
|
||||
case 1:
|
||||
// Try to mount an unmounted card (BTT SKR board has especially some trouble sometimes)
|
||||
card.mount();
|
||||
ScreenHandler.SDCardInserted();
|
||||
break;
|
||||
|
||||
case 2:
|
||||
ScreenHandler.GotoScreen(DGUSLCD_SCREEN_PREPARE);
|
||||
break;
|
||||
|
||||
case 3:
|
||||
ScreenHandler.GotoScreen(DGUSLCD_SCREEN_CONTROL);
|
||||
break;
|
||||
|
||||
case 4:
|
||||
ScreenHandler.GotoScreen(DGUSLCD_SCREEN_ZOFFSET_LEVEL);
|
||||
break;
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
void ControlMenuHandler(DGUS_VP_Variable &var, unsigned short buttonValue) {
|
||||
switch (var.VP) {
|
||||
case VP_BUTTON_PREPAREENTERKEY:
|
||||
switch(buttonValue) {
|
||||
case 5: // About
|
||||
ScreenHandler.GotoScreen(DGUSLCD_SCREEN_INFO);
|
||||
break;
|
||||
|
||||
case 7: // Reset to factory settings
|
||||
settings.reset();
|
||||
settings.save();
|
||||
|
||||
ExtUI::injectCommands_P(PSTR("M300"));
|
||||
|
||||
ScreenHandler.GotoScreen(DGUSLCD_SCREEN_MAIN);
|
||||
break;
|
||||
|
||||
case 9: // Back button
|
||||
ScreenHandler.GotoScreen(DGUSLCD_SCREEN_MAIN);
|
||||
break;
|
||||
}
|
||||
break;
|
||||
|
||||
case VP_BUTTON_TEMPCONTROL:
|
||||
if (buttonValue == 2) ScreenHandler.GotoScreen(DGUSLCD_SCREEN_TEMP);
|
||||
break;
|
||||
|
||||
case VP_BUTTON_ADJUSTENTERKEY:
|
||||
ScreenHandler.HandleLEDToggle();
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
void LevelingModeHandler(DGUS_VP_Variable &var, unsigned short buttonValue) {
|
||||
switch (var.VP) {
|
||||
case VP_BUTTON_BEDLEVELKEY:
|
||||
switch (buttonValue) {
|
||||
case 1:
|
||||
ExtUI::injectCommands_P("G28");
|
||||
|
||||
queue.advance();
|
||||
planner.synchronize();
|
||||
|
||||
ExtUI::injectCommands_P("G0 Z0");
|
||||
|
||||
queue.advance();
|
||||
break;
|
||||
|
||||
case 2:
|
||||
// Increase Z-offset
|
||||
ExtUI::smartAdjustAxis_steps(ExtUI::mmToWholeSteps(0.01, ExtUI::axis_t::Z), ExtUI::axis_t::Z, true);;
|
||||
ScreenHandler.ForceCompleteUpdate();
|
||||
ScreenHandler.RequestSaveSettings();
|
||||
break;
|
||||
|
||||
case 3:
|
||||
// Decrease Z-offset
|
||||
ExtUI::smartAdjustAxis_steps(ExtUI::mmToWholeSteps(-0.01, ExtUI::axis_t::Z), ExtUI::axis_t::Z, true);;
|
||||
ScreenHandler.ForceCompleteUpdate();
|
||||
ScreenHandler.RequestSaveSettings();
|
||||
break;
|
||||
}
|
||||
|
||||
break;
|
||||
|
||||
case VP_BUTTON_PREPAREENTERKEY:
|
||||
if (buttonValue == 9) {
|
||||
#if DISABLED(HOTEND_IDLE_TIMEOUT)
|
||||
thermalManager.disable_all_heaters();
|
||||
#endif
|
||||
|
||||
ScreenHandler.GotoScreen(DGUSLCD_SCREEN_MAIN);
|
||||
}
|
||||
break;
|
||||
|
||||
case VP_BUTTON_MAINENTERKEY:
|
||||
// Go to leveling screen
|
||||
ExtUI::injectCommands_P("G28\nG29\nM500");
|
||||
ScreenHandler.GotoScreen(DGUSLCD_SCREEN_LEVELING);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
void LevelingHandler(DGUS_VP_Variable &var, unsigned short buttonValue) {
|
||||
switch (var.VP) {
|
||||
case VP_BUTTON_BEDLEVELKEY:
|
||||
ScreenHandler.GotoScreen(DGUSLCD_SCREEN_ZOFFSET_LEVEL);
|
||||
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
void TempMenuHandler(DGUS_VP_Variable &var, unsigned short buttonValue) {
|
||||
switch (var.VP) {
|
||||
case VP_BUTTON_ADJUSTENTERKEY:
|
||||
switch (buttonValue) {
|
||||
case 3:
|
||||
ScreenHandler.HandleFanToggle();
|
||||
break;
|
||||
}
|
||||
|
||||
break;
|
||||
|
||||
case VP_BUTTON_TEMPCONTROL:
|
||||
switch (buttonValue){
|
||||
case 3:
|
||||
ScreenHandler.GotoScreen(DGUSLCD_SCREEN_TEMP_PLA);
|
||||
break;
|
||||
|
||||
case 4:
|
||||
ScreenHandler.GotoScreen(DGUSLCD_SCREEN_TEMP_ABS);
|
||||
break;
|
||||
|
||||
case 7:
|
||||
ScreenHandler.GotoScreen(DGUSLCD_SCREEN_CONTROL);
|
||||
break;
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
void PrepareMenuHandler(DGUS_VP_Variable &var, unsigned short buttonValue) {
|
||||
switch (var.VP) {
|
||||
case VP_BUTTON_PREPAREENTERKEY:
|
||||
switch (buttonValue){
|
||||
case 3:
|
||||
ScreenHandler.GotoScreen(DGUSLCD_SCREEN_MOVE10MM);
|
||||
break;
|
||||
|
||||
case 6:
|
||||
// Disable steppers
|
||||
ScreenHandler.HandleMotorLockUnlock(var, &buttonValue);
|
||||
break;
|
||||
|
||||
case 9:
|
||||
ScreenHandler.GotoScreen(DGUSLCD_SCREEN_MAIN);
|
||||
break;
|
||||
}
|
||||
break;
|
||||
|
||||
case VP_BUTTON_HEATLOADSTARTKEY:
|
||||
ScreenHandler.GotoScreen(DGUSLCD_SCREEN_FEED);
|
||||
break;
|
||||
|
||||
case VP_BUTTON_COOLDOWN:
|
||||
ScreenHandler.HandleAllHeatersOff(var, &buttonValue);
|
||||
break;
|
||||
|
||||
case VP_BUTTON_TEMPCONTROL:
|
||||
switch (buttonValue) {
|
||||
case 5:
|
||||
thermalManager.setTargetHotend(ui.material_preset[0].hotend_temp, 0);
|
||||
thermalManager.setTargetBed(ui.material_preset[0].bed_temp);
|
||||
|
||||
break;
|
||||
|
||||
case 6:
|
||||
thermalManager.setTargetHotend(ui.material_preset[1].hotend_temp, 0);
|
||||
thermalManager.setTargetBed(ui.material_preset[1].bed_temp);
|
||||
break;
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
ScreenHandler.ForceCompleteUpdate();
|
||||
}
|
||||
|
||||
void TuneMenuHandler(DGUS_VP_Variable &var, unsigned short buttonValue) {
|
||||
switch (var.VP) {
|
||||
case VP_BUTTON_ADJUSTENTERKEY:
|
||||
switch (buttonValue) {
|
||||
case 2:
|
||||
ScreenHandler.GotoScreen(ExtUI::isPrintingFromMediaPaused() ? DGUSLCD_SCREEN_PRINT_PAUSED : DGUSLCD_SCREEN_PRINT_RUNNING);
|
||||
break;
|
||||
|
||||
case 3:
|
||||
ScreenHandler.HandleFanToggle();
|
||||
break;
|
||||
|
||||
case 4:
|
||||
ScreenHandler.HandleLEDToggle();
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void PrintRunningMenuHandler(DGUS_VP_Variable &var, unsigned short buttonValue) {
|
||||
switch (var.VP) {
|
||||
case VP_BUTTON_ADJUSTENTERKEY:
|
||||
switch (buttonValue) {
|
||||
case 1:
|
||||
ScreenHandler.GotoScreen(DGUSLCD_SCREEN_TUNING);
|
||||
break;
|
||||
}
|
||||
break;
|
||||
|
||||
case VP_BUTTON_PAUSEPRINTKEY:
|
||||
switch (buttonValue) {
|
||||
case 1:
|
||||
ScreenHandler.GotoScreen(DGUSLCD_SCREEN_DIALOG_PAUSE);
|
||||
break;
|
||||
}
|
||||
break;
|
||||
|
||||
case VP_BUTTON_STOPPRINTKEY:
|
||||
switch (buttonValue) {
|
||||
case 1:
|
||||
ScreenHandler.GotoScreen(DGUSLCD_SCREEN_DIALOG_STOP);
|
||||
break;
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
void PrintPausedMenuHandler(DGUS_VP_Variable &var, unsigned short buttonValue) {
|
||||
switch (var.VP) {
|
||||
case VP_BUTTON_RESUMEPRINTKEY:
|
||||
#if ENABLED(FILAMENT_RUNOUT_SENSOR)
|
||||
runout.reset();
|
||||
#endif
|
||||
|
||||
if (!ScreenHandler.HandlePendingUserConfirmation()) {
|
||||
ExtUI::resumePrint();
|
||||
ScreenHandler.GotoScreen(DGUSLCD_SCREEN_PRINT_RUNNING);
|
||||
}
|
||||
break;
|
||||
|
||||
case VP_BUTTON_ADJUSTENTERKEY:
|
||||
switch (buttonValue) {
|
||||
case 1:
|
||||
ScreenHandler.GotoScreen(DGUSLCD_SCREEN_TUNING);
|
||||
break;
|
||||
}
|
||||
break;
|
||||
|
||||
case VP_BUTTON_STOPPRINTKEY:
|
||||
switch (buttonValue) {
|
||||
case 1:
|
||||
ScreenHandler.GotoScreen(DGUSLCD_SCREEN_DIALOG_STOP);
|
||||
break;
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
void PrintPauseDialogHandler(DGUS_VP_Variable &var, unsigned short buttonValue) {
|
||||
switch (var.VP){
|
||||
case VP_BUTTON_PAUSEPRINTKEY:
|
||||
switch (buttonValue) {
|
||||
case 2:
|
||||
ExtUI::pausePrint();
|
||||
ScreenHandler.GotoScreen(DGUSLCD_SCREEN_PRINT_PAUSED);
|
||||
break;
|
||||
|
||||
case 3:
|
||||
ScreenHandler.GotoScreen(DGUSLCD_SCREEN_PRINT_RUNNING);
|
||||
break;
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
void PrintFinishMenuHandler(DGUS_VP_Variable &var, unsigned short buttonValue) {
|
||||
switch (var.VP){
|
||||
case VP_BUTTON_MAINENTERKEY:
|
||||
switch (buttonValue) {
|
||||
case 5:
|
||||
ScreenHandler.GotoScreen(DGUSLCD_SCREEN_MAIN);
|
||||
break;
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
void FilamentRunoutHandler(DGUS_VP_Variable &var, unsigned short buttonValue) {
|
||||
switch (var.VP){
|
||||
case VP_BUTTON_RESUMEPRINTKEY:
|
||||
ExtUI::resumePrint();
|
||||
ScreenHandler.GotoScreen(DGUSLCD_SCREEN_PRINT_RUNNING);
|
||||
break;
|
||||
|
||||
case VP_BUTTON_STOPPRINTKEY:
|
||||
ExtUI::stopPrint();
|
||||
ScreenHandler.GotoScreen(DGUSLCD_SCREEN_MAIN);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
void StopConfirmScreenHandler(DGUS_VP_Variable &var, unsigned short buttonValue) {
|
||||
switch (var.VP){
|
||||
case VP_BUTTON_STOPPRINTKEY:
|
||||
switch (buttonValue) {
|
||||
case 2:
|
||||
ExtUI::stopPrint();
|
||||
ScreenHandler.GotoScreen(DGUSLCD_SCREEN_MAIN);
|
||||
break;
|
||||
|
||||
case 3:
|
||||
ScreenHandler.GotoScreen(ExtUI::isPrintingPaused() ? DGUSLCD_SCREEN_PRINT_PAUSED : DGUSLCD_SCREEN_PRINT_RUNNING);
|
||||
break;
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
void PreheatSettingsScreenHandler(DGUS_VP_Variable &var, unsigned short buttonValue) {
|
||||
switch (var.VP){
|
||||
case VP_BUTTON_PREPAREENTERKEY:
|
||||
// Save button, save settings and go back
|
||||
ScreenHandler.RequestSaveSettings();
|
||||
ScreenHandler.GotoScreen(DGUSLCD_SCREEN_TEMP);
|
||||
break;
|
||||
|
||||
case VP_BUTTON_COOLDOWN: // You can't make this up
|
||||
// Back button, discard settings
|
||||
settings.load();
|
||||
|
||||
ScreenHandler.GotoScreen(DGUSLCD_SCREEN_TEMP);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
void InfoMenuHandler(DGUS_VP_Variable &var, unsigned short buttonValue) {
|
||||
switch (var.VP){
|
||||
case VP_BUTTON_TEMPCONTROL:
|
||||
ScreenHandler.GotoScreen(DGUSLCD_SCREEN_CONTROL);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
void change_filament_with_temp(PGM_P command, const uint16_t celsius) {
|
||||
// Heat if necessary
|
||||
if (ExtUI::getActualTemp_celsius(ExtUI::E0) < celsius && abs(ExtUI::getActualTemp_celsius(ExtUI::E0) - celsius) > 2) {
|
||||
ScreenHandler.setstatusmessagePGM(PSTR("Heating up..."));
|
||||
|
||||
thermalManager.setTargetHotend(celsius, ExtUI::H0);
|
||||
thermalManager.wait_for_hotend(ExtUI::H0, false);
|
||||
}
|
||||
|
||||
// Inject load filament command
|
||||
ScreenHandler.setstatusmessagePGM(PSTR("Filament load/unload..."));
|
||||
|
||||
char cmd[64];
|
||||
sprintf_P(cmd, command, ScreenHandler.feed_amount);
|
||||
|
||||
SERIAL_ECHOPAIR("Injecting command: ", cmd);
|
||||
ExtUI::injectCommands(cmd);
|
||||
|
||||
// Handle commands
|
||||
SERIAL_ECHOPGM_P("- waiting for queue");
|
||||
queue.advance();
|
||||
planner.synchronize();
|
||||
|
||||
SERIAL_ECHOPGM_P("- done");
|
||||
|
||||
ScreenHandler.setstatusmessagePGM(PSTR("Filament load/unload complete"));
|
||||
}
|
||||
|
||||
void FeedHandler(DGUS_VP_Variable &var, unsigned short buttonValue) {
|
||||
if (var.VP != VP_BUTTON_HEATLOADSTARTKEY) return;
|
||||
|
||||
// Common for load/unload -> determine minimum temperature
|
||||
uint16_t celsius = ExtUI::getActualTemp_celsius(ExtUI::H0);
|
||||
if (celsius < PREHEAT_1_TEMP_HOTEND) {
|
||||
celsius = PREHEAT_1_TEMP_HOTEND;
|
||||
}
|
||||
|
||||
switch (buttonValue) {
|
||||
case 1:
|
||||
dgusdisplay.WriteVariable(VP_FEED_PROGRESS, static_cast<int16_t>(10));
|
||||
|
||||
change_filament_with_temp(PSTR("M701 L%f P0"), celsius);
|
||||
|
||||
dgusdisplay.WriteVariable(VP_FEED_PROGRESS, static_cast<int16_t>(0));
|
||||
break;
|
||||
|
||||
case 2:
|
||||
dgusdisplay.WriteVariable(VP_FEED_PROGRESS, static_cast<int16_t>(10));
|
||||
|
||||
change_filament_with_temp(PSTR("M702 U%f"), celsius);
|
||||
|
||||
dgusdisplay.WriteVariable(VP_FEED_PROGRESS, static_cast<int16_t>(0));
|
||||
break;
|
||||
|
||||
case 3:
|
||||
ScreenHandler.GotoScreen(DGUSLCD_SCREEN_PREPARE);
|
||||
break;
|
||||
}
|
||||
|
||||
ScreenHandler.ForceCompleteUpdate();
|
||||
}
|
||||
|
||||
void MoveHandler(DGUS_VP_Variable &var, unsigned short buttonValue) {
|
||||
if (var.VP == VP_BUTTON_HEATLOADSTARTKEY) {
|
||||
ScreenHandler.GotoScreen(DGUSLCD_SCREEN_PREPARE);
|
||||
}
|
||||
|
||||
if (var.VP == VP_BUTTON_MOVEKEY) {
|
||||
switch (buttonValue) {
|
||||
case 1:
|
||||
ScreenHandler.GotoScreen(DGUSLCD_SCREEN_MOVE10MM);
|
||||
break;
|
||||
case 2:
|
||||
ScreenHandler.GotoScreen(DGUSLCD_SCREEN_MOVE1MM);
|
||||
break;
|
||||
case 3:
|
||||
ScreenHandler.GotoScreen(DGUSLCD_SCREEN_MOVE01MM);
|
||||
break;
|
||||
case 4:
|
||||
ExtUI::injectCommands_P("G28");
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Register the page handlers
|
||||
#define PAGE_HANDLER(SCRID, HDLRPTR) { .ScreenID=SCRID, .Handler=HDLRPTR },
|
||||
const struct PageHandler PageHandlers[] PROGMEM = {
|
||||
PAGE_HANDLER(DGUSLCD_Screens::DGUSLCD_SCREEN_MAIN, MainMenuHandler)
|
||||
|
||||
PAGE_HANDLER(DGUSLCD_Screens::DGUSLCD_SCREEN_CONTROL, ControlMenuHandler)
|
||||
|
||||
PAGE_HANDLER(DGUSLCD_Screens::DGUSLCD_SCREEN_ZOFFSET_LEVEL, LevelingModeHandler)
|
||||
PAGE_HANDLER(DGUSLCD_Screens::DGUSLCD_SCREEN_LEVELING, LevelingHandler)
|
||||
|
||||
PAGE_HANDLER(DGUSLCD_Screens::DGUSLCD_SCREEN_INFO, InfoMenuHandler)
|
||||
|
||||
PAGE_HANDLER(DGUSLCD_Screens::DGUSLCD_SCREEN_TEMP, TempMenuHandler)
|
||||
PAGE_HANDLER(DGUSLCD_Screens::DGUSLCD_SCREEN_TEMP_PLA, PreheatSettingsScreenHandler)
|
||||
PAGE_HANDLER(DGUSLCD_Screens::DGUSLCD_SCREEN_TEMP_ABS, PreheatSettingsScreenHandler)
|
||||
|
||||
PAGE_HANDLER(DGUSLCD_Screens::DGUSLCD_SCREEN_TUNING, TuneMenuHandler)
|
||||
PAGE_HANDLER(DGUSLCD_Screens::DGUSLCD_SCREEN_FEED, FeedHandler)
|
||||
PAGE_HANDLER(DGUSLCD_Screens::DGUSLCD_SCREEN_MOVE01MM, MoveHandler)
|
||||
PAGE_HANDLER(DGUSLCD_Screens::DGUSLCD_SCREEN_MOVE1MM, MoveHandler)
|
||||
PAGE_HANDLER(DGUSLCD_Screens::DGUSLCD_SCREEN_MOVE10MM, MoveHandler)
|
||||
|
||||
PAGE_HANDLER(DGUSLCD_Screens::DGUSLCD_SCREEN_FILAMENTRUNOUT1, FilamentRunoutHandler)
|
||||
PAGE_HANDLER(DGUSLCD_Screens::DGUSLCD_SCREEN_FILAMENTRUNOUT2, FilamentRunoutHandler)
|
||||
|
||||
PAGE_HANDLER(DGUSLCD_Screens::DGUSLCD_SCREEN_DIALOG_STOP, StopConfirmScreenHandler)
|
||||
|
||||
PAGE_HANDLER(DGUSLCD_Screens::DGUSLCD_SCREEN_PRINT_RUNNING, PrintRunningMenuHandler)
|
||||
PAGE_HANDLER(DGUSLCD_Screens::DGUSLCD_SCREEN_PRINT_PAUSED, PrintPausedMenuHandler)
|
||||
PAGE_HANDLER(DGUSLCD_Screens::DGUSLCD_SCREEN_PRINT_FINISH, PrintFinishMenuHandler)
|
||||
|
||||
PAGE_HANDLER(DGUSLCD_Screens::DGUSLCD_SCREEN_DIALOG_PAUSE, PrintPauseDialogHandler)
|
||||
|
||||
PAGE_HANDLER(DGUSLCD_Screens::DGUSLCD_SCREEN_PREPARE, PrepareMenuHandler)
|
||||
|
||||
// Terminating
|
||||
PAGE_HANDLER(static_cast<DGUSLCD_Screens>(0) ,0)
|
||||
};
|
||||
|
||||
void DGUSCrealityDisplay_HandleReturnKeyEvent(DGUS_VP_Variable &var, void *val_ptr) {
|
||||
const struct PageHandler *map = PageHandlers;
|
||||
const uint16_t *ret;
|
||||
const DGUSLCD_Screens current_screen = DGUSScreenHandler::getCurrentScreen();
|
||||
|
||||
while ((ret = (uint16_t*) pgm_read_ptr(&(map->Handler)))) {
|
||||
if ((map->ScreenID) == current_screen) {
|
||||
unsigned short button_value = *static_cast<unsigned short*>(val_ptr);
|
||||
button_value = (button_value & 0xffU) << 8U | (button_value >> 8U);
|
||||
|
||||
SERIAL_ECHOPAIR("Invoking handler for screen ", current_screen);
|
||||
SERIAL_ECHOLNPAIR("with VP=", var.VP, " value=", button_value);
|
||||
|
||||
map->Handler(var, button_value);
|
||||
return;
|
||||
}
|
||||
|
||||
map++;
|
||||
}
|
||||
}
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,11 @@
|
||||
#pragma once
|
||||
|
||||
// Mapping of handlers per page. This construction is necessary because the CR-6 touch screen re-uses the same button IDs all over the place.
|
||||
typedef void (*DGUS_CREALITY_SCREEN_BUTTON_HANDLER)(DGUS_VP_Variable &var, unsigned short buttonValue);
|
||||
|
||||
struct PageHandler {
|
||||
DGUSLCD_Screens ScreenID;
|
||||
DGUS_CREALITY_SCREEN_BUTTON_HANDLER Handler;
|
||||
};
|
||||
|
||||
void DGUSCrealityDisplay_HandleReturnKeyEvent(DGUS_VP_Variable &var, void *val_ptr);
|
||||
@@ -951,6 +951,10 @@ namespace ExtUI {
|
||||
TERN_(HAS_RESUME_CONTINUE, wait_for_user = false);
|
||||
}
|
||||
|
||||
bool isWaitingOnUser() {
|
||||
return TERN(HAS_RESUME_CONTINUE, wait_for_user, false);
|
||||
}
|
||||
|
||||
void printFile(const char *filename) {
|
||||
UNUSED(filename);
|
||||
IFSD(card.openAndPrintFile(filename), NOOP);
|
||||
|
||||
@@ -199,6 +199,7 @@ namespace ExtUI {
|
||||
void setFlow_percent(const int16_t, const extruder_t);
|
||||
bool awaitingUserConfirm();
|
||||
void setUserConfirmed();
|
||||
bool isWaitingOnUser();
|
||||
|
||||
#if ENABLED(LIN_ADVANCE)
|
||||
float getLinearAdvance_mm_mm_s(const extruder_t);
|
||||
|
||||
@@ -380,8 +380,8 @@ FORCE_INLINE void probe_specific_action(const bool deploy) {
|
||||
|
||||
DEBUG_EOL();
|
||||
|
||||
TERN_(WAIT_FOR_NOZZLE_HEAT, if (hotend_temp > thermalManager.degHotend(0) + (TEMP_WINDOW)) thermalManager.wait_for_hotend(0));
|
||||
TERN_(WAIT_FOR_BED_HEAT, if (bed_temp > thermalManager.degBed() + (TEMP_BED_WINDOW)) thermalManager.wait_for_bed_heating());
|
||||
TERN_(WAIT_FOR_NOZZLE_HEAT, if (!WITHIN(thermalManager.degHotend(0), (thermalManager.degTargetHotend(0) - TEMP_HYSTERESIS), (thermalManager.degTargetHotend(0) + TEMP_HYSTERESIS))) thermalManager.wait_for_hotend(0, false));
|
||||
TERN_(WAIT_FOR_BED_HEAT, if (!WITHIN(thermalManager.degBed(), (thermalManager.degTargetBed() - TEMP_BED_HYSTERESIS), (thermalManager.degTargetBed() + TEMP_BED_HYSTERESIS))) thermalManager.wait_for_bed_heating(false));
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
@@ -3254,6 +3254,7 @@ void Temperature::tick() {
|
||||
#if ENABLED(AUTO_REPORT_TEMPERATURES)
|
||||
AutoReporter<Temperature::AutoReportTemp> Temperature::auto_reporter;
|
||||
void Temperature::AutoReportTemp::report() {
|
||||
PORT_REDIRECT(SERIAL_ALL);
|
||||
print_heater_states(active_extruder);
|
||||
SERIAL_EOL();
|
||||
}
|
||||
@@ -3525,11 +3526,11 @@ void Temperature::tick() {
|
||||
return false;
|
||||
}
|
||||
|
||||
void Temperature::wait_for_bed_heating() {
|
||||
if (isHeatingBed()) {
|
||||
void Temperature::wait_for_bed_heating(const bool no_wait_for_cooling/*=true*/) {
|
||||
if (isHeatingBed() || !no_wait_for_cooling ) {
|
||||
SERIAL_ECHOLNPGM("Wait for bed heating...");
|
||||
LCD_MESSAGEPGM(MSG_BED_HEATING);
|
||||
wait_for_bed();
|
||||
wait_for_bed(no_wait_for_cooling);
|
||||
ui.reset_status();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -672,7 +672,7 @@ class Temperature {
|
||||
#endif
|
||||
);
|
||||
|
||||
static void wait_for_bed_heating();
|
||||
static void wait_for_bed_heating(const bool no_wait_for_cooling=true);
|
||||
|
||||
FORCE_INLINE static bool degBedNear(const float &temp) {
|
||||
return ABS(degBed() - temp) < (TEMP_BED_HYSTERESIS);
|
||||
|
||||
@@ -12,12 +12,20 @@ set -e
|
||||
use_example_configs "Creality/Ender-3 V2"
|
||||
opt_enable MARLIN_DEV_MODE
|
||||
exec_test $1 $2 "Ender 3 v2" "$3"
|
||||
restore_configs
|
||||
|
||||
use_example_configs "Creality/Ender-3 V2"
|
||||
opt_disable CLASSIC_JERK
|
||||
opt_add SDCARD_EEPROM_EMULATION
|
||||
exec_test $1 $2 "Ender 3 v2, SD EEPROM, w/o CLASSIC_JERK" "$3"
|
||||
restore_configs
|
||||
|
||||
opt_set SERIAL_PORT 1
|
||||
opt_set MOTHERBOARD BOARD_CREALITY_V452
|
||||
opt_disable NOZZLE_TO_PROBE_OFFSET
|
||||
opt_enable NOZZLE_AS_PROBE Z_SAFE_HOMING Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN
|
||||
opt_enable PROBE_ACTIVE_INPUT PROBE_TARE PROBE_TARE_ONLY_WHILE_INACTIVE
|
||||
exec_test $1 $2 "Creality V4.5.2 PROBE_ACTIVE_INPUT, PROBE_TARE_ONLY_WHILE_INACTIVE" "$3"
|
||||
restore_configs
|
||||
opt_set SERIAL_PORT 1
|
||||
opt_set MOTHERBOARD BOARD_CREALITY_V452
|
||||
|
||||
@@ -22,6 +22,8 @@ opt_add TEMP_CHAMBER_PIN 3
|
||||
opt_add HEATER_CHAMBER_PIN 45
|
||||
opt_set GRID_MAX_POINTS_X 16
|
||||
opt_set FANMUX0_PIN 53
|
||||
opt_set PROBE_REQUIRES_MINTEMP_NOZZLE 150
|
||||
opt_set PROBE_REQUIRES_MINTEMP_BED 50
|
||||
opt_disable USE_WATCHDOG
|
||||
opt_enable REPRAP_DISCOUNT_SMART_CONTROLLER LCD_PROGRESS_BAR LCD_PROGRESS_BAR_TEST \
|
||||
FIX_MOUNTED_PROBE Z_SAFE_HOMING CODEPENDENT_XY_HOMING PIDTEMPBED PROBE_TEMP_COMPENSATION \
|
||||
|
||||
@@ -53,6 +53,7 @@ default_src_filter = +<src/*> -<src/config> -<src/HAL> +<src/HAL/shared>
|
||||
-<src/lcd/menu/menu_ubl.cpp>
|
||||
-<src/lcd/extui/lib/mks_ui>
|
||||
-<src/lcd/extui/lib/dgus> -<src/lcd/extui/dgus_lcd.cpp>
|
||||
-<src/lcd/extui/lib/dgus_creality> -<src/lcd/extui/dgus_creality_lcd.cpp>
|
||||
-<src/lcd/extui/example.cpp>
|
||||
-<src/lcd/extui/malyan_lcd.cpp>
|
||||
-<src/lcd/extui/lib/ftdi_eve_touch_ui>
|
||||
@@ -282,6 +283,7 @@ HAS_MENU_UBL = src_filter=+<src/lcd/menu/menu_ubl.cpp>
|
||||
ANYCUBIC_LCD_CHIRON = src_filter=+<src/lcd/extui/anycubic_chiron_lcd.cpp> +<src/lcd/extui/lib/anycubic_chiron>
|
||||
ANYCUBIC_LCD_I3MEGA = src_filter=+<src/lcd/extui/anycubic_i3mega_lcd.cpp> +<src/lcd/extui/lib/anycubic_i3mega>
|
||||
HAS_DGUS_LCD = src_filter=+<src/lcd/extui/lib/dgus> +<src/lcd/extui/dgus_lcd.cpp>
|
||||
DGUS_LCD_UI_CREALITY_TOUCH = src_filter=+<src/lcd/extui/lib/dgus_creality> +<src/lcd/extui/dgus_creality_lcd.cpp>
|
||||
TOUCH_UI_FTDI_EVE = src_filter=+<src/lcd/extui/lib/ftdi_eve_touch_ui>
|
||||
EXTUI_EXAMPLE = src_filter=+<src/lcd/extui/example.cpp>
|
||||
MALYAN_LCD = src_filter=+<src/lcd/extui/malyan_lcd.cpp>
|
||||
|
||||
Reference in New Issue
Block a user