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-11-09 18:15:55 +0300
committerDavid Crocker <dcrocker@eschertech.com>2017-11-09 18:16:08 +0300
commit2d79e7afdd4a155c71d376de593fcb0731ce8911 (patch)
tree62fb99906c96755aed19ab9f1e489d569d103490 /src/Storage
parent90d307da50d49f19e1f746cacc9c938022cc8c7e (diff)
Towards 1.20beta7
String parameters can now be quoted in all G- and M-commands Added partial support for standstill current reduction (M917) M0 and M1 no longe turns anything off or run any macros when in simulation mode
Diffstat (limited to 'src/Storage')
-rw-r--r--src/Storage/MassStorage.cpp28
1 files changed, 14 insertions, 14 deletions
diff --git a/src/Storage/MassStorage.cpp b/src/Storage/MassStorage.cpp
index 19f9d9a0..8d29e8e8 100644
--- a/src/Storage/MassStorage.cpp
+++ b/src/Storage/MassStorage.cpp
@@ -86,7 +86,7 @@ FileWriteBuffer *MassStorage::AllocateWriteBuffer()
return nullptr;
}
- FileWriteBuffer *buffer = freeWriteBuffers;
+ FileWriteBuffer * const buffer = freeWriteBuffers;
freeWriteBuffers = buffer->Next();
buffer->SetNext(nullptr);
return buffer;
@@ -224,9 +224,9 @@ const char* MassStorage::GetMonthName(const uint8_t month)
// Delete a file or directory
bool MassStorage::Delete(const char* directory, const char* fileName, bool silent)
{
- const char* location = (directory != nullptr)
- ? platform->GetMassStorage()->CombineName(directory, fileName)
- : fileName;
+ const char* const location = (directory != nullptr)
+ ? platform->GetMassStorage()->CombineName(directory, fileName)
+ : fileName;
if (f_unlink(location) != FR_OK)
{
if (!silent)
@@ -241,7 +241,7 @@ bool MassStorage::Delete(const char* directory, const char* fileName, bool silen
// Create a new directory
bool MassStorage::MakeDirectory(const char *parentDir, const char *dirName)
{
- const char* location = platform->GetMassStorage()->CombineName(parentDir, dirName);
+ const char* const location = platform->GetMassStorage()->CombineName(parentDir, dirName);
if (f_mkdir(location) != FR_OK)
{
platform->MessageF(ErrorMessage, "Failed to create directory %s\n", location);
@@ -288,9 +288,9 @@ bool MassStorage::FileExists(const char *file) const
bool MassStorage::FileExists(const char *directory, const char *fileName) const
{
- const char *location = (directory != nullptr)
- ? platform->GetMassStorage()->CombineName(directory, fileName)
- : fileName;
+ const char * const location = (directory != nullptr)
+ ? platform->GetMassStorage()->CombineName(directory, fileName)
+ : fileName;
return FileExists(location);
}
@@ -310,9 +310,9 @@ bool MassStorage::DirectoryExists(const char* directory, const char* subDirector
// Return the last modified time of a file, or zero if failure
time_t MassStorage::GetLastModifiedTime(const char* directory, const char *fileName) const
{
- const char *location = (directory != nullptr)
- ? platform->GetMassStorage()->CombineName(directory, fileName)
- : fileName;
+ const char * const location = (directory != nullptr)
+ ? platform->GetMassStorage()->CombineName(directory, fileName)
+ : fileName;
FILINFO fil;
fil.lfname = nullptr;
if (f_stat(location, &fil) == FR_OK)
@@ -324,9 +324,9 @@ time_t MassStorage::GetLastModifiedTime(const char* directory, const char *fileN
bool MassStorage::SetLastModifiedTime(const char* directory, const char *fileName, time_t time)
{
- const char *location = (directory != nullptr)
- ? platform->GetMassStorage()->CombineName(directory, fileName)
- : fileName;
+ const char * const location = (directory != nullptr)
+ ? platform->GetMassStorage()->CombineName(directory, fileName)
+ : fileName;
const struct tm * const timeInfo = gmtime(&time);
FILINFO fno;
fno.fdate = (WORD)(((timeInfo->tm_year - 80) * 512U) | (timeInfo->tm_mon + 1) * 32U | timeInfo->tm_mday);