From 81ec94db64b8285096e5f3eab76c5ab58bb1ff90 Mon Sep 17 00:00:00 2001 From: Alex Voinea Date: Mon, 15 Aug 2022 16:18:17 +0300 Subject: [PATCH 1/8] Show firmware version on splash screen --- Firmware/Marlin_main.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Firmware/Marlin_main.cpp b/Firmware/Marlin_main.cpp index e2069d204..cf1878d45 100644 --- a/Firmware/Marlin_main.cpp +++ b/Firmware/Marlin_main.cpp @@ -798,7 +798,7 @@ int uart_putchar(char c, FILE *) void lcd_splash() { lcd_clear(); // clears display and homes screen - lcd_puts_P(PSTR("\n Original Prusa i3\n Prusa Research")); + lcd_printf_P(PSTR("\n Original Prusa i3\n Prusa Research\n%20.20S"), PSTR(FW_VERSION)); } From f1e127ace4ee6f4b02ad48bdab1cf1d15599e31f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gu=C3=B0ni=20M=C3=A1r=20Gilbert?= Date: Sat, 17 Sep 2022 08:53:36 +0000 Subject: [PATCH 2/8] Initialise status line message in setup() Fixes #3581 --- Firmware/ultralcd.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Firmware/ultralcd.cpp b/Firmware/ultralcd.cpp index 18efd1278..86b51ef13 100755 --- a/Firmware/ultralcd.cpp +++ b/Firmware/ultralcd.cpp @@ -7518,6 +7518,9 @@ void ultralcd_init() lcd_oldcardstatus = IS_SD_INSERTED; #endif//(SDCARDDETECT > 0) lcd_encoder_diff = 0; + + // Initialise status line + lcd_setstatuspgm(MSG_WELCOME); } void lcd_ignore_click(bool b) From 4d6d267aefe9974176fe68cf0c0dd76da52b85cf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gu=C3=B0ni=20M=C3=A1r=20Gilbert?= Date: Sat, 17 Sep 2022 08:57:30 +0000 Subject: [PATCH 3/8] Don't initialise lcd status message in definition static variables are automatically zero initialised. Now that the status line message is initialised in ultralcd_init(), we don't need to set the variable in global scope. Saves 22 bytes of flash and 1 byte of SRAM --- Firmware/ultralcd.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Firmware/ultralcd.cpp b/Firmware/ultralcd.cpp index 86b51ef13..91972153e 100755 --- a/Firmware/ultralcd.cpp +++ b/Firmware/ultralcd.cpp @@ -94,7 +94,7 @@ static float manual_feedrate[] = MANUAL_FEEDRATE; /* LCD message status */ static LongTimer lcd_status_message_timeout; static uint8_t lcd_status_message_level; -static char lcd_status_message[LCD_WIDTH + 1] = WELCOME_MSG; +static char lcd_status_message[LCD_WIDTH + 1]; /* !Configuration settings */ From be7c1d55c813d6ab04ed809abcef56948bf28ee8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gu=C3=B0ni=20M=C3=A1r=20Gilbert?= Date: Sat, 17 Sep 2022 09:13:07 +0000 Subject: [PATCH 4/8] Remove redundant for-loop Now that lcd_status_message is now initialised correctly at boot-up, this for-loop is no longer required. Now lcd_status_message is only set in lcd_updatestatus() which always calls lcd_finishstatus() lcd_finishstatus() makes sure the message does not exceed 20 characters Saves 34 bytes of flash --- Firmware/ultralcd.cpp | 5 ----- 1 file changed, 5 deletions(-) diff --git a/Firmware/ultralcd.cpp b/Firmware/ultralcd.cpp index 91972153e..cd322b126 100755 --- a/Firmware/ultralcd.cpp +++ b/Firmware/ultralcd.cpp @@ -669,11 +669,6 @@ void lcdui_print_status_line(void) break; } } - - // Fill the rest of line to have nice and clean output - for(uint8_t fillspace = 0; fillspace < LCD_WIDTH; fillspace++) - if ((lcd_status_message[fillspace] <= 31 )) - lcd_print(' '); } //! @brief Show Status Screen From 156b5e5b99fbdebd480e569814c10915672cd02f Mon Sep 17 00:00:00 2001 From: Yuri D'Elia Date: Mon, 19 Sep 2022 18:14:28 +0200 Subject: [PATCH 5/8] Update current FW version --- Firmware/Configuration.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Firmware/Configuration.h b/Firmware/Configuration.h index 5d8b28fea..af36b3616 100644 --- a/Firmware/Configuration.h +++ b/Firmware/Configuration.h @@ -17,8 +17,8 @@ extern PGM_P sPrinterName; // Firmware version #define FW_MAJOR 3 -#define FW_MINOR 11 -#define FW_REVISION 1 +#define FW_MINOR 13 +#define FW_REVISION 0 //#define FW_FLAVOR RC //uncomment if DEBUG, DEVEL, ALPHA, BETA or RC //#define FW_FLAVERSION 1 //uncomment if FW_FLAVOR is defined and versioning is needed. #ifndef FW_FLAVOR From 1c4e9463ec808fcb17de3eafbba755ff1af44c0d Mon Sep 17 00:00:00 2001 From: Yuri D'Elia Date: Tue, 20 Sep 2022 16:56:17 +0200 Subject: [PATCH 6/8] Temperature model: update R0 estimate Update the default R0 estimate thanks to a larger dataset. This improves the error margin during self-check. --- Firmware/variants/1_75mm_MK3-EINSy10a-E3Dv6full.h | 2 +- Firmware/variants/1_75mm_MK3S-EINSy10a-E3Dv6full.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Firmware/variants/1_75mm_MK3-EINSy10a-E3Dv6full.h b/Firmware/variants/1_75mm_MK3-EINSy10a-E3Dv6full.h index ed5a1c551..ecab4565b 100644 --- a/Firmware/variants/1_75mm_MK3-EINSy10a-E3Dv6full.h +++ b/Firmware/variants/1_75mm_MK3-EINSy10a-E3Dv6full.h @@ -422,7 +422,7 @@ #define TEMP_MODEL_C_thr 0.01 // C estimation iteration threshold #define TEMP_MODEL_C_itr 30 // C estimation iteration limit -#define TEMP_MODEL_R 29.7 // initial guess for heatblock resistance (K/W) +#define TEMP_MODEL_R 20.5 // initial guess for heatblock resistance (K/W) #define TEMP_MODEL_Rl 5 // R estimation lower limit #define TEMP_MODEL_Rh 50 // R estimation upper limit #define TEMP_MODEL_R_thr 0.01 // R estimation iteration threshold diff --git a/Firmware/variants/1_75mm_MK3S-EINSy10a-E3Dv6full.h b/Firmware/variants/1_75mm_MK3S-EINSy10a-E3Dv6full.h index 5b57bcec4..c1767ae10 100644 --- a/Firmware/variants/1_75mm_MK3S-EINSy10a-E3Dv6full.h +++ b/Firmware/variants/1_75mm_MK3S-EINSy10a-E3Dv6full.h @@ -426,7 +426,7 @@ #define TEMP_MODEL_C_thr 0.01 // C estimation iteration threshold #define TEMP_MODEL_C_itr 30 // C estimation iteration limit -#define TEMP_MODEL_R 29.7 // initial guess for heatblock resistance (K/W) +#define TEMP_MODEL_R 20.5 // initial guess for heatblock resistance (K/W) #define TEMP_MODEL_Rl 5 // R estimation lower limit #define TEMP_MODEL_Rh 50 // R estimation upper limit #define TEMP_MODEL_R_thr 0.01 // R estimation iteration threshold From 129df6dd4aaccfafee1a7ec431b4017eda2bff6f Mon Sep 17 00:00:00 2001 From: Yuri D'Elia Date: Wed, 21 Sep 2022 10:19:16 +0200 Subject: [PATCH 7/8] Do not reset line on serial commands without N Fix regression introduced in fc10ca31466e1c58bcb5b9b90976a489239a6fde. Accept incoming serial commands without line numbers (assumed to be injected by the host), but do not reset the last line count when doing so. --- Firmware/cmdqueue.cpp | 10 ++++------ Firmware/cmdqueue.h | 1 - 2 files changed, 4 insertions(+), 7 deletions(-) diff --git a/Firmware/cmdqueue.cpp b/Firmware/cmdqueue.cpp index 687f9cabc..b286d3931 100755 --- a/Firmware/cmdqueue.cpp +++ b/Firmware/cmdqueue.cpp @@ -26,10 +26,7 @@ bool comment_mode = false; char *strchr_pointer; // just a pointer to find chars in the command string like X, Y, Z, E, etc ShortTimer serialTimeoutTimer; - -long gcode_N = 0; long gcode_LastN = 0; - uint32_t sdpos_atomic = 0; @@ -403,7 +400,7 @@ void get_command() cmdbuffer[bufindw+serial_count+CMDHDRSIZE] = 0; //terminate string if(!comment_mode){ - gcode_N = 0; + long gcode_N = -1; // Line numbers must be first in buffer @@ -490,7 +487,7 @@ void get_command() // Command is complete: store the current line into buffer, move to the next line. // Store type of entry - cmdbuffer[bufindw] = gcode_N ? CMDBUFFER_CURRENT_TYPE_USB_WITH_LINENR : CMDBUFFER_CURRENT_TYPE_USB; + cmdbuffer[bufindw] = gcode_N >= 0 ? CMDBUFFER_CURRENT_TYPE_USB_WITH_LINENR : CMDBUFFER_CURRENT_TYPE_USB; #ifdef CMDBUFFER_DEBUG SERIAL_ECHO_START; @@ -506,7 +503,8 @@ void get_command() ++ buflen; // Update the processed gcode line - gcode_LastN = gcode_N; + if (gcode_N >= 0) + gcode_LastN = gcode_N; #ifdef CMDBUFFER_DEBUG SERIAL_ECHOPGM("Number of commands in the buffer: "); diff --git a/Firmware/cmdqueue.h b/Firmware/cmdqueue.h index 5229b96b0..3573d5020 100644 --- a/Firmware/cmdqueue.h +++ b/Firmware/cmdqueue.h @@ -52,7 +52,6 @@ extern int serial_count; extern bool comment_mode; extern char *strchr_pointer; -extern long gcode_N; extern long gcode_LastN; extern bool cmdqueue_pop_front(); From 2cdd3ba36483d4856a783ea3648fb284ea124eea Mon Sep 17 00:00:00 2001 From: Alex Voinea Date: Wed, 21 Sep 2022 14:53:54 +0200 Subject: [PATCH 8/8] Move strings to progmem --- Firmware/Marlin_main.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Firmware/Marlin_main.cpp b/Firmware/Marlin_main.cpp index 8de0e8692..d89800642 100644 --- a/Firmware/Marlin_main.cpp +++ b/Firmware/Marlin_main.cpp @@ -4285,11 +4285,11 @@ void process_commands() #endif //PRUSA_SN_SUPPORT else if(code_seen_P(PSTR("Fir"))){ // PRUSA Fir - SERIAL_PROTOCOLLN(FW_VERSION_FULL); + SERIAL_PROTOCOLLNPGM(FW_VERSION_FULL); } else if(code_seen_P(PSTR("Rev"))){ // PRUSA Rev - SERIAL_PROTOCOLLN(FILAMENT_SIZE "-" ELECTRONICS "-" NOZZLE_TYPE ); + SERIAL_PROTOCOLLNPGM(FILAMENT_SIZE "-" ELECTRONICS "-" NOZZLE_TYPE ); } else if(code_seen_P(PSTR("Lang"))) { // PRUSA Lang lang_reset();