From 497637ee841551b2a6175e1a342fbbea5f2575f8 Mon Sep 17 00:00:00 2001 From: Yuri D'Elia Date: Tue, 18 Feb 2020 12:23:42 +0100 Subject: [PATCH 1/6] Remove hard-coded X/Y jerk limits --- Firmware/ConfigurationStore.cpp | 4 ---- Firmware/Marlin_main.cpp | 2 -- 2 files changed, 6 deletions(-) diff --git a/Firmware/ConfigurationStore.cpp b/Firmware/ConfigurationStore.cpp index 0bd13a3a1..0698c7f2d 100644 --- a/Firmware/ConfigurationStore.cpp +++ b/Firmware/ConfigurationStore.cpp @@ -247,10 +247,6 @@ bool Config_RetrieveSettings() { EEPROM_readData(reinterpret_cast(EEPROM_M500_base), reinterpret_cast(&cs), sizeof(cs), "cs"); - - - if (cs.max_jerk[X_AXIS] > DEFAULT_XJERK) cs.max_jerk[X_AXIS] = DEFAULT_XJERK; - if (cs.max_jerk[Y_AXIS] > DEFAULT_YJERK) cs.max_jerk[Y_AXIS] = DEFAULT_YJERK; calculate_extruder_multipliers(); //if max_feedrate_silent and max_acceleration_units_per_sq_second_silent were never stored to eeprom, use default values: diff --git a/Firmware/Marlin_main.cpp b/Firmware/Marlin_main.cpp index 1dcb89389..38034fa59 100755 --- a/Firmware/Marlin_main.cpp +++ b/Firmware/Marlin_main.cpp @@ -7102,8 +7102,6 @@ Sigma_Exit: #endif cs.max_jerk[E_AXIS] = e; } - if (cs.max_jerk[X_AXIS] > DEFAULT_XJERK) cs.max_jerk[X_AXIS] = DEFAULT_XJERK; - if (cs.max_jerk[Y_AXIS] > DEFAULT_YJERK) cs.max_jerk[Y_AXIS] = DEFAULT_YJERK; } break; From 153de8e1dbe7d64f8465d6151b54950ae6e22ec0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gu=C3=B0ni=20M=C3=A1r=20Gilbert?= Date: Sat, 10 Jul 2021 17:01:13 +0000 Subject: [PATCH 2/6] Remove redundant lines --- Firmware/ultralcd.cpp | 4 +--- Firmware/ultralcd.h | 11 ----------- 2 files changed, 1 insertion(+), 14 deletions(-) diff --git a/Firmware/ultralcd.cpp b/Firmware/ultralcd.cpp index 81fef9674..9df919af7 100755 --- a/Firmware/ultralcd.cpp +++ b/Firmware/ultralcd.cpp @@ -241,9 +241,7 @@ static void lcd_detect_IRsensor(); #endif //IR_SENSOR_ANALOG static void lcd_selftest_error(TestError error, const char *_error_1, const char *_error_2); static void lcd_colorprint_change(); -#ifdef SNMM -static int get_ext_nr(); -#endif //SNMM + #if defined (SNMM) || defined(SNMM_V2) static void fil_load_menu(); static void fil_unload_menu(); diff --git a/Firmware/ultralcd.h b/Firmware/ultralcd.h index 68b933d02..5e39b34db 100755 --- a/Firmware/ultralcd.h +++ b/Firmware/ultralcd.h @@ -162,15 +162,6 @@ void lcd_commands(); extern bool bSettings; // flag (i.e. 'fake parameter') for 'lcd_hw_setup_menu()' function void lcd_hw_setup_menu(void); // NOT static due to using inside "util" module ("nozzle_diameter_check()") - -void change_extr(int extr); - -#ifdef SNMM -void extr_unload_all(); -void extr_unload_used(); -#endif //SNMM -void extr_unload(); - enum class FilamentAction : uint_least8_t { None, //!< 'none' state is used as flag for (filament) autoLoad (i.e. opposite for 'autoLoad' state) @@ -218,8 +209,6 @@ void lcd_pinda_calibration_menu(); void lcd_calibrate_pinda(); void lcd_temp_calibration_set(); -void display_loading(); - void lcd_set_degree(); #if (LANG_MODE != 0) From b1972fdcee97808a2f523193d0292c2e10864c50 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gu=C3=B0ni=20M=C3=A1r=20Gilbert?= Date: Wed, 28 Jul 2021 16:47:47 +0000 Subject: [PATCH 3/6] Fixes https://github.com/prusa3d/Prusa-Firmware/issues/3252 --- Firmware/ultralcd.cpp | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/Firmware/ultralcd.cpp b/Firmware/ultralcd.cpp index 658e6b01f..ef5cf1e5b 100755 --- a/Firmware/ultralcd.cpp +++ b/Firmware/ultralcd.cpp @@ -8844,6 +8844,22 @@ void menu_lcd_lcdupdate_func(void) #if (SDCARDDETECT > 0) if ((IS_SD_INSERTED != lcd_oldcardstatus)) { + if(menu_menu == lcd_sdcard_menu) { + // If the user is either inside the submenus + // 1. 'Print from SD' --> and SD card is removed + // 2. 'No SD card' --> and SD card is inserted + // + // 1. 'Print from SD': We want to back out of this submenu + // and instead show the submenu title 'No SD card'. + // + // 2. 'No SD card': When the user inserts the SD card we want + // to back out of this submenu. Not only to show + // 'Print from SD' submenu title but also because the user + // will be prompted with another menu with the sorted list of files. + // Without backing out of the menu, the list will appear empty and + // The user will need to back out of two nested submenus. + menu_back(); + } lcd_draw_update = 2; lcd_oldcardstatus = IS_SD_INSERTED; lcd_refresh(); // to maybe revive the LCD if static electricity killed it. @@ -8861,8 +8877,6 @@ void menu_lcd_lcdupdate_func(void) } else { - if(menu_menu==lcd_sdcard_menu) - menu_back(); card.release(); LCD_MESSAGERPGM(_i("Card removed"));////MSG_SD_REMOVED c=20 } From 63c6373f8d84db189b3fc6ba40b5c138a5609a11 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gu=C3=B0ni=20M=C3=A1r=20Gilbert?= Date: Sat, 25 Dec 2021 09:41:50 +0000 Subject: [PATCH 4/6] Remove TEMP_STAT_LEDS from firmware This isn't used by MK3 printers. It seems to be leftover code from Marlin --- Firmware/Configuration.h | 5 ----- Firmware/Marlin_main.cpp | 36 ------------------------------------ 2 files changed, 41 deletions(-) diff --git a/Firmware/Configuration.h b/Firmware/Configuration.h index 1ede18c03..75a9ad5cc 100644 --- a/Firmware/Configuration.h +++ b/Firmware/Configuration.h @@ -489,11 +489,6 @@ your extruder heater takes 2 minutes to hit the target on heating. // Increase the FAN pwm frequency. Removes the PWM noise but increases heating in the FET/Arduino //#define FAST_PWM_FAN -// Temperature status LEDs that display the hotend and bet temperature. -// If all hotends and bed temperature and temperature setpoint are < 54C then the BLUE led is on. -// Otherwise the RED led is on. There is 1C hysteresis. -//#define TEMP_STAT_LEDS - // Use software PWM to drive the fan, as for the heaters. This uses a very low frequency // which is not ass annoying as with the hardware PWM. On the other hand, if this frequency // is too low, you should also increment SOFT_PWM_SCALE. diff --git a/Firmware/Marlin_main.cpp b/Firmware/Marlin_main.cpp index 01e62f2a6..985af1b2d 100755 --- a/Firmware/Marlin_main.cpp +++ b/Firmware/Marlin_main.cpp @@ -9814,39 +9814,6 @@ void controllerFan() } #endif -#ifdef TEMP_STAT_LEDS -static bool blue_led = false; -static bool red_led = false; -static uint32_t stat_update = 0; - -void handle_status_leds(void) { - float max_temp = 0.0; - if(_millis() > stat_update) { - stat_update += 500; // Update every 0.5s - for (int8_t cur_extruder = 0; cur_extruder < EXTRUDERS; ++cur_extruder) { - max_temp = max(max_temp, degHotend(cur_extruder)); - max_temp = max(max_temp, degTargetHotend(cur_extruder)); - } - #if defined(TEMP_BED_PIN) && TEMP_BED_PIN > -1 - max_temp = max(max_temp, degTargetBed()); - max_temp = max(max_temp, degBed()); - #endif - if((max_temp > 55.0) && (red_led == false)) { - digitalWrite(STAT_LED_RED, 1); - digitalWrite(STAT_LED_BLUE, 0); - red_led = true; - blue_led = false; - } - if((max_temp < 54.0) && (blue_led == false)) { - digitalWrite(STAT_LED_RED, 0); - digitalWrite(STAT_LED_BLUE, 1); - red_led = false; - blue_led = true; - } - } -} -#endif - #ifdef SAFETYTIMER /** * @brief Turn off heating after safetytimer_inactive_time milliseconds of inactivity @@ -10090,9 +10057,6 @@ if(0) WRITE(E0_ENABLE_PIN,oldstatus); } #endif - #ifdef TEMP_STAT_LEDS - handle_status_leds(); - #endif check_axes_activity(); mmu_loop(); From 58867f6c06c8cdaf80da7d5b617221490601e410 Mon Sep 17 00:00:00 2001 From: Alex Voinea Date: Fri, 4 Feb 2022 15:53:12 +0100 Subject: [PATCH 5/6] Fix arduino 1.8.13 warnings --- Firmware/MarlinSerial.cpp | 2 +- Firmware/MarlinSerial.h | 11 +++++++---- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/Firmware/MarlinSerial.cpp b/Firmware/MarlinSerial.cpp index 5f1c5ce33..e09ddac32 100644 --- a/Firmware/MarlinSerial.cpp +++ b/Firmware/MarlinSerial.cpp @@ -30,7 +30,7 @@ uint8_t selectedSerialPort = 0; // this is so I can support Attiny series and any other chip without a UART #if defined(UBRRH) || defined(UBRR0H) || defined(UBRR1H) || defined(UBRR2H) || defined(UBRR3H) -#if UART_PRESENT(SERIAL_PORT) +#ifdef HAS_UART ring_buffer rx_buffer = { { 0 }, 0, 0 }; #endif diff --git a/Firmware/MarlinSerial.h b/Firmware/MarlinSerial.h index 27e722bc0..ebfc11c1b 100644 --- a/Firmware/MarlinSerial.h +++ b/Firmware/MarlinSerial.h @@ -28,9 +28,12 @@ #endif // The presence of the UBRRH register is used to detect a UART. -#define UART_PRESENT(port) ((port == 0 && (defined(UBRRH) || defined(UBRR0H))) || \ - (port == 1 && defined(UBRR1H)) || (port == 2 && defined(UBRR2H)) || \ - (port == 3 && defined(UBRR3H))) +#if ((port == 0 && (defined(UBRRH) || defined(UBRR0H))) || \ + (port == 1 && defined(UBRR1H)) || \ + (port == 2 && defined(UBRR2H)) || \ + (port == 3 && defined(UBRR3H))) +#define HAS_UART +#endif // These are macros to build serial port register names for the selected SERIAL_PORT (C preprocessor // requires two levels of indirection to expand macro values properly) @@ -82,7 +85,7 @@ struct ring_buffer int tail; }; -#if UART_PRESENT(SERIAL_PORT) +#ifdef HAS_UART extern ring_buffer rx_buffer; #endif From 274f198188c3f5137ab2de74ddde2618ee5929e4 Mon Sep 17 00:00:00 2001 From: Alex Voinea Date: Fri, 4 Feb 2022 16:28:49 +0100 Subject: [PATCH 6/6] Fix typo from long ago --- Firmware/MarlinSerial.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Firmware/MarlinSerial.h b/Firmware/MarlinSerial.h index ebfc11c1b..3bb0926b2 100644 --- a/Firmware/MarlinSerial.h +++ b/Firmware/MarlinSerial.h @@ -28,10 +28,10 @@ #endif // The presence of the UBRRH register is used to detect a UART. -#if ((port == 0 && (defined(UBRRH) || defined(UBRR0H))) || \ - (port == 1 && defined(UBRR1H)) || \ - (port == 2 && defined(UBRR2H)) || \ - (port == 3 && defined(UBRR3H))) +#if ((SERIAL_PORT == 0 && (defined(UBRRH) || defined(UBRR0H))) || \ + (SERIAL_PORT == 1 && defined(UBRR1H)) || \ + (SERIAL_PORT == 2 && defined(UBRR2H)) || \ + (SERIAL_PORT == 3 && defined(UBRR3H))) #define HAS_UART #endif