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-19 19:22:58 +0300
committerDavid Crocker <dcrocker@eschertech.com>2020-12-19 19:22:58 +0300
commitc6f43ce3ad613cd00a488d501432208b0e493c1a (patch)
treea78e8dca32bf85041ab9bc3e03e7d77b8a589770 /src/Hardware/NonVolatileMemory.cpp
parent89a8139551a2eccacaf0818a4f15b8234ecdac0d (diff)
Don't disable task scheduling when reading NVM
Disabling task scheculting when reading NVM caused an assertion failure when NVM was read in the exceptoin handler
Diffstat (limited to 'src/Hardware/NonVolatileMemory.cpp')
-rw-r--r--src/Hardware/NonVolatileMemory.cpp12
1 files changed, 4 insertions, 8 deletions
diff --git a/src/Hardware/NonVolatileMemory.cpp b/src/Hardware/NonVolatileMemory.cpp
index 1a5e8582..d36e6dae 100644
--- a/src/Hardware/NonVolatileMemory.cpp
+++ b/src/Hardware/NonVolatileMemory.cpp
@@ -26,14 +26,11 @@ void NonVolatileMemory::EnsureRead() noexcept
#elif defined(__LPC17xx__)
# error //TODO
#elif SAM4E || SAM4S || SAME70
+ const bool cacheEnabled = Cache::Disable();
+ flash_read_user_signature(reinterpret_cast<uint32_t*>(&buffer), sizeof(buffer)/sizeof(uint32_t));
+ if (cacheEnabled)
{
- TaskCriticalSectionLocker lock; // prevent scheduling while the cache is disabled
- const bool cacheEnabled = Cache::Disable();
- flash_read_user_signature(reinterpret_cast<uint32_t*>(&buffer), sizeof(buffer)/sizeof(uint32_t));
- if (cacheEnabled)
- {
- Cache::Enable();
- }
+ Cache::Enable();
}
#else
# error Unsupported processor
@@ -79,7 +76,6 @@ void NonVolatileMemory::EnsureWritten() noexcept
if (state == NvmState::writeNeeded)
{
# if SAM4E || SAM4S || SAME70
- TaskCriticalSectionLocker lock; // prevent scheduling while the cache is disabled
const bool cacheEnabled = Cache::Disable();
flash_write_user_signature(reinterpret_cast<const uint32_t*>(&buffer));
if (cacheEnabled)