File tree Expand file tree Collapse file tree 1 file changed +6
-9
lines changed Expand file tree Collapse file tree 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 {
258258static uint8_t *_boardInfo = (uint8_t *)(0x801F000 );
259259static bool has_otp_info = false ;
260260
261- static SecureQSPIFBlockDevice secure_root;
262-
263261// 8Kbit secure OTP area (on MX25L12833F)
264262bool getSecureFlashData () {
265- static PortentaBoardInfo* info = new PortentaBoardInfo ();
263+ static PortentaBoardInfo info;
264+ static SecureQSPIFBlockDevice secure_root;
266265 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;
270269 has_otp_info = true ;
271- } else {
272- delete info;
273270 }
274271 secure_root.deinit ();
275272 return ret == 0 ;
@@ -411,4 +408,4 @@ void bootM4() {
411408#endif
412409}
413410
414- #endif
411+ #endif
You can’t perform that action at this time.
0 commit comments