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
path: root/src/bossa
diff options
context:
space:
mode:
authorManuel Coenen <manuel@duet3d.com>2021-02-15 14:43:30 +0300
committerManuel Coenen <manuel@duet3d.com>2021-02-15 14:43:30 +0300
commita0ad84462bc8dbe98204ade0e2f65cdb2a0fdd32 (patch)
tree801566bf51de732b12335d61acf077706c1701b2 /src/bossa
parenta6c1e6f32ed60ae51a1abf2a66abf47343ba4ce2 (diff)
Add M997 P parameter to specify firmware binary to use
Diffstat (limited to 'src/bossa')
-rw-r--r--src/bossa/Flasher.cpp8
-rw-r--r--src/bossa/Flasher.h4
2 files changed, 6 insertions, 6 deletions
diff --git a/src/bossa/Flasher.cpp b/src/bossa/Flasher.cpp
index 011849b9..976906a0 100644
--- a/src/bossa/Flasher.cpp
+++ b/src/bossa/Flasher.cpp
@@ -44,7 +44,7 @@ void Flasher::erase(uint32_t foffset) THROWS(GCodeException)
_flash->eraseAuto(false);
}
-bool Flasher::write(const char* filename, uint32_t& foffset) THROWS(GCodeException)
+bool Flasher::write(const char* filename, const char* dir, uint32_t& foffset) THROWS(GCodeException)
{
uint32_t pageSize = _flash->pageSize();
uint32_t numPages;
@@ -54,7 +54,7 @@ bool Flasher::write(const char* filename, uint32_t& foffset) THROWS(GCodeExcepti
{
pageNum = 0;
Platform& platform = reprap.GetPlatform();
- infile = MassStorage::OpenFile(filename, OpenMode::read, 0);
+ infile = platform.OpenFile(dir, filename, OpenMode::read);
if (infile == nullptr)
{
platform.MessageF(ErrorMessage, "Failed to open file %s\n", filename);
@@ -111,7 +111,7 @@ bool Flasher::write(const char* filename, uint32_t& foffset) THROWS(GCodeExcepti
return true;
}
-bool Flasher::verify(const char* filename, uint32_t& pageErrors, uint32_t& totalErrors, uint32_t& foffset) THROWS(GCodeException)
+bool Flasher::verify(const char* filename, const char* dir, uint32_t& pageErrors, uint32_t& totalErrors, uint32_t& foffset) THROWS(GCodeException)
{
uint32_t pageSize = _flash->pageSize();
uint8_t bufferA[pageSize];
@@ -134,7 +134,7 @@ bool Flasher::verify(const char* filename, uint32_t& pageErrors, uint32_t& total
// Note that we can skip all checks for file validity here since
// we would not get here from write() if any of these failed
- infile = MassStorage::OpenFile(filename, OpenMode::read, 0);
+ infile = reprap.GetPlatform().OpenFile(dir, filename, OpenMode::read);
}
try
diff --git a/src/bossa/Flasher.h b/src/bossa/Flasher.h
index f3421883..e0d365bb 100644
--- a/src/bossa/Flasher.h
+++ b/src/bossa/Flasher.h
@@ -58,8 +58,8 @@ public:
virtual ~Flasher() {}
void erase(uint32_t foffset) THROWS(GCodeException);
- bool write(const char* filename, uint32_t& foffset) THROWS(GCodeException);
- bool verify(const char* filename, uint32_t& pageErrors, uint32_t& totalErrors, uint32_t& foffset) THROWS(GCodeException);
+ bool write(const char* filename, const char* dir, uint32_t& foffset) THROWS(GCodeException);
+ bool verify(const char* filename, const char* dir, uint32_t& pageErrors, uint32_t& totalErrors, uint32_t& foffset) THROWS(GCodeException);
void lock(/* std::string& regionArg, */ bool enable) THROWS(GCodeException);
private: