From 10d156b28cae3b03dec94ff8eb1a7ac5ff6da29c Mon Sep 17 00:00:00 2001 From: gudnimg Date: Tue, 6 Aug 2024 10:32:28 +0000 Subject: [PATCH 1/9] tests: Fix a compiler warning in tests -fpermissive MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Prusa-Firmware/tests/../Firmware/util.h:114:25: error: invalid conversion from ‘const char*’ to ‘char*’ [-fpermissive] 114 | pStrEnd = strchr(this->ptr, '"'); | ~~~~~~^~~~~~~~~~~~~~~~ | | | const char* --- Firmware/util.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Firmware/util.h b/Firmware/util.h index dca66b2fed..86d99827b7 100644 --- a/Firmware/util.h +++ b/Firmware/util.h @@ -96,7 +96,7 @@ struct unquoted_string { : len(0) , found(false) { - char * pStrEnd = NULL; + const char * pStrEnd = NULL; // Start of the string this->ptr = strchr(pStr, '"'); From ad1e3cb12a428e8f652a14dce51c378afa55e561 Mon Sep 17 00:00:00 2001 From: gudnimg Date: Tue, 6 Aug 2024 12:57:42 +0000 Subject: [PATCH 2/9] Configuration: missing stdint.h include MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The following error is raised in unit testing environment: Prusa-Firmware/Firmware/Configuration.h:16:14: error: ‘uint16_t’ does not name a type 16 | extern const uint16_t _nPrinterType; --- Firmware/Configuration.h | 1 + 1 file changed, 1 insertion(+) diff --git a/Firmware/Configuration.h b/Firmware/Configuration.h index b959352238..cd655bbd87 100644 --- a/Firmware/Configuration.h +++ b/Firmware/Configuration.h @@ -1,6 +1,7 @@ #ifndef CONFIGURATION_H #define CONFIGURATION_H +#include #include "boards.h" #define STR_HELPER(x) #x From 9ae8beacc61989bcd89b2fd853d03256bb35173f Mon Sep 17 00:00:00 2001 From: gudnimg Date: Tue, 6 Aug 2024 12:59:55 +0000 Subject: [PATCH 3/9] eeprom: add missing include stddef.h MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Fixes compiler warning in test environment: Prusa-Firmware/Firmware/eeprom.h:712:51: error: ‘size_t’ has not been declared 712 | bool eeprom_is_initialized_block(const void *__p, size_t __n); | --- Firmware/eeprom.h | 1 + 1 file changed, 1 insertion(+) diff --git a/Firmware/eeprom.h b/Firmware/eeprom.h index ff1d4f3c12..0a63e14c6a 100644 --- a/Firmware/eeprom.h +++ b/Firmware/eeprom.h @@ -12,6 +12,7 @@ #define EEPROM_H #include +#include #include "Configuration_var.h" // Custom Mendel Name From f628c5f91214c57605ec5c1eb66d4ce51bb54832 Mon Sep 17 00:00:00 2001 From: gudnimg Date: Tue, 6 Aug 2024 13:59:49 +0000 Subject: [PATCH 4/9] util: should include avr/eeprom.h The file is calling eeprom_read_byte and should include avr/eeprom.h --- Firmware/util.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/Firmware/util.cpp b/Firmware/util.cpp index 02582aef68..f0999561bf 100644 --- a/Firmware/util.cpp +++ b/Firmware/util.cpp @@ -5,6 +5,7 @@ #include "sound.h" #include "language.h" #include "util.h" +#include #include #include "Prusa_farm.h" From a1fcb8564e63b551d2eb6a6960b351d05a7f0815 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gu=C3=B0ni=20M=C3=A1r=20Gilbert?= Date: Thu, 8 Aug 2024 15:05:30 +0000 Subject: [PATCH 5/9] util: reorder includes alphabetically Place system includes on top --- Firmware/util.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/Firmware/util.cpp b/Firmware/util.cpp index f0999561bf..f5481ecf87 100644 --- a/Firmware/util.cpp +++ b/Firmware/util.cpp @@ -1,13 +1,13 @@ -#include "Configuration.h" +#include +#include -#include "ultralcd.h" +#include "Configuration.h" +#include "language.h" #include "menu.h" +#include "Prusa_farm.h" #include "sound.h" -#include "language.h" +#include "ultralcd.h" #include "util.h" -#include -#include -#include "Prusa_farm.h" // Allocate the version string in the program memory. Otherwise the string lands either on the stack or in the global RAM. static const char FW_VERSION_STR[] PROGMEM = FW_VERSION; From 0153eb05a1dce706914bf436b470f2bb13915c3b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gu=C3=B0ni=20M=C3=A1r=20Gilbert?= Date: Thu, 8 Aug 2024 15:09:04 +0000 Subject: [PATCH 6/9] util: add stdio.h include for sprintf_P --- Firmware/util.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/Firmware/util.cpp b/Firmware/util.cpp index f5481ecf87..a553938b75 100644 --- a/Firmware/util.cpp +++ b/Firmware/util.cpp @@ -1,5 +1,6 @@ #include #include +#include // for sprintf_P #include "Configuration.h" #include "language.h" From 835caa0230b22c03f44de9732aacba35f81464ec Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gu=C3=B0ni=20M=C3=A1r=20Gilbert?= Date: Tue, 13 Aug 2024 23:23:21 +0000 Subject: [PATCH 7/9] mesh_bed_calibration: drop Marlin.h include --- Firmware/mesh_bed_calibration.h | 2 +- Firmware/util.cpp | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/Firmware/mesh_bed_calibration.h b/Firmware/mesh_bed_calibration.h index 61fe08604e..8ee8325242 100644 --- a/Firmware/mesh_bed_calibration.h +++ b/Firmware/mesh_bed_calibration.h @@ -1,6 +1,6 @@ #pragma once -#include "Marlin.h" +#include #define BED_ZERO_REF_X (- 22.f + X_PROBE_OFFSET_FROM_EXTRUDER) // -22 + 23 = 1 #define BED_ZERO_REF_Y (- 0.6f + Y_PROBE_OFFSET_FROM_EXTRUDER + 4.f) // -0.6 + 5 + 4 = 8.4 diff --git a/Firmware/util.cpp b/Firmware/util.cpp index a553938b75..42c70713a0 100644 --- a/Firmware/util.cpp +++ b/Firmware/util.cpp @@ -4,6 +4,8 @@ #include "Configuration.h" #include "language.h" +#include "lcd.h" +#include "Marlin.h" // delay_keep_alive #include "menu.h" #include "Prusa_farm.h" #include "sound.h" From 41245b2a5915bbe1f5815f7907b7ca07a86730ef Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gu=C3=B0ni=20M=C3=A1r=20Gilbert?= Date: Tue, 13 Aug 2024 23:26:09 +0000 Subject: [PATCH 8/9] Marlin: drop mmu2.h include We should only be including it where needed --- Firmware/Filament_sensor.cpp | 1 + Firmware/Marlin.h | 1 - 2 files changed, 1 insertion(+), 1 deletion(-) diff --git a/Firmware/Filament_sensor.cpp b/Firmware/Filament_sensor.cpp index c186d049e1..b70ada3b34 100644 --- a/Firmware/Filament_sensor.cpp +++ b/Firmware/Filament_sensor.cpp @@ -8,6 +8,7 @@ #include "language.h" #include "menu.h" #include "messages.h" +#include "mmu2.h" #include "planner.h" #include "temperature.h" #include "ultralcd.h" diff --git a/Firmware/Marlin.h b/Firmware/Marlin.h index 6640f08a41..2ee72cf065 100755 --- a/Firmware/Marlin.h +++ b/Firmware/Marlin.h @@ -21,7 +21,6 @@ #include "Configuration.h" #include "pins.h" #include "Timer.h" -#include "mmu2.h" #include "printer_state.h" #ifndef AT90USB From 80f27618c934d48385cad2fdd5c9b9a355605bbd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gu=C3=B0ni=20M=C3=A1r=20Gilbert?= Date: Tue, 13 Aug 2024 23:40:18 +0000 Subject: [PATCH 9/9] Marlin: drop lcd.h include Only include it where needed --- Firmware/Marlin.h | 2 -- Firmware/Marlin_main.cpp | 1 + Firmware/Prusa_farm.cpp | 1 + Firmware/mesh_bed_calibration.cpp | 1 + Firmware/mmu2_reporting.cpp | 1 + Firmware/planner.cpp | 1 + Firmware/stepper.cpp | 1 + Firmware/temperature.cpp | 1 + Firmware/xyzcal.cpp | 1 + 9 files changed, 8 insertions(+), 2 deletions(-) diff --git a/Firmware/Marlin.h b/Firmware/Marlin.h index 2ee72cf065..809fd99876 100755 --- a/Firmware/Marlin.h +++ b/Firmware/Marlin.h @@ -63,8 +63,6 @@ #define MYSERIAL MSerial #endif -#include "lcd.h" - #define SERIAL_PROTOCOL(x) (MYSERIAL.print(x)) #define SERIAL_PROTOCOL_F(x,y) (MYSERIAL.print(x,y)) #define SERIAL_PROTOCOLPGM(x) (serialprintPGM(PSTR(x))) diff --git a/Firmware/Marlin_main.cpp b/Firmware/Marlin_main.cpp index eb049a05c7..b3eaf05b95 100644 --- a/Firmware/Marlin_main.cpp +++ b/Firmware/Marlin_main.cpp @@ -76,6 +76,7 @@ #include "cardreader.h" #include "ConfigurationStore.h" #include "language.h" +#include "lcd.h" #include "math.h" #include "util.h" #include "Timer.h" diff --git a/Firmware/Prusa_farm.cpp b/Firmware/Prusa_farm.cpp index 70fc119a87..7233f39d79 100644 --- a/Firmware/Prusa_farm.cpp +++ b/Firmware/Prusa_farm.cpp @@ -8,6 +8,7 @@ #include "ultralcd.h" #include "Filament_sensor.h" #include "language.h" +#include "lcd.h" #include "stopwatch.h" #ifdef PRUSA_FARM diff --git a/Firmware/mesh_bed_calibration.cpp b/Firmware/mesh_bed_calibration.cpp index 4cd8669379..97a3cde879 100644 --- a/Firmware/mesh_bed_calibration.cpp +++ b/Firmware/mesh_bed_calibration.cpp @@ -2,6 +2,7 @@ #include "ConfigurationStore.h" #include "util.h" #include "language.h" +#include "lcd.h" #include "mesh_bed_calibration.h" #include "mesh_bed_leveling.h" #include "stepper.h" diff --git a/Firmware/mmu2_reporting.cpp b/Firmware/mmu2_reporting.cpp index 31960ad0fb..7c6ad1df71 100644 --- a/Firmware/mmu2_reporting.cpp +++ b/Firmware/mmu2_reporting.cpp @@ -11,6 +11,7 @@ #include "ultralcd.h" #include "Filament_sensor.h" #include "language.h" +#include "lcd.h" #include "temperature.h" #include "sound.h" diff --git a/Firmware/planner.cpp b/Firmware/planner.cpp index 91e9956c62..b8fc9b6749 100644 --- a/Firmware/planner.cpp +++ b/Firmware/planner.cpp @@ -57,6 +57,7 @@ #include "temperature.h" #include "fancheck.h" #include "ultralcd.h" +#include "lcd.h" #include "language.h" #include "ConfigurationStore.h" diff --git a/Firmware/stepper.cpp b/Firmware/stepper.cpp index 43c779f352..16fad21fc2 100644 --- a/Firmware/stepper.cpp +++ b/Firmware/stepper.cpp @@ -26,6 +26,7 @@ #include "planner.h" #include "temperature.h" #include "ultralcd.h" +#include "lcd.h" #include "cardreader.h" #include "speed_lookuptable.h" #if defined(DIGIPOTSS_PIN) && DIGIPOTSS_PIN > -1 diff --git a/Firmware/temperature.cpp b/Firmware/temperature.cpp index 8cd856b76d..cee55b6617 100755 --- a/Firmware/temperature.cpp +++ b/Firmware/temperature.cpp @@ -36,6 +36,7 @@ #include "fancheck.h" #include "messages.h" #include "language.h" +#include "lcd.h" #include "SdFatUtil.h" diff --git a/Firmware/xyzcal.cpp b/Firmware/xyzcal.cpp index 138a32755e..8feca80ef6 100644 --- a/Firmware/xyzcal.cpp +++ b/Firmware/xyzcal.cpp @@ -5,6 +5,7 @@ #include "xyzcal.h" #include +#include "lcd.h" #include "stepper.h" #include "temperature.h" #include "sm4.h"