From 7c8ea8e0e06451804cfadb349d732ab4a2949396 Mon Sep 17 00:00:00 2001 From: ellensp <530024+ellensp@users.noreply.github.com> Date: Sun, 12 Nov 2023 15:02:53 +1300 Subject: [PATCH] =?UTF-8?q?=F0=9F=A7=91=E2=80=8D=F0=9F=92=BB=20Fix=20M808?= =?UTF-8?q?=20debug=20(#26367)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Marlin/src/feature/powerloss.cpp | 7 ++++--- Marlin/src/feature/repeat.h | 3 +++ 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/Marlin/src/feature/powerloss.cpp b/Marlin/src/feature/powerloss.cpp index 75ac03f00c..5a25710084 100644 --- a/Marlin/src/feature/powerloss.cpp +++ b/Marlin/src/feature/powerloss.cpp @@ -581,9 +581,10 @@ void PrintJobRecovery::resume() { DEBUG_ECHOLNPGM("zraise: ", info.zraise, " ", info.flag.raised ? "(before)" : ""); #if ENABLED(GCODE_REPEAT_MARKERS) - DEBUG_ECHOLNPGM("repeat index: ", info.stored_repeat.index); - for (uint8_t i = 0; i < info.stored_repeat.index; ++i) - DEBUG_ECHOLNPGM("..... sdpos: ", info.stored_repeat.marker.sdpos, " count: ", info.stored_repeat.marker.counter); + const uint8_t ind = info.stored_repeat.count(); + DEBUG_ECHOLNPGM("repeat markers: ", ind); + for (uint8_t i = ind; i--;) + DEBUG_ECHOLNPGM("...", i, " sdpos: ", info.stored_repeat.get_marker_sdpos(i), " count: ", info.stored_repeat.get_marker_counter(i)); #endif #if HAS_HOME_OFFSET diff --git a/Marlin/src/feature/repeat.h b/Marlin/src/feature/repeat.h index 8a54149b3d..ce309f6470 100644 --- a/Marlin/src/feature/repeat.h +++ b/Marlin/src/feature/repeat.h @@ -48,6 +48,9 @@ public: static void add_marker(const uint32_t sdpos, const uint16_t count); static void loop(); static void cancel(); + static uint8_t count() { return index; } + static int16_t get_marker_counter(const uint8_t i) { return marker[i].counter; } + static uint32_t get_marker_sdpos(const uint8_t i) { return marker[i].sdpos; } }; extern Repeat repeat;