From ab427804acce47246e997da25c63d36983df14ce Mon Sep 17 00:00:00 2001 From: InsanityAutomation Date: Sun, 26 Feb 2023 15:22:37 -0500 Subject: [PATCH] Add debug message, reduce ram usage to avoid comm corruption from stack --- Marlin/Configuration.h | 4 ++-- Marlin/Configuration_adv.h | 4 ++-- Marlin/src/lcd/extui/ia_dwin/Creality_DWIN.cpp | 11 ++++++----- 3 files changed, 10 insertions(+), 9 deletions(-) diff --git a/Marlin/Configuration.h b/Marlin/Configuration.h index 5c9063afc6..28819ff148 100644 --- a/Marlin/Configuration.h +++ b/Marlin/Configuration.h @@ -2084,7 +2084,7 @@ // Gradually reduce leveling correction until a set height is reached, // at which point movement will be level to the machine's XY plane. // The height can be set with M420 Z - #define ENABLE_LEVELING_FADE_HEIGHT + //#define ENABLE_LEVELING_FADE_HEIGHT #if ENABLED(ENABLE_LEVELING_FADE_HEIGHT) #define DEFAULT_LEVELING_FADE_HEIGHT 00.0 // (mm) Default fade height. #endif @@ -2529,7 +2529,7 @@ * * View the current statistics with M78. */ -#define PRINTCOUNTER +//#define PRINTCOUNTER #if ENABLED(PRINTCOUNTER) #define PRINTCOUNTER_SAVE_INTERVAL 60 // (minutes) EEPROM save interval during print #endif diff --git a/Marlin/Configuration_adv.h b/Marlin/Configuration_adv.h index 3573eb55ce..abcb9ebde0 100644 --- a/Marlin/Configuration_adv.h +++ b/Marlin/Configuration_adv.h @@ -1214,7 +1214,7 @@ // Backlash Compensation // Adds extra movement to axes on direction-changes to account for backlash. // -#define BACKLASH_COMPENSATION +//#define BACKLASH_COMPENSATION #if ENABLED(BACKLASH_COMPENSATION) // Define values for backlash distance and correction. // If BACKLASH_GCODE is enabled these values are the defaults. @@ -2459,7 +2459,7 @@ // For debug-echo: 128 bytes for the optimal speed. // Other output doesn't need to be that speedy. // :[0, 2, 4, 8, 16, 32, 64, 128, 256] -#define TX_BUFFER_SIZE 128 +#define TX_BUFFER_SIZE 64 // Host Receive Buffer Size // Without XON/XOFF flow control (see SERIAL_XON_XOFF below) 32 bytes should be enough. diff --git a/Marlin/src/lcd/extui/ia_dwin/Creality_DWIN.cpp b/Marlin/src/lcd/extui/ia_dwin/Creality_DWIN.cpp index 344fad6832..b6a52f2e0d 100644 --- a/Marlin/src/lcd/extui/ia_dwin/Creality_DWIN.cpp +++ b/Marlin/src/lcd/extui/ia_dwin/Creality_DWIN.cpp @@ -580,10 +580,10 @@ int RTSSHOW::RTS_RecData() recdat.addr = vp; recdat.len = tmp[2]; for(unsigned int i = 0;i < dlen; i+=2) - { - recdat.data[i/2]= tmp[3+i]; - recdat.data[i/2]= (recdat.data[i/2] << 8 )| tmp[4+i]; - } + { + recdat.data[i/2]= tmp[3+i]; + recdat.data[i/2]= (recdat.data[i/2] << 8 )| tmp[4+i]; + } SERIAL_ECHOLNPGM("VP received: ", vp , " - len ", tmp[2]); @@ -598,6 +598,7 @@ int RTSSHOW::RTS_RecData() // discard anything else rx_datagram_state = DGUS_IDLE; + return -1; } } return -1; @@ -801,7 +802,7 @@ void RTSSHOW::RTS_HandleData() SERIAL_ECHOLNPGM_P(PSTR(" *******RTS_HandleData******** ")); if (waitway > 0) //for waiting { - SERIAL_ECHOLNPGM("waitway ==", (int)waitway); + SERIAL_ECHOLNPGM("handle waitway ==", (int)waitway); memset(&recdat, 0, sizeof(recdat)); recdat.head[0] = FHONE; recdat.head[1] = FHTWO;