File tree 1 file changed +6
-9
lines changed
1 file changed +6
-9
lines changed Original file line number Diff line number Diff line change @@ -258,18 +258,15 @@ class SecureQSPIFBlockDevice: public QSPIFBlockDevice {
258
258
static uint8_t *_boardInfo = (uint8_t *)(0x801F000 );
259
259
static bool has_otp_info = false ;
260
260
261
- static SecureQSPIFBlockDevice secure_root;
262
-
263
261
// 8Kbit secure OTP area (on MX25L12833F)
264
262
bool getSecureFlashData () {
265
- static PortentaBoardInfo* info = new PortentaBoardInfo ();
263
+ static PortentaBoardInfo info;
264
+ static SecureQSPIFBlockDevice secure_root;
266
265
secure_root.init ();
267
- auto ret = secure_root.readSecure (info, 0 , sizeof (PortentaBoardInfo));
268
- if (info-> magic == OTP_QSPI_MAGIC) {
269
- _boardInfo = (uint8_t *)info;
266
+ auto ret = secure_root.readSecure (& info, 0 , sizeof (PortentaBoardInfo));
267
+ if (info. magic == OTP_QSPI_MAGIC) {
268
+ _boardInfo = (uint8_t *)& info;
270
269
has_otp_info = true ;
271
- } else {
272
- delete info;
273
270
}
274
271
secure_root.deinit ();
275
272
return ret == 0 ;
@@ -411,4 +408,4 @@ void bootM4() {
411
408
#endif
412
409
}
413
410
414
- #endif
411
+ #endif
You can’t perform that action at this time.
0 commit comments