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:
authorManuel Coenen <manuel@duet3d.com>2021-01-19 18:09:51 +0300
committerManuel Coenen <manuel@duet3d.com>2021-01-19 18:09:51 +0300
commitb52fe6b5480ec8fdef388ca2273b038e3d2b334c (patch)
tree66ffdd242641f62c04eda234390bb7c171c9ddec /src/Hardware/NonVolatileMemory.cpp
parent13f2a61c28178b8457361f05650c19b5c09e3c37 (diff)
Restore compilability for SAM4E/4S builds
Diffstat (limited to 'src/Hardware/NonVolatileMemory.cpp')
-rw-r--r--src/Hardware/NonVolatileMemory.cpp12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/Hardware/NonVolatileMemory.cpp b/src/Hardware/NonVolatileMemory.cpp
index 45aee49e..e0ef6d85 100644
--- a/src/Hardware/NonVolatileMemory.cpp
+++ b/src/Hardware/NonVolatileMemory.cpp
@@ -27,7 +27,11 @@ void NonVolatileMemory::EnsureRead() noexcept
# error //TODO
#elif SAM4E || SAM4S || SAME70
const bool cacheEnabled = Cache::Disable();
+# if SAME70
Flash::ReadUserSignature(reinterpret_cast<uint32_t*>(&buffer), sizeof(buffer)/sizeof(uint32_t));
+# else
+ flash_read_user_signature(reinterpret_cast<uint32_t*>(&buffer), sizeof(buffer)/sizeof(uint32_t));
+# endif
if (cacheEnabled)
{
Cache::Enable();
@@ -66,7 +70,11 @@ void NonVolatileMemory::EnsureWritten() noexcept
{
// Erase the page
# if SAM4E || SAM4S || SAME70
+# if SAME70
Flash::EraseUserSignature();
+# else
+ flash_erase_user_signature();
+# endif
# elif defined(__LPC17xx__)
LPC_EraseSoftwareResetDataSlots(); // erase the last flash sector
# endif
@@ -77,7 +85,11 @@ void NonVolatileMemory::EnsureWritten() noexcept
{
# if SAM4E || SAM4S || SAME70
const bool cacheEnabled = Cache::Disable();
+# if SAME70
Flash::WriteUserSignature(reinterpret_cast<const uint32_t*>(&buffer));
+# else
+ flash_write_user_signature(reinterpret_cast<const uint32_t*>(&buffer));
+# endif
if (cacheEnabled)
{
Cache::Enable();