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

[BUG] DWIN: compilation error due to undeclared heating bed #23966

Closed Ludy87 closed 2 years ago

Ludy87 commented 2 years ago

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

Yes, and the problem still exists.

Bug Description

enable DWIN_MARLINUI_PORTRAIT, disable LCD_SET_PROGRESS_MANUALLY and do not use a heated bed.

Marlin\src\lcd\e3v2\marlinui\ui_status_480x272.cpp: In function 'void _draw_heater_status(heater_id_t, uint16_t, uint16_t)':
Marlin\src\lcd\e3v2\marlinui\ui_status_480x272.cpp:240:31: error: 'old_bed_temp' was not declared in this scope
     const bool c_draw = tc != old_bed_temp, t_draw = tt != old_bed_target, i_draw = ta != old_bed_on;
                               ^~~~~~~~~~~~
Marlin\src\lcd\e3v2\marlinui\ui_status_480x272.cpp:240:31: note: suggested alternative: 'old_temp'
     const bool c_draw = tc != old_bed_temp, t_draw = tt != old_bed_target, i_draw = ta != old_bed_on;
                               ^~~~~~~~~~~~
                               old_temp
Marlin\src\lcd\e3v2\marlinui\ui_status_480x272.cpp:254:31: error: 't_draw' was not declared in this scope
   if (!ui.did_first_redraw || t_draw) {
                               ^~~~~~
Marlin\src\lcd\e3v2\marlinui\ui_status_480x272.cpp:254:31: note: suggested alternative: 'c_draw'
   if (!ui.did_first_redraw || t_draw) {
                               ^~~~~~
                               c_draw
Marlin\src\lcd\e3v2\marlinui\ui_status_480x272.cpp:260:31: error: 'i_draw' was not declared in this scope
   if (!ui.did_first_redraw || i_draw){
                               ^~~~~~
Marlin\src\lcd\e3v2\marlinui\ui_status_480x272.cpp:260:31: note: suggested alternative: 'c_draw'
   if (!ui.did_first_redraw || i_draw){
                               ^~~~~~
                               c_draw
Marlin\src\lcd\e3v2\marlinui\ui_status_480x272.cpp: In static member function 'static void MarlinUI::draw_status_screen()':
Marlin\src\lcd\e3v2\marlinui\ui_status_480x272.cpp:348:38: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
   if (!ui.did_first_redraw || old_fp != feedrate_percentage) {
                               ~~~~~~~^~~~~~~~~~~~~~~~~~~~~~
Marlin\src\lcd\e3v2\marlinui\ui_status_480x272.cpp:423:9: error: 'progress_t' does not name a type; did you mean 'preheat_t'?
   const progress_t progress = TERN(HAS_PRINT_PROGRESS_PERMYRIAD, get_progress_permyriad, get_progress_percent)();
         ^~~~~~~~~~
         preheat_t
Marlin\src\lcd\e3v2\marlinui\ui_status_480x272.cpp:429:47: error: 'progress' was not declared in this scope
   const uint16_t pb_solid = (pb_width - 2) * (progress / (PROGRESS_SCALE)) * 0.01f;
                                               ^~~~~~~~
Marlin\src\lcd\e3v2\marlinui\ui_status_480x272.cpp:429:47: note: suggested alternative: 'refresh'
   const uint16_t pb_solid = (pb_width - 2) * (progress / (PROGRESS_SCALE)) * 0.01f;
                                               ^~~~~~~~
                                               refresh
compilation terminated due to -fmax-errors=5.

enable DWIN_MARLINUI_PORTRAIT, enable LCD_SET_PROGRESS_MANUALLY and do not use a heated bed.

Marlin\src\lcd\e3v2\marlinui\ui_status_480x272.cpp: In function 'void _draw_heater_status(heater_id_t, uint16_t, uint16_t)':
Marlin\src\lcd\e3v2\marlinui\ui_status_480x272.cpp:240:31: error: 'old_bed_temp' was not declared in this scope
     const bool c_draw = tc != old_bed_temp, t_draw = tt != old_bed_target, i_draw = ta != old_bed_on;
                               ^~~~~~~~~~Compiling .pio\build\mega2560\src\src\lcd\marlinui.cpp.o
~~
Marlin\src\lcd\e3v2\marlinui\ui_status_480x272.cpp:240:31: note: suggested alternative: 'old_temp'
     const bool c_draw = tc != old_bed_temp, t_draw = tt != old_bed_target, i_draw = ta != old_bed_on;
                               ^~~~~~~~~~~~
                               old_temp
Marlin\src\lcd\e3v2\marlinui\ui_status_480x272.cpp:254:31: error: 't_draw' was not declared in this scope
   if (!ui.did_first_redraw || t_draw) {
                               ^~~~~~
Marlin\src\lcd\e3v2\marlinui\ui_status_480x272.cpp:254:31: note: suggested alternative: 'c_draw'
   if (!ui.did_first_redraw || t_draw) {
                               ^~~~~~
                               c_draw
Marlin\src\lcd\e3v2\marlinui\ui_status_480x272.cpp:260:31: error: 'i_draw' was not declared in this scope
   if (!ui.did_first_redraw || i_draw){
                               ^~~~~~
Marlin\src\lcd\e3v2\marlinui\ui_status_480x272.cpp:260:31: note: suggested alternative: 'c_draw'
   if (!ui.did_first_redraw || i_draw){
                               ^~~~~~
                               c_draw
Marlin\src\lcd\e3v2\marlinui\ui_status_480x272.cpp: In static member function 'static void MarlinUI::draw_status_screen()':
Marlin\src\lcd\e3v2\marlinui\ui_status_480x272.cpp:348:38: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
   if (!ui.did_first_redraw || old_fp != feedrate_percentage) {
                               ~~~~~~~^~~~~~~~~~~~~~~~~~~~~~
*** [.pio\build\mega2560\src\src\lcd\e3v2\marlinui\ui_status_480x272.cpp.o] Error 1

Bug Timeline

No response

Expected behavior

no error exception

Actual behavior

exception

Steps to Reproduce

No response

Version of Marlin Firmware

last bugfix-2.0.x

Printer model

No response

Electronics

No response

Add-ons

No response

Bed Leveling

No response

Your Slicer

No response

Host Software

No response

Additional information & file uploads

all other settings are the Marlin defaults. If you have any questions, don't hesitate to annoy me.

Ludy87 commented 2 years ago

next error #define SDSUPPORT and #define DWIN_CREALITY_LCD

Marlin\src\lcd\e3v2\common\encoder.cpp: In function 'EncoderState Encoder_ReceiveAnalyze()':
Marlin\src\lcd\e3v2\common\encoder.cpp:105:12: error: 'ENCODER_PHASE_0' was not declared in this scope
       case ENCODER_PHASE_0:
            ^~~~~~~~~~~~~~~
Marlin\src\lcd\e3v2\common\encoder.cpp:105:12: note: suggested alternative: 'ENCODER_WAIT_MS'
       case ENCODER_PHASE_0:
            ^~~~~~~~~~~~~~~
            ENCODER_WAIT_MS
Marlin\src\lcd\e3v2\common\encoder.cpp:106:37: error: 'ENCODER_PHASE_3' was not declared in this scope
              if (lastEncoderBits == ENCODER_PHASE_3) temp_diff++;
                                     ^~~~~~~~~~~~~~~
Marlin\src\lcd\e3v2\common\encoder.cpp:106:37: note: suggested alternative: 'ENCODER_WAIT_MS'
              if (lastEncoderBits == ENCODER_PHASE_3) temp_diff++;
                                     ^~~~~~~~~~~~~~~
                                     ENCODER_WAIT_MS
Marlin\src\lcd\e3v2\common\encoder.cpp:107:37: error: 'ENCODER_PHASE_1' was not declared in this scope
         else if (lastEncoderBits == ENCODER_PHASE_1) temp_diff--;
                                     ^~~~~~~~~~~~~~~
Marlin\src\lcd\e3v2\common\encoder.cpp:107:37: note: suggested alternative: 'ENCODER_WAIT_MS'
         else if (lastEncoderBits == ENCODER_PHASE_1) temp_diff--;
                                     ^~~~~~~~~~~~~~~
                                     ENCODER_WAIT_MS
Marlin\src\lcd\e3v2\common\encoder.cpp:109:12: error: 'ENCODER_PHASE_1' was not declared in this scope
       case ENCODER_PHASE_1:
            ^~~~~~~~~~~~~~~
Marlin\src\lcd\e3v2\common\encoder.cpp:109:12: note: suggested alternative: 'ENCODER_WAIT_MS'
       case ENCODER_PHASE_1:
            ^~~~~~~~~~~~~~~
            ENCODER_WAIT_MS
Marlin\src\lcd\e3v2\common\encoder.cpp:111:37: error: 'ENCODER_PHASE_2' was not declared in this scope
         else if (lastEncoderBits == ENCODER_PHASE_2) temp_diff--;
                                     ^~~~~~~~~~~~~~~
Marlin\src\lcd\e3v2\common\encoder.cpp:111:37: note: suggested alternative: 'ENCODER_WAIT_MS'
         else if (lastEncoderBits == ENCODER_PHASE_2) temp_diff--;
                                     ^~~~~~~~~~~~~~~
                                     ENCODER_WAIT_MS
compilation terminated due to -fmax-errors=5.
*** [.pio\build\mega2560\src\src\lcd\e3v2\common\encoder.cpp.o] Error 1
In file included from Marlin\src\lcd\e3v2\creality\../../../inc/MarlinConfigPre.h:37:0,
                 from Marlin\src\lcd\e3v2\creality\dwin.cpp:27:
Marlin\src\lcd\e3v2\creality\dwin.cpp: In function 'void Draw_Prepare_Menu()':
Marlin\src\lcd\e3v2\creality\../../../inc/../core/macros.h:273:48: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]    
 #define WITHIN(N,L,H)       ((N) >= (L) && (N) <= (H))
                                            ~~~~^~~~~~
Marlin\src\lcd\e3v2\creality\dwin.cpp:751:53: note: in expansion of macro 'WITHIN'
 #define VISI(T,L,S) (WITHIN(L, T - MROWS, MROWS) || WITHIN(S, 0, MROWS))
                                                     ^~~~~~
Marlin\src\lcd\e3v2\creality\dwin.cpp:758:20: note: in expansion of macro 'VISI'
   #define PVISI(L) VISI(PREPARE_CASE_TOTAL, L, PSCROL(L))
                    ^~~~
Marlin\src\lcd\e3v2\creality\dwin.cpp:770:7: note: in expansion of macro 'PVISI'
   if (PVISI(0)) Draw_Back_First(select_prepare.now == CASE_BACK);                 // < Back
       ^~~~~
Marlin\src\lcd\e3v2\creality\../../../inc/../core/macros.h:273:48: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]    
 #define WITHIN(N,L,H)       ((N) >= (L) && (N) <= (H))
                                            ~~~~^~~~~~
Marlin\src\lcd\e3v2\creality\dwin.cpp:751:53: note: in expansion of macro 'WITHIN'
 #define VISI(T,L,S) (WITHIN(L, T - MROWS, MROWS) || WITHIN(S, 0, MROWS))
                                                     ^~~~~~
Marlin\src\lcd\e3v2\creality\dwin.cpp:758:20: note: in expansion of macro 'VISI'
   #define PVISI(L) VISI(PREPARE_CASE_TOTAL, L, PSCROL(L))
                    ^~~~
Marlin\src\lcd\e3v2\creality\dwin.cpp:771:7: note: in expansion of macro 'PVISI'
   if (PVISI(PREPARE_CASE_MOVE)) Item_Prepare_Move(PSCROL(PREPARE_CASE_MOVE));     // Move >
       ^~~~~
Marlin\src\lcd\e3v2\creality\../../../inc/../core/macros.h:273:48: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]    
 #define WITHIN(N,L,H)       ((N) >= (L) && (N) <= (H))
                                            ~~~~^~~~~~
Marlin\src\lcd\e3v2\creality\dwin.cpp:751:53: note: in expansion of macro 'WITHIN'
 #define VISI(T,L,S) (WITHIN(L, T - MROWS, MROWS) || WITHIN(S, 0, MROWS))
                                                     ^~~~~~
Marlin\src\lcd\e3v2\creality\dwin.cpp:758:20: note: in expansion of macro 'VISI'
   #define PVISI(L) VISI(PREPARE_CASE_TOTAL, L, PSCROL(L))
                    ^~~~
Marlin\src\lcd\e3v2\creality\dwin.cpp:772:7: note: in expansion of macro 'PVISI'
   if (PVISI(PREPARE_CASE_DISA)) Item_Prepare_Disable(PSCROL(PREPARE_CASE_DISA));  // Disable Stepper
       ^~~~~
Marlin\src\lcd\e3v2\creality\../../../inc/../core/macros.h:273:48: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]    
 #define WITHIN(N,L,H)       ((N) >= (L) && (N) <= (H))
                                            ~~~~^~~~~~
Marlin\src\lcd\e3v2\creality\dwin.cpp:751:53: note: in expansion of macro 'WITHIN'
 #define VISI(T,L,S) (WITHIN(L, T - MROWS, MROWS) || WITHIN(S, 0, MROWS))
                                                     ^~~~~~
Marlin\src\lcd\e3v2\creality\dwin.cpp:758:20: note: in expansion of macro 'VISI'
   #define PVISI(L) VISI(PREPARE_CASE_TOTAL, L, PSCROL(L))
                    ^~~~
Marlin\src\lcd\e3v2\creality\dwin.cpp:780:11: note: in expansion of macro 'PVISI'
       if (PVISI(PREPARE_CASE_ABS)) Item_Prepare_ABS(PSCROL(PREPARE_CASE_ABS));    // Preheat ABS
           ^~~~~
Marlin\src\lcd\e3v2\creality\../../../inc/../core/macros.h:273:48: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]    
 #define WITHIN(N,L,H)       ((N) >= (L) && (N) <= (H))
                                            ~~~~^~~~~~
Marlin\src\lcd\e3v2\creality\dwin.cpp:751:53: note: in expansion of macro 'WITHIN'
 #define VISI(T,L,S) (WITHIN(L, T - MROWS, MROWS) || WITHIN(S, 0, MROWS))
                                                     ^~~~~~
Marlin\src\lcd\e3v2\creality\dwin.cpp:758:20: note: in expansion of macro 'VISI'
   #define PVISI(L) VISI(PREPARE_CASE_TOTAL, L, PSCROL(L))
                    ^~~~
Marlin\src\lcd\e3v2\creality\dwin.cpp:784:9: note: in expansion of macro 'PVISI'
     if (PVISI(PREPARE_CASE_COOL)) Item_Prepare_Cool(PSCROL(PREPARE_CASE_COOL));   // Cooldown
         ^~~~~
Marlin\src\lcd\e3v2\creality\../../../inc/../core/macros.h:273:48: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]    
 #define WITHIN(N,L,H)       ((N) >= (L) && (N) <= (H))
                                            ~~~~^~~~~~
Marlin\src\lcd\e3v2\creality\dwin.cpp:751:53: note: in expansion of macro 'WITHIN'
 #define VISI(T,L,S) (WITHIN(L, T - MROWS, MROWS) || WITHIN(S, 0, MROWS))
                                                     ^~~~~~
Marlin\src\lcd\e3v2\creality\dwin.cpp:758:20: note: in expansion of macro 'VISI'
   #define PVISI(L) VISI(PREPARE_CASE_TOTAL, L, PSCROL(L))
                    ^~~~
Marlin\src\lcd\e3v2\creality\dwin.cpp:786:7: note: in expansion of macro 'PVISI'
   if (PVISI(PREPARE_CASE_LANG)) Item_Prepare_Lang(PSCROL(PREPARE_CASE_LANG));     // Language CN/EN
ellensp commented 2 years ago

You get 'ENCODER_PHASE_0' errors when you have enabled this display without defining the required encoder pins You cannot just enable DWIN_CREALITY_LCD on all motherboards. The associated pins.h file needs to define encoder pins when this display is selected

The first error is an error.

Ludy87 commented 2 years ago

Possibly stop the ENCODER_PHASE_X error in SanityCheck.h.

ellensp commented 2 years ago

give this a try. If you still get errors attach you config files.

github-actions[bot] commented 2 years 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.