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

Commit38ab2af

Browse files
authored
Merge pull request#1026 from pennam/opta-vid-pid-patch
OPTA: allow vid/pid function override from derived core
2 parentsbf5dca2 +323e4c2 commit38ab2af

File tree

2 files changed

+5
-8
lines changed

2 files changed

+5
-8
lines changed

‎variants/OPTA/pins_arduino.h‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -148,11 +148,14 @@ static const uint8_t SCK = PIN_SPI_SCK;
148148
// Use these only if bootloader data is not available / valid
149149
#define_BOARD_VENDORID0x2341
150150
#define_BOARD_PRODUCTID0x0264
151+
152+
#ifndefFIRST_PROGRAMMING
151153
uint16_t_getVid_();
152154
uint16_t_getPid_();
153155

154156
// Retrieve (Arduino OUI) Ethernet MAC Address from QSPIF OTP
155157
uint8_t_getSecureEthMac_(uint8_t*);
158+
#endif
156159

157160
#defineBOARD_NAME"Arduino Opta"
158161

‎variants/OPTA/variant.cpp‎

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -313,26 +313,19 @@ uint16_t boardRevision() {
313313
return (((OptaBoardInfo*)_boardInfo)->revision);
314314
}
315315

316+
#ifndef FIRST_PROGRAMMING
316317
uint16_t_getVid_() {
317-
#ifdef FIRST_PROGRAMMING
318-
return _BOARD_VENDORID;
319-
#else
320318
if (!has_otp_info) {
321319
getSecureFlashData();
322320
}
323321
return ((OptaBoardInfo*)_boardInfo)->vid;
324-
#endif
325322
}
326323

327324
uint16_t_getPid_() {
328-
#ifdef FIRST_PROGRAMMING
329-
return _BOARD_PRODUCTID;
330-
#else
331325
if (!has_otp_info) {
332326
getSecureFlashData();
333327
}
334328
return ((OptaBoardInfo*)_boardInfo)->pid;
335-
#endif
336329
}
337330

338331
uint8_t_getSecureEthMac_(uint8_t *mac_address) {
@@ -349,6 +342,7 @@ uint8_t mbed_otp_mac_address(char *mac)
349342
auto ret =_getSecureEthMac_(reinterpret_cast<uint8_t *>(mac));
350343
return ret;
351344
}
345+
#endif
352346

353347
#defineBOARD_REVISION(x,y) (x <<8 | y)
354348

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp