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>2020-12-16 00:54:04 +0300
committerDavid Crocker <dcrocker@eschertech.com>2020-12-16 00:54:04 +0300
commitbf9b6d50e0285a253e2806c3c694149751475b19 (patch)
treed19fd2857735e9305f6f71eddbfe9062c61e00bf /src/Hardware/NonVolatileMemory.cpp
parentc65a7797c2fc05334b41584c70583f50d3161ba6 (diff)
Disable cache while writing data to user signature
Diffstat (limited to 'src/Hardware/NonVolatileMemory.cpp')
-rw-r--r--src/Hardware/NonVolatileMemory.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/Hardware/NonVolatileMemory.cpp b/src/Hardware/NonVolatileMemory.cpp
index 72b91bd5..d0534821 100644
--- a/src/Hardware/NonVolatileMemory.cpp
+++ b/src/Hardware/NonVolatileMemory.cpp
@@ -75,7 +75,12 @@ void NonVolatileMemory::EnsureWritten() noexcept
if (state == NvmState::writeNeeded)
{
# if SAM4E || SAM4S || SAME70
+ const bool cacheEnabled = Cache::Disable();
flash_write_user_signature(reinterpret_cast<const uint32_t*>(&buffer));
+ if (cacheEnabled)
+ {
+ Cache::Enable();
+ }
# elif defined(__LPC17xx__)
LPC_WriteSoftwareResetData(slot, buffer, sizeof(buffer));
# else