From 323e4c2e7cb27d64d31cb73d41976cc245b9cb6b Mon Sep 17 00:00:00 2001 From: pennam Date: Fri, 21 Feb 2025 12:49:01 +0100 Subject: [PATCH] OPTA: allow vid/pid function override from derived core --- variants/OPTA/pins_arduino.h | 3 +++ variants/OPTA/variant.cpp | 10 ++-------- 2 files changed, 5 insertions(+), 8 deletions(-) diff --git a/variants/OPTA/pins_arduino.h b/variants/OPTA/pins_arduino.h index 25d6e8c06..a1243b4e8 100644 --- a/variants/OPTA/pins_arduino.h +++ b/variants/OPTA/pins_arduino.h @@ -148,11 +148,14 @@ static const uint8_t SCK = PIN_SPI_SCK; // Use these only if bootloader data is not available / valid #define _BOARD_VENDORID 0x2341 #define _BOARD_PRODUCTID 0x0264 + +#ifndef FIRST_PROGRAMMING uint16_t _getVid_(); uint16_t _getPid_(); // Retrieve (Arduino OUI) Ethernet MAC Address from QSPIF OTP uint8_t _getSecureEthMac_(uint8_t *); +#endif #define BOARD_NAME "Arduino Opta" diff --git a/variants/OPTA/variant.cpp b/variants/OPTA/variant.cpp index eabe1cdab..93b796e88 100644 --- a/variants/OPTA/variant.cpp +++ b/variants/OPTA/variant.cpp @@ -313,26 +313,19 @@ uint16_t boardRevision() { return (((OptaBoardInfo*)_boardInfo)->revision); } +#ifndef FIRST_PROGRAMMING uint16_t _getVid_() { -#ifdef FIRST_PROGRAMMING - return _BOARD_VENDORID; -#else if (!has_otp_info) { getSecureFlashData(); } return ((OptaBoardInfo*)_boardInfo)->vid; -#endif } uint16_t _getPid_() { -#ifdef FIRST_PROGRAMMING - return _BOARD_PRODUCTID; -#else if (!has_otp_info) { getSecureFlashData(); } return ((OptaBoardInfo*)_boardInfo)->pid; -#endif } uint8_t _getSecureEthMac_(uint8_t *mac_address) { @@ -349,6 +342,7 @@ uint8_t mbed_otp_mac_address(char *mac) auto ret = _getSecureEthMac_(reinterpret_cast(mac)); return ret; } +#endif #define BOARD_REVISION(x,y) (x << 8 | y) pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy