Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/Duet3D/RepRapFirmware.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Crocker <dcrocker@eschertech.com>2017-07-24 17:42:07 +0300
committerDavid Crocker <dcrocker@eschertech.com>2017-07-24 17:42:20 +0300
commit9d9fee318500fc753d2694f719ed01461aa78492 (patch)
tree76e17531fb033c99fcb2135fad0bd269f59d02bc /src/Storage
parent16cd110c4b72f6004d31e0bbfc4cf36669653470 (diff)
Version 1.19beta10+4
Leadscrew corrections were incorrect. The 3-leadscrew case is now know to work. The 2- and 4-leadscrew cases need to be tested on suitable printers. Fixed "Can't delete 0:/sys/resurrect.g" messages Added support for M591 command to configure filament sensors (but filament sensor support still incomplete) Added support for M672 command to program the Duet3D delta effector (tested and fully working) Changes to support new CoreNG that supports a parameter in attachInterrupt callbacks
Diffstat (limited to 'src/Storage')
-rw-r--r--src/Storage/FileStore.cpp6
-rw-r--r--src/Storage/MassStorage.cpp7
-rw-r--r--src/Storage/MassStorage.h2
3 files changed, 9 insertions, 6 deletions
diff --git a/src/Storage/FileStore.cpp b/src/Storage/FileStore.cpp
index 38372583..d73a6f5f 100644
--- a/src/Storage/FileStore.cpp
+++ b/src/Storage/FileStore.cpp
@@ -40,9 +40,9 @@ bool FileStore::IsOpenOn(const FATFS *fs) const
// This is protected - only Platform can access it.
bool FileStore::Open(const char* directory, const char* fileName, bool write)
{
- const char* location = (directory != nullptr)
- ? platform->GetMassStorage()->CombineName(directory, fileName)
- : fileName;
+ const char* const location = (directory != nullptr)
+ ? platform->GetMassStorage()->CombineName(directory, fileName)
+ : fileName;
writing = write;
if (writing)
diff --git a/src/Storage/MassStorage.cpp b/src/Storage/MassStorage.cpp
index 12cf1bc2..17741acd 100644
--- a/src/Storage/MassStorage.cpp
+++ b/src/Storage/MassStorage.cpp
@@ -222,14 +222,17 @@ const char* MassStorage::GetMonthName(const uint8_t month)
}
// Delete a file or directory
-bool MassStorage::Delete(const char* directory, const char* fileName)
+bool MassStorage::Delete(const char* directory, const char* fileName, bool silent)
{
const char* location = (directory != nullptr)
? platform->GetMassStorage()->CombineName(directory, fileName)
: fileName;
if (f_unlink(location) != FR_OK)
{
- platform->MessageF(GENERIC_MESSAGE, "Can't delete file %s\n", location);
+ if (!silent)
+ {
+ platform->MessageF(GENERIC_MESSAGE, "Can't delete file %s\n", location);
+ }
return false;
}
return true;
diff --git a/src/Storage/MassStorage.h b/src/Storage/MassStorage.h
index 05468b0f..968ef46d 100644
--- a/src/Storage/MassStorage.h
+++ b/src/Storage/MassStorage.h
@@ -24,7 +24,7 @@ public:
bool FindNext(FileInfo &file_info);
const char* GetMonthName(const uint8_t month);
const char* CombineName(const char* directory, const char* fileName);
- bool Delete(const char* directory, const char* fileName);
+ bool Delete(const char* directory, const char* fileName, bool silent = false);
bool MakeDirectory(const char *parentDir, const char *dirName);
bool MakeDirectory(const char *directory);
bool Rename(const char *oldFilename, const char *newFilename);