diff options
author | Manuel Coenen <manuel@duet3d.com> | 2020-12-08 14:50:54 +0300 |
---|---|---|
committer | Manuel Coenen <manuel@duet3d.com> | 2020-12-08 14:50:54 +0300 |
commit | 84b6882bee082357379ddb2b060e492b86ba4292 (patch) | |
tree | a05e0c908f5720ee51bf6ef4f4edd7ebad9801fb /src/Display | |
parent | 1254903e761f38bb4533a7f536d3d8af4d60b617 (diff) |
Remove HAS_MASS_STORAGE and SUPPORT_SCANNER from Duet2_SBC
Fix wrong #import in DataTransfer
Fix compiler and linker errors if HAS_MASS_STORAGE is false but
HAS_LINUX_INTERFACE is true
Diffstat (limited to 'src/Display')
-rw-r--r-- | src/Display/Menu.cpp | 8 | ||||
-rw-r--r-- | src/Display/MenuItem.cpp | 4 | ||||
-rw-r--r-- | src/Display/MenuItem.h | 2 |
3 files changed, 14 insertions, 0 deletions
diff --git a/src/Display/Menu.cpp b/src/Display/Menu.cpp index a5754a75..55bbf906 100644 --- a/src/Display/Menu.cpp +++ b/src/Display/Menu.cpp @@ -120,11 +120,13 @@ void Menu::LoadFixedMenu() noexcept ResetCache(); +#if HAS_MASS_STORAGE char acLine1[] = "text R3 C5 F0 T\"No SD Card Found\""; char acLine2[] = "button R15 C5 F0 T\"Mount SD\" A\"M21\""; (void)ParseMenuLine(acLine1); (void)ParseMenuLine(acLine2); +#endif } // Display a M291 message box @@ -374,6 +376,7 @@ const char *Menu::ParseMenuLine(char * const commandWord) noexcept AddItem(pNewItem, true); column += pNewItem->GetWidth(); } +#if HAS_MASS_STORAGE else if (StringEqualsIgnoreCase(commandWord, "files")) { const char * const actionString = AppendString(action); @@ -383,6 +386,7 @@ const char *Menu::ParseMenuLine(char * const commandWord) noexcept row += nparam * lcd.GetFontHeight(fontNumber); column = 0; } +#endif else { errorColumn = 1; @@ -656,7 +660,11 @@ void Menu::Refresh() noexcept #if HAS_LINUX_INTERFACE !reprap.UsingLinuxInterface() && #endif +#if HAS_MASS_STORAGE !MassStorage::IsDriveMounted(0) +#else + true // When there is no mass storage drives cannot be mounted anyway and the above equals true +#endif ) { if (!displayingFixedMenu) diff --git a/src/Display/MenuItem.cpp b/src/Display/MenuItem.cpp index 614cf173..a1925a4f 100644 --- a/src/Display/MenuItem.cpp +++ b/src/Display/MenuItem.cpp @@ -89,8 +89,10 @@ 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); +#endif case 20: { const auto tool = reprap.GetCurrentOrDefaultTool(); // this can be null, especially during startup return tool.IsNotNull() && tool->HasTemperatureFault(); @@ -683,6 +685,7 @@ bool ValueMenuItem::Adjust(int clicks) noexcept : Adjust_AlterHelper(clicks); } +#if HAS_MASS_STORAGE FilesMenuItem::FilesMenuItem(PixelNumber r, PixelNumber c, PixelNumber w, FontNumber fn, Visibility vis, const char *cmd, const char *dir, const char *acFile, unsigned int nf) noexcept : MenuItem(r, c, w, LeftAlign, fn, vis), numDisplayLines(nf), command(cmd), initialDirectory(dir), m_acFile(acFile), m_uListingFirstVisibleIndex(0), m_uListingSelectedIndex(0) @@ -1078,6 +1081,7 @@ PixelNumber FilesMenuItem::GetVisibilityRowOffset(PixelNumber tCurrentOffset, Pi // TODO return 0; } +#endif // Image menu item members // The image file format is: diff --git a/src/Display/MenuItem.h b/src/Display/MenuItem.h index cdd754f3..a5d6a383 100644 --- a/src/Display/MenuItem.h +++ b/src/Display/MenuItem.h @@ -181,6 +181,7 @@ private: bool error; // for temporary use when printing }; +#if HAS_MASS_STORAGE class FilesMenuItem final : public MenuItem { public: @@ -227,6 +228,7 @@ private: enum CardState : uint8_t { notStarted, mounting, mounted, error } sdCardState; uint8_t initialDirectoryNesting; }; +#endif class ImageMenuItem final : public MenuItem { |