Skip to content

Commit 2062504

Browse files
committed
chore(h7rs): otp area support
Signed-off-by: Frederic Pillon <frederic.pillon@st.com>
1 parent 0436f78 commit 2062504

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

  • libraries/SrcWrapper/src/stm32

‎libraries/SrcWrapper/src/stm32/otp.c‎

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,11 @@
1818
uint8_t *OTP_Read(uint8_t id)
1919
{
2020
uint8_t *p_id;
21-
21+
#if defined(OTP_AREA_END_ADDR)
2222
p_id = (uint8_t *)(OTP_AREA_END_ADDR - 7) ;
23+
#else
24+
p_id = (uint8_t *)(OTP_AREA_BASE + OTP_SIZE - 7) ;
25+
#endif
2326

2427
while (((*(p_id + 7)) != id) && (p_id != (uint8_t *)OTP_AREA_BASE)) {
2528
p_id -= 8 ;

0 commit comments

Comments
 (0)