mirror of
https://github.com/UpsilonNumworks/Upsilon.git
synced 2026-01-18 16:27:34 +01:00
Some code
This commit is contained in:
@@ -70,6 +70,10 @@ void EnableInternalFlashInterrupt() {
|
||||
InternalFlash::EnableFlashInterrupt();
|
||||
}
|
||||
|
||||
void ClearInternalFlashErrors() {
|
||||
InternalFlash::ClearErrors();
|
||||
}
|
||||
|
||||
void LockSlotA() {
|
||||
ExternalFlash::LockSlotA();
|
||||
}
|
||||
|
||||
@@ -20,6 +20,7 @@ void EnableInternalProtection();
|
||||
void SetInternalSectorProtection(int i, bool protect);
|
||||
void EnableInternalSessionLock(); // Will cause BUSERR when enabled
|
||||
void EnableInternalFlashInterrupt();
|
||||
void ClearInternalFlashErrors();
|
||||
void LockSlotA();
|
||||
void LockSlotB();
|
||||
|
||||
|
||||
@@ -363,6 +363,17 @@ void EnableFlashInterrupt() {
|
||||
close();
|
||||
}
|
||||
|
||||
void ClearErrors() {
|
||||
class FLASH::SR sr(0);
|
||||
// Error flags are cleared by writing 1
|
||||
sr.setERSERR(true);
|
||||
sr.setPGPERR(true);
|
||||
sr.setPGAERR(true);
|
||||
sr.setWRPERR(true);
|
||||
sr.setEOP(true);
|
||||
FLASH.SR()->set(sr);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -20,6 +20,7 @@ void DisableProtection();
|
||||
void SetSectorProtection(int i, bool protect);
|
||||
void EnableSessionLock();
|
||||
void EnableFlashInterrupt();
|
||||
void ClearErrors();
|
||||
|
||||
/* The Device is powered by a 2.8V LDO. This allows us to perform writes to the
|
||||
* Flash 32 bits at once. */
|
||||
|
||||
Reference in New Issue
Block a user