Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] M1001: error: 'card' was not declared in this scope, after PR#21840 #21850

Closed
kad opened this issue May 9, 2021 · 1 comment
Closed

Comments

@kad
Copy link
Contributor

kad commented May 9, 2021

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

Yes, and the problem still exists.

Bug Description

Current bugfix-2.0.x branch build fails if config has enabled NO_SD_AUTOSTART. E.g. on Melzi where flash space is very limited.

Marlin/src/gcode/sd/M1001.cpp: In static member function 'static void GcodeSuite::M1001()':
Marlin/src/gcode/sd/M1001.cpp:71:3: error: 'card' was not declared in this scope
   card.flag.sdprinting = card.flag.sdprintdone = false;
   ^~~~
Marlin/src/gcode/sd/M1001.cpp:71:3: note: suggested alternative: 'word'
   card.flag.sdprinting = card.flag.sdprintdone = false;
   ^~~~
   word
*** [.pio/build/anycubic_mega_zero_melzi_pinda_a2/src/src/gcode/sd/M1001.cpp.o] Error 1

Bug Timeline

Introduced in PR#21840

Expected behavior

Build should be fine.

Actual behavior

Failed to compile.

Steps to Reproduce

  1. Melzi configs. e.g. anycubic mega zero.
  2. #define NO_SD_AUTOSTART (as part of saving flash for leveling sensors).

Version of Marlin Firmware

bugfix-2.0.x

Printer model

Anycubic Mega Zero

Electronics

Melzi

Add-ons

No response

Your Slicer

No response

Host Software

No response

Additional information & file uploads

Simplest fix is to remove #if / #endif around cardreader.h include, so card definition will be imported if SDSUPPORT enabled.

#if DISABLED(NO_SD_AUTOSTART)
  #include "../../sd/cardreader.h"
#endif
kad added a commit to kad/Marlin that referenced this issue May 13, 2021
Fixes undeclared reference to card in M1001 introduced by PR#21840

Fixes: MarlinFirmware#21850
@github-actions
Copy link

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.

@github-actions github-actions bot locked and limited conversation to collaborators Jul 13, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants