diff --git a/ion/src/device/n0110/drivers/board.cpp b/ion/src/device/n0110/drivers/board.cpp index 5c6e16ef9..124764fd8 100644 --- a/ion/src/device/n0110/drivers/board.cpp +++ b/ion/src/device/n0110/drivers/board.cpp @@ -401,13 +401,13 @@ void writePCBVersion(PCBVersion version) { } void lockPCBVersion() { - uint8_t * destination = reinterpret_cast(InternalFlash::Config::OTPLocksAddress + k_pcbVersionOTPIndex); + uint8_t * destination = reinterpret_cast(InternalFlash::Config::OTPLockAddress(k_pcbVersionOTPIndex)); uint8_t zero = 0; InternalFlash::WriteMemory(destination, &zero, sizeof(zero)); } bool pcbVersionIsLocked() { - return *reinterpret_cast(InternalFlash::Config::OTPLocksAddress + k_pcbVersionOTPIndex) == 0; + return *reinterpret_cast(InternalFlash::Config::OTPLockAddress(k_pcbVersionOTPIndex)) == 0; } } diff --git a/ion/src/device/n0110/drivers/config/internal_flash.h b/ion/src/device/n0110/drivers/config/internal_flash.h index 9a1c7a84a..9fcbeed14 100644 --- a/ion/src/device/n0110/drivers/config/internal_flash.h +++ b/ion/src/device/n0110/drivers/config/internal_flash.h @@ -21,6 +21,7 @@ constexpr static uint32_t OTPLocksAddress = 0x1FF07A00; constexpr static int NumberOfOTPBlocks = 16; constexpr static uint32_t OTPBlockSize = 0x20; constexpr uint32_t OTPAddress(int block) { return OTPStartAddress + block * OTPBlockSize; }; +constexpr uint32_t OTPLockAddress(int block) { return OTPLocksAddress + block; } } }