diff --git a/Marlin/Configuration_adv.h b/Marlin/Configuration_adv.h index 22a5ff9c90..d661b01dc5 100644 --- a/Marlin/Configuration_adv.h +++ b/Marlin/Configuration_adv.h @@ -1361,7 +1361,7 @@ //#define BROWSE_MEDIA_ON_INSERT // Open the file browser when media is inserted - #define EVENT_GCODE_SD_ABORT "G28XY" // G-code to run on SD Abort Print (e.g., "G28XY" or "G27") + #define EVENT_GCODE_SD_ABORT "G91\nG1Z5\nG92\nM84\nM104S0\nM140S0" // G-code to run on SD Abort Print (e.g., "G28XY" or "G27") #if ENABLED(PRINTER_EVENT_LEDS) #define PE_LEDS_COMPLETED_TIME (30*60) // (seconds) Time to keep the LED "done" color before restoring normal illumination diff --git a/Marlin/Version.h b/Marlin/Version.h index 76bd78de49..35de8795aa 100644 --- a/Marlin/Version.h +++ b/Marlin/Version.h @@ -28,7 +28,7 @@ /** * Marlin release version identifier */ -#define SHORT_BUILD_VERSION "2.0.7_DW7.3" +#define SHORT_BUILD_VERSION "2.0.7_DW7.3.1" /** * Verbose version identifier which should contain a reference to the location diff --git a/Marlin/src/lcd/extui/lib/Creality/Creality_DWIN.cpp b/Marlin/src/lcd/extui/lib/Creality/Creality_DWIN.cpp index 8b6c8d531e..e7ade473da 100644 --- a/Marlin/src/lcd/extui/lib/Creality/Creality_DWIN.cpp +++ b/Marlin/src/lcd/extui/lib/Creality/Creality_DWIN.cpp @@ -1,3 +1,36 @@ +/** + * Marlin 3D Printer Firmware + * Copyright (c) 2021 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] + * + * Based on Sprinter and grbl. + * Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + * + */ + +/* **************************************** + * lcd/extui/lib/Creality/Creality_DWIN.cpp + * **************************************** + * Extensible_UI implementation for Creality DWIN + * 10SPro, Max, CRX, and others + * Based original Creality release, ported to ExtUI for Marlin 2.0 + * Written by Insanity Automation, sponsored by Tiny Machines 3D + * + * ***************************************/ + + #include "Creality_DWIN.h" #include "FileNavigator.h" #include @@ -522,6 +555,7 @@ void RTSSHOW::RTS_SndData(const char *str, unsigned long addr, unsigned char cmd if (len > 0) { + if(len>20) len = 20; //databuf is 26 chars, loop adds 6 for header so limit data to 20 databuf[0] = FHONE; databuf[1] = FHTWO; databuf[2] = 3 + len; @@ -653,6 +687,11 @@ void RTSSHOW::RTS_HandleData() } switch(recdat.addr) { + case ProbeOffset_Z : + { + Checkkey = Zoffset_Value; + break; + } case Flowrate : case StepMM_X : case StepMM_Y : @@ -660,7 +699,6 @@ void RTSSHOW::RTS_HandleData() case StepMM_E : case ProbeOffset_X : case ProbeOffset_Y : - case ProbeOffset_Z : case HotendPID_AutoTmp : case BedPID_AutoTmp : case HotendPID_P : @@ -724,6 +762,8 @@ SERIAL_ECHOLNPGM_P(PSTR("BeginSwitch")); InforShowStatus = false; SERIAL_ECHOLNPGM_P(PSTR("Handle Data PrintFile Pre")); filenavigator.getFiles(0); + fileIndex = 0; + recordcount = 0; SERIAL_ECHOLNPGM_P(PSTR("Handle Data PrintFile Post")); RTS_SndData(ExchangePageBase + 46, ExchangepageAddr); } @@ -873,21 +913,30 @@ SERIAL_ECHOLNPGM_P(PSTR("BeginSwitch")); { tmp_zprobe_offset = ((float)recdat.data[0]) / 100; } - + tmp_zprobe_offset = tmp_zprobe_offset; //Invert sign here so it follows below + SERIAL_ECHOLNPAIR("Requested Offset ", tmp_zprobe_offset); if (WITHIN((tmp_zprobe_offset), Z_PROBE_OFFSET_RANGE_MIN, Z_PROBE_OFFSET_RANGE_MAX)) { - - smartAdjustAxis_steps(((getAxisSteps_per_mm(Z) * (getZOffset_mm() - tmp_zprobe_offset)) * -1), (axis_t)Z, false); - //babystepAxis_steps(((int)getAxisSteps_per_mm(Z) * (getZOffset_mm() - tmp_zprobe_offset) * -1), (axis_t)Z); - //setZOffset_mm(tmp_zprobe_offset); + int16_t tmpSteps = mmToWholeSteps(getZOffset_mm() - tmp_zprobe_offset, (axis_t)Z); + if(tmpSteps==0) + { + SERIAL_ECHOLNPGM_P(PSTR("Rounding to step")); + if(getZOffset_mm() < tmp_zprobe_offset) + tmpSteps = 1; + else + tmpSteps = -1; + } + smartAdjustAxis_steps(tmpSteps*-1, (axis_t)Z, false); + char zOffs[20], tmp1[11]; + sprintf_P(zOffs, PSTR("Z Offset : %s"), dtostrf(getZOffset_mm(), 1, 3, tmp1)); + onStatusChanged(zOffs); } else { + onStatusChanged_P(PSTR("Requested Offset Beyond Limits")); RTS_SndData(getZOffset_mm() * 100, ProbeOffset_Z); } - char zOffs[20], tmp1[11]; - sprintf_P(zOffs, PSTR("Z Offset : %s"), dtostrf(getZOffset_mm(), 1, 3, tmp1)); - onStatusChanged(zOffs); + rtscheck.RTS_SndData(getZOffset_mm() * 100, ProbeOffset_Z); break; @@ -1609,6 +1658,8 @@ SERIAL_ECHOLNPGM_P(PSTR("BeginSwitch")); PrintStatue[1] = 0; PrinterStatusKey[0] = 1; PrinterStatusKey[1] = 3; + fileIndex = 0; + recordcount = 0; } else if(recdat.data[0] == 2) //Page Down { @@ -1633,6 +1684,11 @@ SERIAL_ECHOLNPGM_P(PSTR("BeginSwitch")); filenavigator.getFiles(fileIndex); } } + else if(recdat.data[0] == 4) //Page Up + { + SERIAL_ECHOLNPGM_P(PSTR("Refresh")); + injectCommands_P(PSTR("M22\nM21")); + } else if (recdat.data[0] == 0) // return to main page { InforShowStatus = true; @@ -1682,6 +1738,8 @@ void onMediaInserted() SERIAL_ECHOLNPGM_P(PSTR("***Initing card is OK***")); filenavigator.reset(); filenavigator.getFiles(0); + fileIndex = 0; + recordcount = 0; } void onMediaError() diff --git a/Marlin/src/lcd/extui/lib/Creality/Creality_DWIN.h b/Marlin/src/lcd/extui/lib/Creality/Creality_DWIN.h index 41dfc32af3..9124acf07e 100644 --- a/Marlin/src/lcd/extui/lib/Creality/Creality_DWIN.h +++ b/Marlin/src/lcd/extui/lib/Creality/Creality_DWIN.h @@ -1,3 +1,35 @@ +/** + * Marlin 3D Printer Firmware + * Copyright (c) 2021 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] + * + * Based on Sprinter and grbl. + * Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + * + */ + +/* **************************************** + * lcd/extui/lib/Creality/Creality_DWIN.h + * **************************************** + * Extensible_UI implementation for Creality DWIN + * 10SPro, Max, CRX, and others + * Based original Creality release, ported to ExtUI for Marlin 2.0 + * Written by Insanity Automation, sponsored by Tiny Machines 3D + * + * ***************************************/ + #pragma once #include "string.h" diff --git a/Marlin/src/lcd/extui/lib/Creality/FileNavigator.h b/Marlin/src/lcd/extui/lib/Creality/FileNavigator.h index a205bb2820..2c86fa210b 100644 --- a/Marlin/src/lcd/extui/lib/Creality/FileNavigator.h +++ b/Marlin/src/lcd/extui/lib/Creality/FileNavigator.h @@ -22,10 +22,10 @@ #pragma once /* **************************************** - * lcd/extui/lib/Creality/FileNavigator.cpp + * lcd/extui/lib/Creality/FileNavigator.h * **************************************** * Extensible_UI implementation for Creality DWIN - * 10SPro, Max, CR10V2 + * 10SPro, Max, CRX and others * Based on implementations for Anycubic Chiron and Nextion by Nick Wells and Skorpi08 * Written by Insanity Automation * ***************************************/ diff --git a/Marlin/src/lcd/extui/ui_api.cpp b/Marlin/src/lcd/extui/ui_api.cpp index c6415813f4..66bc10c411 100644 --- a/Marlin/src/lcd/extui/ui_api.cpp +++ b/Marlin/src/lcd/extui/ui_api.cpp @@ -1065,7 +1065,9 @@ namespace ExtUI { } void onStatusChanged_P(PGM_P const pstr) { - onStatusChanged(pstr); + char msg[strlen_P(pstr) + 1]; + strcpy_P(msg, pstr); + onStatusChanged(msg); } FileList::FileList() { refresh(); } diff --git a/README.md b/README.md index 814170cd5e..f6b569022f 100644 --- a/README.md +++ b/README.md @@ -55,6 +55,14 @@ Marlin Discord - https://discord.gg/n5NJ59y -- Due to the above, the current recommendation is to try and limit folder depth to 3 subdirectories and keep names short if possible. - Base bumped to Marlin Bugfix as of 20210418 +# Changes for DW7.3.1 +- Added SD file refresh button for users with damaged SD Detect Pins +- Modified print finish button action to raise z by 5mm and disable steppers rather than rehome XY +- Solve rounding issue with babystepping below step precision by forcing always round up caused by recent upstream change +- Modified babystepping resolution for fine adjustment to .02mm from .01mm +- Force file pages to reset paging value on entry to screen to prevent incorrect scrolling +- Additional string length buffer safeties + The default build button is now a batch Build All! If you want to build a custom stock 2560 environment, use the env:megaatmega2560 environment. For SKR 1.3/1.4 boards use the LPC1768/9 environments as usual. For SKR Mini or Creality STM32F1 boards use the standard STM32 environments per vendor. @@ -74,6 +82,7 @@ Please keep in mind when flashing the Creality 32 bit boards with the binary fil ## Known Issues - While auto leveling (measuring) is in progress pressing other buttons on the screen can abort portions of the script depending where it is - - The process includes heating the bed before probing, probing then heating the nozzle before moving to Z0. + - Thanks to Jarrett Wendt for finding that if you are experiencing distorted sounds, and use a Mac, the default Archive Utility on MacOS has been found to be corrupting the files. If you're on a Mac, try unzipping with The Unarchiver or Keka instead. ## Future Goals diff --git a/buildroot/share/PlatformIO/scripts/common-cxxflags.py b/buildroot/share/PlatformIO/scripts/common-cxxflags.py index cb185352b4..0a6bd2b18d 100644 --- a/buildroot/share/PlatformIO/scripts/common-cxxflags.py +++ b/buildroot/share/PlatformIO/scripts/common-cxxflags.py @@ -33,7 +33,7 @@ def add_cpu_freq(): if env.GetBuildType() == "debug" and env.get('UPLOAD_PROTOCOL') not in ['jlink', 'stlink']: env['BUILD_DIR'] = '$PROJECT_BUILD_DIR/$PIOENV/debug' env_name = str(env["PIOENV"]) -env.Replace(PROGNAME="%s_DW7.3" % (env_name)) +env.Replace(PROGNAME="%s_DW7.3.1" % (env_name)) print("Environment: %s" % (env_name)) # On some platform, F_CPU is a runtime variable. Since it's used to convert from ns diff --git a/buildroot/share/PlatformIO/scripts/random-bin.py b/buildroot/share/PlatformIO/scripts/random-bin.py index 74b8f08d47..98d9dba59e 100644 --- a/buildroot/share/PlatformIO/scripts/random-bin.py +++ b/buildroot/share/PlatformIO/scripts/random-bin.py @@ -6,5 +6,5 @@ Import("env") from datetime import datetime env_name = str(env["PIOENV"]) -env['PROGNAME'] = "firmware_%s_DW7.3" % (env_name) +env['PROGNAME'] = "firmware_%s_DW7.3.1" % (env_name) #env['PROGNAME'] .= datetime.now().strftime("-%Y%m%d-%H%M%S")