Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit9f8a26b

Browse files
committed
Opta: secure_qspi: simplify code
1 parent2ece915 commit9f8a26b

File tree

1 file changed

+6
-8
lines changed

1 file changed

+6
-8
lines changed

‎variants/OPTA/variant.cpp‎

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -283,19 +283,17 @@ static bool has_otp_info = false;
283283

284284
boolgetSecureFlashData() {
285285
static OptaBoardInfo info;
286-
uint8_t temp_buf[sizeof(OptaBoardInfo) +1];
287-
int ret =0;
288-
static SecureQSPIFBlockDevice secure_root;
289-
secure_root.init();
290-
// read secure sector 2 ( address 1 << 13 )
291-
ret = secure_root.readSecure(temp_buf, (1 <<13),sizeof(temp_buf));
286+
char temp_buf[sizeof(OptaBoardInfo) +1];
287+
int ret = QSPI_STATUS_OK;
288+
mbed::QSPI_qspi(QSPI_FLASH1_IO0, QSPI_FLASH1_IO1, QSPI_FLASH1_IO2, QSPI_FLASH1_IO3, QSPI_FLASH1_SCK, QSPI_FLASH1_CSN, QSPIF_POLARITY_MODE_0);
289+
auto rxlen =sizeof(temp_buf);
290+
ret = _qspi.read(0x48, -1,1 <<13, temp_buf, &rxlen);
292291
memcpy(&info, &temp_buf[1],sizeof(OptaBoardInfo));
293292
if (info.magic == OTP_QSPI_MAGIC) {
294293
_boardInfo = (uint8_t*)&info;
295294
has_otp_info =true;
296295
}
297-
secure_root.deinit();
298-
return ret ==0;
296+
return ret == QSPI_STATUS_OK;
299297
}
300298

301299
uint8_t*boardInfo() {

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp