Skip to content

Commit 323e4c2

Browse files
committed
OPTA: allow vid/pid function override from derived core
1 parent bf5dca2 commit 323e4c2

File tree

2 files changed

+5
-8
lines changed

2 files changed

+5
-8
lines changed

Diff for: variants/OPTA/pins_arduino.h

+3
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_VENDORID 0x2341
150150
#define _BOARD_PRODUCTID 0x0264
151+
152+
#ifndef FIRST_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
#define BOARD_NAME "Arduino Opta"
158161

Diff for: variants/OPTA/variant.cpp

+2-8
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
#define BOARD_REVISION(x,y) (x << 8 | y)
354348

0 commit comments

Comments
 (0)