mirror of
https://github.com/UpsilonNumworks/Upsilon.git
synced 2026-01-18 16:27:34 +01:00
[ion/device/n0110] Change getter for OTPAddress
This commit is contained in:
@@ -390,11 +390,11 @@ PCBVersion readPCBVersion() {
|
||||
}
|
||||
|
||||
PCBVersion readPCBVersionInMemory() {
|
||||
return ~*reinterpret_cast<const PCBVersion *>(InternalFlash::Config::OTPAddresses[pcbVersionOTPIndex]);
|
||||
return ~*reinterpret_cast<const PCBVersion *>(InternalFlash::Config::OTPAddress(pcbVersionOTPIndex));
|
||||
}
|
||||
|
||||
void writePCBVersion(PCBVersion version) {
|
||||
uint8_t * destination = reinterpret_cast<uint8_t *>(InternalFlash::Config::OTPAddresses[pcbVersionOTPIndex]);
|
||||
uint8_t * destination = reinterpret_cast<uint8_t *>(InternalFlash::Config::OTPAddress(pcbVersionOTPIndex));
|
||||
PCBVersion formattedVersion = ~version;
|
||||
InternalFlash::WriteMemory(destination, reinterpret_cast<uint8_t *>(&formattedVersion), sizeof(formattedVersion));
|
||||
}
|
||||
|
||||
@@ -19,12 +19,8 @@ constexpr static uint32_t SectorAddresses[NumberOfSectors+1] = {
|
||||
constexpr static uint32_t OTPStartAddress = 0x1FF07800;
|
||||
constexpr static uint32_t OTPLocksAddress = 0x1FF07A00;
|
||||
constexpr static int NumberOfOTPBlocks = 16;
|
||||
constexpr static uint32_t OTPAddresses[NumberOfOTPBlocks] = {
|
||||
0x1FF07800, 0x1FF07820, 0x1FF07840, 0x1FF07860,
|
||||
0x1FF07880, 0x1FF078A0, 0x1FF078C0, 0x1FF078E0,
|
||||
0x1FF07900, 0x1FF07920, 0x1FF07940, 0x1FF07960,
|
||||
0x1FF07980, 0x1FF079A0, 0x1FF079C0, 0x1FF079E0,
|
||||
};
|
||||
constexpr static uint32_t OTPBlockSize = 0x20;
|
||||
constexpr uint32_t OTPAddress(int block) { return OTPStartAddress + block * OTPBlockSize; };
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user