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] Missing PLR include #27372

Closed
1 task done
Minims opened this issue Aug 28, 2024 · 3 comments
Closed
1 task done

[BUG] Missing PLR include #27372

Minims opened this issue Aug 28, 2024 · 3 comments

Comments

@Minims
Copy link
Contributor

Minims commented Aug 28, 2024

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

Yes, and the problem still exists.

Bug Description

Since 94e9f26

I have this error :

Compiling .pio/build/LPC1769/src/src/module/settings.cpp.o
In file included from Marlin/src/gcode/control/../../inc/MarlinConfigPre.h:43,
                 from Marlin/src/gcode/control/../../inc/MarlinConfig.h:28,
                 from Marlin/src/gcode/control/../gcode.h:342,
                 from Marlin/src/gcode/control/M80_M81.cpp:23:
Marlin/src/gcode/control/M80_M81.cpp: In static member function 'static void GcodeSuite::M81()':
Marlin/src/gcode/control/M80_M81.cpp:87:30: error: 'recovery' was not declared in this scope; did you mean 'remove'?
   87 |   TERN_(POWER_LOSS_RECOVERY, recovery.purge()); // Clear PLR on intentional shutdown
      |                              ^~~~~~~~
Marlin/src/gcode/control/../../inc/../core/macros.h:620:26: note: in definition of macro 'THIRD'
  620 | #define THIRD(a,b,c,...) c
      |                          ^
Marlin/src/gcode/control/../../inc/../core/macros.h:208:29: note: in expansion of macro '___TERN'
  208 | #define __TERN(T,V...)      ___TERN(_CAT(_NO,T),V)  // Prepend '_NO' to get '_NOT_0' or '_NOT_1'
      |                             ^~~~~~~
Marlin/src/gcode/control/../../inc/../core/macros.h:207:29: note: in expansion of macro '__TERN'
  207 | #define _TERN(E,V...)       __TERN(_CAT(T_,E),V)    // Prepend 'T_' to get 'T_0' or 'T_1'
      |                             ^~~~~~
Marlin/src/gcode/control/../../inc/../core/macros.h:206:29: note: in expansion of macro '_TERN'
  206 | #define TERN_(O,A)          _TERN(_ENA_1(O),,A)     // OPTION ? 'A' : '<nul>'
      |                             ^~~~~
Marlin/src/gcode/control/M80_M81.cpp:87:3: note: in expansion of macro 'TERN_'
   87 |   TERN_(POWER_LOSS_RECOVERY, recovery.purge()); // Clear PLR on intentional shutdown
      |   ^~~~~
Marlin/src/inc/Warnings.cpp:238:6: warning: #warning "Note: Auto-assigned Z2 STEP/DIR/ENABLE_PINs to unused En_STEP/DIR/ENABLE_PINs. (Define NO_AUTO_ASSIGN_WARNING to suppress this warning.)" [-Wcpp]
  238 |     #warning "Note: Auto-assigned Z2 STEP/DIR/ENABLE_PINs to unused En_STEP/DIR/ENABLE_PINs. (Define NO_AUTO_ASSIGN_WARNING to suppress this warning.)"
      |      ^~~~~~~
*** [.pio/build/LPC1769/src/src/gcode/control/M80_M81.cpp.o] Error 1
======================================================================== [FAILED] Took 3.38 seconds ========================================================================

Environment    Status    Duration
-------------  --------  ------------
LPC1769        FAILED    00:00:03.377
=================================================================== 1 failed, 0 succeeded in 00:00:03.377 ===================================================================

Bug Timeline

New bug, starts with 94e9f26

Expected behavior

Build does not fail

Actual behavior

Build is failling

Steps to Reproduce

  1. Build marlin with this option :
 #define POWER_LOSS_RECOVERY
  #if ENABLED(POWER_LOSS_RECOVERY)
    #define PLR_ENABLED_DEFAULT        true // Power-Loss Recovery enabled by default. (Set with 'M413 Sn' & M500)
    //#define PLR_BED_THRESHOLD BED_MAXTEMP // (°C) Skip user confirmation at or above this bed temperature (0 to disable)

    //#define POWER_LOSS_PIN             44 // Pin to detect power-loss. Set to -1 to disable default pin on boards without module, or comment to use board default.
    #define POWER_LOSS_STATE           HIGH // State of pin indicating power-loss
    //#define POWER_LOSS_PULLUP             // Set pullup / pulldown as appropriate for your sensor
    //#define POWER_LOSS_PULLDOWN

    //#define POWER_LOSS_ZRAISE        2    // (mm) Z axis raise on resume (on power-loss with UPS)
    #define POWER_LOSS_PURGE_LEN      20    // (mm) Length of filament to purge on resume

    // Without a POWER_LOSS_PIN the following option helps reduce wear on the SD card,
    // especially with "vase mode" printing. Set too high and vases cannot be continued.
    #define POWER_LOSS_MIN_Z_CHANGE    0.05 // (mm) Minimum Z change before saving power-loss data

    //#define BACKUP_POWER_SUPPLY           // Backup power / UPS to move the steppers on power-loss
    #if ENABLED(BACKUP_POWER_SUPPLY)
      #define POWER_LOSS_RETRACT_LEN     10 // (mm) Length of filament to retract on fail
    #endif

Version of Marlin Firmware

latest bugfix-2.1.0

Printer model

Prusa MK3S SKR BEAR

Electronics

SKR 1.4 Turbo 1.4

LCD/Controller

LCD 2004

Other add-ons

No response

Bed Leveling

UBL Bilinear mesh

Your Slicer

Prusa Slicer

Host Software

SD Card (headless)

Don't forget to include

  • A ZIP file containing your Configuration.h and Configuration_adv.h.

Additional information & file uploads

config.zip

@MarlinFirmware MarlinFirmware deleted a comment Aug 28, 2024
@MarlinFirmware MarlinFirmware deleted a comment Aug 28, 2024
@MarlinFirmware MarlinFirmware deleted a comment Aug 28, 2024
@MarlinFirmware MarlinFirmware deleted a comment Aug 28, 2024
@MarlinFirmware MarlinFirmware deleted a comment Aug 28, 2024
@MarlinFirmware MarlinFirmware deleted a comment Aug 28, 2024
@MarlinFirmware MarlinFirmware deleted a comment Aug 28, 2024
@MarlinFirmware MarlinFirmware deleted a comment Aug 28, 2024
@ellensp
Copy link
Contributor

ellensp commented Aug 28, 2024

Please ignore the pathetic hackers desperately trying to get you to download malicious code

@ellensp
Copy link
Contributor

ellensp commented Aug 28, 2024

real fix is just a missing include

diff --git a/Marlin/src/gcode/control/M80_M81.cpp b/Marlin/src/gcode/control/M80_M81.cpp
index e86e267313..ba5a0b6879 100644
--- a/Marlin/src/gcode/control/M80_M81.cpp
+++ b/Marlin/src/gcode/control/M80_M81.cpp
@@ -38,6 +38,10 @@
   #include "../../MarlinCore.h"
 #endif
 
+#if ENABLED(POWER_LOSS_RECOVERY)
+  #include "../../feature/powerloss.h"
+#endif
+
 #if ENABLED(PSU_CONTROL)
 
   /**

@thisiskeithb thisiskeithb changed the title [BUG] (bug summary) [BUG] Missing PLR include Aug 28, 2024
@thisiskeithb
Copy link
Member

Fixed in cf46d18

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

6 participants
@ellensp @thinkyhead @Minims @thisiskeithb and others