From e9588824bbd5f37c722e470aaa49152d76802373 Mon Sep 17 00:00:00 2001 From: InsanityAutomation Date: Sun, 17 Feb 2019 13:45:51 -0500 Subject: [PATCH] 10s pro support and basic dwin files to start changes --- Marlin/Configuration.h | 1103 ++++++-- Marlin/Configuration_adv.h | 318 ++- .../lcd/extensible_ui/lib/Creality_DWIN.cpp | 2272 +++++++++++++++++ .../src/lcd/extensible_ui/lib/Creality_DWIN.h | 193 ++ build_number | 1 + 5 files changed, 3578 insertions(+), 309 deletions(-) create mode 100644 Marlin/src/lcd/extensible_ui/lib/Creality_DWIN.cpp create mode 100644 Marlin/src/lcd/extensible_ui/lib/Creality_DWIN.h create mode 100644 build_number diff --git a/Marlin/Configuration.h b/Marlin/Configuration.h index bd67939356..663f9504b9 100644 --- a/Marlin/Configuration.h +++ b/Marlin/Configuration.h @@ -1,3 +1,140 @@ +#define ADAPTIVE_FAN_SLOWING +/* + Base machine + Choose one option below to define machine size, board, and parameters + + + Choose this for CR10 Original Melzi Board + You still need to select a machine size below! +*/ +//#define MachineCR10Orig + +/* + Enabled this for linear advance instead of mesh leveling on a melzi board +*/ +//#define OrigLA +/* + Select machine size +*/ +//#define MachineEnder2 // Must Select MachineCR10Orig above! +//#define MachineEnder3 // Must Select MachineCR10Orig above! +//#define MachineEnder4 +//#define MachineMini +//#define MachineCR20 //Buzzer doesnt work, need to map pin +//#define MachineCR20Pro +//#define MachineCR10Std +//#define MachineCRX +//#define MachineCR10SPro +//#define MachineS4 +#define MachineS5 + +//#define PLUS // Adds bltouch, allmetal, bilinear (standard), lerdge, 93 e steps/mm + +//#define Big_UI + +#define BoardRev2 //Enable for SD detect function on Rev 2.1 boards or Ender 4 +//#define GraphicLCD //Full graphics LCD for Ender 4 +//#define AddonFilSensor //Adds a filamnt runout sensor to the CR20 or Ender 4 +//#define lerdgeFilSensor //Using lerdge filament sensor, which is opposite polarity to stock +//#define DualFilSensors //Using dual filament sensors on XMax and YMAX + +/* + Hotend Type + Choose one option below. + E3D assumes the following mount : + https://www.thingiverse.com/thing:2494642 + + Configured with 5015 left wing, right wing ABL sensor (BLTouch or M18) only +*/ +#define HotendStock +//#define HotendE3D + +/* + Enable this if you have an all metal hotend capable of 300c + +*/ +#define HotendAllMetal + +/* + * Select these if you have changed to a high performance extruder + */ + + //#define EZRstruder + //#define Bondtech + //#define E3DTitan + + /* + * + * If any dual extruder is used, define type here + */ + + //#define Dual_BowdenSplitterY + //#define Dual_CyclopsSingleNozzle + //#define Dual_ChimeraDualNozzle + + +/* + Choose bed type below. If you have an extenrally controlled + ac bed, leave both disabled +*/ +//#define BedAC +#define BedDC + +//#define SolidBedMounts //Removed a few LCD options to save some memory since not needed with solid mounts + +/* + If you have upgraded to an S board but kept the original display + then enable this line +*/ +//#define OrigLCD + +/* + Choose ABL sensor type below + Leave all disabled if no sensor is available +*/ +//#define ABL_EZABL // TH3D EZABL or Any NO Sensor +//#define ABL_NCSW //Creality ABL or Any NC Sensor +#define ABL_BLTOUCH + +//#define CREALITY_ABL_MOUNT //Using creality ABL mount +/* + Choose bed leveling type here + Requires a sensor from above + Melzi board users may only select ABL_BI for bilinear leveling +*/ +//#define ABL_BI +#define ABL_UBL + +//#define POWER_LOSS_RECOVERY //Large and does not fit with any other features on Melzi, or UBL on Atmega +/* + + Choose a probe grid density below. Faster probes less points, but is less accurate. + Extreme is for extremely uneven or tilted bed surfaces. + UBL and Extreme are recommended with solid bed mounts as it becomes a one time commissioning. + Standard is recommended in most other scenarios. +*/ +//#define MeshFast +//#define MeshStd +//#define MeshFine +#define MeshExtreme + +/* + Disables SD Sort, Autotemp, Arc support, Linear Advance (Unless overridden with OrigLA above), Big edit fonts, and a few other little things + Intended to resolve issues with certain newer boards experiencing motion errors under load. + Enables Slim Menus +*/ +//#define LowMemoryBoard + + +/* + Enclosure Controls +*/ +//#define EnclosureLight // Uses 5vdc LED's hooked to D12 +//#define EnclosureTempSensor // Uses PT100 Probe hooked to A12, only partially implemented upstream +//#define EnclosureHeater //Planned to use A11 to control heater upstream, and repurpose the unused y max as the fan output. Not yet fully implemented upstream + + + /** * Marlin 3D Printer Firmware * Copyright (C) 2019 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] @@ -73,8 +210,10 @@ // User-specified version info of this build to display in [Pronterface, etc] terminal window during // startup. Implementation of an idea by Prof Braino to inform user that any changes made to this // build by the user have been successfully uploaded into firmware. -#define STRING_CONFIG_H_AUTHOR "(none, default config)" // Who made the changes. +#define STRING_CONFIG_H_AUTHOR "TinyMachines3D" // Who made the changes. +#if(DISABLED(MachineCR10Orig) && DISABLED(LowMemoryBoard)) #define SHOW_BOOTSCREEN +#endif #define STRING_SPLASH_LINE1 SHORT_BUILD_VERSION // will be shown during bootup in line 1 #define STRING_SPLASH_LINE2 WEBSITE_URL // will be shown during bootup in line 2 @@ -90,13 +229,123 @@ */ // Enable to show the bitmap in Marlin/_Bootscreen.h on startup. -//#define SHOW_CUSTOM_BOOTSCREEN - +#if(DISABLED(MachineEnder4) && DISABLED(MachineCR10Orig) && DISABLED(LowMemoryBoard)) +#define SHOW_CUSTOM_BOOTSCREEN +#endif // Enable to show the bitmap in Marlin/_Statusscreen.h on the status screen. -//#define CUSTOM_STATUS_SCREEN_IMAGE +#if(DISABLED(MachineCR10Orig) && DISABLED(MachineEnder4)) +#define CUSTOM_STATUS_SCREEN_IMAGE +#endif -// @section machine +#if(ENABLED(MachineMini)) +#define CUSTOM_MACHINE_NAME "Mini SuPeR" +#elif(ENABLED(MachineEnder2)) +#define CUSTOM_MACHINE_NAME "TM3D Ender2" +#elif(ENABLED(MachineEnder3)) +#define CUSTOM_MACHINE_NAME "TM3D Ender3" +#elif(ENABLED(MachineEnder4)) +#define CUSTOM_MACHINE_NAME "TM3D Ender4" +#elif(ENABLED(MachineCR20)) +#define CUSTOM_MACHINE_NAME "SuPeR CR-20" +#elif(ENABLED(MachineCR10Orig)) +#define CUSTOM_MACHINE_NAME "SuPeR CR-10" +#elif(ENABLED(MachineCRX)) +#define CUSTOM_MACHINE_NAME "TM3D CR-X" +#elif(ENABLED(MachineCR10Std)) +#define CUSTOM_MACHINE_NAME "300 SuPeR" +#elif(ENABLED(MachineS4)) +#define CUSTOM_MACHINE_NAME "400 SuPeR" +#elif(ENABLED(MachineS5)) +#define CUSTOM_MACHINE_NAME "500 SuPeR" +#endif +#if(ENABLED(MachineMini)) +#define VerChar1 "M" +#elif(ENABLED(MachineEnder2)) +#define VerChar1 "E2" +#elif(ENABLED(MachineEnder3)) +#define VerChar1 "E3" +#elif(ENABLED(MachineEnder4)) +#define VerChar1 "E4" +#elif(ENABLED(MachineCR20)) +#define VerChar1 "2" +#elif(ENABLED(MachineCR10Orig)) +#define VerChar1 "O" +#elif(ENABLED(MachineCR10Std)) +#define VerChar1 "S" +#elif(ENABLED(MachineCRX)) +#define VerChar1 "X" +#elif(ENABLED(MachineS4)) +#define VerChar1 "4" +#elif(ENABLED(MachineS5)) +#define VerChar1 "5" +#endif + +#if(ENABLED(HotendStock)) +#define VerChar2 "S" +#elif(ENABLED(HotendE3D)) +#define VerChar2 "E" +#endif + +#if(ENABLED(HotendAllMetal)) +#define VerChar3 "M" +#else +#define VerChar3 "S" +#endif + + +#if(ENABLED(BedAC)) +#define VerChar4 "A" +#elif(ENABLED(BedDC)) +#define VerChar4 "D" +#else +#define VerChar4 "N" +#endif + +#if(ENABLED(ABL_EZABL)) +#define VerChar5 "A" +#elif(ENABLED(ABL_BLTOUCH)) +#define VerChar5 "B" +#else +#define VerChar5 "N" +#endif + +#if(ENABLED(ABL_UBL)) +#define VerChar6 "U" +#elif(ENABLED(ABL_BI)) +#define VerChar6 "B" +#else +#define VerChar6 "N" +#endif + +#define DETAILED_BUILD_VERSION SHORT_BUILD_VERSION " TM3D " VerChar1 VerChar2 VerChar3 VerChar4 VerChar5 VerChar6 + +#if ENABLED(PLUS) + #define lerdgeFilSensor //Using lerdge filament sensor, which is opposite polarity to stock) + #define HotendAllMetal + #define EZRstruder + #if DISABLED(ABL_UBL) + #define ABL_BI + #endif + #define ABL_BLTOUCH + #define HotendAllMetal +#endif + +#if(ENABLED(MachineCRX)) + #define MachineCR10Std + #define Dual_BowdenSplitterY +#endif + +#if ENABLED(MachineCR20Pro) + #define MachineCR20 + #define ABL_BLTOUCH + #define HotendAllMetal + #if DISABLED(ABL_UBL) + #define ABL_BI + #define POWER_LOSS_RECOVERY + #endif + #define SolidBedMounts +#endif /** * Select the serial port on the board to use for communication with the host. * This allows the connection of wireless adapters (for instance) to non-default port pins. @@ -132,7 +381,11 @@ // The following define selects which electronics board you have. // Please choose the name from boards.h that matches your setup #ifndef MOTHERBOARD - #define MOTHERBOARD BOARD_RAMPS_14_EFB +#if(ENABLED(MachineCR10Orig)) +#define MOTHERBOARD BOARD_MELZI_CREALITY +#else +#define MOTHERBOARD BOARD_RAMPS_14_EFB +#endif #endif // Optional custom name for your RepStrap or other custom machine @@ -147,13 +400,18 @@ // This defines the number of extruders // :[1, 2, 3, 4, 5, 6] -#define EXTRUDERS 1 - +#if(ENABLED(Dual_BowdenSplitterY) || ENABLED(Dual_CyclopsSingleNozzle) || ENABLED(Dual_ChimeraDualNozzle)) + #define EXTRUDERS 2 +#else + #define EXTRUDERS 1 +#endif // Generally expected filament diameter (1.75, 2.85, 3.0, ...). Used for Volumetric, Filament Width Sensor, etc. -#define DEFAULT_NOMINAL_FILAMENT_DIA 3.0 +#define DEFAULT_NOMINAL_FILAMENT_DIA 1.75 // For Cyclops or any "multi-extruder" that shares a single nozzle. -//#define SINGLENOZZLE +#if(ENABLED(Dual_BowdenSplitterY) || ENABLED(Dual_CyclopsSingleNozzle)) + #define SINGLENOZZLE +#endif /** * Průša MK2 Single Nozzle Multi-Material Multiplexer, and variants. @@ -280,8 +538,10 @@ // Offset of the extruders (uncomment if using more than one and relying on firmware to position when changing). // The offset has to be X=0, Y=0 for the extruder 0 hotend (default extruder). // For the other hotends it is their distance from the extruder 0 hotend. -//#define HOTEND_OFFSET_X {0.0, 20.00} // (mm) relative X-offset for each nozzle -//#define HOTEND_OFFSET_Y {0.0, 5.00} // (mm) relative Y-offset for each nozzle +#if(ENABLED(Dual_ChimeraDualNozzle)) + #define HOTEND_OFFSET_X {0.0, 18.00} // (in mm) for each extruder, offset of the hotend on the X axis + #define HOTEND_OFFSET_Y {0.0, 0.00} // (in mm) for each extruder, offset of the hotend on the Y axis +#endif //#define HOTEND_OFFSET_Z {0.0, 0.00} // (mm) relative Z-offset for each nozzle // @section machine @@ -369,15 +629,37 @@ * * :{ '0': "Not used", '1':"100k / 4.7k - EPCOS", '2':"200k / 4.7k - ATC Semitec 204GT-2", '3':"Mendel-parts / 4.7k", '4':"10k !! do not use for a hotend. Bad resolution at high temp. !!", '5':"100K / 4.7k - ATC Semitec 104GT-2 (Used in ParCan & J-Head)", '501':"100K Zonestar (Tronxy X3A)", '6':"100k / 4.7k EPCOS - Not as accurate as Table 1", '7':"100k / 4.7k Honeywell 135-104LAG-J01", '8':"100k / 4.7k 0603 SMD Vishay NTCS0603E3104FXT", '9':"100k / 4.7k GE Sensing AL03006-58.2K-97-G1", '10':"100k / 4.7k RS 198-961", '11':"100k / 4.7k beta 3950 1%", '12':"100k / 4.7k 0603 SMD Vishay NTCS0603E3104FXT (calibrated for Makibox hot bed)", '13':"100k Hisens 3950 1% up to 300°C for hotend 'Simple ONE ' & hotend 'All In ONE'", '20':"PT100 (Ultimainboard V2.x)", '51':"100k / 1k - EPCOS", '52':"200k / 1k - ATC Semitec 204GT-2", '55':"100k / 1k - ATC Semitec 104GT-2 (Used in ParCan & J-Head)", '60':"100k Maker's Tool Works Kapton Bed Thermistor beta=3950", '61':"100k Formbot / Vivedino 3950 350C thermistor 4.7k pullup", '66':"Dyze Design 4.7M High Temperature thermistor", '67':"Slice Engineering 450C High Temperature thermistor", '70':"the 100K thermistor found in the bq Hephestos 2", '71':"100k / 4.7k Honeywell 135-104LAF-J01", '147':"Pt100 / 4.7k", '1047':"Pt1000 / 4.7k", '110':"Pt100 / 1k (non-standard)", '1010':"Pt1000 / 1k (non standard)", '-4':"Thermocouple + AD8495", '-3':"Thermocouple + MAX31855 (only for sensor 0)", '-2':"Thermocouple + MAX6675 (only for sensor 0)", '-1':"Thermocouple + AD595",'998':"Dummy 1", '999':"Dummy 2" } */ +#if ENABLED(HotendStock) #define TEMP_SENSOR_0 1 -#define TEMP_SENSOR_1 0 + #if(ENABLED(Dual_ChimeraDualNozzle)) + #define TEMP_SENSOR_1 1 + #endif +#endif +#if ENABLED(HotendE3D) +#define TEMP_SENSOR_0 5 + #if(ENABLED(Dual_ChimeraDualNozzle)) + #define TEMP_SENSOR_1 5 + #endif +#endif +#if(DISABLED(Dual_ChimeraDualNozzle)) + #define TEMP_SENSOR_1 0 +#endif #define TEMP_SENSOR_2 0 #define TEMP_SENSOR_3 0 #define TEMP_SENSOR_4 0 #define TEMP_SENSOR_5 0 -#define TEMP_SENSOR_BED 0 -#define TEMP_SENSOR_CHAMBER 0 -#define CHAMBER_HEATER_PIN -1 // On/off pin for enclosure heating system +#if ENABLED(BedDC) + #define TEMP_SENSOR_BED 5 +#elif ENABLED(BedAC) + #define TEMP_SENSOR_BED 11 +#else + #define TEMP_SENSOR_BED 0 +#endif + +#if(ENABLED(EnclosureTempSensor)) + #define TEMP_SENSOR_CHAMBER 147 + #define CHAMBER_HEATER_PIN 12 +#endif // Dummy thermistor constant temperature readings, for use with 998 and 999 #define DUMMY_THERMISTOR_998_VALUE 25 @@ -388,31 +670,36 @@ //#define TEMP_SENSOR_1_AS_REDUNDANT #define MAX_REDUNDANT_TEMP_SENSOR_DIFF 10 -#define TEMP_RESIDENCY_TIME 10 // (seconds) Time to wait for hotend to "settle" in M109 -#define TEMP_WINDOW 1 // (°C) Temperature proximity for the "temperature reached" timer -#define TEMP_HYSTERESIS 3 // (°C) Temperature proximity considered "close enough" to the target +// Extruder temperature must be close to target for this long before M109 returns success +#define TEMP_RESIDENCY_TIME 10 // (seconds) +#define TEMP_HYSTERESIS 3 // (degC) range of +/- temperatures considered "close" to the target one +#define TEMP_WINDOW 1 // (degC) Window around target to start the residency timer x degC early. -#define TEMP_BED_RESIDENCY_TIME 10 // (seconds) Time to wait for bed to "settle" in M190 -#define TEMP_BED_WINDOW 1 // (°C) Temperature proximity for the "temperature reached" timer -#define TEMP_BED_HYSTERESIS 3 // (°C) Temperature proximity considered "close enough" to the target +// Bed temperature must be close to target for this long before M190 returns success +#define TEMP_BED_RESIDENCY_TIME 10 // (seconds) +#define TEMP_BED_HYSTERESIS 3 // (degC) range of +/- temperatures considered "close" to the target one +#define TEMP_BED_WINDOW 1 // (degC) Window around target to start the residency timer x degC early. -#define TEMP_CHAMBER_HYSTERESIS 3 // (°C) Temperature proximity considered "close enough" to the target - -// Below this temperature the heater will be switched off -// because it probably indicates a broken thermistor wire. -#define HEATER_0_MINTEMP 5 -#define HEATER_1_MINTEMP 5 -#define HEATER_2_MINTEMP 5 -#define HEATER_3_MINTEMP 5 -#define HEATER_4_MINTEMP 5 -#define HEATER_5_MINTEMP 5 -#define BED_MINTEMP 5 +// The minimal temperature defines the temperature below which the heater will not be enabled It is used +// to check that the wiring to the thermistor is not broken. +// Otherwise this would lead to the heater being powered on all the time. +#define HEATER_0_MINTEMP 5 +#define HEATER_1_MINTEMP 5 +#define HEATER_2_MINTEMP 5 +#define HEATER_3_MINTEMP 5 +#define HEATER_4_MINTEMP 5 +#define HEATER_5_MINTEMP 5 +#define BED_MINTEMP 5 #define CHAMBER_MINTEMP 5 -// 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 +// When temperature exceeds max temp, your heater will be switched off. +// This feature exists to protect your hotend from overheating accidentally, but *NOT* from thermistor short/failure! +// You should use MINTEMP for thermistor short/failure protection. +#if (ENABLED(HotendAllMetal)) + #define HEATER_0_MAXTEMP 310 +#else + #define HEATER_0_MAXTEMP 250 +#endif #define HEATER_1_MAXTEMP 275 #define HEATER_2_MAXTEMP 275 #define HEATER_3_MAXTEMP 275 @@ -432,11 +719,13 @@ #define PID_MAX BANG_MAX // Limits current to nozzle while PID is active (see PID_FUNCTIONAL_RANGE below); 255=full current #define PID_K1 0.95 // Smoothing factor within any PID loop #if ENABLED(PIDTEMP) - //#define PID_EDIT_MENU // Add PID editing to the "Advanced Settings" menu. (~700 bytes of PROGMEM) - //#define PID_AUTOTUNE_MENU // Add PID auto-tuning to the "Advanced Settings" menu. (~250 bytes of PROGMEM) - //#define PID_DEBUG // Sends debug data to the serial port. - //#define PID_OPENLOOP 1 // Puts PID in open loop. M104/M140 sets the output power from 0 to PID_MAX - //#define SLOW_PWM_HEATERS // PWM with very low frequency (roughly 0.125Hz=8s) and minimum state time of approximately 1s useful for heaters driven by a relay +#if(DISABLED(MachineCR10Orig)) + #define PID_EDIT_MENU + #define PID_AUTOTUNE_MENU // Add PID Autotune to the LCD "Temperature" menu to run M303 and apply the result. +#endif + //#define PID_DEBUG // Sends debug data to the serial port. + //#define PID_OPENLOOP 1 // Puts PID in open loop. M104/M140 sets the output power from 0 to PID_MAX + //#define SLOW_PWM_HEATERS // PWM with very low frequency (roughly 0.125Hz=8s) and minimum state time of approximately 1s useful for heaters driven by a relay //#define PID_PARAMS_PER_HOTEND // Uses separate PID parameters for each extruder (useful for mismatched extruders) // Set/get with gcode: M301 E[extruder number, 0-2] #define PID_FUNCTIONAL_RANGE 10 // If the temperature difference between the target temperature and the actual temperature @@ -444,10 +733,31 @@ // If you are using a pre-configured hotend then you can use one of the value sets by uncommenting it +#if ENABLED(HotendStock) + + #if(ENABLED(MachineCRX)) + #define DEFAULT_Kp 17.5 + #define DEFAULT_Ki 1.37 + #define DEFAULT_Kd 55.47 + #else + // Stock CR-10 Hotend fan 100% + #define DEFAULT_Kp 17.42 + #define DEFAULT_Ki 1.27 + #define DEFAULT_Kd 59.93 + #endif +#endif + +#if ENABLED(HotendE3D) +//E3D v6 Clone with 5050 fan wing at 100% set to 235 +#define DEFAULT_Kp 23.36 +#define DEFAULT_Ki 1.99 +#define DEFAULT_Kd 87.46 +#endif + // Ultimaker - #define DEFAULT_Kp 22.2 - #define DEFAULT_Ki 1.08 - #define DEFAULT_Kd 114 + //#define DEFAULT_Kp 22.2 + //#define DEFAULT_Ki 1.08 + //#define DEFAULT_Kd 114 // MakerGear //#define DEFAULT_Kp 7.0 @@ -478,8 +788,9 @@ * 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 - + #if(DISABLED(MachineCR10Orig) && DISABLED(LowMemoryBoard)) +#define PIDTEMPBED +#endif //#define BED_LIMIT_SWITCHING /** @@ -496,9 +807,9 @@ //120V 250W silicone heater into 4mm borosilicate (MendelMax 1.5+) //from FOPDT model - kp=.39 Tp=405 Tdead=66, Tc set to 79.2, aggressive factor of .15 (vs .1, 1, 10) - #define DEFAULT_bedKp 10.00 - #define DEFAULT_bedKi .023 - #define DEFAULT_bedKd 305.4 +#define DEFAULT_bedKp 690.34 +#define DEFAULT_bedKi 111.47 +#define DEFAULT_bedKd 1068.83 //120V 250W silicone heater into 4mm borosilicate (MendelMax 1.5+) //from pidautotune @@ -519,14 +830,14 @@ * *** IT IS HIGHLY RECOMMENDED TO LEAVE THIS OPTION ENABLED! *** */ #define PREVENT_COLD_EXTRUSION -#define EXTRUDE_MINTEMP 170 +#define EXTRUDE_MINTEMP 160 /** * Prevent a single extrusion longer than EXTRUDE_MAXLENGTH. * Note: For Bowden Extruders make this large enough to allow load/unload. */ #define PREVENT_LENGTHY_EXTRUDE -#define EXTRUDE_MAXLENGTH 200 +#define EXTRUDE_MAXLENGTH 500 //=========================================================================== //======================== Thermal Runaway Protection ======================= @@ -557,7 +868,9 @@ // Uncomment one of these options to enable CoreXY, CoreXZ, or CoreYZ kinematics // either in the usual order or reversed -//#define COREXY +#if(ENABLED(MachineEnder4)) + #define COREXY +#endif //#define COREXZ //#define COREYZ //#define COREYX @@ -607,14 +920,23 @@ #endif // Mechanical endstop with COM to ground and NC to Signal uses "false" here (most common setup). +#if(ENABLED(MachineEnder4)) +#define X_MIN_ENDSTOP_INVERTING true // set to true to invert the logic of the endstop. +#else #define X_MIN_ENDSTOP_INVERTING false // set to true to invert the logic of the endstop. +#endif #define Y_MIN_ENDSTOP_INVERTING false // set to true to invert the logic of the endstop. -#define Z_MIN_ENDSTOP_INVERTING false // set to true to invert the logic of the endstop. #define X_MAX_ENDSTOP_INVERTING false // set to true to invert the logic of the endstop. #define Y_MAX_ENDSTOP_INVERTING false // set to true to invert the logic of the endstop. -#define Z_MAX_ENDSTOP_INVERTING false // set to true to invert the logic of the endstop. -#define Z_MIN_PROBE_ENDSTOP_INVERTING false // set to true to invert the logic of the probe. +#define Z_MAX_ENDSTOP_INVERTING true // set to true to invert the logic of the endstop. +#if (DISABLED(ABL_EZABL)&& DISABLED(ABL_BLTOUCH)) + #define Z_MIN_ENDSTOP_INVERTING false // set to true to invert the logic of the endstop. + #define Z_MIN_PROBE_ENDSTOP_INVERTING false // set to true to invert the logic of the probe. +#else +#define Z_MIN_ENDSTOP_INVERTING true // set to true to invert the logic of the endstop. +#define Z_MIN_PROBE_ENDSTOP_INVERTING true // set to true to invert the logic of the probe. +#endif /** * Stepper Drivers * @@ -630,15 +952,15 @@ * TMC5160, TMC5160_STANDALONE * :['A4988', 'A5984', 'DRV8825', 'LV8729', 'L6470', 'TB6560', 'TB6600', 'TMC2100', 'TMC2130', 'TMC2130_STANDALONE', 'TMC2160', 'TMC2160_STANDALONE', 'TMC2208', 'TMC2208_STANDALONE', 'TMC26X', 'TMC26X_STANDALONE', 'TMC2660', 'TMC2660_STANDALONE', 'TMC5130', 'TMC5130_STANDALONE', 'TMC5160', 'TMC5160_STANDALONE'] */ -//#define X_DRIVER_TYPE A4988 -//#define Y_DRIVER_TYPE A4988 -//#define Z_DRIVER_TYPE A4988 +#define X_DRIVER_TYPE A4988 +#define Y_DRIVER_TYPE A4988 +#define Z_DRIVER_TYPE A4988 //#define X2_DRIVER_TYPE A4988 //#define Y2_DRIVER_TYPE A4988 //#define Z2_DRIVER_TYPE A4988 //#define Z3_DRIVER_TYPE A4988 -//#define E0_DRIVER_TYPE A4988 -//#define E1_DRIVER_TYPE A4988 +#define E0_DRIVER_TYPE A4988 +#define E1_DRIVER_TYPE A4988 //#define E2_DRIVER_TYPE A4988 //#define E3_DRIVER_TYPE A4988 //#define E4_DRIVER_TYPE A4988 @@ -687,22 +1009,92 @@ * Override with M92 * X, Y, Z, E0 [, E1[, E2[, E3[, E4[, E5]]]]] */ -#define DEFAULT_AXIS_STEPS_PER_UNIT { 80, 80, 4000, 500 } + +#if(ENABLED(Bondtech) || ENABLED(E3DTitan)) + #define EStepsmm 415 +#elif ENABLED(EZRstruder) + #define EStepsmm 93 +#elif ENABLED(MachineCR10SPro) + #define EStepsmm 140 +#else + #define EStepsmm 95 +#endif + +#define DEFAULT_AXIS_STEPS_PER_UNIT { 80, 80, 400, EStepsmm } /** * Default Max Feed Rate (mm/s) * Override with M203 * X, Y, Z, E0 [, E1[, E2[, E3[, E4[, E5]]]]] */ -#define DEFAULT_MAX_FEEDRATE { 300, 300, 5, 25 } +#if ENABLED(MachineCR20Pro) + #define DEFAULT_MAX_FEEDRATE { 7500, 7500, 10, 25 } + #define DEFAULT_MAX_ACCELERATION { 2000, 2000, 100, 25 } + #define DEFAULT_ACCELERATION 300 // X, Y, Z and E acceleration for printing moves + #define DEFAULT_RETRACT_ACCELERATION 1000 // E acceleration for retracts + #define DEFAULT_TRAVEL_ACCELERATION 300 // X, Y, Z acceleration for travel (non printing) moves + #define DEFAULT_XJERK 10.0 + #define DEFAULT_YJERK 8.0 + #define DEFAULT_ZJERK 0.4 + #define DEFAULT_EJERK 5.0 +#elif (ENABLED(MachineMini) || ENABLED(MachineCR20) || ENABLED(MachineEnder2) || ENABLED(MachineEnder3) || ENABLED(MachineEnder4)) + #define DEFAULT_MAX_FEEDRATE { 750, 750, 10, 25 } + #define DEFAULT_MAX_ACCELERATION { 2000, 2000, 100, 25 } + #define DEFAULT_ACCELERATION 300 // X, Y, Z and E acceleration for printing moves + #define DEFAULT_RETRACT_ACCELERATION 1000 // E acceleration for retracts + #define DEFAULT_TRAVEL_ACCELERATION 300 // X, Y, Z acceleration for travel (non printing) moves + #define DEFAULT_XJERK 10.0 + #define DEFAULT_YJERK 8.0 + #define DEFAULT_ZJERK 0.4 + #define DEFAULT_EJERK 5.0 +#elif (ENABLED(MachineCR10SPro)) + #define DEFAULT_MAX_FEEDRATE { 500, 500, 10, 25 } + #define DEFAULT_MAX_ACCELERATION { 750, 750, 100, 25 } + #define DEFAULT_ACCELERATION 300 // X, Y, Z and E acceleration for printing moves + #define DEFAULT_RETRACT_ACCELERATION 1000 // E acceleration for retracts + #define DEFAULT_TRAVEL_ACCELERATION 300 // X, Y, Z acceleration for travel (non printing) moves + #define DEFAULT_XJERK 8.0 + #define DEFAULT_YJERK 8.0 + #define DEFAULT_ZJERK 0.4 + #define DEFAULT_EJERK 5.0 +#elif (ENABLED(MachineCR10Std)) + #define DEFAULT_MAX_FEEDRATE { 500, 500, 10, 25 } + #define DEFAULT_MAX_ACCELERATION { 1500, 1500, 100, 25 } + #define DEFAULT_ACCELERATION 300 // X, Y, Z and E acceleration for printing moves + #define DEFAULT_RETRACT_ACCELERATION 1000 // E acceleration for retracts + #define DEFAULT_TRAVEL_ACCELERATION 300 // X, Y, Z acceleration for travel (non printing) moves + #define DEFAULT_XJERK 10.0 + #define DEFAULT_YJERK 8.0 + #define DEFAULT_ZJERK 0.4 + #define DEFAULT_EJERK 5.0 +#elif ENABLED( MachineS4) + #define DEFAULT_MAX_FEEDRATE { 500, 400, 10, 25 } + #define DEFAULT_MAX_ACCELERATION { 1000, 750, 100, 25 } + #define DEFAULT_ACCELERATION 300 // X, Y, Z and E acceleration for printing moves + #define DEFAULT_RETRACT_ACCELERATION 1000 // E acceleration for retracts + #define DEFAULT_TRAVEL_ACCELERATION 300 // X, Y, Z acceleration for travel (non printing) moves + #define DEFAULT_XJERK 10.0 + #define DEFAULT_YJERK 6.0 + #define DEFAULT_ZJERK 0.4 + #define DEFAULT_EJERK 5.0 +#elif ENABLED(MachineS5) + #define DEFAULT_MAX_FEEDRATE { 300, 300, 10, 25 } + #define DEFAULT_MAX_ACCELERATION { 1000, 500, 100, 25 } + #define DEFAULT_ACCELERATION 300 // X, Y, Z and E acceleration for printing moves + #define DEFAULT_RETRACT_ACCELERATION 1000 // E acceleration for retracts + #define DEFAULT_TRAVEL_ACCELERATION 300 // X, Y, Z acceleration for travel (non printing) moves + #define DEFAULT_XJERK 10.0 + #define DEFAULT_YJERK 5.0 + #define DEFAULT_ZJERK 0.4 + #define DEFAULT_EJERK 5.0 +#endif /** * Default Max Acceleration (change/s) change = mm/s * (Maximum start speed for accelerated moves) * Override with M201 - * X, Y, Z, E0 [, E1[, E2[, E3[, E4[, E5]]]]] + * X, Y, Z, E0 [, E1[, E2[, E3[, E4]]]] */ -#define DEFAULT_MAX_ACCELERATION { 3000, 3000, 100, 10000 } /** * Default Acceleration (change/s) change = mm/s @@ -712,14 +1104,11 @@ * 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 // // Use Junction Deviation instead of traditional Jerk Limiting // -//#define JUNCTION_DEVIATION +#define JUNCTION_DEVIATION #if ENABLED(JUNCTION_DEVIATION) #define JUNCTION_DEVIATION_MM 0.02 // (mm) Distance from real junction edge #endif @@ -732,13 +1121,6 @@ * When changing speed and direction, if the difference is less than the * value set here, it may happen instantaneously. */ -#if DISABLED(JUNCTION_DEVIATION) - #define DEFAULT_XJERK 10.0 - #define DEFAULT_YJERK 10.0 - #define DEFAULT_ZJERK 0.3 -#endif - -#define DEFAULT_EJERK 5.0 // May be used by Linear Advance /** * S-Curve Acceleration @@ -748,7 +1130,7 @@ * * See https://github.com/synthetos/TinyG/wiki/Jerk-Controlled-Motion-Explained */ -//#define S_CURVE_ACCELERATION +#define S_CURVE_ACCELERATION //=========================================================================== //============================= Z Probe Options ============================= @@ -796,14 +1178,18 @@ * Use G29 repeatedly, adjusting the Z height at each point with movement commands * or (with LCD_BED_LEVELING) the LCD controller. */ -//#define PROBE_MANUALLY -//#define MANUAL_PROBE_START_Z 0.2 +#if (DISABLED(ABL_EZABL) &&DISABLED(ABL_NCSW) && DISABLED(ABL_BLTOUCH) ) +#define PROBE_MANUALLY +#define MANUAL_PROBE_START_Z 0.2 +#endif /** * A Fix-Mounted Probe either doesn't deploy or needs manual deployment. * (e.g., an inductive probe or a nozzle-based probe-switch.) */ -//#define FIX_MOUNTED_PROBE +#if ENABLED(ABL_EZABL) || ENABLED(ABL_NCSW) + #define FIX_MOUNTED_PROBE +#endif /** * Z Servo Probe, such as an endstop switch on a rotating arm. @@ -814,13 +1200,42 @@ /** * The BLTouch probe uses a Hall effect sensor and emulates a servo. */ -//#define BLTOUCH +#if ENABLED(ABL_BLTOUCH) +#define BLTOUCH +#endif #if ENABLED(BLTOUCH) - //#define BLTOUCH_DELAY 375 // (ms) Enable and increase if needed +#define BLTOUCH_DELAY 375 // (ms) Enable and increase if needed #endif +/** + * Enable one or more of the following if probing seems unreliable. + * Heaters and/or fans can be disabled during probing to minimize electrical + * noise. A delay can also be added to allow noise and vibration to settle. + * These options are most useful for the BLTouch probe, but may also improve + * readings with inductive probes and piezo sensors. + */ +#if ((ENABLED(ABL_EZABL) || ENABLED(ABL_NCSW)) && ENABLED(BED_AC)) +#define PROBING_HEATERS_OFF // Turn heaters off when probing +#endif +// 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) +#endif +//#define PROBING_FANS_OFF // Turn fans off when probing +//#define DELAY_BEFORE_PROBING 200 // (ms) To prevent vibrations from triggering piezo sensors + // A probe that is deployed and stowed with a solenoid pin (SOL1_PIN) -//#define SOLENOID_PROBE +#if ENABLED(ABL_BLTOUCH) +#define PROBING_FANS_OFF // Turn fans off when probing +#if(ENABLED(MachineCR10Orig)) +#define SOLENOID_PROBE PIN_27 +#define SERVO0_PIN 27 +#elif(ENABLED(MachineEnder4)) +#define SOLENOID_PROBE PIN_15 +#else +#define SOLENOID_PROBE PIN_11 +#endif +#endif // A sled-mounted probe like those designed by Charles Bell. //#define Z_PROBE_SLED @@ -856,15 +1271,55 @@ * O-- FRONT --+ * (0,0) */ -#define X_PROBE_OFFSET_FROM_EXTRUDER 10 // X offset: -left +right [of the nozzle] -#define Y_PROBE_OFFSET_FROM_EXTRUDER 10 // Y offset: -front +behind [the nozzle] -#define Z_PROBE_OFFSET_FROM_EXTRUDER 0 // Z offset: -below +above [the nozzle] + #if ENABLED(MachineCRX) && ENABLED(HotendStock) + #if ENABLED(ABL_BLTOUCH) + #define X_PROBE_OFFSET_FROM_EXTRUDER -22 // X offset: -left +right [of the nozzle] + #define Y_PROBE_OFFSET_FROM_EXTRUDER -45 // Y offset: -front +behind [the nozzle] + #define Z_PROBE_OFFSET_FROM_EXTRUDER 0 // Z offset: -below +above [the nozzle] + #endif + + #if ENABLED(ABL_EZABL) || ENABLED(ABL_NCSW) + #define X_PROBE_OFFSET_FROM_EXTRUDER -44 // X offset: -left +right [of the nozzle] + #define Y_PROBE_OFFSET_FROM_EXTRUDER -10 // Y offset: -front +behind [the nozzle] + #define Z_PROBE_OFFSET_FROM_EXTRUDER 0 // Z offset: -below +above [the nozzle] + #endif + #else + #if (ENABLED(ABL_BLTOUCH) && ENABLED(HotendStock)) + #define X_PROBE_OFFSET_FROM_EXTRUDER -41 // X offset: -left +right [of the nozzle] + #define Y_PROBE_OFFSET_FROM_EXTRUDER -8 // Y offset: -front +behind [the nozzle] + #define Z_PROBE_OFFSET_FROM_EXTRUDER 0 // Z offset: -below +above [the nozzle] + #endif + + #if ((ENABLED(ABL_EZABL) || ENABLED(ABL_NCSW)) && ENABLED(HotendStock)) && DISABLED(CREALITY_ABL_MOUNT) + #define X_PROBE_OFFSET_FROM_EXTRUDER -44 // X offset: -left +right [of the nozzle] + #define Y_PROBE_OFFSET_FROM_EXTRUDER -10 // Y offset: -front +behind [the nozzle] + #define Z_PROBE_OFFSET_FROM_EXTRUDER 0 // Z offset: -below +above [the nozzle] + #endif + + #if ((ENABLED(ABL_EZABL) || ENABLED(ABL_NCSW)) && ENABLED(HotendStock)) && ENABLED(CREALITY_ABL_MOUNT) + #define X_PROBE_OFFSET_FROM_EXTRUDER -55 // X offset: -left +right [of the nozzle] + #define Y_PROBE_OFFSET_FROM_EXTRUDER -15 // Y offset: -front +behind [the nozzle] + #define Z_PROBE_OFFSET_FROM_EXTRUDER 0 // Z offset: -below +above [the nozzle] + #endif + + #if (ENABLED(ABL_BLTOUCH) && ENABLED(HotendE3D)) + #define X_PROBE_OFFSET_FROM_EXTRUDER 33 // X offset: -left +right [of the nozzle] + #define Y_PROBE_OFFSET_FROM_EXTRUDER 5 // Y offset: -front +behind [the nozzle] + #define Z_PROBE_OFFSET_FROM_EXTRUDER 0 // Z offset: -below +above [the nozzle] + #endif + + #if ((ENABLED(ABL_EZABL) || ENABLED(ABL_NCSW)) && ENABLED(HotendE3D)) + #define X_PROBE_OFFSET_FROM_EXTRUDER 33 // X offset: -left +right [of the nozzle] + #define Y_PROBE_OFFSET_FROM_EXTRUDER 5 // Y offset: -front +behind [the nozzle] + #define Z_PROBE_OFFSET_FROM_EXTRUDER 0 // Z offset: -below +above [the nozzle] + #endif + #endif // Certain types of probes need to stay away from edges #define MIN_PROBE_EDGE 10 // X and Y axis travel speed (mm/m) between probes -#define XY_PROBE_SPEED 8000 +#define XY_PROBE_SPEED 6000 // Feedrate (mm/m) for the first approach when double-probing (MULTIPLE_PROBING == 2) #define Z_PROBE_SPEED_FAST HOMING_FEEDRATE_Z @@ -875,7 +1330,7 @@ // The number of probes to perform at each point. // Set to 2 for a fast/slow probe, using the second probe result. // Set to 3 or more for slow probes, averaging the results. -//#define MULTIPLE_PROBING 2 +#define MULTIPLE_PROBING 2 /** * Z probes require clearance when deploying, stowing, and moving between @@ -894,35 +1349,20 @@ #define Z_CLEARANCE_DEPLOY_PROBE 10 // Z Clearance for Deploy/Stow #define Z_CLEARANCE_BETWEEN_PROBES 5 // Z Clearance between probe points #define Z_CLEARANCE_MULTI_PROBE 5 // Z Clearance between multiple probes -//#define Z_AFTER_PROBING 5 // Z position after probing is done +#define Z_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 // Enable the M48 repeatability test to test probe accuracy -//#define Z_MIN_PROBE_REPEATABILITY_TEST - -// Before deploy/stow pause for user confirmation -//#define PAUSE_BEFORE_DEPLOY_STOW - -/** - * Enable one or more of the following if probing seems unreliable. - * Heaters and/or fans can be disabled during probing to minimize electrical - * noise. A delay can also be added to allow noise and vibration to settle. - * 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 -#if ENABLED(PROBING_HEATERS_OFF) - //#define WAIT_FOR_BED_HEATER // Wait for bed to heat back up between probes (to improve accuracy) +#if (ENABLED(ABL_EZABL)|| ENABLED(ABL_BLTOUCH) || ENABLED(ABL_NCSW)) +#if(DISABLED(MachineCR10Orig)) +#define Z_MIN_PROBE_REPEATABILITY_TEST +#endif #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 DELAY_BEFORE_PROBING 200 // (ms) To prevent vibrations from triggering piezo sensors - // For Inverting Stepper Enable Pins (Active Low) use 0, Non Inverting (Active High) use 1 // :{ 0:'Low', 1:'High' } #define X_ENABLE_ON 0 @@ -947,15 +1387,49 @@ // @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 +#if(ENABLED(MachineCR10Orig)) + #define INVERT_X_DIR true + #define INVERT_Y_DIR true + #define INVERT_Z_DIR false + #if(ENABLED(E3DTitan)) + #define INVERT_E0_DIR false + #define INVERT_E1_DIR true + #else + #define INVERT_E0_DIR true + #define INVERT_E1_DIR false +#endif +#elif(ENABLED(MachineEnder4)) + #define INVERT_X_DIR true + #define INVERT_Y_DIR true + #define INVERT_Z_DIR true + #if(ENABLED(E3DTitan)) + #define INVERT_E0_DIR false + #define INVERT_E1_DIR true + #else + #define INVERT_E0_DIR true + #define INVERT_E1_DIR false + #endif +#else + #define INVERT_X_DIR false + #if(ENABLED(MachineCRX) || ENABLED(MachineCR10SPro)) + #define INVERT_Y_DIR true + #else + #define INVERT_Y_DIR false + #endif + #define INVERT_Z_DIR true + #if(ENABLED(E3DTitan)) + #define INVERT_E0_DIR true + #define INVERT_E1_DIR false + #else + #define INVERT_E0_DIR false + #define INVERT_E1_DIR true + #endif +#endif // @section extruder // For direct drive extruder v9 set to true, for geared extruder set to false. -#define INVERT_E0_DIR false -#define INVERT_E1_DIR false + #define INVERT_E2_DIR false #define INVERT_E3_DIR false #define INVERT_E4_DIR false @@ -967,7 +1441,7 @@ //#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 4 // (in mm) Minimal z height before homing (G28) for Z clearance above the bed, clamps, ... // Be sure you have this distance over your Z_MAX_POS in case. // Direction of endstops when homing; 1=MAX, -1=MIN @@ -979,8 +1453,95 @@ // @section machine // The size of the print bed -#define X_BED_SIZE 200 -#define Y_BED_SIZE 200 + +#if (DISABLED(ABL_EZABL)&& DISABLED(ABL_BLTOUCH) && DISABLED(ABL_NCSW)) + +#if ENABLED(MachineMini) +#define X_BED_SIZE 300 +#define Y_BED_SIZE 220 +#define Z_MAX_POS 300 +#endif +#if(ENABLED(MachineEnder2)) +#define X_BED_SIZE 150 +#define Y_BED_SIZE 150 +#define Z_MAX_POS 200 +#endif +#if(ENABLED(MachineEnder3)) +#define X_BED_SIZE 230 +#define Y_BED_SIZE 230 +#define Z_MAX_POS 250 +#endif +#if(ENABLED(MachineEnder4)) +#define X_BED_SIZE 220 +#define Y_BED_SIZE 220 +#define Z_MAX_POS 300 +#endif + +#if(ENABLED(MachineCR20)) +#define X_BED_SIZE 230 +#define Y_BED_SIZE 230 +#define Z_MAX_POS 250 +#endif + +#if (ENABLED(MachineCR10Std)) +#define X_BED_SIZE 300 +#define Y_BED_SIZE 300 +#define Z_MAX_POS 400 +#endif + +#if ENABLED( MachineS4) +#define X_BED_SIZE 400 +#define Y_BED_SIZE 400 +#define Z_MAX_POS 400 +#endif +#if ENABLED(MachineS5) +#define X_BED_SIZE 500 +#define Y_BED_SIZE 500 +#define Z_MAX_POS 500 +#endif +// The size of the print bed + +#else + +#if ENABLED(MachineMini) +#define X_BED_SIZE 300 +#define Y_BED_SIZE 220 +#define Z_MAX_POS 300 +#elif(ENABLED(MachineEnder2)) +#define X_BED_SIZE 150 +#define Y_BED_SIZE 150 +#define Z_MAX_POS 200 +#elif(ENABLED(MachineEnder3)) +#define X_BED_SIZE 230 +#define Y_BED_SIZE 230 +#define Z_MAX_POS 250 +#elif(ENABLED(MachineEnder4)) +#define X_BED_SIZE 220 +#define Y_BED_SIZE 220 +#define Z_MAX_POS 300 +#elif(ENABLED(MachineCR20)) +#define X_BED_SIZE 240 +#define Y_BED_SIZE 240 +#define Z_MAX_POS 250 +#elif (ENABLED(MachineCRX)) +#define X_BED_SIZE 315 +#define Y_BED_SIZE 330 +#define Z_MAX_POS 400 +#elif (ENABLED(MachineCR10Std)) +#define X_BED_SIZE 315 +#define Y_BED_SIZE 310 +#define Z_MAX_POS 400 +#elif ENABLED( MachineS4) +#define X_BED_SIZE 410 +#define Y_BED_SIZE 400 +#define Z_MAX_POS 400 +#elif ENABLED(MachineS5) +#define X_BED_SIZE 510 +#define Y_BED_SIZE 500 +#define Z_MAX_POS 500 +#endif + +#endif // Travel limits (mm) after homing, corresponding to endstop positions. #define X_MIN_POS 0 @@ -988,7 +1549,6 @@ #define Z_MIN_POS 0 #define X_MAX_POS X_BED_SIZE #define Y_MAX_POS Y_BED_SIZE -#define Z_MAX_POS 200 /** * Software Endstops @@ -1014,11 +1574,11 @@ #define MAX_SOFTWARE_ENDSTOP_Y #define MAX_SOFTWARE_ENDSTOP_Z #endif - +#if(DISABLED(MachineCR10Orig) && DISABLED(LowMemoryBoard)) #if ENABLED(MIN_SOFTWARE_ENDSTOPS) || ENABLED(MAX_SOFTWARE_ENDSTOPS) - //#define SOFT_ENDSTOPS_MENU_ITEM // Enable/Disable software endstops from the LCD + #define SOFT_ENDSTOPS_MENU_ITEM // Enable/Disable software endstops from the LCD +#endif #endif - /** * Filament Runout Sensors * Mechanical or opto endstops are used to check for the presence of filament. @@ -1027,21 +1587,29 @@ * For other boards you may need to define FIL_RUNOUT_PIN, FIL_RUNOUT2_PIN, etc. * By default the firmware assumes HIGH=FILAMENT PRESENT. */ -//#define FILAMENT_RUNOUT_SENSOR +#if(DISABLED(MachineCR10Orig) &&(DISABLED(MachineCR20)|| ENABLED(AddonFilSensor)) && (DISABLED(MachineEnder4) || ENABLED(AddonFilSensor)) && (DISABLED(MachineCRX)|| ENABLED(AddonFilSensor) || ENABLED(DualFilSensors))) + #define FILAMENT_RUNOUT_SENSOR +#endif #if ENABLED(FILAMENT_RUNOUT_SENSOR) - #define NUM_RUNOUT_SENSORS 1 // Number of sensors, up to one per extruder. Define a FIL_RUNOUT#_PIN for each. - #define FIL_RUNOUT_INVERTING false // set to true to invert the logic of the sensor. + #if ENABLED(DualFilSensors) + #define NUM_RUNOUT_SENSORS 2 // Number of sensors, up to one per extruder. Define a FIL_RUNOUT#_PIN for each. + #define FIL_RUNOUT2_PIN 15 + #else + #define NUM_RUNOUT_SENSORS 1 // Number of sensors, up to one per extruder. Define a FIL_RUNOUT#_PIN for each. + #endif + #if ENABLED(lerdgeFilSensor) + #define FIL_RUNOUT_INVERTING false // set to true to invert the logic of the sensor. + #else + #define FIL_RUNOUT_INVERTING true // set to true to invert the logic of the sensor. + #endif #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.) - #define FILAMENT_RUNOUT_SCRIPT "M600" - + #define FILAMENT_RUNOUT_SCRIPT "M600 \n M117 \n" + #define FIL_RUNOUT_PIN 2 // 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 @@ -1091,15 +1659,21 @@ */ //#define AUTO_BED_LEVELING_3POINT //#define AUTO_BED_LEVELING_LINEAR -//#define AUTO_BED_LEVELING_BILINEAR -//#define AUTO_BED_LEVELING_UBL -//#define MESH_BED_LEVELING - +#if (ENABLED(ABL_EZABL)|| ENABLED(ABL_BLTOUCH) || ENABLED(ABL_NCSW)) + #if ((ENABLED(ABL_UBL))) + #define AUTO_BED_LEVELING_UBL + #endif + #if ((ENABLED(ABL_BI))) + #define AUTO_BED_LEVELING_BILINEAR + #endif +#elif (DISABLED(OrigLA)) + #define MESH_BED_LEVELING +#endif /** * Normally G28 leaves leveling disabled on completion. Enable * this option to have G28 restore the prior leveling state. */ -//#define RESTORE_LEVELING_AFTER_G28 +#define RESTORE_LEVELING_AFTER_G28 /** * Enable detailed logging of G28, G29, M48, etc. @@ -1117,13 +1691,17 @@ // For Cartesian machines, instead of dividing moves on mesh boundaries, // split up moves into short segments like a Delta. This follows the // contours of the bed more closely than edge-to-edge straight moves. - #define SEGMENT_LEVELED_MOVES - #define LEVELED_SEGMENT_LENGTH 5.0 // (mm) Length of all segments (except the last one) + #if DISABLED(ABL_UBL) + #define SEGMENT_LEVELED_MOVES + #define LEVELED_SEGMENT_LENGTH 5.0 // (mm) Length of all segments (except the last one) + #endif /** * Enable the G26 Mesh Validation Pattern tool. */ - //#define G26_MESH_VALIDATION +#if(DISABLED(MachineCR10Orig)) +#define G26_MESH_VALIDATION // Enable G26 mesh validation +#endif #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 the G26 Mesh Validation Tool. @@ -1134,17 +1712,49 @@ #endif +#if ENABLED(MeshFast) +#define GRID_MAX_POINTS_X 3 +#elif (ENABLED(MeshStd) ) + #define GRID_MAX_POINTS_X 5 +#elif ENABLED( MeshFine) + #define GRID_MAX_POINTS_X 8 +#elif ENABLED(MeshExtreme) + #define GRID_MAX_POINTS_X 15 +#else + GRID_MAX_POINTS_X 3 +#endif + #define GRID_MAX_POINTS_Y GRID_MAX_POINTS_X + #if ENABLED(AUTO_BED_LEVELING_LINEAR) || ENABLED(AUTO_BED_LEVELING_BILINEAR) // Set the number of grid points per dimension. - #define GRID_MAX_POINTS_X 3 - #define GRID_MAX_POINTS_Y GRID_MAX_POINTS_X - // Set the boundaries for probing (where the probe can reach). - //#define LEFT_PROBE_BED_POSITION MIN_PROBE_EDGE - //#define RIGHT_PROBE_BED_POSITION (X_BED_SIZE - (MIN_PROBE_EDGE)) - //#define FRONT_PROBE_BED_POSITION MIN_PROBE_EDGE - //#define BACK_PROBE_BED_POSITION (Y_BED_SIZE - (MIN_PROBE_EDGE)) + + +// Set the boundaries for probing (where the probe can reach). +#if( (X_PROBE_OFFSET_FROM_EXTRUDER + 15) > 0 ) +#define LEFT_PROBE_BED_POSITION (X_PROBE_OFFSET_FROM_EXTRUDER + 5) +#else +#define LEFT_PROBE_BED_POSITION 10 +#endif + +#if( (X_BED_SIZE + X_PROBE_OFFSET_FROM_EXTRUDER - 5) < X_BED_SIZE) +#define RIGHT_PROBE_BED_POSITION (X_BED_SIZE + X_PROBE_OFFSET_FROM_EXTRUDER - 5) +#else +#define RIGHT_PROBE_BED_POSITION (X_BED_SIZE - X_PROBE_OFFSET_FROM_EXTRUDER - 5) +#endif + +#if ( (Y_PROBE_OFFSET_FROM_EXTRUDER + 25) > 10 ) +#define FRONT_PROBE_BED_POSITION (Y_PROBE_OFFSET_FROM_EXTRUDER + 25) +#else +#define FRONT_PROBE_BED_POSITION 25 +#endif + +#if( (Y_BED_SIZE + Y_PROBE_OFFSET_FROM_EXTRUDER - 25) < Y_BED_SIZE) +#define BACK_PROBE_BED_POSITION (Y_BED_SIZE + Y_PROBE_OFFSET_FROM_EXTRUDER - 25) +#else +#define BACK_PROBE_BED_POSITION (Y_BED_SIZE - 25) +#endif // Probe along the Y axis, advancing X after each column //#define PROBE_Y_FIRST @@ -1173,16 +1783,11 @@ //========================= Unified Bed Leveling ============================ //=========================================================================== - //#define MESH_EDIT_GFX_OVERLAY // Display a graphics overlay while editing the mesh - - #define MESH_INSET 1 // Set Mesh bounds as an inset region of the bed - #define GRID_MAX_POINTS_X 10 // Don't use more than 15 points per axis, implementation limited. - #define GRID_MAX_POINTS_Y GRID_MAX_POINTS_X - + #define MESH_EDIT_GFX_OVERLAY // Display a graphics overlay while editing the mesh #define UBL_MESH_EDIT_MOVES_Z // Sophisticated users prefer no movement of nozzle #define UBL_SAVE_ACTIVE_ON_M500 // Save the currently active mesh in the current slot on M500 - //#define UBL_Z_RAISE_WHEN_OFF_MESH 2.5 // When the nozzle is off the mesh, this value is used + #define UBL_Z_RAISE_WHEN_OFF_MESH 0 // When the nozzle is off the mesh, this value is used // as the Z-Height correction value. #elif ENABLED(MESH_BED_LEVELING) @@ -1191,9 +1796,13 @@ //=================================== Mesh ================================== //=========================================================================== - #define MESH_INSET 10 // Set Mesh bounds as an inset region of the bed - #define GRID_MAX_POINTS_X 3 // Don't use more than 7 points per axis, implementation limited. - #define GRID_MAX_POINTS_Y GRID_MAX_POINTS_X +#if(ENABLED(MachineEnder3)) + #define MESH_INSET 40 // Set Mesh bounds as an inset region of the bed +#else + #define MESH_INSET 20 // Set Mesh bounds as an inset region of the bed +#endif + //#define GRID_MAX_POINTS_X 3 // Don't use more than 7 points per axis, implementation limited. + //#define GRID_MAX_POINTS_Y GRID_MAX_POINTS_X //#define MESH_G28_REST_ORIGIN // After homing all axes ('G28' or 'G28 XYZ') rest Z at Z_MIN_POS @@ -1204,40 +1813,114 @@ * Override if the automatically selected points are inadequate. */ #if ENABLED(AUTO_BED_LEVELING_3POINT) || ENABLED(AUTO_BED_LEVELING_UBL) - //#define PROBE_PT_1_X 15 - //#define PROBE_PT_1_Y 180 - //#define PROBE_PT_2_X 15 - //#define PROBE_PT_2_Y 20 - //#define PROBE_PT_3_X 170 - //#define PROBE_PT_3_Y 20 + +#if(DISABLED(MachineCR10Orig) && DISABLED(MachineEnder4)) +#define MESH_EDIT_GFX_OVERLAY // Display a graphics overlay while editing the mesh +#endif +#if ENABLED(MachineMini) +#define PROBE_PT_1_X 50 // Probing points for 3-Point leveling of the mesh +#define PROBE_PT_1_Y 180 +#define PROBE_PT_2_X 180 +#define PROBE_PT_2_Y 180 +#define PROBE_PT_3_X 180 +#define PROBE_PT_3_Y 50 +#define MESH_INSET 15 +#endif +#if ENABLED(MachineEnder2) +#define PROBE_PT_1_X 50 // Probing points for 3-Point leveling of the mesh +#define PROBE_PT_1_Y 130 +#define PROBE_PT_2_X 100 +#define PROBE_PT_2_Y 130 +#define PROBE_PT_3_X 100 +#define PROBE_PT_3_Y 50 +#define MESH_INSET 15 +#endif +#if ENABLED(MachineEnder3) +#define PROBE_PT_1_X 50 // Probing points for 3-Point leveling of the mesh +#define PROBE_PT_1_Y 180 +#define PROBE_PT_2_X 180 +#define PROBE_PT_2_Y 180 +#define PROBE_PT_3_X 180 +#define PROBE_PT_3_Y 50 +#define MESH_INSET 15 +#endif +#if ENABLED(MachineEnder4) +#define PROBE_PT_1_X 50 // Probing points for 3-Point leveling of the mesh +#define PROBE_PT_1_Y 180 +#define PROBE_PT_2_X 150 +#define PROBE_PT_2_Y 180 +#define PROBE_PT_3_X 150 +#define PROBE_PT_3_Y 50 +#define MESH_INSET 15 +#endif + +#if ENABLED(MachineCR20) +#define PROBE_PT_1_X 50 // Probing points for 3-Point leveling of the mesh +#define PROBE_PT_1_Y 180 +#define PROBE_PT_2_X 150 +#define PROBE_PT_2_Y 180 +#define PROBE_PT_3_X 150 +#define PROBE_PT_3_Y 50 +#define MESH_INSET 15 +#endif + +#if (ENABLED(MachineCR10Std) ) +#define PROBE_PT_1_X 50 // Probing points for 3-Point leveling of the mesh +#define PROBE_PT_1_Y 270 +#define PROBE_PT_2_X 250 +#define PROBE_PT_2_Y 270 +#define PROBE_PT_3_X 250 +#define PROBE_PT_3_Y 50 +#define MESH_INSET 25 +#endif + +#if ENABLED( MachineS4) +#define PROBE_PT_1_X 60 // Probing points for 3-Point leveling of the mesh +#define PROBE_PT_1_Y 340 +#define PROBE_PT_2_X 340 +#define PROBE_PT_2_Y 340 +#define PROBE_PT_3_X 340 +#define PROBE_PT_3_Y 60 +#define MESH_INSET 20 +#endif +#if ENABLED(MachineS5) +#define PROBE_PT_1_X 80 // Probing points for 3-Point leveling of the mesh +#define PROBE_PT_1_Y 420 +#define PROBE_PT_2_X 420 +#define PROBE_PT_2_Y 420 +#define PROBE_PT_3_X 420 +#define PROBE_PT_3_Y 80 +#define MESH_INSET 25 +#endif #endif /** * Add a bed leveling sub-menu for ABL or MBL. * Include a guided procedure if manual probing is enabled. */ -//#define LCD_BED_LEVELING - -#if ENABLED(LCD_BED_LEVELING) - #define MESH_EDIT_Z_STEP 0.025 // (mm) Step size while manually probing Z axis. - #define LCD_PROBE_Z_RANGE 4 // (mm) Z Range centered on Z_MIN_POS for LCD Z adjustment - //#define MESH_EDIT_MENU // Add a menu to edit mesh points +#if (DISABLED(ABL_EZABL) && DISABLED(ABL_NCSW) && DISABLED(ABL_BLTOUCH) &&DISABLED(OrigLA)) +#define LCD_BED_LEVELING #endif -// Add a menu item to move between bed corners for manual bed adjustment -//#define LEVEL_BED_CORNERS +#if ENABLED(LCD_BED_LEVELING) + #define MESH_EDIT_Z_STEP 0.025 // Step size while manually probing Z axis. + #define LCD_PROBE_Z_RANGE 8 // Z Range centered on Z_MIN_POS for LCD Z adjustment +#endif +#if(DISABLED(MachineCR10Orig) && DISABLED(SolidBedMounts)) +// Add a menu item to move between bed corners for manual bed adjustment + #define LEVEL_BED_CORNERS +#endif #if ENABLED(LEVEL_BED_CORNERS) - #define LEVEL_CORNERS_INSET 30 // (mm) An inset for corner leveling - #define LEVEL_CORNERS_Z_HOP 4.0 // (mm) Move nozzle up before moving between corners - //#define LEVEL_CENTER_TOO // Move to the center after the last corner + #define LEVEL_CORNERS_INSET 40 // (mm) An inset for corner leveling + #define LEVEL_CENTER_TOO // Move to the center after the last corner #endif /** * Commands to execute at the end of G29 probing. * Useful to retract or move the Z probe out of the way. */ -//#define Z_PROBE_END_SCRIPT "G1 Z10 F12000\nG1 X15 Y330\nG1 Z0.5\nG1 Z10" +#define Z_PROBE_END_SCRIPT "M280 P0 S90" // @section homing @@ -1260,11 +1943,22 @@ // - Move the Z probe (or nozzle) to a defined XY point before Z Homing when homing all axes (G28). // - 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_BED_SIZE) / 2) // X point for Z homing when homing all axes (G28). - #define Z_SAFE_HOMING_Y_POINT ((Y_BED_SIZE) / 2) // Y point for Z homing when homing all axes (G28). + #if ENABLED(MachineS4) + #define Z_SAFE_HOMING_X_POINT 60 // X point for Z homing when homing all axis (G28). + #define Z_SAFE_HOMING_Y_POINT 60 // Y point for Z homing when homing all axis (G28). + #elif ENABLED(MachineS5) + #define Z_SAFE_HOMING_X_POINT 80 // X point for Z homing when homing all axis (G28). + #define Z_SAFE_HOMING_Y_POINT 80 // Y point for Z homing when homing all axis (G28). + #elif ENABLED(MachineCRX) + #define Z_SAFE_HOMING_X_POINT 50 // X point for Z homing when homing all axis (G28). + #define Z_SAFE_HOMING_Y_POINT 70 // Y point for Z homing when homing all axis (G28). + #else + #define Z_SAFE_HOMING_X_POINT 50 // X point for Z homing when homing all axis (G28). + #define Z_SAFE_HOMING_Y_POINT 50 // Y point for Z homing when homing all axis (G28). + #endif #endif // Homing speeds (mm/m) @@ -1345,10 +2039,11 @@ // M501 - reads parameters from EEPROM (if you need reset them after you changed them temporarily). // M502 - reverts to the default "factory settings". You still need to store them in EEPROM afterwards if you want to. // -//#define EEPROM_SETTINGS // Enable for M500 and M501 commands +#define EEPROM_SETTINGS // Enable for M500 and M501 commands //#define DISABLE_M503 // Saves ~2700 bytes of PROGMEM. Disable for release! +#if(DISABLED(MachineCR10Orig)) #define EEPROM_CHITCHAT // Give feedback on EEPROM commands. Disable to save PROGMEM. - +#endif // // Host Keepalive // @@ -1398,13 +2093,17 @@ * 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 } - #define NOZZLE_PARK_POINT { (X_MIN_POS + 10), (Y_MAX_POS - 10), 20 } - #define NOZZLE_PARK_XY_FEEDRATE 100 // (mm/s) X and Y axes feedrate (also used for delta Z axis) - #define NOZZLE_PARK_Z_FEEDRATE 5 // (mm/s) Z axis feedrate (not used for delta printers) +// Specify a park position as { X, Y, Z } +#if(ENABLED(MachineEnder2)) +#define NOZZLE_PARK_POINT { (0), (0), 20 } +#else +#define NOZZLE_PARK_POINT { (10), (10), 20 } +#endif +#define NOZZLE_PARK_XY_FEEDRATE 100 // X and Y axes feedrate in mm/s (also used for delta printers Z axis) +#define NOZZLE_PARK_Z_FEEDRATE 5 // Z axis feedrate in mm/s (not used for delta printers) #endif /** @@ -1484,8 +2183,9 @@ * M76 - Pause the print job timer * M77 - Stop the print job timer */ -#define PRINTJOB_TIMER_AUTOSTART - + #if(DISABLED(MachineCR10Orig)) + #define PRINTJOB_TIMER_AUTOSTART +#endif /** * Print Counter * @@ -1498,8 +2198,9 @@ * * View the current statistics with M78. */ -//#define PRINTCOUNTER - + #if(DISABLED(MachineCR10Orig)) + #define PRINTCOUNTER +#endif //============================================================================= //============================= LCD and SD support ============================ //============================================================================= @@ -1556,7 +2257,7 @@ * you must uncomment the following option or it won't work. * */ -//#define SDSUPPORT +#define SDSUPPORT /** * SD CARD: SPI SPEED @@ -1596,7 +2297,7 @@ // 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 /** * Encoder Direction Options @@ -1628,15 +2329,18 @@ // // Add individual axis homing items (Home X, Home Y, and Home Z) to the LCD menu. // -//#define INDIVIDUAL_AXIS_HOMING_MENU - +#if(DISABLED(MachineCR10Orig)) +#define INDIVIDUAL_AXIS_HOMING_MENU +#endif // // SPEAKER/BUZZER // // 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 +#if(DISABLED(MachineCR10Orig)) +#define SPEAKER +#endif // // The duration and frequency for the UI feedback sound. @@ -1720,7 +2424,18 @@ //======================== LCD / Controller Selection ========================= //===================== (I2C and Shift-Register LCDs) ===================== //============================================================================= - +#if(ENABLED(MachineEnder4) && DISABLED(GraphicLCD)) +#define REPRAP_DISCOUNT_SMART_CONTROLLER +#elif(ENABLED(MachineEnder2) ) +#define MINIPANEL +#elif ENABLED(MachineCR20) + #define MKS_MINI_12864 +#elif(DISABLED(OrigLCD)) +#define REPRAP_DISCOUNT_FULL_GRAPHIC_SMART_CONTROLLER +#endif +#if(ENABLED(OrigLCD)) +#define CR10_STOCKDISPLAY +#endif // // CONTROLLER TYPE: I2C // @@ -2093,4 +2808,4 @@ //#define DEACTIVATE_SERVOS_AFTER_MOVE // Allow servo angle to be edited and saved to EEPROM -//#define EDITABLE_SERVO_ANGLES +//#define EDITABLE_SERVO_ANGLES \ No newline at end of file diff --git a/Marlin/Configuration_adv.h b/Marlin/Configuration_adv.h index 442cd948f7..60ba358285 100644 --- a/Marlin/Configuration_adv.h +++ b/Marlin/Configuration_adv.h @@ -74,10 +74,10 @@ * 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 10 // 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 ENABLED(ADAPTIVE_FAN_SLOWING) && ENABLED(PIDTEMP) //#define NO_FAN_SLOWING_IN_PID_TUNING // Don't slow fan speed during M303 #endif @@ -94,7 +94,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 50 // Seconds #define WATCH_TEMP_INCREASE 2 // Degrees Celsius #endif @@ -102,14 +102,25 @@ * Thermal Protection parameters for the bed are just as above for hotends. */ #if ENABLED(THERMAL_PROTECTION_BED) - #define THERMAL_PROTECTION_BED_PERIOD 20 // Seconds +#if(ENABLED(BedDC)) + + #define THERMAL_PROTECTION_BED_PERIOD 50 // Seconds #define THERMAL_PROTECTION_BED_HYSTERESIS 2 // Degrees Celsius + #define WATCH_BED_TEMP_PERIOD 180 // Seconds + #define WATCH_BED_TEMP_INCREASE 2 // Degrees Celsius +#else + + #define THERMAL_PROTECTION_BED_PERIOD 30 // Seconds + #define THERMAL_PROTECTION_BED_HYSTERESIS 2 // Degrees Celsius + + #define WATCH_BED_TEMP_PERIOD 120 // Seconds + #define WATCH_BED_TEMP_INCREASE 2 // Degrees Celsius +#endif + /** * As described above, except for the bed (M140/M190/M303). */ - #define WATCH_BED_TEMP_PERIOD 60 // Seconds - #define WATCH_BED_TEMP_INCREASE 2 // Degrees Celsius #endif /** @@ -146,14 +157,17 @@ * Also, if the temperature is set to a value below mintemp, it will not be changed by autotemp. * On an Ultimaker, some initial testing worked with M109 S215 B260 F1 in the start.gcode */ + #if(DISABLED(MachineCR10Orig) && DISABLED(LowMemoryBoard)) #define AUTOTEMP +#endif #if ENABLED(AUTOTEMP) #define AUTOTEMP_OLDWEIGHT 0.98 #endif // Show extra position information in M114 -//#define M114_DETAIL - + #if(DISABLED(MachineCR10Orig) && DISABLED(LowMemoryBoard)) +#define M114_DETAIL +#endif // Show Temperature ADC value // Enable for M105 to include ADC values read from temperature sensors. //#define SHOW_TEMP_ADC_VALUES @@ -224,7 +238,7 @@ // When first starting the main fan, run it at full speed for the // given number of milliseconds. This gets the fan spinning reliably // before setting a PWM value. (Does not work with software PWM for fan on Sanguinololu) -//#define FAN_KICKSTART_TIME 100 +#define FAN_KICKSTART_TIME 100 /** * PWM Fan Scaling @@ -306,13 +320,15 @@ /** * M355 Case Light on-off / brightness */ -//#define CASE_LIGHT_ENABLE +#if(ENABLED(EnclosureLight)) + #define CASE_LIGHT_ENABLE +#endif #if ENABLED(CASE_LIGHT_ENABLE) - //#define CASE_LIGHT_PIN 4 // Override the default pin if needed + #define CASE_LIGHT_PIN 12 // Override the default pin if needed #define INVERT_CASE_LIGHT false // Set true if Case Light is ON when pin is LOW #define CASE_LIGHT_DEFAULT_ON true // Set default power-up state on - #define CASE_LIGHT_DEFAULT_BRIGHTNESS 105 // Set default power-up brightness (0-255, requires PWM pin) - //#define MENU_ITEM_CASE_LIGHT // Add a Case Light option to the LCD main menu + #define CASE_LIGHT_DEFAULT_BRIGHTNESS 255 // Set default power-up brightness (0-255, requires PWM pin) + #define MENU_ITEM_CASE_LIGHT // Add a Case Light option to the LCD main menu //#define CASE_LIGHT_USE_NEOPIXEL // Use Neopixel LED as case light, requires NEOPIXEL_LED. #if ENABLED(CASE_LIGHT_USE_NEOPIXEL) #define CASE_LIGHT_NEOPIXEL_COLOR { 255, 255, 255, 255 } // { Red, Green, Blue, White } @@ -455,7 +471,7 @@ #define Y_HOME_BUMP_MM 5 #define Z_HOME_BUMP_MM 2 #define HOMING_BUMP_DIVISOR { 2, 2, 4 } // Re-Bump Speed Divisor (Divides the Homing Feedrate) -//#define QUICK_HOME // If homing includes X and Y, do a diagonal move initially +#define QUICK_HOME // If homing includes X and Y, do a diagonal move initially // When G28 is called, this option will make Y home before X //#define HOME_Y_BEFORE_X @@ -525,8 +541,9 @@ #define DEFAULT_MINSEGMENTTIME 20000 // If defined the movements slow down when the look ahead buffer is only half full +#if(DISABLED(MachineCR10Orig) && DISABLED(LowMemoryBoard)) #define SLOWDOWN - +#endif // Frequency limit // See nophead's blog for more info // Not working O @@ -535,7 +552,7 @@ // Minimum planner junction speed. Sets the default minimum speed the planner plans for at the end // of the buffer and all stops. This should not be much greater than zero and should only be changed // if unwanted behavior is observed on a user's machine when running at very slow speeds. -#define MINIMUM_PLANNER_SPEED 0.05 // (mm/s) +#define MINIMUM_PLANNER_SPEED 0.05 // (mm/sec) // // Backlash Compensation @@ -704,30 +721,33 @@ #define ENCODER_100X_STEPS_PER_SEC 80 // (steps/s) Encoder rate for 100x speed #endif -// Play a beep when the feedrate is changed from the Status Screen -//#define BEEP_ON_FEEDRATE_CHANGE -#if ENABLED(BEEP_ON_FEEDRATE_CHANGE) - #define FEEDRATE_CHANGE_BEEP_DURATION 10 - #define FEEDRATE_CHANGE_BEEP_FREQUENCY 440 +// Include a page of printer information in the LCD Main Menu +#if(DISABLED(MachineCR10Orig)) + #define LCD_INFO_MENU +#endif +// Leave out seldom-used LCD menu items to recover some Program Memory + #if(ENABLED(MachineCR10Orig) || ENABLED(LowMemoryBoard)) +#define SLIM_LCD_MENUS #endif -// Include a page of printer information in the LCD Main Menu -//#define LCD_INFO_MENU - // Scroll a longer status message into view -//#define STATUS_MESSAGE_SCROLLING + #if(DISABLED(MachineCR10Orig) && DISABLED(LowMemoryBoard)) +#define STATUS_MESSAGE_SCROLLING // On the Info Screen, display XY with one decimal place when possible -//#define LCD_DECIMAL_SMALL_XY - +#define LCD_DECIMAL_SMALL_XY +#endif // The timeout (in ms) to return to the status screen from sub-menus -//#define LCD_TIMEOUT_TO_STATUS 15000 +#define LCD_TIMEOUT_TO_STATUS 15000 // Add an 'M73' G-code to set the current percentage -//#define LCD_SET_PROGRESS_MANUALLY - -#if HAS_CHARACTER_LCD && HAS_PRINT_PROGRESS - //#define LCD_PROGRESS_BAR // Show a progress bar on HD44780 LCDs for SD printing + #if(DISABLED(MachineCR10Orig) && DISABLED(LowMemoryBoard)) +#define LCD_SET_PROGRESS_MANUALLY +#endif +#if ENABLED(SDSUPPORT) || ENABLED(LCD_SET_PROGRESS_MANUALLY) + #if((ENABLED(MachineEnder4) && DISABLED(GraphicLCD))) + #define LCD_PROGRESS_BAR + #endif// Show a progress bar on HD44780 LCDs for SD printing #if ENABLED(LCD_PROGRESS_BAR) #define PROGRESS_BAR_BAR_TIME 2000 // (ms) Amount of time to show the bar #define PROGRESS_BAR_MSG_TIME 3000 // (ms) Amount of time to show the status message @@ -735,7 +755,7 @@ //#define PROGRESS_MSG_ONCE // Show the message for MSG_TIME then clear it //#define LCD_PROGRESS_BAR_TEST // Add a menu item to test the progress bar #endif -#endif +#endif // SDSUPPORT || LCD_SET_PROGRESS_MANUALLY /** * LED Control Menu @@ -768,8 +788,9 @@ // Reverse SD sort to show "more recent" files first, according to the card's FAT. // Since the FAT gets out of order with usage, SDCARD_SORT_ALPHA is recommended. + #if(DISABLED(MachineCR10Orig) && DISABLED(LowMemoryBoard)) #define SDCARD_RATHERRECENTFIRST - +#endif // Add an option in the menu to run all auto#.g files //#define MENU_ADDAUTOSTART @@ -829,8 +850,9 @@ //#define LONG_FILENAME_HOST_SUPPORT // Enable this option to scroll long filenames in the SD card menu - //#define SCROLL_LONG_FILENAMES - + #if(DISABLED(MachineCR10Orig) && DISABLED(LowMemoryBoard)) + #define SCROLL_LONG_FILENAMES +#endif /** * This option allows you to abort SD printing when any endstop is triggered. * This feature must be enabled with "M540 S1" or from the LCD menu. @@ -913,8 +935,9 @@ // A bigger font is available for edit items. Costs 3120 bytes of PROGMEM. // Western only. Not available for Cyrillic, Kana, Turkish, Greek, or Chinese. + #if(DISABLED(MachineCR10Orig) && DISABLED(LowMemoryBoard)) //#define USE_BIG_EDIT_FONT - +#endif // A smaller font may be used on the Info Screen. Costs 2300 bytes of PROGMEM. // Western only. Not available for Cyrillic, Kana, Turkish, Greek, or Chinese. //#define USE_SMALL_INFOFONT @@ -939,7 +962,9 @@ * This will prevent position updates from being displayed. */ #if ENABLED(U8GLIB_ST7920) - //#define LIGHTWEIGHT_UI + #if ENABLED(Big_UI) + #define LIGHTWEIGHT_UI + #endif #if ENABLED(LIGHTWEIGHT_UI) #define STATUS_EXPIRE_SECONDS 20 #endif @@ -984,29 +1009,29 @@ * * Warning: Does not respect endstops! */ -//#define BABYSTEPPING +#define BABYSTEPPING #if ENABLED(BABYSTEPPING) //#define BABYSTEP_WITHOUT_HOMING - //#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_MULTIPLICATOR 1 // Babysteps are very small. Increase for faster motion. + //#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_MULTIPLICATOR 10 // Babysteps are very small. Increase for faster motion. + #define DOUBLECLICK_FOR_Z_BABYSTEPPING // Double-click on the Status Screen for Z Babystepping. - //#define DOUBLECLICK_FOR_Z_BABYSTEPPING // Double-click on the Status Screen for Z Babystepping. - #if ENABLED(DOUBLECLICK_FOR_Z_BABYSTEPPING) - #define DOUBLECLICK_MAX_INTERVAL 1250 // Maximum interval between clicks, in milliseconds. - // Note: Extra time may be added to mitigate controller latency. - //#define BABYSTEP_ALWAYS_AVAILABLE // Allow babystepping at all times (not just during movement). - //#define MOVE_Z_WHEN_IDLE // Jump to the move Z menu on doubleclick when printer is idle. + #if ENABLED(ABL_EZABL) || ENABLED(ABL_BLTOUCH) || ENABLED(ABL_NCSW) + #if ENABLED(DOUBLECLICK_FOR_Z_BABYSTEPPING) + #define DOUBLECLICK_MAX_INTERVAL 1250 // Maximum interval between clicks, in milliseconds. + // Note: Extra time may be added to mitigate controller latency. + #define BABYSTEP_ALWAYS_AVAILABLE // Allow babystepping at all times (not just during movement). + #define BABYSTEP_ZPROBE_OFFSET // Enable to combine M851 and Babystepping + #define BABYSTEP_ZPROBE_GFX_OVERLAY // Enable graphical overlay on Z-offset editor + #endif + + //#define MOVE_Z_WHEN_IDLE // Jump to the move Z menu on doubleclick when printer is idle. #if ENABLED(MOVE_Z_WHEN_IDLE) - #define MOVE_Z_IDLE_MULTIPLICATOR 1 // Multiply 1mm by this factor for the move step size. + #define MOVE_Z_IDLE_MULTIPLICATOR 1 // Multiply 1mm by this factor for the move step size. #endif #endif - //#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 - #endif #endif // @section extruder @@ -1027,9 +1052,11 @@ * See http://marlinfw.org/docs/features/lin_advance.html for full instructions. * Mention @Sebastianv650 on GitHub to alert the author of any issues. */ -//#define LIN_ADVANCE +#if ((DISABLED(MachineCR10Orig) && DISABLED(LowMemoryBoard)) || ENABLED(OrigLA)) && DISABLED(MachineCR10SPro) + #define LIN_ADVANCE +#endif #if ENABLED(LIN_ADVANCE) - #define LIN_ADVANCE_K 0.22 // Unit: mm compression per 1mm/s extruder speed + #define LIN_ADVANCE_K 0.5 // Unit: mm compression per 1mm/s extruder speed //#define LA_DEBUG // If enabled, this will generate debug information output over USB. #endif @@ -1037,6 +1064,35 @@ #if ENABLED(MESH_BED_LEVELING) || ENABLED(AUTO_BED_LEVELING_UBL) // Override the mesh area if the automatic (max) area is too large + + #if( (X_PROBE_OFFSET_FROM_EXTRUDER + 15) > 0 ) + #define MESH_MIN_X (X_PROBE_OFFSET_FROM_EXTRUDER + 5) + #else + #define MESH_MIN_X 10 + #endif + + #if( (X_BED_SIZE + X_PROBE_OFFSET_FROM_EXTRUDER - 10) < X_BED_SIZE) + #define MESH_MAX_X (X_BED_SIZE + X_PROBE_OFFSET_FROM_EXTRUDER - 5) + #else + #if(ENABLED(MachineEnder3)) + #define MESH_MAX_X (X_BED_SIZE - 40) + #else + #define MESH_MAX_X (X_BED_SIZE - 10) + #endif + #endif + + #if ( (Y_PROBE_OFFSET_FROM_EXTRUDER + 25) > 10 ) + #define MESH_MIN_Y (Y_PROBE_OFFSET_FROM_EXTRUDER + 25) + #else + #define MESH_MIN_Y 25 + #endif + + #if( (Y_BED_SIZE + Y_PROBE_OFFSET_FROM_EXTRUDER - 25) < Y_BED_SIZE) + #define MESH_MAX_Y (Y_BED_SIZE + Y_PROBE_OFFSET_FROM_EXTRUDER - 25) + #else + #define MESH_MAX_Y (Y_BED_SIZE - 25) + #endif + //#define MESH_MIN_X MESH_INSET //#define MESH_MIN_Y MESH_INSET //#define MESH_MAX_X X_BED_SIZE - (MESH_INSET) @@ -1047,9 +1103,11 @@ * Repeatedly attempt G29 leveling until it succeeds. * Stop after G29_MAX_RETRIES attempts. */ -//#define G29_RETRY_AND_RECOVER +#if ENABLED(ABL_BI) + #define G29_RETRY_AND_RECOVER +#endif #if ENABLED(G29_RETRY_AND_RECOVER) - #define G29_MAX_RETRIES 3 + #define G29_MAX_RETRIES 1 #define G29_HALT_ON_FAILURE /** * Specify the GCODE commands that will be executed when leveling succeeds, @@ -1148,7 +1206,11 @@ // The number of linear motions that can be in the plan at any give time. // THE BLOCK_BUFFER_SIZE NEEDS TO BE A POWER OF 2 (e.g. 8, 16, 32) because shifts and ors are used to do the ring-buffering. #if ENABLED(SDSUPPORT) - #define BLOCK_BUFFER_SIZE 16 // SD,LCD,Buttons take more memory, block buffer needs to be smaller + #if(ENABLED(MachineCR10Orig) || ENABLED(LowMemoryBoard)) + #define BLOCK_BUFFER_SIZE 4 // SD,LCD,Buttons take more memory, block buffer needs to be smaller + #else + #define BLOCK_BUFFER_SIZE 16 + #endif #else #define BLOCK_BUFFER_SIZE 16 // maximize block buffer #endif @@ -1157,8 +1219,11 @@ // The ASCII buffer for serial input #define MAX_CMD_SIZE 96 +#if(ENABLED(MachineCR10Orig) || ENABLED(LowMemoryBoard)) +#define BUFSIZE 2 +#else #define BUFSIZE 4 - +#endif // Transmission to Host Buffer Size // To save 386 bytes of PROGMEM (and TX_BUFFER_SIZE+3 bytes of RAM) set to 0. // To buffer a simple "ok" you need 4 bytes. @@ -1194,16 +1259,16 @@ // enter the serial receive buffer, so they cannot be blocked. // Currently handles M108, M112, M410 // Does not work on boards using AT90USB (USBCON) processors! -//#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. @@ -1235,17 +1300,16 @@ * Note that M207 / M208 / M209 settings are saved to EEPROM. * */ -//#define FWRETRACT + #if(DISABLED(MachineCR10Orig) && DISABLED(LowMemoryBoard)) +#define FWRETRACT // ONLY PARTIALLY TESTED +#endif #if ENABLED(FWRETRACT) - #define FWRETRACT_AUTORETRACT // costs ~500 bytes of PROGMEM - #if ENABLED(FWRETRACT_AUTORETRACT) - #define MIN_AUTORETRACT 0.1 // When auto-retract is on, convert E moves of this length and over - #define MAX_AUTORETRACT 10.0 // Upper limit for auto-retract conversion - #endif + #define MIN_AUTORETRACT 0.1 // When auto-retract is on, convert E moves of this length and over + #define MAX_AUTORETRACT 10.0 // Upper limit for auto-retract conversion #define RETRACT_LENGTH 3 // Default retract length (positive mm) #define RETRACT_LENGTH_SWAP 13 // Default swap retract length (positive mm), for extruder change #define RETRACT_FEEDRATE 45 // Default feedrate for retracting (mm/s) - #define RETRACT_ZRAISE 0 // Default retract Z-raise (mm) + #define RETRACT_ZRAISE 0 // Default retract Z-lift #define RETRACT_RECOVER_LENGTH 0 // Default additional recover length (mm, added to retract length when recovering) #define RETRACT_RECOVER_LENGTH_SWAP 0 // Default additional swap recover length (mm, added to retract length when recovering from extruder change) #define RETRACT_RECOVER_FEEDRATE 8 // Default feedrate for recovering from retraction (mm/s) @@ -1261,22 +1325,21 @@ */ #if EXTRUDERS > 1 // Z raise distance for tool-change, as needed for some extruders - #define TOOLCHANGE_ZRAISE 2 // (mm) + #define TOOLCHANGE_ZRAISE 1 // (mm) // Retract and prime filament on tool-change - //#define TOOLCHANGE_FILAMENT_SWAP + #define TOOLCHANGE_FILAMENT_SWAP #if ENABLED(TOOLCHANGE_FILAMENT_SWAP) - #define TOOLCHANGE_FIL_SWAP_LENGTH 12 // (mm) - #define TOOLCHANGE_FIL_EXTRA_PRIME 2 // (mm) - #define TOOLCHANGE_FIL_SWAP_RETRACT_SPEED 3600 // (mm/m) - #define TOOLCHANGE_FIL_SWAP_PRIME_SPEED 3600 // (mm/m) + #define TOOLCHANGE_FIL_SWAP_LENGTH 80 // (mm) + #define TOOLCHANGE_FIL_SWAP_RETRACT_SPEED 3000 // (mm/m) + #define TOOLCHANGE_FIL_SWAP_PRIME_SPEED 3000 // (mm/m) #endif /** * Position to park head during tool change. * Doesn't apply to SWITCHING_TOOLHEAD, DUAL_X_CARRIAGE, or PARKING_EXTRUDER */ - //#define TOOLCHANGE_PARK + #define TOOLCHANGE_PARK #if ENABLED(TOOLCHANGE_PARK) #define TOOLCHANGE_PARK_XY { X_MIN_POS + 10, Y_MIN_POS + 10 } #define TOOLCHANGE_PARK_XY_FEEDRATE 6000 // (mm/m) @@ -1293,47 +1356,53 @@ * 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. + #define PAUSE_PARK_RETRACT_LENGTH 4 // (mm) Initial retract. // This short retract is done immediately, before parking the nozzle. - #define FILAMENT_CHANGE_UNLOAD_FEEDRATE 10 // (mm/s) Unload filament feedrate. This can be pretty fast. + #define FILAMENT_CHANGE_UNLOAD_FEEDRATE 41 // (mm/s) Unload filament feedrate. This can be pretty fast. #define FILAMENT_CHANGE_UNLOAD_ACCEL 25 // (mm/s^2) Lower acceleration may allow a faster feedrate. - #define FILAMENT_CHANGE_UNLOAD_LENGTH 100 // (mm) The length of filament for a complete unload. + #define FILAMENT_CHANGE_UNLOAD_LENGTH 430 // (mm) The length of filament for a complete unload. // For Bowden, the full length of the tube and nozzle. // For direct drive, the full length of the nozzle. // Set to 0 for manual unloading. #define FILAMENT_CHANGE_SLOW_LOAD_FEEDRATE 6 // (mm/s) Slow move when starting load. #define FILAMENT_CHANGE_SLOW_LOAD_LENGTH 0 // (mm) Slow length, to allow time to insert material. // 0 to disable start loading and skip to fast load only - #define FILAMENT_CHANGE_FAST_LOAD_FEEDRATE 6 // (mm/s) Load filament feedrate. This can be pretty fast. + #define FILAMENT_CHANGE_FAST_LOAD_FEEDRATE 30 // (mm/s) Load filament feedrate. This can be pretty fast. #define FILAMENT_CHANGE_FAST_LOAD_ACCEL 25 // (mm/s^2) Lower acceleration may allow a faster feedrate. - #define FILAMENT_CHANGE_FAST_LOAD_LENGTH 0 // (mm) Load length of filament, from extruder gear to nozzle. + #if(ENABLED(MachineCRX)) + #define FILAMENT_CHANGE_FAST_LOAD_LENGTH 450 // (mm) Load length of filament, from extruder gear to nozzle. + #else + #define FILAMENT_CHANGE_FAST_LOAD_LENGTH 430 // (mm) Load length of filament, from extruder gear to nozzle. + #endif // For Bowden, the full length of the tube and nozzle. // 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 20 // (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. #define ADVANCED_PAUSE_RESUME_PRIME 0 // (mm) Extra distance to prime nozzle after returning from park. // Filament Unload does a Retract, Delay, and Purge first: - #define FILAMENT_UNLOAD_RETRACT_LENGTH 13 // (mm) Unload initial retract length. + #define FILAMENT_UNLOAD_RETRACT_LENGTH 4 // (mm) Unload initial retract length. #define FILAMENT_UNLOAD_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_LENGTH 0 // (mm) An unretract is done, then this length is purged. #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 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 HOME_BEFORE_FILAMENT_CHANGE // Ensure homing has been completed prior to 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_UNLOAD_ALL_EXTRUDERS // Allow M702 to unload all extruders above a minimum target temp (as set by M302) + #define PARK_HEAD_ON_PAUSE // Park the nozzle during pause and filament change. + #define HOME_BEFORE_FILAMENT_CHANGE // Ensure homing has been completed prior to parking for filament change +#if(DISABLED(MachineCR10Orig) && DISABLED(LowMemoryBoard)) + #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 #endif // @section tmc @@ -1983,13 +2052,15 @@ /** * Auto-report temperatures with M155 S */ + #if(DISABLED(MachineCR10Orig) && DISABLED(LowMemoryBoard)) #define AUTO_REPORT_TEMPERATURES - +#endif /** * Include capabilities in M115 output */ + #if(DISABLED(MachineCR10Orig)) #define EXTENDED_CAPABILITIES_REPORT - +#endif /** * Disable all Volumetric extrusion options */ @@ -2027,7 +2098,9 @@ /** * Spend 28 bytes of SRAM to optimize the GCode parser */ + #if(DISABLED(MachineCR10Orig) && DISABLED(LowMemoryBoard)) #define FASTER_GCODE_PARSER +#endif /** * CNC G-code options @@ -2043,7 +2116,6 @@ #ifdef G0_FEEDRATE //#define VARIABLE_G0_FEEDRATE // The G0 feedrate is set by F in G0 motion mode #endif - /** * G-code Macros * @@ -2059,27 +2131,43 @@ /** * User-defined menu items that execute custom GCode */ -//#define CUSTOM_USER_MENUS +#if(ENABLED(ABL_UBL) || ENABLED(ABL_BI)) + #define CUSTOM_USER_MENUS +#endif + #if ENABLED(CUSTOM_USER_MENUS) - //#define CUSTOM_USER_MENU_TITLE "Custom Commands" - #define USER_SCRIPT_DONE "M117 User Script Done" + //#define USER_SCRIPT_DONE "M117 User Script Done" #define USER_SCRIPT_AUDIBLE_FEEDBACK - //#define USER_SCRIPT_RETURN // Return to status screen after a script + #define USER_SCRIPT_RETURN // Return to status screen after a script + #define CUSTOM_USER_MENU_TITLE "Commissioning" - #define USER_DESC_1 "Home & UBL Info" - #define USER_GCODE_1 "G28\nG29 W" +#if ENABLED(BedDC) + #define CommBedTmp "55" +#else + #define CommBedTmp "75" +#endif - #define USER_DESC_2 "Preheat for " PREHEAT_1_LABEL - #define USER_GCODE_2 "M140 S" STRINGIFY(PREHEAT_1_TEMP_BED) "\nM104 S" STRINGIFY(PREHEAT_1_TEMP_HOTEND) +#if (ENABLED(ABL_UBL)) + #define USER_DESC_1 "UBL Commission 1" + #define USER_GCODE_1 "M502 \n M500 \n M501 \n M190 S" CommBedTmp" \n M104 S225 \n G28 \n G29 P1 \n G29 S1 \n M117 Run Step 2" - #define USER_DESC_3 "Preheat for " PREHEAT_2_LABEL - #define USER_GCODE_3 "M140 S" STRINGIFY(PREHEAT_2_TEMP_BED) "\nM104 S" STRINGIFY(PREHEAT_2_TEMP_HOTEND) + #define USER_DESC_2 "UBL Commission 2" + #define USER_GCODE_2 "G29 S1 \n G29 S0 \n G29 F 10.0 \n G29 A \n M500 \n G28 \n G29 L1 \n M109 S225 \n G1 X100 Y 100 \n G1 Z0 \n M117 Set Z Offset" - #define USER_DESC_4 "Heat Bed/Home/Level" - #define USER_GCODE_4 "M140 S" STRINGIFY(PREHEAT_2_TEMP_BED) "\nG28\nG29" + #define USER_DESC_3 "Prep for Z Adjust" + #define USER_GCODE_3 "M190 " CommBedTmp" \n M104 235 \n G28 \n G29 L1 \n G1 X100 Y 100 \n G1 Z0" - #define USER_DESC_5 "Home & Info" - #define USER_GCODE_5 "G28\nM503" + #define USER_DESC_4 "Fill Mesh Points" + #define USER_GCODE_4 "G29 P3 \n G29 P3 \n G29 P3 \n G29 T" +#elif ENABLED(ABL_BI) + #define USER_DESC_1 "BIL Commission" + #define USER_GCODE_1 "M502 \n M500 \n M501 \n M190 " CommBedTmp" \n M104 S225 \n G28 \n G29 \n M500 \n G28 \n M420 S \n M109 S225 \n G1 X100 Y 100 \n G1 Z0 \n M117 Set Z Offset" + + #define USER_DESC_2 "Prep for Z Adjust" + #define USER_GCODE_2 "M190 " CommBedTmp" \n M104 235 \n G28 \n M420 S \n G1 X100 Y 100 \n G1 Z0" +#endif + #define USER_DESC_5 "Run Mesh Validation" + #define USER_GCODE_5 "G26" #endif /** @@ -2096,9 +2184,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 #endif //=========================================================================== @@ -2313,7 +2401,7 @@ /** * M43 - display pin status, watch pins for changes, watch endstops & toggle LED, Z servo probe test, toggle pins */ -//#define PINS_DEBUGGING +#define PINS_DEBUGGING // Enable Marlin dev mode which adds some special commands -//#define MARLIN_DEV_MODE +//#define MARLIN_DEV_MODE \ No newline at end of file diff --git a/Marlin/src/lcd/extensible_ui/lib/Creality_DWIN.cpp b/Marlin/src/lcd/extensible_ui/lib/Creality_DWIN.cpp new file mode 100644 index 0000000000..e59599d08a --- /dev/null +++ b/Marlin/src/lcd/extensible_ui/lib/Creality_DWIN.cpp @@ -0,0 +1,2272 @@ +#include "Creality_DWIN.h" +#include +#include +#include +#include + +#include "../ui_api.h" + +const float manual_feedrate_mm_m[] = MANUAL_FEEDRATE; +uint8_t progress_bar_percent; +int startprogress = 0; +CRec CardRecbuf; +int temphot=0; +//int tempbed=0; +//float pause_z = 0; +#if DISABLED(POWER_LOSS_RECOVERY) + int power_off_type_yes = 0; + int power_off_commands_count = 0; +#endif + +float PLA_ABSModeTemp = 195; +millis_t next_rts_update_ms = 0; +int last_target_temperature_bed; +int last_target_temperature[4] = {0}; +char waitway = 0; +int recnum = 0; +unsigned char original_extruder = 0; +unsigned char Percentrecord = 0; +float ChangeMaterialbuf[2] = {0}; + +char NozzleTempStatus[3] = {0}; + + +bool PrintMode = true; + +char PrintStatue[2] = {0}; //PrintStatue[0], 0 represent to 43 page, 1 represent to 44 page +bool CardUpdate = false; //represents to update file list +char CardCheckStatus[2] = {0}; //CardCheckStatus[0] represents to check card in printing and after making sure to begin and to check card in heating with value as 1, but 0 for off +unsigned char LanguageRecbuf; // !0 represent Chinese, 0 represent English +char PrinterStatusKey[2] = {0}; // PrinterStatusKey[1] value: 0 represents to keep temperature, 1 represents to heating , 2 stands for cooling , 3 stands for printing + // PrinterStatusKey[0] value: 0 reprensents 3D printer ready +extern CardReader card; +bool lcd_sd_status;//represents SD-card status, true means SD is available, false means opposite. + +char Checkfilenum=0; +char FilenamesCount = 0; +char cmdbuf[20] = {0}; +char FilementStatus[2] = {0}; + +unsigned char AxisPagenum = 0; //0 for 10mm, 1 for 1mm, 2 for 0.1mm +bool InforShowStatus = true; +bool TPShowStatus = false; // true for only opening time and percentage, false for closing time and percentage. +bool FanStatus = true; +bool AutoLevelStatus = true; +bool AutohomeKey = false; +unsigned char AutoHomeIconNum; +RTSSHOW rtscheck; +int Update_Time_Value = 0; +unsigned long VolumeSet = 0x80; +extern char power_off_commands[9][96]; +bool PoweroffContinue = false; +extern const char *injected_commands_P; +char commandbuf[30]; + +inline void RTS_line_to_current(AxisEnum axis) { + if (!planner.is_full()) + planner.buffer_line_kinematic(current_position, MMM_TO_MMS(manual_feedrate_mm_m[(int8_t)axis]), active_extruder); +} + +RTSSHOW::RTSSHOW(){ + recdat.head[0] = snddat.head[0] = FHONE; + recdat.head[1] = snddat.head[1] = FHTWO; + memset(databuf,0, sizeof(databuf)); +} + +void RTSSHOW::RTS_SDCardInit(void) +{ + if(!card.cardOK) + card.initsd(); + delay(2); + if (card.cardOK) + { + SERIAL_ECHOLN("***Initing card is OK***"); + uint16_t fileCnt = card.getnrfilenames(); + card.getWorkDirName(); + if (card.filename[0] == '/') { + card.initsd(); + } + else + { + card.updir(); + } + + int addrnum =0; + int num = 0; + for (uint16_t i = 0; i < fileCnt && i < MaxFileNumber + addrnum; i++) + { + card.getfilename(fileCnt-1-i); + char *pointFilename = card.longFilename; + int filenamelen = strlen(card.longFilename); + int j = 1; + while((strncmp(&pointFilename[j],".gcode",6) && strncmp(&pointFilename[j],".GCODE",6)) && (j++) < filenamelen); + if(j >= filenamelen) + { + addrnum++; + continue; + } + + if(j >= TEXTBYTELEN) + { + strncpy(&card.longFilename[TEXTBYTELEN -3],"~~",2); + card.longFilename[TEXTBYTELEN-1] = '\0'; + j = TEXTBYTELEN-1; + } + + delay(3); + strncpy(CardRecbuf.Cardshowfilename[num], card.longFilename,j); + + strcpy(CardRecbuf.Cardfilename[num],card.filename); + CardRecbuf.addr[num] = SDFILE_ADDR +num*10; + RTS_SndData(CardRecbuf.Cardshowfilename[num],CardRecbuf.addr[num]); + CardRecbuf.Filesum = (++num); + //SERIAL_ECHO(" CardRecbuf.Filesum =="); + //SERIAL_ECHO(CardRecbuf.Filesum); + RTS_SndData(1,FilenameIcon+CardRecbuf.Filesum); + } + if(LanguageRecbuf != 0) + RTS_SndData(0,IconPrintstatus); // 0 for Ready + else + RTS_SndData(0+CEIconGrap,IconPrintstatus); + + lcd_sd_status = IS_SD_INSERTED; + + } + else + { + SERIAL_ECHOLN("***Initing card fails***"); + if(LanguageRecbuf != 0) + RTS_SndData(6,IconPrintstatus); // 6 for Card Removed + else + RTS_SndData(6+CEIconGrap,IconPrintstatus); + } +} + +void RTSSHOW::RTS_SDCardUpate(void) +{ + //SERIAL_ECHO("\n SDUpdate "); + const bool sd_status = IS_SD_INSERTED; + if (sd_status != lcd_sd_status) + { + //SERIAL_PROTOCOLLN(" ***test6*** "); + if (sd_status) //sd_status = true + { + card.initsd(); + #if ENABLED(POWER_LOSS_RECOVERY) + init_power_off_info(); + #endif + RTS_SDCardInit(); + } + else + { + card.release(); + if( CardCheckStatus[0] == 1)// heating or printing + { + RTS_SDcard_Stop(); + CardCheckStatus[0] = 0; //cancel to check card during printing the gcode file + } + + if(LanguageRecbuf != 0) + RTS_SndData(6,IconPrintstatus); // 6 for Card Removed + else + RTS_SndData(6+CEIconGrap,IconPrintstatus); + for(int i = 0;i < CardRecbuf.Filesum;i++) + { + for(int j = 0;j < 10;j++) + RTS_SndData(0,CardRecbuf.addr[i]+j); + //RTS_SndData(4,FilenameIcon+1+i); + RTS_SndData((unsigned long)0xFFFF,FilenameNature + (i+1)*16); // white + } + + for(int j = 0;j < 10;j++) + { + RTS_SndData(0,Printfilename+j); //clean screen. + RTS_SndData(0,Choosefilename+j); //clean filename + } + for(int j = 0;j < 8;j++) + RTS_SndData(0,FilenameCount+j); + for(int j = 1;j <= 20;j++) //clean filename Icon + { + RTS_SndData(10,FilenameIcon+j); + RTS_SndData(10,FilenameIcon1+j); + } + memset(&CardRecbuf,0,sizeof(CardRecbuf)); + } + + lcd_sd_status = sd_status; + + } + + //SERIAL_ECHOPAIR("\n ***CardUpdate = ",CardUpdate); + //SERIAL_ECHOPAIR("\n ***lcd_sd_status = ",lcd_sd_status); + //SERIAL_ECHOPAIR("\n ***card.cardOK = ",card.cardOK); + if (CardUpdate && lcd_sd_status && card.cardOK) // represents to update file list + { + //SERIAL_PROTOCOLLN(" ***test7*** "); + for(int j = 0;j < 10;j++) //clean filename + RTS_SndData(0,Choosefilename+j); + for(int j = 0;j < 8;j++) + RTS_SndData(0,FilenameCount+j); + for (uint16_t i = 0; i < CardRecbuf.Filesum ; i++) + { + delay(3); + RTS_SndData(CardRecbuf.Cardshowfilename[i],CardRecbuf.addr[i]); + RTS_SndData(1,FilenameIcon+1+i); + RTS_SndData((unsigned long)0xFFFF,FilenameNature + (i+1)*16); // white + RTS_SndData(10,FilenameIcon1+1+i); + } + CardUpdate = false; + SERIAL_ECHO("====end===="); + } +} + +#if ENABLED(MachineCR10SPro) || ENABLED(AddonFilSensor) + + int RTSSHOW::RTS_CheckFilement(int mode) + { + SERIAL_ECHO(" ****RTS_CheckFilement*** "); + waitway = 4; + for(Checkfilenum= 0; 0==READ(FIL_RUNOUT_PIN) && Checkfilenum < 50;Checkfilenum++)// no filements check + delay(15); + + if(49 <= Checkfilenum ) //no filements + { + SERIAL_ECHO("\n Check Filament Setting Screen "); + if(mode) + { + FilementStatus[0] = mode; // for mode status of no filement . the sentence can be canceled, which isn't neccessary? + if(LanguageRecbuf != 0) + RTS_SndData(ExchangePageBase + 38, ExchangepageAddr); //exchange to 38 page + else + RTS_SndData(ExchangePageBase + 78, ExchangepageAddr); + } + Checkfilenum = 0; + waitway = 0; + return 1; + } + else + Checkfilenum = 0; + + waitway = 0; + return 0; + + } +#endif +void RTSSHOW::RTS_Init() +{ + Serial2.begin(115200); + + //LanguageRecbuf =eeprom_read_byte((unsigned char*)FONT_EEPROM); + //AutoLevelStatus = eeprom_read_byte((unsigned char*)FONT_EEPROM+2); + LanguageRecbuf = 0; + AutoLevelStatus = 1; + int showcount = 0; + + #if HAS_MESH && (ENABLED(MachineCR10SPro) || ENABLED(Force10SProDisplay)) + if (leveling_is_valid()) + { + for(int xCount = 0; xCount < GRID_MAX_POINTS_X; xCount++) + { + for(int yCount = 0; yCount < GRID_MAX_POINTS_X; yCount++) + { + if((showcount++) < 16) + { + rtscheck.RTS_SndData(z_values[xCount][yCount] *10000, AutolevelVal + (showcount-1)*2); + rtscheck.RTS_SndData(showcount,AutolevelIcon); + } + } + } + RTS_SndData(2, AutoLevelIcon);/*On*/ + enqueue_and_echo_commands_P((PSTR("M420 S1"))); + AutoLevelStatus = planner.leveling_active; + } + else + { + RTS_SndData(3, AutoLevelIcon);/*Off*/ + //settings.load(); + } + #endif + + //VolumeSet = eeprom_read_byte((unsigned char*)FONT_EEPROM+4); + //if(VolumeSet < 0 || VolumeSet > 0xFF) + VolumeSet = 0x20; + + if(PrintMode)RTS_SndData(3, FanKeyIcon+1); // saving mode + else RTS_SndData(2, FanKeyIcon+1); // normal + last_target_temperature_bed = thermalManager.target_temperature_bed; + last_target_temperature[0] = thermalManager.target_temperature[0]; + feedrate_percentage = 100; + RTS_SndData(feedrate_percentage,FeedrateDisplay); + + /***************turn off motor*****************/ + RTS_SndData(11, FilenameIcon); + + /***************transmit temperature to screen*****************/ + RTS_SndData(0, NozzlePreheat); + RTS_SndData(0, BedPreheat); + RTS_SndData(thermalManager.current_temperature[0], NozzleTemp); + RTS_SndData(thermalManager.current_temperature_bed, Bedtemp); + /***************transmit Fan speed to screen*****************/ + #if FAN_COUNT > 0 + for (uint8_t i = 0; i < FAN_COUNT; i++) fanSpeeds[i] = FanOff;//turn 0ff fans + #endif + RTS_SndData(2, FanKeyIcon); //turn 0ff fans + FanStatus = true; + + /*********transmit SD card filename to screen***************/ + RTS_SDCardInit(); + /***************transmit Printer information to screen*****************/ + for(int j = 0;j < 20;j++) //clean filename + RTS_SndData(0,MacVersion+j); + char sizebuf[20]={0}; + sprintf(sizebuf,"%d X %d X %d",Y_BED_SIZE, X_BED_SIZE, Z_MAX_POS); + RTS_SndData(CUSTOM_MACHINE_NAME, MacVersion); + RTS_SndData(DETAILED_BUILD_VERSION, SoftVersion); + RTS_SndData(sizebuf, PrinterSize); + if(LanguageRecbuf != 0) + RTS_SndData(WEBSITE_URL, CorpWebsite); + else + RTS_SndData(WEBSITE_URL, CorpWebsite); + + /**************************some info init*******************************/ + RTS_SndData(0,PrintscheduleIcon); + RTS_SndData(0,PrintscheduleIcon+1); + + /************************clean screen*******************************/ + for(int i = 0;i < MaxFileNumber;i++) + { + for(int j = 0;j < 10;j++) + RTS_SndData(0,SDFILE_ADDR +i*10+j); + } + + for(int j = 0;j < 10;j++) + { + RTS_SndData(0,Printfilename+j); //clean screen. + RTS_SndData(0,Choosefilename+j); //clean filename + } + for(int j = 0;j < 8;j++) + RTS_SndData(0,FilenameCount+j); + for(int j = 1;j <= MaxFileNumber;j++) + { + RTS_SndData(10,FilenameIcon+j); + RTS_SndData(10,FilenameIcon1+j); + } + + rts_probe_zoffset = zprobe_zoffset; + //SERIAL_ECHOPAIR("\n init rts_probe_zoffset = ",rts_probe_zoffset); + SERIAL_ECHOPAIR("\n init zprobe_zoffset = ",zprobe_zoffset); + RTS_SndData(zprobe_zoffset*100, 0x1026); + /************************EEPROM*******************************/ + //settings.load(); + + SERIAL_ECHOLN("===Initing RTS has finished==="); + +} + +int RTSSHOW::RTS_RecData() +{ + while(Serial2.available() > 0 && (recnum < SizeofDatabuf)) + { + databuf[recnum] = Serial2.read(); + if(databuf[0] != FHONE) //ignore the invalid data + { + if(recnum > 0) // prevent the program from running. + { + memset(databuf,0,sizeof(databuf)); + recnum = 0; + } + continue; + } + delay(10); + recnum++; + } + + if(recnum < 1) //receive nothing + return -1; + else if((recdat.head[0] == databuf[0]) && (recdat.head[1] == databuf[1]) && recnum > 2) + { + // SERIAL_ECHOLN(" *** RTS_RecData1*** "); + + recdat.len = databuf[2]; + recdat.command = databuf[3]; + if(recdat.len == 0x03 && (recdat.command == 0x82 || recdat.command == 0x80) && (databuf[4] == 0x4F) && (databuf[5] == 0x4B)) //response for writing byte + { + memset(databuf,0, sizeof(databuf)); + recnum = 0; + //SERIAL_ECHOLN(" *** RTS_RecData1*** "); + return -1; + } + else if(recdat.command == 0x83) //response for reading the data from the variate + { + recdat.addr = databuf[4]; + recdat.addr = (recdat.addr << 8 ) | databuf[5]; + recdat.bytelen = databuf[6]; + for(int i = 0;i < recdat.bytelen;i+=2) + { + recdat.data[i/2]= databuf[7+i]; + recdat.data[i/2]= (recdat.data[i/2] << 8 )| databuf[8+i]; + } + } + else if(recdat.command == 0x81) //response for reading the page from the register + { + recdat.addr = databuf[4]; + recdat.bytelen = databuf[5]; + for(int i = 0;i < recdat.bytelen;i++) + { + recdat.data[i]= databuf[6+i]; + //recdat.data[i]= (recdat.data[i] << 8 )| databuf[7+i]; + } + } + + } + else + { + memset(databuf,0, sizeof(databuf)); + recnum = 0; + return -1; //receive the wrong data + } + memset(databuf,0, sizeof(databuf)); + recnum = 0; + return 2; +} + +void RTSSHOW::RTS_SndData(void) +{ + if((snddat.head[0] == FHONE) && (snddat.head[1] == FHTWO) && snddat.len >= 3){ + databuf[0] = snddat.head[0]; + databuf[1] = snddat.head[1]; + databuf[2] = snddat.len; + databuf[3] = snddat.command; + if(snddat.command ==0x80) //to write data to the register + { + databuf[4] = snddat.addr; + for(int i =0;i <(snddat.len - 2);i++) + databuf[5+i] = snddat.data[i]; + } + else if(snddat.len == 3 && (snddat.command ==0x81)) //to read data from the register + { + databuf[4] = snddat.addr; + databuf[5] = snddat.bytelen; + } + else if(snddat.command ==0x82) //to write data to the variate + { + databuf[4] = snddat.addr >> 8; + databuf[5] = snddat.addr & 0xFF; + for(int i =0;i <(snddat.len - 3);i += 2) + { + databuf[6 + i] = snddat.data[i/2] >> 8; + databuf[7 + i] = snddat.data[i/2] & 0xFF; + } + } + else if(snddat.len == 4 && (snddat.command ==0x83)) //to read data from the variate + { + databuf[4] = snddat.addr >> 8; + databuf[5] = snddat.addr & 0xFF; + databuf[6] = snddat.bytelen; + } + for(int i = 0;i < (snddat.len + 3);i++) + { + Serial2.write(databuf[i]); + delayMicroseconds(1); + } + + memset(&snddat,0,sizeof(snddat)); + memset(databuf,0, sizeof(databuf)); + snddat.head[0] = FHONE; + snddat.head[1] = FHTWO; + } +} + + +void RTSSHOW::RTS_SndData(const String &s, unsigned long addr, unsigned char cmd /*= VarAddr_W*/) +{ + if(s.length() < 1) + return; + RTS_SndData(s.c_str(), addr, cmd); +} + +void RTSSHOW::RTS_SndData(const char *str, unsigned long addr, unsigned char cmd/*= VarAddr_W*/) +{ + + int len = strlen(str); + + if( len > 0) + { + databuf[0] = FHONE; + databuf[1] = FHTWO; + databuf[2] = 3+len; + databuf[3] = cmd; + databuf[4] = addr >> 8; + databuf[5] = addr & 0x00FF; + for(int i =0;i 0xFFFF) + { + snddat.data[0] = n >> 16; + snddat.data[1] = n & 0xFFFF; + snddat.len = 7; + } + else + { + snddat.data[0] = n; + snddat.len = 5; + } + } + else if(cmd == RegAddr_W) + { + snddat.data[0] = n; + snddat.len = 3; + } + else if(cmd == VarAddr_R) + { + snddat.bytelen = n; + snddat.len = 4; + } + snddat.command = cmd; + snddat.addr = addr; + RTS_SndData(); +} + +void RTSSHOW::RTS_SndData(unsigned int n, unsigned long addr, unsigned char cmd){ RTS_SndData((int)n, addr, cmd); } + +void RTSSHOW::RTS_SndData(float n, unsigned long addr, unsigned char cmd){ RTS_SndData((int)n, addr, cmd); } + +void RTSSHOW::RTS_SndData(long n, unsigned long addr, unsigned char cmd){ RTS_SndData((unsigned long)n, addr, cmd); } + +void RTSSHOW::RTS_SndData(unsigned long n, unsigned long addr, unsigned char cmd/*= VarAddr_W*/) +{ + if(cmd == VarAddr_W ) + { + if(n > 0xFFFF) + { + snddat.data[0] = n >> 16; + snddat.data[1] = n & 0xFFFF; + snddat.len = 7; + } + else + { + snddat.data[0] = n; + snddat.len = 5; + } + } + else if(cmd == VarAddr_R) + { + snddat.bytelen = n; + snddat.len = 4; + } + snddat.command = cmd; + snddat.addr = addr; + RTS_SndData(); +} + +void RTSSHOW::RTS_SDcard_Stop() +{ + waitway = 4; + if(card.sdprinting) { + card.stopSDPrint(); + clear_command_queue(); + quickstop_stepper(); + } + SERIAL_ECHO("\n stopping ==\n"); + SERIAL_ECHOLNPGM("//action:cancel"); + thermalManager.disable_all_heaters(); + print_job_timer.reset(); + #if ENABLED(SDSUPPORT) && ENABLED(POWEROFF_SAVE_SD_FILE) + card.openPowerOffFile(power_off_info.power_off_filename, O_CREAT | O_WRITE | O_TRUNC | O_SYNC); + power_off_info.valid_head = 0; + power_off_info.valid_foot = 0; + if (card.savePowerOffInfo(&power_off_info, sizeof(power_off_info)) == -1) + { + SERIAL_PROTOCOLLN("Stop to Write power off file failed."); + } + card.closePowerOffFile(); + power_off_commands_count = 0; + #endif + + #if FAN_COUNT > 0 + for (uint8_t i = 0; i < FAN_COUNT; i++) fanSpeeds[i] = FanOff; + #endif + FanStatus = true; + + wait_for_heatup = false; + PrinterStatusKey[0] = 0; + enqueue_and_echo_commands_P(PSTR("M84")); //shut down the stepper motor. + SERIAL_ECHOLNPGM("//action:cancel"); +} + + +void RTSSHOW::RTS_HandleData() +{ + int Checkkey = -1; + SERIAL_PROTOCOLLN(" *******RTS_HandleData********\n "); + if(waitway > 0) //for waiting + { + SERIAL_ECHO("\n waitway =="); + SERIAL_ECHO((int)waitway); + memset(&recdat,0 , sizeof(recdat)); + recdat.head[0] = FHONE; + recdat.head[1] = FHTWO; + return; + } + SERIAL_ECHO("\n recdat.data[0] =="); + SERIAL_ECHO(recdat.data[0]); + SERIAL_ECHO("\n recdat.addr =="); + SERIAL_ECHO(recdat.addr); + for(int i = 0;Addrbuf[i] != 0;i++) + { + if(recdat.addr == Addrbuf[i]) + { + if(Addrbuf[i] >= Stopprint && Addrbuf[i] <= Resumeprint) + Checkkey = PrintChoice; + else if(Addrbuf[i] == NzBdSet || Addrbuf[i] == NozzlePreheat || Addrbuf[i] == BedPreheat ) + Checkkey = ManualSetTemp; + else if(Addrbuf[i] >= AutoZero && Addrbuf[i] <= DisplayZaxis) + Checkkey = XYZEaxis; + else if(Addrbuf[i] >= FilementUnit1 && Addrbuf[i] <= FilementUnit2) + Checkkey = Filement; + else + Checkkey = i; + break; + } + } + + if(recdat.addr >= SDFILE_ADDR && recdat.addr <= (SDFILE_ADDR + 10 *(FileNum+1))) + Checkkey = Filename; + + if(Checkkey < 0) + { + memset(&recdat,0 , sizeof(recdat)); + recdat.head[0] = FHONE; + recdat.head[1] = FHTWO; + return; + } +SERIAL_ECHO("== Checkkey=="); +SERIAL_ECHO(Checkkey); + switch(Checkkey) + { + case Printfile : + if(recdat.data[0] == 1) // card + { + InforShowStatus = false; + CardUpdate = true; + CardRecbuf.recordcount = -1; + RTS_SDCardUpate(); + SERIAL_ECHO("\n Handle Data PrintFile 1 Setting Screen "); + if(LanguageRecbuf != 0) + RTS_SndData(ExchangePageBase + 2, ExchangepageAddr); //exchange to 2 page + else + RTS_SndData(ExchangePageBase + 46, ExchangepageAddr); + + } + else if(recdat.data[0] == 2) // return after printing result. + { + InforShowStatus = true; + TPShowStatus = false; + quickstop_stepper(); + RTS_SndData(11, FilenameIcon); + RTS_SndData(0,PrintscheduleIcon); + RTS_SndData(0,PrintscheduleIcon+1); + RTS_SndData(0,Percentage); + delay(2); + RTS_SndData(0,Timehour); + RTS_SndData(0,Timemin); + print_job_timer.reset(); + + SERIAL_ECHO("\n Handle Data PrintFile 2 Setting Screen "); + if(LanguageRecbuf != 0) + RTS_SndData(ExchangePageBase + 1, ExchangepageAddr); //exchange to 1 page + else + RTS_SndData(ExchangePageBase + 45, ExchangepageAddr); //exchange to 45 page + } + else if(recdat.data[0] == 3 ) // Temperature control + { + InforShowStatus = true; + TPShowStatus = false; + SERIAL_ECHO("\n Handle Data PrintFile 3 Setting Screen "); + if(LanguageRecbuf != 0) + { + if(FanStatus) + RTS_SndData(ExchangePageBase + 16, ExchangepageAddr); //exchange to 16 page, the fans off + else + RTS_SndData(ExchangePageBase + 15, ExchangepageAddr); //exchange to 15 page, the fans on + } + else + { + if(FanStatus) + RTS_SndData(ExchangePageBase + 58, ExchangepageAddr); //exchange to 58 page, the fans off + else + RTS_SndData(ExchangePageBase + 57, ExchangepageAddr); //exchange to 57 page, the fans on + } + } + else if(recdat.data[0] == 4 ) //Settings + InforShowStatus = false; + break; + + case Ajust : + if(recdat.data[0] == 1) + { + InforShowStatus = false; + FanStatus?RTS_SndData(2, FanKeyIcon):RTS_SndData(3, FanKeyIcon); + } + else if(recdat.data[0] == 2) + { + SERIAL_ECHO("\n Handle Data Adjust 2 Setting Screen "); + InforShowStatus = true; + if(PrinterStatusKey[1] == 3)// during heating + { + if(LanguageRecbuf != 0) + RTS_SndData(ExchangePageBase + 10, ExchangepageAddr); // in heating + else + RTS_SndData(ExchangePageBase + 52, ExchangepageAddr); + } + else if(PrinterStatusKey[1] == 4) + { + if(LanguageRecbuf != 0) + RTS_SndData(ExchangePageBase + 12, ExchangepageAddr); // in the pause + else + RTS_SndData(ExchangePageBase + 54, ExchangepageAddr); + } + else + { + if(LanguageRecbuf != 0) + RTS_SndData(ExchangePageBase + 11, ExchangepageAddr); // in printing + else + RTS_SndData(ExchangePageBase + 53, ExchangepageAddr); + + } + } + else if(recdat.data[0] == 3) + { + if(FanStatus) //turn on the fan + { + RTS_SndData(3, FanKeyIcon); + fanSpeeds[0] = FanOn; + FanStatus = false; + } + else//turn off the fan + { + RTS_SndData(2, FanKeyIcon); + fanSpeeds[0] = FanOff; + FanStatus = true; + } + } + else if(recdat.data[0] == 4) + { + if(PrintMode) // normal printing mode + { + RTS_SndData(2, FanKeyIcon+1); + PrintMode = false; + } + else // power saving mode + { + RTS_SndData(3, FanKeyIcon+1); + PrintMode = true; + } + + } + break; + + case Feedrate : + feedrate_percentage = recdat.data[0]; + break; + + case PrintChoice: + if(recdat.addr == Stopprint) + { + if(PrintStatue[1] == 1 && recdat.data[0] == 0xF0) // in the pause + { + if(LanguageRecbuf != 0) + RTS_SndData(ExchangePageBase + 12, ExchangepageAddr); //exchange to 12 page + else + RTS_SndData(ExchangePageBase + 54, ExchangepageAddr); + break; + } + else if(PrintStatue[1] == 0 && recdat.data[0] == 0xF0) + { + if(PrinterStatusKey[1] == 3)// during heating + { + if(LanguageRecbuf != 0) + RTS_SndData(ExchangePageBase + 10, ExchangepageAddr); // in heating + else + RTS_SndData(ExchangePageBase + 52, ExchangepageAddr); + } + else + { + if(LanguageRecbuf != 0) + RTS_SndData(ExchangePageBase + 11, ExchangepageAddr); // in printing + else + RTS_SndData(ExchangePageBase + 53, ExchangepageAddr); + } + break; + } + //FilementStatus[0] = 0; // recover the status waiting to check filements + + + if(LanguageRecbuf != 0) + RTS_SndData(ExchangePageBase + 86, ExchangepageAddr); + else + RTS_SndData(ExchangePageBase + 87, ExchangepageAddr); + RTS_SndData(0,Timehour); + RTS_SndData(0,Timemin); + Update_Time_Value = 0; + CardCheckStatus[0] = 0;// close the key of checking card in printing + RTS_SDcard_Stop(); + } + else if(recdat.addr == Pauseprint) + { + if(recdat.data[0] != 0xF1) + break; + + if(LanguageRecbuf != 0) + RTS_SndData(ExchangePageBase + 86, ExchangepageAddr); + else + RTS_SndData(ExchangePageBase + 87, ExchangepageAddr); + + //char pause_str_Z[16]; + waitway = 1; //reject to receive cmd + //current_position[Z_AXIS] += 5; + //pause_z = current_position[Z_AXIS]; + card.pauseSDPrint(); + print_job_timer.pause(); + #ifdef ACTION_ON_PAUSE + SERIAL_ECHOLNPGM("From Pauseprint\n"); + SERIAL_ECHOLNPGM("//action:" ACTION_ON_PAUSE); + #endif + temphot=thermalManager.degTargetHotend(0); //thermalManager.target_temperature[0]; + //tempbed=thermalManager.degTargetBed();//thermalManager.target_temperature_bed; + //thermalManager.setTargetHotend(0, 0); + //thermalManager.setTargetBed(0); + + PrintStatue[1] = 1; //for return the corresponding page + PrinterStatusKey[1] = 4; + + + + Update_Time_Value = 0; + //memset(commandbuf,0,sizeof(commandbuf)); + //dtostrf(pause_z, 3, 2, pause_str_Z); + //sprintf(commandbuf,"G0 X10 Y10 Z%s",pause_str_Z); + //strncpy_P(commandbuf, PSTR("G28 X0 Y0"), sizeof(commandbuf) - 1); + //injected_commands_P =commandbuf;// PSTR("G28 X0 Y0");//commandbuf; + //enqueue_and_echo_commands_P(PSTR("G28 X0 Y0")); + + // Wait for planner moves to finish! + planner.synchronize(); + enqueue_and_echo_commands_P(PSTR("M25")); + //enqueue_and_echo_commands_P(PSTR("G1 Z +5")); + //enqueue_and_echo_commands_P(PSTR("G0 X10 Y10 F3000")); + + } + else if(recdat.addr == Resumeprint && recdat.data[0] == 1) + { + #if ENABLED(MachineCR10SPro) || ENABLED(AddonFilSensor) + /**************checking filement status during printing************/ + if(RTS_CheckFilement(0)) + { + for(startprogress=0;startprogress < 5;startprogress++) + { + RTS_SndData(startprogress, ExchFlmntIcon); + delay(400); + } + break; + } + #endif + + //char pause_str_Z[16]; + //memset(pause_str_Z, 0, sizeof(pause_str_Z)); + //dtostrf(pause_z-5, 3, 2, pause_str_Z); + //memset(commandbuf,0,sizeof(commandbuf)); + enqueue_and_echo_commands_P(PSTR("M24")); + //sprintf_P(commandbuf, PSTR("M190 S%i"), tempbed); + //enqueue_and_echo_command(commandbuf); + memset(commandbuf,0,sizeof(commandbuf)); + sprintf_P(commandbuf, PSTR("M109 S%i"), temphot); + enqueue_and_echo_command(commandbuf); + //enqueue_and_echo_commands_P(PSTR("G28 X0 Y0")); + planner.synchronize(); + //memset(commandbuf,0,sizeof(commandbuf)); + //sprintf_P(commandbuf, PSTR("G0 Z%s"), pause_str_Z); + //enqueue_and_echo_command(commandbuf); + + //card.startFileprint(); + //print_job_timer.start(); + #ifdef ACTION_ON_RESUME + SERIAL_ECHOLNPGM("//action:" ACTION_ON_RESUME); + #endif + + #if ENABLED(FILAMENT_RUNOUT_SENSOR) + runout.reset(); + #endif + FilementStatus[1] = 2; + + PrinterStatusKey[1] = 0; + InforShowStatus = true; + Update_Time_Value = RTS_UPDATE_VALUE; + + if(LanguageRecbuf != 0) + RTS_SndData(0,IconPrintstatus); // 1 for Heating + else + RTS_SndData(0+CEIconGrap,IconPrintstatus); + PrintStatue[1] = 0; + Update_Time_Value = 0; + //PrinterStatusKey[1] = 3; + CardCheckStatus[0] = 1; // open the key of checking card in printing + if(LanguageRecbuf != 0) + RTS_SndData(ExchangePageBase + 10, ExchangepageAddr); //exchange to 10 page + else + RTS_SndData(ExchangePageBase + 52, ExchangepageAddr); + } + if(recdat.addr == Resumeprint && recdat.data[0] == 2) // warming + { + NozzleTempStatus[2] = 1; + PrinterStatusKey[1] = 0; + InforShowStatus = true; + Update_Time_Value = RTS_UPDATE_VALUE; + thermalManager.target_temperature[0] = temphot; + startprogress = 0; + FilementStatus[1] = 2; + if(LanguageRecbuf != 0) + RTS_SndData(ExchangePageBase + 7, ExchangepageAddr); //exchange to 12 page + else + RTS_SndData(ExchangePageBase + 82, ExchangepageAddr); + } + break; + + case Zoffset: + //SERIAL_ECHOPAIR("\n rts_probe_zoffset = ",rts_probe_zoffset); + //SERIAL_ECHOPAIR("\n rcv data = ",recdat.data[0]); + if(recdat.data[0]>= 32768) { + rts_probe_zoffset = ((float)recdat.data[0]-65536)/100; + } + else { + rts_probe_zoffset = ((float)recdat.data[0])/100; + } + + //SERIAL_ECHOPAIR("\n rts_probe_zoffset = ",rts_probe_zoffset); + //SERIAL_ECHOPAIR("\n target = ",(zprobe_zoffset - rts_probe_zoffset)); + //SERIAL_ECHOPAIR("\n target axis = ",Z_AXIS); + //SERIAL_ECHOPAIR("\n steps mm = ",planner.steps_to_mm[Z_AXIS]); + if (WITHIN((rts_probe_zoffset), Z_PROBE_OFFSET_RANGE_MIN, Z_PROBE_OFFSET_RANGE_MAX)) { + thermalManager.babystep_axis(Z_AXIS, (400 * (zprobe_zoffset - rts_probe_zoffset) * -1)); + zprobe_zoffset = rts_probe_zoffset; + //SERIAL_ECHOPAIR("\n StepsMoved = ",(400 * (zprobe_zoffset - rts_probe_zoffset) * -1)); + //SERIAL_ECHOPAIR("\n probe_zoffset = ",zprobe_zoffset); + RTS_SndData(zprobe_zoffset*100, 0x1026); + } + //SERIAL_ECHOPAIR("\n rts_probe_zoffset = ",rts_probe_zoffset); + settings.save(); + //SERIAL_ECHOPAIR("\n probe_zoffset = ",zprobe_zoffset); + break; + + case TempControl: + if(recdat.data[0] == 0) + { + InforShowStatus = true; + TPShowStatus = false; + } + else if(recdat.data[0] == 1) + { + /*if(LanguageRecbuf != 0) + { + if(FanStatus) + RTS_SndData(ExchangePageBase + 18, ExchangepageAddr); //exchange to 18 page, the fans off + else + RTS_SndData(ExchangePageBase + 17, ExchangepageAddr); //exchange to 17 page, the fans on + } + else + { + if(FanStatus) + RTS_SndData(ExchangePageBase + 60, ExchangepageAddr); //exchange to 60 page, the fans off + else + RTS_SndData(ExchangePageBase + 59, ExchangepageAddr); //exchange to 59 page, the fans on + } */ + } + else if(recdat.data[0] == 2) + { + //InforShowStatus = true; + } + else if(recdat.data[0] == 3) + { + if(FanStatus) //turn on the fan + { + fanSpeeds[0] = FanOn; + FanStatus = false; + if(LanguageRecbuf != 0) + RTS_SndData(ExchangePageBase + 15, ExchangepageAddr); //exchange to 15 page, the fans on + else + RTS_SndData(ExchangePageBase + 57, ExchangepageAddr); //exchange to 57 page, the fans on + } + else//turn off the fan + { + fanSpeeds[0] = FanOff; + FanStatus = true; + if(LanguageRecbuf != 0) + RTS_SndData(ExchangePageBase + 16, ExchangepageAddr); //exchange to 16 page, the fans off + else + RTS_SndData(ExchangePageBase + 58, ExchangepageAddr); //exchange to 58 page, the fans on + } + } + else if(recdat.data[0] == 5) //PLA mode + { + thermalManager.setTargetHotend((PLA_ABSModeTemp = PREHEAT_1_TEMP_HOTEND), 0); + thermalManager.setTargetBed(PREHEAT_1_TEMP_BED); + + RTS_SndData(PREHEAT_1_TEMP_HOTEND,NozzlePreheat); + RTS_SndData(PREHEAT_1_TEMP_BED,BedPreheat); + + } + else if(recdat.data[0] == 6) //ABS mode + { + thermalManager.setTargetHotend((PLA_ABSModeTemp = PREHEAT_2_TEMP_HOTEND), 0); + thermalManager.setTargetBed(PREHEAT_2_TEMP_BED); + + RTS_SndData(PREHEAT_2_TEMP_HOTEND,NozzlePreheat); + RTS_SndData(PREHEAT_2_TEMP_BED,BedPreheat); + } + else if(recdat.data[0] == 0xF1) + { + //InforShowStatus = true; + #if FAN_COUNT > 0 + for (uint8_t i = 0; i < FAN_COUNT; i++) fanSpeeds[i] = FanOn; + #endif + FanStatus = false; + thermalManager.disable_all_heaters(); + + RTS_SndData(0,NozzlePreheat); + delay(1); + RTS_SndData(0,BedPreheat); + delay(1); + if(LanguageRecbuf != 0) + { + RTS_SndData(8,IconPrintstatus); // 8 for Cooling + RTS_SndData(ExchangePageBase + 15, ExchangepageAddr); + } + else + { + RTS_SndData(8+CEIconGrap,IconPrintstatus); + RTS_SndData(ExchangePageBase + 57, ExchangepageAddr); + } + + PrinterStatusKey[1] = 2; + } + break; + + case ManualSetTemp: + if(recdat.addr == NzBdSet) + { + if(recdat.data[0] == 0) + { + if(LanguageRecbuf != 0) + { + if(FanStatus) + RTS_SndData(ExchangePageBase + 16, ExchangepageAddr); //exchange to 16 page, the fans off + else + RTS_SndData(ExchangePageBase + 15, ExchangepageAddr); //exchange to 15 page, the fans on + } + else + { + if(FanStatus) + RTS_SndData(ExchangePageBase + 58, ExchangepageAddr); //exchange to 58 page, the fans off + else + RTS_SndData(ExchangePageBase + 57, ExchangepageAddr); //exchange to 57 page, the fans on + } + } + else if(recdat.data[0] == 1) + { + thermalManager.target_temperature[0] = 0; + RTS_SndData(0,NozzlePreheat); + } + else if(recdat.data[0] == 2) + { + thermalManager.target_temperature_bed = 0; + RTS_SndData(0,BedPreheat); + } + } + else if(recdat.addr == NozzlePreheat) + { + thermalManager.target_temperature[0] = recdat.data[0]; + } + else if(recdat.addr == BedPreheat) + { + thermalManager.target_temperature_bed = recdat.data[0]; + } + break; + + case Setting: + if(recdat.data[0] == 0) // return to main page + { + InforShowStatus = true; + TPShowStatus = false; + } + else if(recdat.data[0] == 1) //Bed Autoleveling + { + AutoLevelStatus?RTS_SndData(2, AutoLevelIcon):RTS_SndData(3, AutoLevelIcon); + RTS_SndData(10, FilenameIcon); //Motor Icon + waitway = 2; //only for prohibiting to receive massage + + enqueue_and_echo_commands_P((PSTR("G28"))); + waitway = 2; + set_bed_leveling_enabled(false); + enqueue_and_echo_commands_P((PSTR("G1 F150 Z0.2"))); + set_bed_leveling_enabled(true); + if(LanguageRecbuf != 0) + RTS_SndData(ExchangePageBase + 22, ExchangepageAddr); // Autoleve + else + RTS_SndData(ExchangePageBase + 64, ExchangepageAddr); + + } + else if(recdat.data[0] == 2) // Exchange filement + { + InforShowStatus = true; + TPShowStatus = false; + memset(ChangeMaterialbuf,0,sizeof(ChangeMaterialbuf)); + ChangeMaterialbuf[1]=ChangeMaterialbuf[0] = 10; + RTS_SndData(10*ChangeMaterialbuf[0], FilementUnit1); //It's ChangeMaterialbuf for show,instead of current_position[E_AXIS] in them. + RTS_SndData(10*ChangeMaterialbuf[1], FilementUnit2); + RTS_SndData(thermalManager.current_temperature[0],NozzleTemp); + RTS_SndData(thermalManager.target_temperature[0],NozzlePreheat); + delay(2); + if(LanguageRecbuf != 0) + RTS_SndData(ExchangePageBase + 23, ExchangepageAddr); //Change filement + else + RTS_SndData(ExchangePageBase + 65, ExchangepageAddr); + + } + else if(recdat.data[0] == 3) //Move + { + //InforShowoStatus = false; + AxisPagenum = 0; + rtscheck.RTS_SndData(10*current_position[X_AXIS], DisplayXaxis); + rtscheck.RTS_SndData(10*current_position[Y_AXIS], DisplayYaxis); + rtscheck.RTS_SndData(10*current_position[Z_AXIS], DisplayZaxis); + delay(2); + if(LanguageRecbuf != 0) + RTS_SndData(ExchangePageBase + 29, ExchangepageAddr); //Move axis, 10mm + else + RTS_SndData(ExchangePageBase + 71, ExchangepageAddr); + } + else if(recdat.data[0] == 4) //Language + { + + } + else if(recdat.data[0] == 5) //Printer Information + { + if(LanguageRecbuf != 0) + RTS_SndData(WEBSITE_URL, CorpWebsite); + else + RTS_SndData(WEBSITE_URL, CorpWebsite); + } + else if(recdat.data[0] == 6)// Diabalestepper + { + enqueue_and_echo_commands_P(PSTR("M84")); + RTS_SndData(11, FilenameIcon); + } + break; + + case ReturnBack: + if(recdat.data[0] == 1) // return to the tool page + { + Update_Time_Value = RTS_UPDATE_VALUE; + InforShowStatus = false; + if(LanguageRecbuf != 0) + RTS_SndData(ExchangePageBase + 21, ExchangepageAddr); + else + RTS_SndData(ExchangePageBase + 63, ExchangepageAddr); + } + if(recdat.data[0] == 2) // return to the Level mode page + { + if(LanguageRecbuf != 0) + RTS_SndData(ExchangePageBase + 22, ExchangepageAddr); + else + RTS_SndData(ExchangePageBase + 64, ExchangepageAddr); + } + break; + + case Bedlevel: + #if (ENABLED(MachineCRX) && DISABLED(Force10SProDisplay)) || ENABLED(ForceCRXDisplay) + if(recdat.data[0] == 1) // Top Left + { + waitway = 4; //only for prohibiting to receive massage + enqueue_and_echo_commands_P((PSTR("G1 F100 Z3;"))); + enqueue_and_echo_commands_P((PSTR("G1 X30 Y30 F5000"))); + waitway = 2; + enqueue_and_echo_commands_P((PSTR("G1 F100 Z-3"))); + + } + else if(recdat.data[0] == 2) // Top Right + { + waitway = 4; //only for prohibiting to receive massage + enqueue_and_echo_commands_P((PSTR("G1 F200 Z3"))); + enqueue_and_echo_commands_P((PSTR("G1 X270 Y30 F5000"))); + waitway = 2; + enqueue_and_echo_commands_P((PSTR("G1 F200 Z-3"))); + } + else if(recdat.data[0] == 3) // Centre + { + waitway = 4; //only for prohibiting to receive massage + enqueue_and_echo_commands_P((PSTR("G1 F200 Z3"))); + enqueue_and_echo_commands_P((PSTR("G1 X150 Y150 F5000"))); + waitway = 2; + enqueue_and_echo_commands_P((PSTR("G1 F200 Z-3"))); + } + else if(recdat.data[0] == 4) // Bottom Left + { + waitway = 4; //only for prohibiting to receive massage + enqueue_and_echo_commands_P((PSTR("G1 F200 Z3"))); + enqueue_and_echo_commands_P((PSTR("G1 X30 Y270 F5000"))); + waitway = 2; + enqueue_and_echo_commands_P((PSTR("G1 F200 Z-3"))); + } + else if(recdat.data[0] == 5) // Bottom Right + { + waitway = 4; //only for prohibiting to receive massage + enqueue_and_echo_commands_P((PSTR("G1 F200 Z3"))); + enqueue_and_echo_commands_P((PSTR("G1 X270 Y270 F5000"))); + waitway = 2; + enqueue_and_echo_commands_P((PSTR("G1 F200 Z-3"))); + } + break; + #else + if(recdat.data[0] == 1)// Z-axis to home + { + // Disallow Z homing if X or Y are unknown + if (!all_axes_known()) + enqueue_and_echo_commands_P(PSTR("G28")); + else + enqueue_and_echo_commands_P(PSTR("G28 Z0")); + set_bed_leveling_enabled(false); + enqueue_and_echo_commands_P(PSTR("G1 F150 Z0.2")); + set_bed_leveling_enabled(true); + rts_probe_zoffset = zprobe_zoffset; + RTS_SndData(zprobe_zoffset*100, 0x1026); + } + else if(recdat.data[0] == 2)// Z-axis to Up + { + //current_position[Z_AXIS] += 0.1; + //RTS_line_to_current(Z_AXIS); + if (WITHIN((zprobe_zoffset + 0.1), Z_PROBE_OFFSET_RANGE_MIN, Z_PROBE_OFFSET_RANGE_MAX)) { + thermalManager.babystep_axis(Z_AXIS, 40); + zprobe_zoffset = (zprobe_zoffset + 0.1); + rts_probe_zoffset = zprobe_zoffset; + RTS_SndData(zprobe_zoffset*100, 0x1026); + settings.save(); + } + } + else if(recdat.data[0] == 3)// Z-axis to Down + { + if (WITHIN((zprobe_zoffset - 0.1), Z_PROBE_OFFSET_RANGE_MIN, Z_PROBE_OFFSET_RANGE_MAX)) { + thermalManager.babystep_axis(Z_AXIS, -40); + zprobe_zoffset = (zprobe_zoffset - 0.1); + rts_probe_zoffset = zprobe_zoffset; + RTS_SndData(zprobe_zoffset*100, 0x1026); + settings.save(); + } + } + else if(recdat.data[0] == 4) // Assitant Level + { + waitway = 4; //only for prohibiting to receive massage + enqueue_and_echo_commands_P((PSTR("G28 X0 Y0 Z0"))); + enqueue_and_echo_commands_P((PSTR("G90"))); + waitway = 2; + set_bed_leveling_enabled(false); + enqueue_and_echo_commands_P((PSTR("G1 F200 Z0.2"))); + set_bed_leveling_enabled(true); + if(LanguageRecbuf != 0) + RTS_SndData(ExchangePageBase + 28, ExchangepageAddr); + else + RTS_SndData(ExchangePageBase + 84, ExchangepageAddr); + } + else if(recdat.data[0] == 5) // AutoLevel + { + waitway = 3; //only for prohibiting to receive massage + RTS_SndData(1, AutolevelIcon); + if(LanguageRecbuf != 0) + RTS_SndData(ExchangePageBase + 43, ExchangepageAddr); // Autoleve ... ,please wait + else + RTS_SndData(ExchangePageBase + 85, ExchangepageAddr); + enqueue_and_echo_commands_P(PSTR("G29")); + //stepper.synchronize(); + set_bed_leveling_enabled(false); + enqueue_and_echo_commands_P((PSTR("G1 F100 Z10.2;"))); + enqueue_and_echo_commands_P(PSTR("G1 X150 Y150 F5000")); + enqueue_and_echo_commands_P((PSTR("G1 F100 Z0.2"))); + set_bed_leveling_enabled(true); + } + else if(recdat.data[0] == 6) // Assitant Level , Centre 1 + { + waitway = 4; //only for prohibiting to receive massage + enqueue_and_echo_commands_P((PSTR("G1 F100 Z3;"))); + enqueue_and_echo_commands_P((PSTR("G1 X150 Y150 F5000"))); + waitway = 2; + enqueue_and_echo_commands_P((PSTR("G1 F100 Z-3"))); + } + else if(recdat.data[0] == 7) // Assitant Level , Front Left 2 + { + waitway = 4; //only for prohibiting to receive massage + enqueue_and_echo_commands_P((PSTR("G1 F100 Z3;"))); + enqueue_and_echo_commands_P((PSTR("G1 X30 Y30 F5000"))); + waitway = 2; + enqueue_and_echo_commands_P((PSTR("G1 F100 Z-3"))); + } + else if(recdat.data[0] == 8) // Assitant Level , Front Right 3 + { + waitway = 4; //only for prohibiting to receive massage + enqueue_and_echo_commands_P((PSTR("G1 F100 Z3;"))); + enqueue_and_echo_commands_P((PSTR("G1 X270 Y30 F5000"))); + waitway = 2; + enqueue_and_echo_commands_P((PSTR("G1 F100 Z-3"))); + } + else if(recdat.data[0] == 9) // Assitant Level , Back Right 4 + { + waitway = 4; //only for prohibiting to receive massage + enqueue_and_echo_commands_P((PSTR("G1 F100 Z3;"))); + enqueue_and_echo_commands_P((PSTR("G1 X270 Y270 F5000"))); + waitway = 2; + enqueue_and_echo_commands_P((PSTR("G1 F100 Z-3"))); + } + else if(recdat.data[0] == 10) // Assitant Level , Back Left 5 + { + waitway = 4; //only for prohibiting to receive massage + enqueue_and_echo_commands_P((PSTR("G1 F100 Z3;"))); + enqueue_and_echo_commands_P((PSTR("G1 X30 Y270 F5000"))); + waitway = 2; + enqueue_and_echo_commands_P((PSTR("G1 F100 Z-3"))); + } + else if(recdat.data[0] == 11) // Autolevel switch + { + if(AutoLevelStatus) //turn on the Autolevel + { + RTS_SndData(3, AutoLevelIcon); + AutoLevelStatus = false; + enqueue_and_echo_commands_P((PSTR("M420 S1"))); + } + else//turn off the Autolevel + { + RTS_SndData(2, AutoLevelIcon); + AutoLevelStatus = true; + enqueue_and_echo_commands_P((PSTR("M420 0"))); + } + last_zoffset = rts_probe_zoffset; + RTS_SndData(zprobe_zoffset*100, 0x1026); + //eeprom_write_byte((unsigned char*)FONT_EEPROM+2, AutoLevelStatus); + } + + RTS_SndData(10, FilenameIcon); + #endif + break; + + case XYZEaxis: + AxisEnum axis; + float min,max; + waitway = 4; + if(recdat.addr == DisplayXaxis) + { + axis = X_AXIS; + min = X_MIN_POS; + max = X_MAX_POS; + } + else if(recdat.addr == DisplayYaxis) + { + axis = Y_AXIS; + min = Y_MIN_POS; + max = Y_MAX_POS; + } + else if(recdat.addr == DisplayZaxis) + { + axis = Z_AXIS; + min = Z_MIN_POS; + max = Z_MAX_POS; + } + else if(recdat.addr == AutoZero) + { + if(recdat.data[0] == 3) //autohome + { + waitway = 4; + enqueue_and_echo_commands_P((PSTR("G28"))); + enqueue_and_echo_commands_P((PSTR("G1 F100 Z10.2"))); + InforShowStatus = AutohomeKey = true; + AutoHomeIconNum = 0; + Update_Time_Value = 0; + if(LanguageRecbuf != 0) + RTS_SndData(ExchangePageBase + 32, ExchangepageAddr); + else + RTS_SndData(ExchangePageBase + 74, ExchangepageAddr); + RTS_SndData(10,FilenameIcon); + } + else + { + AxisPagenum = recdat.data[0]; + waitway = 0; + } + break; + } + + current_position[axis] = ((float)recdat.data[0])/10; + if (current_position[axis] < min) current_position[axis] = min; + else if (current_position[axis] > max) current_position[axis] = max; + + if(axis==Z_AXIS) //roll polling + { + RTS_line_to_current(axis); + RTS_SndData(10*current_position[X_AXIS], DisplayXaxis); + RTS_SndData(10*current_position[Y_AXIS], DisplayYaxis); + RTS_SndData(10*current_position[Z_AXIS], DisplayZaxis); + } + else + RTS_line_to_current(axis); + delay(1); + RTS_SndData(10, FilenameIcon); + waitway = 0; + break; + + case Filement: + + #if ENABLED(MachineCR10SPro) || ENABLED(AddonFilSensor) + /**************checking filement status during changing filement************/ + if(RTS_CheckFilement(3)) break; + #endif + + unsigned int IconTemp; + if(recdat.addr == Exchfilement) + { + if(recdat.data[0] == 1) // Unload filement1 + { + original_extruder = active_extruder; + active_extruder = 0; + + current_position[E_AXIS] -= ChangeMaterialbuf[0]; + + if( NozzleTempStatus[1]== 0 && thermalManager.current_temperature[0] < (PLA_ABSModeTemp-5)) + { + NozzleTempStatus[1] = 1; + RTS_SndData((int)PLA_ABSModeTemp, 0x1020); + delay(5); + if(LanguageRecbuf != 0) + RTS_SndData(ExchangePageBase + 24, ExchangepageAddr); //exchange to 24 page + else + RTS_SndData(ExchangePageBase + 66, ExchangepageAddr); + break; + } + } + else if(recdat.data[0] == 2) // Load filement1 + { + original_extruder = active_extruder; + active_extruder = 0; + current_position[E_AXIS] += ChangeMaterialbuf[0]; + + if( NozzleTempStatus[1]== 0 && thermalManager.current_temperature[0] < (PLA_ABSModeTemp-5)) + { + NozzleTempStatus[1] = 1; + RTS_SndData((int)PLA_ABSModeTemp, 0x1020); + delay(5); + if(LanguageRecbuf != 0) + RTS_SndData(ExchangePageBase + 24, ExchangepageAddr); //exchange to 24 page + else + RTS_SndData(ExchangePageBase + 66, ExchangepageAddr); + break; + } + } + else if(recdat.data[0] == 3) // Unload filement2 + { + original_extruder = active_extruder; + active_extruder = 1; + + current_position[E_AXIS] -= ChangeMaterialbuf[1]; + + if( NozzleTempStatus[1]== 0 && thermalManager.current_temperature[0] < (PLA_ABSModeTemp-5)) + { + NozzleTempStatus[1] = 1; + RTS_SndData((int)PLA_ABSModeTemp, 0x1020); + delay(5); + if(LanguageRecbuf != 0) + RTS_SndData(ExchangePageBase + 24, ExchangepageAddr); //exchange to 24 page + else + RTS_SndData(ExchangePageBase + 66, ExchangepageAddr); + break; + } + } + else if(recdat.data[0] == 4) // Load filement2 + { + original_extruder = active_extruder; + active_extruder = 1; + + current_position[E_AXIS] += ChangeMaterialbuf[1]; + + if( NozzleTempStatus[1]== 0 && thermalManager.current_temperature[0] < (PLA_ABSModeTemp-5)) + { + NozzleTempStatus[1] = 1; + RTS_SndData((int)PLA_ABSModeTemp, 0x1020); + delay(5); + if(LanguageRecbuf != 0) + RTS_SndData(ExchangePageBase + 24, ExchangepageAddr); //exchange to 24 page + else + RTS_SndData(ExchangePageBase + 66, ExchangepageAddr); + break; + } + } + else if(recdat.data[0] == 5) // sure to heat + { + NozzleTempStatus[0] = 1; + //InforShowoStatus = true; + + thermalManager.target_temperature[0] = (thermalManager.target_temperature[0] >= PLA_ABSModeTemp? thermalManager.target_temperature[0]: PLA_ABSModeTemp); + IconTemp = thermalManager.current_temperature[0] * 100/thermalManager.target_temperature[0]; + if(IconTemp >= 100) + IconTemp = 100; + RTS_SndData(IconTemp, HeatPercentIcon); + + RTS_SndData(thermalManager.current_temperature[0], NozzleTemp); + RTS_SndData(thermalManager.target_temperature[0], NozzlePreheat); + delay(5); + if(LanguageRecbuf != 0) + RTS_SndData(ExchangePageBase + 26, ExchangepageAddr); //exchange to 26 page + else + RTS_SndData(ExchangePageBase + 68, ExchangepageAddr); + break; + } + else if(recdat.data[0] == 6) //cancel to heat + { + NozzleTempStatus[1] = 0; + if(LanguageRecbuf != 0) + RTS_SndData(ExchangePageBase + 23, ExchangepageAddr); //exchange to 23 page + else + RTS_SndData(ExchangePageBase + 65, ExchangepageAddr); + break; + } + else if(recdat.data[0] == 0xF1) //Sure to cancel heating + { + //InforShowoStatus = true; + NozzleTempStatus[0] = NozzleTempStatus[1] = 0; + delay(1); + if(LanguageRecbuf != 0) + RTS_SndData(ExchangePageBase + 23, ExchangepageAddr); //exchange to 22 page + else + RTS_SndData(ExchangePageBase + 65, ExchangepageAddr); + break; + } + else if(recdat.data[0] == 0xF0) // not to cancel heating + break; + + RTS_line_to_current(E_AXIS); + RTS_SndData(10*ChangeMaterialbuf[0], FilementUnit1); //It's ChangeMaterialbuf for show,instead of current_position[E_AXIS] in them. + RTS_SndData(10*ChangeMaterialbuf[1], FilementUnit2); + active_extruder = original_extruder; + } + else if(recdat.addr == FilementUnit1) + { + ChangeMaterialbuf[0] = ((float)recdat.data[0])/10; + } + else if(recdat.addr == FilementUnit2) + { + ChangeMaterialbuf[1] = ((float)recdat.data[0])/10; + } + break; + + case LanguageChoice: + #if DISABLED(TM3DTouchscreenUpdates) + LanguageRecbuf = recdat.data[0]; + //eeprom_write_byte((unsigned char*)FONT_EEPROM, LanguageRecbuf); + /*next step:record the data to EEPROM*/ + if(card.cardOK) + { + if(LanguageRecbuf != 0) + RTS_SndData(0,IconPrintstatus); // 0 for Ready + else + RTS_SndData(0+CEIconGrap,IconPrintstatus); + } + else + { + if(LanguageRecbuf != 0) + RTS_SndData(6,IconPrintstatus); // 6 for Card Removed + else + RTS_SndData(6+CEIconGrap,IconPrintstatus); + } + #else + SERIAL_ECHOPAIR("\n ***recdat.data[0] =",recdat.data[0]); + if(recdat.data[0]==1) { + settings.save(); + } + else { + enqueue_and_echo_commands_P(PSTR("M300")); + } + + #endif + break; + + case No_Filement: + char comdbuf[30]; + SERIAL_ECHO("\n No Filament"); + if(recdat.data[0] == 1) + { + /**************checking filement status during changing filement************/ + #if ENABLED(MachineCR10SPro) || ENABLED(AddonFilSensor) + if(RTS_CheckFilement(0)) break; + #endif + + if(FilementStatus[0] == 1) // check filement before starting to print + { + enqueue_and_echo_command(cmdbuf); + enqueue_and_echo_commands_P(PSTR("M24")); + for(int j = 0;j < 10;j++) //clean screen. + RTS_SndData(0,Printfilename+j); + + int filelen = strlen(CardRecbuf.Cardshowfilename[FilenamesCount]); + filelen = (TEXTBYTELEN - filelen)/2; + if(filelen > 0) + { + char buf[20]; + memset(buf,0,sizeof(buf)); + strncpy(buf," ",filelen); + strcpy(&buf[filelen],CardRecbuf.Cardshowfilename[FilenamesCount]); + RTS_SndData(buf, Printfilename); + } + else + RTS_SndData(CardRecbuf.Cardshowfilename[FilenamesCount], Printfilename); + delay(2); + if(LanguageRecbuf != 0) + { + RTS_SndData(1,IconPrintstatus); // 1 for Heating + delay(2); + RTS_SndData(ExchangePageBase + 10, ExchangepageAddr); //exchange to 10 page + } + else + { + RTS_SndData(1+CEIconGrap,IconPrintstatus); // 1 for Heating + delay(2); + RTS_SndData(ExchangePageBase + 52, ExchangepageAddr); + } + + TPShowStatus = InforShowStatus = true; + PrinterStatusKey[0] = 1; + PrinterStatusKey[1] = 3; + CardCheckStatus[0] = 1; // open the key of checking card in printing + FilenamesCount = PrintStatue[1] = 0; + + FilementStatus[0] = 0; // recover the status waiting to check filements + } + else if(FilementStatus[0] == 2) // check filements status during printing + { + //char pause_str_Z[16]; + //memset(pause_str_Z, 0, sizeof(pause_str_Z)); + //dtostrf(pause_z, 3, 2, pause_str_Z); + //sprintf_P(comdbuf, PSTR("M190 S%i"), tempbed); + //enqueue_and_echo_command(comdbuf); + memset(comdbuf,0,sizeof(comdbuf)); + sprintf_P(comdbuf, PSTR("M109 S%i"), temphot); + enqueue_and_echo_command(comdbuf); + //memset(comdbuf,0,sizeof(comdbuf)); + //sprintf_P(comdbuf, PSTR("G0 Z%s"), pause_str_Z); + //enqueue_and_echo_command(comdbuf); + + card.startFileprint(); + print_job_timer.start(); + + if(LanguageRecbuf != 0) + RTS_SndData(1,IconPrintstatus); // 1 for Heating + else + RTS_SndData(1+CEIconGrap,IconPrintstatus); + PrintStatue[1] = 0; + PrinterStatusKey[1] = 3; + CardCheckStatus[0] = 1; // open the key of checking card in printing + if(LanguageRecbuf != 0) + RTS_SndData(ExchangePageBase + 10, ExchangepageAddr); //exchange to 10 page + else + RTS_SndData(ExchangePageBase + 52, ExchangepageAddr); + + FilementStatus[0] = 0; // recover the status waiting to check filements + } + else if(FilementStatus[0] == 3) + { + //RTS_SndData(current_position[E_AXIS], FilementUnit1); + // RTS_SndData(current_position[E_AXIS], FilementUnit2); + if(LanguageRecbuf != 0) + RTS_SndData(ExchangePageBase + 23, ExchangepageAddr); //exchange to 23 page + else + RTS_SndData(ExchangePageBase + 65, ExchangepageAddr); + } + } + else if(recdat.data[0] == 0) + { + if(FilementStatus[0] == 1) + { + if(LanguageRecbuf != 0) + { + RTS_SndData(ExchangePageBase + 2, ExchangepageAddr); //exchange to 2 page + } + else + { + RTS_SndData(ExchangePageBase + 46, ExchangepageAddr); + } + PrinterStatusKey[0] = 0; + } + else if(FilementStatus[0] == 2) // like the pause + { + if(LanguageRecbuf != 0) + RTS_SndData(ExchangePageBase + 12, ExchangepageAddr); //exchange to 12 page + else + RTS_SndData(ExchangePageBase + 54, ExchangepageAddr); + } + else if(FilementStatus[0] == 3) + { + if(LanguageRecbuf != 0) + RTS_SndData(ExchangePageBase + 23, ExchangepageAddr); //exchange to 23 page + else + RTS_SndData(ExchangePageBase + 65, ExchangepageAddr); + } + FilementStatus[0] = 0; // recover the status waiting to check filements + } + break; + #if ENABLED(POWER_LOSS_RECOVERY) + case PwrOffNoF: + //SERIAL_ECHO("\n recdat.data[0] =="); + //SERIAL_ECHO(recdat.data[0]); + //SERIAL_ECHO("\n recdat.addr =="); + //SERIAL_ECHO(recdat.addr); + char cmd1[30]; + if(recdat.data[0] == 1)// Yes:continue to print the 3Dmode during power-off. + { + if (power_off_commands_count > 0) { + sprintf_P(cmd1, PSTR("M190 S%i"), power_off_info.target_temperature_bed); + enqueue_and_echo_command(cmd1); + sprintf_P(cmd1, PSTR("M109 S%i"), power_off_info.target_temperature[0]); + enqueue_and_echo_command(cmd1); + enqueue_and_echo_commands_P(PSTR("M106 S255")); + sprintf_P(cmd1, PSTR("T%i"), power_off_info.saved_extruder); + enqueue_and_echo_command(cmd1); + power_off_type_yes = 1; + + #if FAN_COUNT > 0 + for (uint8_t i = 0; i < FAN_COUNT; i++) fanSpeeds[i] = FanOn; + #endif + FanStatus = false; + + PrintStatue[1] = 0; + PrinterStatusKey[0] = 1; + PrinterStatusKey[1] = 3; + PoweroffContinue = true; + TPShowStatus = InforShowStatus = true; + CardCheckStatus[0] = 1; // open the key of checking card in printing + Update_Time_Value = 0; + if(LanguageRecbuf != 0) + { + RTS_SndData(1,IconPrintstatus); // 1 for Heating + RTS_SndData(ExchangePageBase + 10, ExchangepageAddr); //exchange to 10 page + } + else + { + RTS_SndData(1+CEIconGrap,IconPrintstatus); + RTS_SndData(ExchangePageBase + 52, ExchangepageAddr); + } + //card.startFileprint(); + //print_job_timer.power_off_start(); + } + } + else if(recdat.data[0] == 2)// No + { + InforShowStatus = true; + TPShowStatus = false; + Update_Time_Value = RTS_UPDATE_VALUE; + if(LanguageRecbuf != 0) + RTS_SndData(ExchangePageBase + 1, ExchangepageAddr); //exchange to 1 page + else + RTS_SndData(ExchangePageBase + 45, ExchangepageAddr); //exchange to 45 page + + card.stopSDPrint(); + clear_command_queue(); + quickstop_stepper(); + thermalManager.disable_all_heaters(); + + #if ENABLED(SDSUPPORT) && ENABLED(POWEROFF_SAVE_SD_FILE) + card.openPowerOffFile(power_off_info.power_off_filename, O_CREAT | O_WRITE | O_TRUNC | O_SYNC); + power_off_info.valid_head = 0; + power_off_info.valid_foot = 0; + if (card.savePowerOffInfo(&power_off_info, sizeof(power_off_info)) == -1) + { + SERIAL_PROTOCOLLN("Stop to Write power off file failed."); + } + card.closePowerOffFile(); + power_off_commands_count = 0; + #endif + + wait_for_heatup = false; + PrinterStatusKey[0] = 0; + delay(500); //for system + + } + break; + #endif + case Volume: + if(recdat.data[0] < 0) VolumeSet = 0; + else if(recdat.data[0] > 255 ) VolumeSet = 0xFF; + else VolumeSet = recdat.data[0]; + + + if(VolumeSet == 0) + { + RTS_SndData(0, VolumeIcon); + RTS_SndData(9, SoundIcon); + } + else + { + RTS_SndData((VolumeSet+1)/32 - 1, VolumeIcon); + RTS_SndData(8, SoundIcon); + } + //eeprom_write_byte((unsigned char*)FONT_EEPROM+4, VolumeSet); + RTS_SndData(VolumeSet<<8, SoundAddr+1); + break; + + case Filename : + //if(card.cardOK && recdat.data[0] > 0 && recdat.data[0] <= CardRecbuf.Filesum && recdat.addr != 0x20D2) + /*SERIAL_ECHO("\n recdat.data[0] =="); + SERIAL_ECHO(recdat.data[0]); + SERIAL_ECHO("\n recdat.addr =="); + SERIAL_ECHO(recdat.addr); */ + if(card.cardOK && recdat.addr == FilenameChs) + { + if(recdat.data[0] > CardRecbuf.Filesum) break; + + CardRecbuf.recordcount = recdat.data[0] - 1; + for(int j = 0;j < 10;j++) + RTS_SndData(0,Choosefilename+j); + int filelen = strlen(CardRecbuf.Cardshowfilename[CardRecbuf.recordcount]); + filelen = (TEXTBYTELEN - filelen)/2; + if(filelen > 0) + { + char buf[20]; + memset(buf,0,sizeof(buf)); + strncpy(buf," ",filelen); + strcpy(&buf[filelen],CardRecbuf.Cardshowfilename[CardRecbuf.recordcount]); + RTS_SndData(buf, Choosefilename); + } + else + RTS_SndData(CardRecbuf.Cardshowfilename[CardRecbuf.recordcount], Choosefilename); + + for(int j = 0;j < 8;j++) + RTS_SndData(0,FilenameCount+j); + char buf[20]; + memset(buf,0,sizeof(buf)); + sprintf(buf,"%d/%d",(int)recdat.data[0], CardRecbuf.Filesum); + RTS_SndData(buf, FilenameCount); + delay(2); + for(int j = 1;j <= CardRecbuf.Filesum;j++) + { + RTS_SndData((unsigned long)0xFFFF,FilenameNature + j*16); // white + RTS_SndData(10,FilenameIcon1+j); //clean + } + + RTS_SndData((unsigned long)0x87F0,FilenameNature + recdat.data[0]*16); // Light green + RTS_SndData(6,FilenameIcon1 + recdat.data[0]); // show frame + + } + else if(recdat.addr == FilenamePlay) + { + if(recdat.data[0] == 1 && card.cardOK) //for sure + { + if(CardRecbuf.recordcount < 0) + break; + + //SERIAL_ECHO("*************suceed1**********"); + char cmd[30]; + char* c; + sprintf_P(cmd, PSTR("M23 %s"), CardRecbuf.Cardfilename[CardRecbuf.recordcount]); + for (c = &cmd[4]; *c; c++) *c = tolower(*c); + + FilenamesCount = CardRecbuf.recordcount; + memset(cmdbuf,0,sizeof(cmdbuf)); + strcpy(cmdbuf,cmd); + + #if ENABLED(MachineCR10SPro) || ENABLED(AddonFilSensor) + /**************checking filement status during printing beginning ************/ + if(RTS_CheckFilement(1)) break; + #endif + + //InforShowoStatus = true; + enqueue_and_echo_command(cmd); + enqueue_and_echo_commands_P(PSTR("M24")); + for(int j = 0;j < 10;j++) //clean screen. + RTS_SndData(0,Printfilename+j); + + int filelen = strlen(CardRecbuf.Cardshowfilename[CardRecbuf.recordcount]); + filelen = (TEXTBYTELEN - filelen)/2; + if(filelen > 0) + { + char buf[20]; + memset(buf,0,sizeof(buf)); + strncpy(buf," ",filelen); + strcpy(&buf[filelen],CardRecbuf.Cardshowfilename[CardRecbuf.recordcount]); + RTS_SndData(buf, Printfilename); + } + else + RTS_SndData(CardRecbuf.Cardshowfilename[CardRecbuf.recordcount], Printfilename); + delay(2); + + #if FAN_COUNT > 0 + for (uint8_t i = 0; i < FAN_COUNT; i++) fanSpeeds[i] = FanOn; + #endif + FanStatus = false; + + if(LanguageRecbuf != 0) + { + RTS_SndData(1,IconPrintstatus); // 1 for Heating + delay(2); + RTS_SndData(ExchangePageBase + 10, ExchangepageAddr); //exchange to 10 page + } + else + { + RTS_SndData(1+CEIconGrap,IconPrintstatus); // 1 for Heating + delay(2); + RTS_SndData(ExchangePageBase + 52, ExchangepageAddr); + } + TPShowStatus = InforShowStatus = true; + PrintStatue[1] = 0; + PrinterStatusKey[0] = 1; + PrinterStatusKey[1] = 3; + CardCheckStatus[0] = 1; // open the key of checking card in printing + Update_Time_Value = 0; + } + else if(recdat.data[0] == 0) // return to main page + { + InforShowStatus = true; + TPShowStatus = false; + } + } + break; + + default: + break; + } + + memset(&recdat,0 , sizeof(recdat)); + recdat.head[0] = FHONE; + recdat.head[1] = FHTWO; +} + +void EachMomentUpdate() +{ + millis_t ms = millis(); + if(ms > next_rts_update_ms && InforShowStatus) + { + if ((power_off_type_yes == 0) && lcd_sd_status && (power_off_commands_count > 0)) // print the file before the power is off. + { + SERIAL_PROTOCOLLN(" ***test1*** "); + if(startprogress == 0) + { + rtscheck.RTS_SndData(StartSoundSet, SoundAddr); + + rtscheck.RTS_SndData(5, VolumeIcon); + rtscheck.RTS_SndData(8, SoundIcon); + rtscheck.RTS_SndData(0xC0, VolumeIcon-2); + if(VolumeSet == 0) + { + rtscheck.RTS_SndData(0, VolumeIcon); + rtscheck.RTS_SndData(9, SoundIcon); + } + else + { + rtscheck.RTS_SndData((VolumeSet+1)/32 - 1, VolumeIcon); + rtscheck.RTS_SndData(8, SoundIcon); + } + rtscheck.RTS_SndData(VolumeSet, VolumeIcon-2); + rtscheck.RTS_SndData(VolumeSet<<8, SoundAddr+1); + } + if(startprogress <= 100) + rtscheck.RTS_SndData(startprogress,StartIcon); + else + rtscheck.RTS_SndData((startprogress-100),StartIcon+1); + delay(30); + if((startprogress +=1) > 200) + { + #if ENABLED(POWER_LOSS_RECOVERY) + power_off_type_yes = 1; + + for (uint16_t i = 0; i < CardRecbuf.Filesum ; i++) + { + if(!strcmp(CardRecbuf.Cardfilename[i], &power_off_info.sd_filename[1])) + { + InforShowStatus = true; + int filelen = strlen(CardRecbuf.Cardshowfilename[i]); + filelen = (TEXTBYTELEN - filelen)/2; + if(filelen > 0) + { + char buf[20]; + memset(buf,0,sizeof(buf)); + strncpy(buf," ",filelen); + strcpy(&buf[filelen],CardRecbuf.Cardshowfilename[i]); + rtscheck.RTS_SndData(buf, Printfilename); + } + else + rtscheck.RTS_SndData(CardRecbuf.Cardshowfilename[i],Printfilename); //filenames + if(LanguageRecbuf != 0) + rtscheck.RTS_SndData(ExchangePageBase + 36, ExchangepageAddr); //exchange to 36 page + else + rtscheck.RTS_SndData(ExchangePageBase + 76, ExchangepageAddr); + break; + } + } + #endif + } + + return; + + } + else if((power_off_type_yes == 0) && !power_off_commands_count ) + { + + if(startprogress == 0) + { + rtscheck.RTS_SndData(StartSoundSet, SoundAddr); + + if(VolumeSet == 0) + { + rtscheck.RTS_SndData(0, VolumeIcon); + rtscheck.RTS_SndData(9, SoundIcon); + } + else + { + rtscheck.RTS_SndData((VolumeSet+1)/32 - 1, VolumeIcon); + rtscheck.RTS_SndData(8, SoundIcon); + } + rtscheck.RTS_SndData(VolumeSet, VolumeIcon-2); + rtscheck.RTS_SndData(VolumeSet<<8, SoundAddr+1); + } + if(startprogress <= 100) + rtscheck.RTS_SndData(startprogress,StartIcon); + else + rtscheck.RTS_SndData((startprogress-100),StartIcon+1); + delay(30); + if((startprogress +=1) > 200) + { + SERIAL_PROTOCOLLN(" startprogress "); + power_off_type_yes = 1; + InforShowStatus = true; + TPShowStatus = false; + Update_Time_Value = RTS_UPDATE_VALUE; + if(LanguageRecbuf != 0) + rtscheck.RTS_SndData(ExchangePageBase + 1, ExchangepageAddr); //exchange to 1 page + else + rtscheck.RTS_SndData(ExchangePageBase + 45, ExchangepageAddr); + } + return; + } + else + { + if (TPShowStatus && previous_move_ms != 0) //need to optimize + { + duration_t elapsed = print_job_timer.duration(); + static unsigned int last_cardpercentValue = 101; + rtscheck.RTS_SndData(elapsed.value/3600,Timehour); + rtscheck.RTS_SndData((elapsed.value%3600)/60,Timemin); + if(card.sdprinting) + progress_bar_percent = card.percentDone(); + if((card.sdprinting || print_job_timer.isRunning) && last_cardpercentValue != progress_bar_percent) + { + if( progress_bar_percent > 0 ) + { + Percentrecord = progress_bar_percent+1; + if(Percentrecord<= 50) + { + rtscheck.RTS_SndData((unsigned int)Percentrecord*2 ,PrintscheduleIcon); + rtscheck.RTS_SndData(0,PrintscheduleIcon+1); + } + else + { + rtscheck.RTS_SndData(100 ,PrintscheduleIcon); + rtscheck.RTS_SndData((unsigned int)Percentrecord*2 -100,PrintscheduleIcon+1); + } + } + else + { + rtscheck.RTS_SndData(0,PrintscheduleIcon); + rtscheck.RTS_SndData(0,PrintscheduleIcon+1); + } + rtscheck.RTS_SndData((unsigned int)progress_bar_percent,Percentage); + last_cardpercentValue = progress_bar_percent; + } + } + + rtscheck.RTS_SndData(zprobe_zoffset*100, 0x1026); + //float temp_buf = thermalManager.current_temperature[0]; + rtscheck.RTS_SndData(thermalManager.current_temperature[0],NozzleTemp); + rtscheck.RTS_SndData(thermalManager.current_temperature_bed,Bedtemp); + if(last_target_temperature_bed != thermalManager.target_temperature_bed || (last_target_temperature[0] != thermalManager.target_temperature[0])) + { + rtscheck.RTS_SndData(thermalManager.target_temperature[0],NozzlePreheat); + rtscheck.RTS_SndData(thermalManager.target_temperature_bed,BedPreheat); + + if(card.sdprinting) + { + //keep the icon + } + else if(last_target_temperature_bed < thermalManager.target_temperature_bed || (last_target_temperature[0] < thermalManager.target_temperature[0])) + { + if(LanguageRecbuf != 0) + rtscheck.RTS_SndData(1,IconPrintstatus); // 1 for Heating + else + rtscheck.RTS_SndData(1+CEIconGrap,IconPrintstatus); + Update_Time_Value = 0; + PrinterStatusKey[1] =( PrinterStatusKey[1] == 0? 1 : PrinterStatusKey[1]); + } + else if(last_target_temperature_bed > thermalManager.target_temperature_bed || (last_target_temperature[0] > thermalManager.target_temperature[0])) + { + if(LanguageRecbuf != 0) + rtscheck.RTS_SndData(8,IconPrintstatus); // 8 for Cooling + else + rtscheck.RTS_SndData(8+CEIconGrap,IconPrintstatus); + Update_Time_Value = 0; + PrinterStatusKey[1] =( PrinterStatusKey[1] == 0? 2 : PrinterStatusKey[1] ); + } + + last_target_temperature_bed = thermalManager.target_temperature_bed; + last_target_temperature[0] = thermalManager.target_temperature[0]; + + } + + if(NozzleTempStatus[0] || NozzleTempStatus[2]) //statuse of loadfilement and unloadfinement when temperature is less than + { + unsigned int IconTemp; + + IconTemp = thermalManager.current_temperature[0] * 100/thermalManager.target_temperature[0]; + if(IconTemp >= 100) + IconTemp = 100; + rtscheck.RTS_SndData(IconTemp, HeatPercentIcon); + if(thermalManager.current_temperature[0] >= thermalManager.target_temperature[0] && NozzleTempStatus[0]) + { + NozzleTempStatus[1] = 0; + NozzleTempStatus[0] = 0; + rtscheck.RTS_SndData(10*ChangeMaterialbuf[0], FilementUnit1); + rtscheck.RTS_SndData(10*ChangeMaterialbuf[1], FilementUnit2); + if(LanguageRecbuf != 0) + rtscheck.RTS_SndData(ExchangePageBase + 23, ExchangepageAddr); //exchange to 23 page + else + rtscheck.RTS_SndData(ExchangePageBase + 65, ExchangepageAddr); + RTS_line_to_current(E_AXIS); + active_extruder = original_extruder; + //delay(current_position[E_AXIS] * 1000); + } + else if(thermalManager.current_temperature[0] >= thermalManager.target_temperature[0] && NozzleTempStatus[2]) + { + SERIAL_ECHOPAIR("\n ***NozzleTempStatus[2] =",(int)NozzleTempStatus[2]); + startprogress = NozzleTempStatus[2] = 0; + TPShowStatus = true; + rtscheck.RTS_SndData(4, ExchFlmntIcon); + if(LanguageRecbuf != 0) + rtscheck.RTS_SndData(ExchangePageBase + 8, ExchangepageAddr); //exchange to 23 page + else + rtscheck.RTS_SndData(ExchangePageBase + 83, ExchangepageAddr); + } + else if( NozzleTempStatus[2] ) + { + rtscheck.RTS_SndData((startprogress++)%5, ExchFlmntIcon); + } + } + if(AutohomeKey ) + { + rtscheck.RTS_SndData(AutoHomeIconNum++,AutoZeroIcon); + if(AutoHomeIconNum > 9) AutoHomeIconNum = 0; + } + } + + if(planner.leveling_active) + rtscheck.RTS_SndData(2, AutoLevelIcon);/*Off*/ + else + rtscheck.RTS_SndData(3, AutoLevelIcon);/*On*/ + next_rts_update_ms = ms + RTS_UPDATE_INTERVAL + Update_Time_Value; + } + +} + +void RTSUpdate() //looping at the loop function +{ + /*Check the status of card*/ + rtscheck.RTS_SDCardUpate(); + +#if ENABLED(MachineCR10SPro) || ENABLED(AddonFilSensor) + /*checking filement status during printing */ + + //SERIAL_ECHOPAIR("\n ***FilementStatus[1] =",FilementStatus[1]); + //SERIAL_ECHOPAIR("\n ***card.sdprinting =",card.sdprinting); + + if(FilementStatus[1] == 2 && (card.sdprinting || planner.movesplanned())) + { + //SERIAL_ECHOPAIR("\n FIL_RUNOUT_PIN =",card.sdprinting); + //char cmd[2][30]; + if(READ(FIL_RUNOUT_PIN) == FIL_RUNOUT_INVERTING) + { + //SERIAL_PROTOCOLLN(" Filament runout debounce"); + Checkfilenum++; + delay(5); + if(Checkfilenum>50) + { + //SERIAL_PROTOCOLLN(" Filament runout > 50"); + //char pause_str_Z[16]; + //current_position[Z_AXIS] += 5; + //pause_z = current_position[Z_AXIS]; + waitway = 5; //reject to receive cmd and jump to the corresponding page + card.pauseSDPrint(); + print_job_timer.pause(); + temphot=thermalManager.degTargetHotend(0); //thermalManager.target_temperature[0]; + //tempbed=thermalManager.degTargetBed();//thermalManager.target_temperature_bed; + //thermalManager.setTargetHotend(0, 0); + //thermalManager.setTargetBed(0); + // enqueue_and_echo_commands_P(PSTR("G1 X10 Y10")); + + PrintStatue[1] = 1; // for returning the corresponding page + // FilementStatus[0] = 2; // no filements during printing + Checkfilenum=0; + FilementStatus[1] = 0; + PrinterStatusKey[1] = 4; + + TPShowStatus = false; + Update_Time_Value = 0; + //memset(commandbuf,0,sizeof(commandbuf)); + //dtostrf(pause_z, 3, 2, pause_str_Z); + //sprintf(commandbuf,"G0 X10 Y10 Z%s",pause_str_Z); + //strncpy_P(commandbuf, PSTR("G28 X0 Y0"), sizeof(commandbuf) - 1); + //injected_commands_P =commandbuf;// PSTR("G28 X0 Y0");//commandbuf; + + #ifdef ACTION_ON_PAUSE + SERIAL_ECHOLNPGM("\nFrom Runout\n"); + SERIAL_ECHOLNPGM("//action:" ACTION_ON_PAUSE); + #endif + planner.synchronize(); + enqueue_and_echo_commands_P(PSTR("M25")); + + } + } + } +#endif + + EachMomentUpdate(); + +//SERIAL_ECHOPAIR("\n RTSUpdate Waitway",waitway); + /*wait to receive massage and response*/ + if(!waitway && rtscheck.RTS_RecData() > 0) + //SERIAL_PROTOCOLLN(" Handle Data "); + rtscheck.RTS_HandleData(); +} \ No newline at end of file diff --git a/Marlin/src/lcd/extensible_ui/lib/Creality_DWIN.h b/Marlin/src/lcd/extensible_ui/lib/Creality_DWIN.h new file mode 100644 index 0000000000..7d92adc9a8 --- /dev/null +++ b/Marlin/src/lcd/extensible_ui/lib/Creality_DWIN.h @@ -0,0 +1,193 @@ +#pragma once + +#include "string.h" +#include +#include "../ui_api.h" + +/*********************************/ +#define FHONE (0x5A) +#define FHTWO (0xA5) +#define TEXTBYTELEN 18 +#define MaxFileNumber 20// 16 + +#define CEIconGrap 12 +#define FileNum MaxFileNumber +#define FileNameLen TEXTBYTELEN +#define RTS_UPDATE_INTERVAL 2000 +#define RTS_UPDATE_VALUE (2*RTS_UPDATE_INTERVAL) + +#define SizeofDatabuf 26 + +/*************Register and Variable addr*****************/ +#define RegAddr_W 0x80 +#define RegAddr_R 0x81 +#define VarAddr_W 0x82 +#define VarAddr_R 0x83 +#define ExchangePageBase (unsigned long)0x5A010000 //the first page ID. other page = first page ID + relevant num; +#define StartSoundSet ((unsigned long)0x060480A0) // 06,start-music; 04, 4 musics; 80, the volume value; 04, return value about music number. +#define FONT_EEPROM 90 +#define AutoLeve_EEPROM 100 +#define FanOn 255 +#define FanOff 0 + +/*variable addr*/ +#define ExchangepageAddr 0x0084 +#define SoundAddr 0x00A0 +#define StartIcon 0x1000 +#define FeedrateDisplay 0x1006 +#define Stopprint 0x1008 +#define Pauseprint 0x100A +#define Resumeprint 0x100C +#define PrintscheduleIcon 0x100E +#define Timehour 0x1010 +#define Timemin 0x1012 +#define IconPrintstatus 0x1014 +#define Percentage 0x1016 +#define FanKeyIcon 0x101E + +#define HeatPercentIcon 0x1024 + +#define NzBdSet 0x1032 +#define NozzlePreheat 0x1034 +#define NozzleTemp 0x1036 +#define BedPreheat 0x103A +#define Bedtemp 0x103C + +#define AutoZeroIcon 0x1042 +#define AutoLevelIcon 0x1045 +#define AutoZero 0x1046 +#define DisplayXaxis 0x1048 +#define DisplayYaxis 0x104A +#define DisplayZaxis 0x104C + +#define FilementUnit1 0x1054 +#define Exchfilement 0x1056 +#define FilementUnit2 0x1058 + +#define MacVersion 0x1060 +#define SoftVersion 0x106A +#define PrinterSize 0x1074 +#define CorpWebsite 0x107E +#define VolumeIcon 0x108A +#define SoundIcon 0x108C +#define AutolevelIcon 0x108D +#define ExchFlmntIcon 0x108E +#define AutolevelVal 0x1100 + +#define FilenameIcon 0x1200 +#define FilenameIcon1 0x1220 +#define Printfilename 0x2000 +#define SDFILE_ADDR 0x200A +#define FilenamePlay 0x20D2 +#define FilenameChs 0x20D3 +#define Choosefilename 0x20D4 +#define FilenameCount 0x20DE +#define FilenameNature 0x6003 +/************struct**************/ + +typedef struct DataBuf +{ + unsigned char len; + unsigned char head[2]; + unsigned char command; + unsigned long addr; + unsigned long bytelen; + unsigned short data[32]; + unsigned char reserv[4]; +} DB; + +typedef struct CardRecord +{ + char recordcount; + int Filesum; + unsigned long addr[FileNum]; + char Cardshowfilename[FileNum][FileNameLen]; + char Cardfilename[FileNum][FileNameLen]; +}CRec; + +class RTSSHOW { + public: + RTSSHOW(); + int RTS_RecData(); + void RTS_SDCardInit(void); + void RTS_SDCardUpate(void); + int RTS_CheckFilement(int); + void RTS_SndData(void); + void RTS_SndData(const String &, unsigned long, unsigned char = VarAddr_W); + void RTS_SndData(const char[], unsigned long, unsigned char = VarAddr_W); + void RTS_SndData(char, unsigned long, unsigned char = VarAddr_W); + void RTS_SndData(unsigned char*, unsigned long, unsigned char = VarAddr_W); + void RTS_SndData(int, unsigned long, unsigned char = VarAddr_W); + void RTS_SndData(float, unsigned long, unsigned char = VarAddr_W); + void RTS_SndData(unsigned int,unsigned long, unsigned char = VarAddr_W); + void RTS_SndData(long,unsigned long, unsigned char = VarAddr_W); + void RTS_SndData(unsigned long,unsigned long, unsigned char = VarAddr_W); + void RTS_SDcard_Stop(); + void RTS_HandleData(); + void RTS_Init(); + + DB recdat; + DB snddat; + private: + unsigned char databuf[SizeofDatabuf]; + }; + +extern RTSSHOW rtscheck; + + +#ifdef MachineCRX + #define Addvalue 2 + #define PrintChoice_Value (1+Addvalue) + #define TempControl_Value (4+Addvalue) + #define Setting_Value (8+Addvalue) + #define XYZEaxis_Value (12+Addvalue) + #define Filement_Value (15+Addvalue) + #define Language_Value (18+Addvalue) + #define Filename_Value (21+Addvalue) + + enum PROC_COM {Printfile=0,Ajust,Feedrate,PrintChoice=PrintChoice_Value,TempControl=TempControl_Value,ManualSetTemp,Setting=Setting_Value, + ReturnBack,Bedlevel,Autohome,XYZEaxis=XYZEaxis_Value,Filement=Filement_Value,LanguageChoice=Language_Value,PwrOffNoF,Volume,Filename=Filename_Value}; + + const unsigned long Addrbuf[] = {0x1002, 0x1004, 0x1006, 0x1008, 0x100A, 0x100C, 0x1030, 0x1032, 0x1034, 0x103A, 0x103E, + 0x1040, 0x1044, 0x1046, 0x1048, 0x104A, 0x104C, 0x1054, 0x1056, 0x1058, 0x105C, + 0x105F, 0x1088, 0}; +#else + #define Addvalue 3 + #define PrintChoice_Value (0+Addvalue) + #define Zoffset_Value (3+Addvalue) + #define Setting_Value (8+Addvalue) + #define XYZEaxis_Value (12+Addvalue) + #define Filement_Value (15+Addvalue) + #define Language_Value (18+Addvalue) + #define Filename_Value (22+Addvalue) + + enum PROC_COM {Printfile=0,Ajust,Feedrate,PrintChoice=PrintChoice_Value,Zoffset=Zoffset_Value,TempControl,ManualSetTemp,Setting=Setting_Value, + ReturnBack,Bedlevel,Autohome,XYZEaxis=XYZEaxis_Value,Filement=Filement_Value,LanguageChoice=Language_Value,No_Filement,PwrOffNoF,Volume,Filename=Filename_Value}; + + const unsigned long Addrbuf[] = {0x1002, 0x1004, 0x1006, 0x1008, 0x100A, 0x100C, 0x1026, 0x1030, 0x1032, 0x1034, 0x103A, + 0x103E, 0x1040, 0x1044, 0x1046, 0x1048, 0x104A, 0x104C, 0x1054, 0x1056, 0x1058, + 0x105C, 0x105E, 0x105F, 0x1088, 0}; +#endif +extern void RTSUpdate(); +extern void RTSInit(); + +extern char waitway; +extern char CardCheckStatus[2]; +extern bool InforShowStatus; +extern unsigned char LanguageRecbuf; +extern unsigned char AxisPagenum; +extern bool AutohomeKey; +extern bool TPShowStatus; +extern bool AutoLevelStatus; +extern int Update_Time_Value; +extern bool PoweroffContinue; +extern char FilementStatus[2]; +extern char commandbuf[30]; + +extern int temphot; +extern int tempbed; +extern float pause_z; +extern char PrintStatue[2]; +extern char PrinterStatusKey[2]; +extern const char *injected_commands_P; +extern uint8_t progress_bar_percent; diff --git a/build_number b/build_number new file mode 100644 index 0000000000..573541ac97 --- /dev/null +++ b/build_number @@ -0,0 +1 @@ +0