From 934ff6a7acc1dd2029d10774df7fed2488c42e64 Mon Sep 17 00:00:00 2001 From: antisvin Date: Sat, 12 Nov 2022 00:41:09 +0200 Subject: [PATCH] This gets called from ISR currently --- Source/Storage.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Source/Storage.cpp b/Source/Storage.cpp index a75c9c77..6ea332c7 100644 --- a/Source/Storage.cpp +++ b/Source/Storage.cpp @@ -382,7 +382,7 @@ size_t Storage::writeResource(ResourceHeader* header){ return 0; } #ifndef USE_BOOTLOADER_MODE - taskENTER_CRITICAL(); + UBaseType_t uxSavedInterruptStatus = taskENTER_CRITICAL_FROM_ISR(); #endif int status = -1; if(dest->isMemoryMapped()){ @@ -403,7 +403,7 @@ size_t Storage::writeResource(ResourceHeader* header){ #endif } #ifndef USE_BOOTLOADER_MODE - taskEXIT_CRITICAL(); + taskEXIT_CRITICAL_FROM_ISR(uxSavedInterruptStatus); #endif if(status){ error(FLASH_ERROR, "Write failed");