mirror of
https://github.com/UpsilonNumworks/Upsilon.git
synced 2026-03-27 09:40:07 +01:00
[ion/n0100] Fix DFU
This commit is contained in:
@@ -213,7 +213,7 @@ static void flash_memcpy(uint8_t * destination, uint8_t * source, size_t length)
|
||||
}
|
||||
|
||||
int SectorAtAddress(uint32_t address) {
|
||||
for (int i=0; i<NumberOfSectors; i++) {
|
||||
for (int i = 0; i < Config::NumberOfSectors; i++) {
|
||||
if (address >= Config::SectorAddresses[i] && address < Config::SectorAddresses[i+1]) {
|
||||
return i;
|
||||
}
|
||||
@@ -231,7 +231,7 @@ void MassErase() {
|
||||
}
|
||||
|
||||
void EraseSector(int i) {
|
||||
assert(i >= 0 && i < NumberOfSectors);
|
||||
assert(i >= 0 && i < Config::NumberOfSectors);
|
||||
open();
|
||||
FLASH.CR()->setSNB(i);
|
||||
FLASH.CR()->setSER(true);
|
||||
|
||||
@@ -10,7 +10,6 @@ namespace Flash {
|
||||
|
||||
void MassErase();
|
||||
|
||||
constexpr int NumberOfSectors = 4;
|
||||
int SectorAtAddress(uint32_t address);
|
||||
void EraseSector(int i);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user