MarlinFirmware / Marlin

Marlin is an optimized firmware for RepRap 3D printers based on the Arduino platform. Many commercial 3D printers come with Marlin installed. Check with your vendor if you need source code for your specific machine.
https://marlinfw.org
GNU General Public License v3.0
16.18k stars 19.21k forks source link

Ender 3 v2 compile failed with ProUI #26476

Closed dmitrygribenchuk closed 9 months ago

dmitrygribenchuk commented 9 months ago

Did you test the latest bugfix-2.1.x code?

Yes, and the problem still exists.

Bug Description

Hello. When I try to build firmware for Ender 3 v2 (STM32F103RE_creality) with ProUI enabled (#define DWIN_LCD_PROUI) I have an error:

Compiling .pio/build/STM32F103RE_creality/src/src/sd/SdBaseFile.cpp.o Marlin/src/lcd/e3v2/proui/dwin.cpp: In function 'void dwinPrintAborted()': Marlin/src/lcd/e3v2/proui/dwin.cpp:1725:3: error: 'hostui' was not declared in this scope 1725 | hostui.notify("Print Aborted"); | ^~ Compiling .pio/build/STM32F103RE_creality/src/src/sd/SdFatUtil.cpp.o *** [.pio/build/STM32F103RE_creality/src/src/lcd/e3v2/proui/dwin.cpp.o] Error 1

Bug Timeline

Last success build was about 2 weeks ago

Expected behavior

No response

Actual behavior

No response

Steps to Reproduce

No response

Version of Marlin Firmware

bugfix-2.1.x

Printer model

Ender 3 v2

Electronics

No response

LCD/Controller

No response

Other add-ons

No response

Bed Leveling

None

Your Slicer

Cura

Host Software

None

Don't forget to include

Additional information & file uploads

Configuration.h.gz Configuration_adv.h.gz

ellensp commented 9 months ago

https://github.com/MarlinFirmware/Marlin/pull/26308 didn't check if HOST_PROMPT_SUPPORT is enabled or not, it just assumed that it was

It also added the string "Print Aborted" when marlin already has MSG_PRINT_ABORTED which supports multiple languages

The fix is really simple

diff --git a/Marlin/src/lcd/e3v2/proui/dwin.cpp b/Marlin/src/lcd/e3v2/proui/dwin.cpp
index 366ecffbd9..8d4aa9106b 100644
--- a/Marlin/src/lcd/e3v2/proui/dwin.cpp
+++ b/Marlin/src/lcd/e3v2/proui/dwin.cpp
@@ -1722,7 +1722,7 @@ void dwinPrintAborted() {
       );
     }
   #endif
-  hostui.notify("Print Aborted");
+  TERN_(HOST_PROMPT_SUPPORT, hostui.notify(GET_TEXT_F(MSG_PRINT_ABORTED)));
   dwinPrintFinished();
 }
ellensp commented 9 months ago

I have added a PR to fix this

github-actions[bot] commented 7 months ago

This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.