InsanityAutomation / Marlin

Optimized firmware for RepRap 3D printers based on the Arduino platform.
http://www.marlinfw.org/
GNU General Public License v3.0
449 stars 220 forks source link

Removing support for SD Card, throws out compiling errors. #285

Closed Dulus0 closed 2 years ago

Dulus0 commented 2 years ago

Removing support for SD Card, throws out compiling errors. When compiling with SD enabled it builds ok.

Original lines: //#define MelziHostOnly // Enable this to turn off local SD support and instead prioritize options for Octoprint or USB

if DISABLED(MelziHostOnly)

define SDSUPPORT

endif

If changed to disable SDsupport, either by uncommenting MelziHostOnly or by commenting SDSUPPORT, it causes below build errors. Printer is CR10SPro v1 with stock board and stock display, with BLtouch , microswiss DD, and custom hotend mount.


__In file included from /home/dulus/Marlin CR10S PRO/Marlin-CrealityDwin2.0_Bleeding_25.10.2022/Marlin/src/MarlinCore.cpp:182:0:
/home/dulus/Marlin CR10S PRO/Marlin-CrealityDwin2.0_Bleeding_25.10.2022/Marlin/src/feature/powerloss.h:109:20: error: 'MAXPATHNAMELENGTH' was not declared in this scope
   char sd_filename[MAXPATHNAMELENGTH];
                    ^~~~~~~~~~~~~~~~~
/home/dulus/Marlin CR10S PRO/Marlin-CrealityDwin2.0_Bleeding_25.10.2022/Marlin/src/feature/powerloss.h:109:20: note: suggested alternative: 'MAX_MESSAGE_LENGTH'
   char sd_filename[MAXPATHNAMELENGTH];
                    ^~~~~~~~~~~~~~~~~
                    MAX_MESSAGE_LENGTH
/home/dulus/Marlin CR10S PRO/Marlin-CrealityDwin2.0_Bleeding_25.10.2022/Marlin/src/feature/powerloss.h:141:12: error: 'SdFile' does not name a type; did you mean 'idle'?
     static SdFile file;
            ^~~~~~
            idle
/home/dulus/Marlin CR10S PRO/Marlin-CrealityDwin2.0_Bleeding_25.10.2022/Marlin/src/feature/powerloss.h: In static member function 'static bool PrintJobRecovery::exists()':
/home/dulus/Marlin CR10S PRO/Marlin-CrealityDwin2.0_Bleeding_25.10.2022/Marlin/src/feature/powerloss.h:175:35: error: 'card' was not declared in this scope
     static bool exists() { return card.jobRecoverFileExists(); }
                                   ^~~~
/home/dulus/Marlin CR10S PRO/Marlin-CrealityDwin2.0_Bleeding_25.10.2022/Marlin/src/feature/powerloss.h:175:35: note: suggested alternative: 'arm'
     static bool exists() { return card.jobRecoverFileExists(); }
                                   ^~~~
                                   arm
/home/dulus/Marlin CR10S PRO/Marlin-CrealityDwin2.0_Bleeding_25.10.2022/Marlin/src/feature/powerloss.h: In static member function 'static void PrintJobRecovery::open(bool)':
/home/dulus/Marlin CR10S PRO/Marlin-CrealityDwin2.0_Bleeding_25.10.2022/Marlin/src/feature/powerloss.h:176:41: error: 'card' was not declared in this scope
     static void open(const bool read) { card.openJobRecoveryFile(read); }
                                         ^~~~
/home/dulus/Marlin CR10S PRO/Marlin-CrealityDwin2.0_Bleeding_25.10.2022/Marlin/src/feature/powerloss.h:176:41: note: suggested alternative: 'arm'
     static void open(const bool read) { card.openJobRecoveryFile(read); }
                                         ^~~~
                                         arm
/home/dulus/Marlin CR10S PRO/Marlin-CrealityDwin2.0_Bleeding_25.10.2022/Marlin/src/feature/powerloss.h: In static member function 'static void PrintJobRecovery::close()':
/home/dulus/Marlin CR10S PRO/Marlin-CrealityDwin2.0_Bleeding_25.10.2022/Marlin/src/feature/powerloss.h:177:27: error: 'file' was not declared in this scope
     static void close() { file.close(); }
                           ^~~~
/home/dulus/Marlin CR10S PRO/Marlin-CrealityDwin2.0_Bleeding_25.10.2022/Marlin/src/feature/powerloss.h:177:27: note: suggested alternative: 'kill'
     static void close() { file.close(); }
                           ^~~~
                           kill
In file included from /home/dulus/Marlin CR10S PRO/Marlin-CrealityDwin2.0_Bleeding_25.10.2022/Marlin/src/MarlinCore.cpp:182:0:
/home/dulus/Marlin CR10S PRO/Marlin-CrealityDwin2.0_Bleeding_25.10.2022/Marlin/src/feature/powerloss.h: In static member function 'static bool PrintJobRecovery::interrupted_file_exists()':
/home/dulus/Marlin CR10S PRO/Marlin-CrealityDwin2.0_Bleeding_25.10.2022/Marlin/src/feature/powerloss.h:202:52: error: 'card' was not declared in this scope
     static bool interrupted_file_exists() { return card.fileExists(info.sd_filename); }
                                                    ^~~~
/home/dulus/Marlin CR10S PRO/Marlin-CrealityDwin2.0_Bleeding_25.10.2022/Marlin/src/feature/powerloss.h:202:52: note: suggested alternative: 'arm'
     static bool interrupted_file_exists() { return card.fileExists(info.sd_filename); }
                                                    ^~~~
                                                    arm
/home/dulus/Marlin CR10S PRO/Marlin-CrealityDwin2.0_Bleeding_25.10.2022/Marlin/src/feature/powerloss.h:202:73: error: 'struct job_recovery_info_t' has no member named 'sd_filename'
     static bool interrupted_file_exists() { return card.fileExists(info.sd_filename); }
                                                                         ^~~~~~~~~~~
exit status 1
Error compiling for board Arduino Mega or Mega 2560.__

it compiles ok when commenting below:

if NONE(LowMemoryBoard, MachineCR10Orig)

define POWER_LOSS_RECOVERY

endif

cr10spro_blt_msdd.zip

InsanityAutomation commented 2 years ago

Thats not really a bug, but more a compatibility issue between two options never meant to coexist. Power loss recovery is disabled for the small memory MCU's, that were not actively supporting or testing anymore, so that doesnt come up when it was used with the intended options, as set in the precompiled builds.