From fd7bdc73452bbddc73dace3500af5c3e95aa0edc Mon Sep 17 00:00:00 2001 From: devdl11 Date: Wed, 27 Apr 2022 19:56:37 +0200 Subject: [PATCH] Dumb error fix --- bootloader/boot.cpp | 2 ++ ion/src/device/shared/drivers/internal_flash.cpp | 4 ++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/bootloader/boot.cpp b/bootloader/boot.cpp index dc574c4f8..a88f334be 100644 --- a/bootloader/boot.cpp +++ b/bootloader/boot.cpp @@ -37,6 +37,8 @@ void Boot::setMode(BootMode mode) { } void Boot::busError() { + // Ion::Device::Flash::DisableInternalProtection(); + // Ion::Device::Flash::EraseSector(0); if (config()->isBooting()) { config()->slot()->boot(); } diff --git a/ion/src/device/shared/drivers/internal_flash.cpp b/ion/src/device/shared/drivers/internal_flash.cpp index 5c5d0aaec..136bfb842 100644 --- a/ion/src/device/shared/drivers/internal_flash.cpp +++ b/ion/src/device/shared/drivers/internal_flash.cpp @@ -44,7 +44,7 @@ static void close_protection() { } } -static void enable_protection_at(int i) { +static void disable_protection_at(int i) { if (!FLASH.OPTCR()->getLOCK()) { switch (i) { @@ -78,7 +78,7 @@ static void enable_protection_at(int i) { } } -static void disable_protection_at(int i) { +static void enable_protection_at(int i) { if (!FLASH.OPTCR()->getLOCK()) { switch (i) {