From 7287c9e66ae49bcdda48e7224161abc2161cd6f5 Mon Sep 17 00:00:00 2001 From: Christian Hammacher Date: Wed, 15 Dec 2021 16:53:41 +0100 Subject: Bug fixes Added note for FindFirst/FindNext in SBC mode Added new OpenOCD script for memtests on the MB6HC Bug fix: 12864 displays didn't show certain menu items in SBC mode Bug fix: When an event was triggered and the corresponding macro wasn't present, the print could not be resumed in SBC mode --- Scripts/duet3_openocd_memtest.cfg | 13 +++++++++++++ src/Display/MenuItem.cpp | 28 ++++++++++++++++++++++++---- src/GCodes/GCodes4.cpp | 13 +++++++------ src/Storage/MassStorage.cpp | 1 + 4 files changed, 45 insertions(+), 10 deletions(-) create mode 100644 Scripts/duet3_openocd_memtest.cfg diff --git a/Scripts/duet3_openocd_memtest.cfg b/Scripts/duet3_openocd_memtest.cfg new file mode 100644 index 00000000..cf58e35f --- /dev/null +++ b/Scripts/duet3_openocd_memtest.cfg @@ -0,0 +1,13 @@ +# Atmel-ICE JTAG/SWD in-circuit debugger. +interface cmsis-dap +cmsis_dap_vid_pid 0x03eb 0x2141 + +# Chip info +set CHIPNAME atsame70q20 +source [find target/atsamv.cfg] + +reset_config srst_only + +# Run memtest +source [find tools/memtest.tcl] +runAllMemTests 0x20400000 0x60000 diff --git a/src/Display/MenuItem.cpp b/src/Display/MenuItem.cpp index d11db3b7..a2bbe754 100644 --- a/src/Display/MenuItem.cpp +++ b/src/Display/MenuItem.cpp @@ -89,9 +89,29 @@ bool MenuItem::IsVisible() const noexcept return ps == PauseState::pausing || ps == PauseState::paused; } case 7: return reprap.GetGCodes().IsReallyPrintingOrResuming(); -#if HAS_MASS_STORAGE - case 10: return MassStorage::IsDriveMounted(0); - case 11: return !MassStorage::IsDriveMounted(0); +#if HAS_MASS_STORAGE || HAS_SBC_INTERFACE + case 10: return +# if HAS_MASS_STORAGE + MassStorage::IsDriveMounted(0) +# endif +# if HAS_MASS_STORAGE && HAS_SBC_INTERFACE + || +# endif +# if HAS_SBC_INTERFACE + reprap.UsingSbcInterface() +# endif + ; + case 11: return +# if HAS_MASS_STORAGE + !MassStorage::IsDriveMounted(0) +# endif +# if HAS_MASS_STORAGE && HAS_SBC_INTERFACE + && +# endif +# if HAS_SBC_INTERFACE + !reprap.UsingSbcInterface() +# endif + ; #endif case 20: { const auto tool = reprap.GetCurrentOrDefaultTool(); // this can be null, especially during startup @@ -865,7 +885,7 @@ void FilesMenuItem::ListFiles(Lcd& lcd, PixelNumber rightMargin, bool highlight, } --dirEntriesToSkip; } - gotFileInfo = MassStorage::FindNext(oFileInfo); + gotFileInfo = MassStorage::FindNext(oFileInfo); } // We always iterate the entire viewport so that old listing lines that may not be overwritten are cleared diff --git a/src/GCodes/GCodes4.cpp b/src/GCodes/GCodes4.cpp index 4324b419..52ac4c03 100644 --- a/src/GCodes/GCodes4.cpp +++ b/src/GCodes/GCodes4.cpp @@ -1514,14 +1514,15 @@ void GCodes::RunStateMachine(GCodeBuffer& gb, const StringRef& reply) noexcept HandleReply(gb, stateMachineResult, reply.c_str()); CheckForDeferredPause(gb); + } + #if HAS_SBC_INTERFACE - if (reportPause) - { - fileGCode->Invalidate(); - reprap.GetSbcInterface().ReportPause(); - } -#endif + if (reportPause) + { + fileGCode->Invalidate(); + reprap.GetSbcInterface().ReportPause(); } +#endif } // Do a manual probe. This is in its own function to reduce the amount of stack space needed by RunStateMachine(). See the comment at the top of that function. diff --git a/src/Storage/MassStorage.cpp b/src/Storage/MassStorage.cpp index 4c95caa8..8e21ad70 100644 --- a/src/Storage/MassStorage.cpp +++ b/src/Storage/MassStorage.cpp @@ -698,6 +698,7 @@ bool MassStorage::FindNext(FileInfo &file_info) noexcept return true; } #endif + // TODO implement SBC interface for this dirMutex.Release(); return false; -- cgit v1.2.3