diff --git a/src/Arduino_10BASE_T1S.h b/src/Arduino_10BASE_T1S.h index 8a60479..8f1d1a3 100644 --- a/src/Arduino_10BASE_T1S.h +++ b/src/Arduino_10BASE_T1S.h @@ -46,6 +46,11 @@ static int const IRQ_PIN = 2; static int const CS_PIN = PinNameToIndex(PH_6); static int const RESET_PIN = PinNameToIndex(PJ_11); static int const IRQ_PIN = PinNameToIndex(PC_7); +#elif defined(ARDUINO_PORTENTA_C33) +/* Pro Demo kit on MID carrier, UNO form factor */ +static int const CS_PIN = 25; +static int const RESET_PIN = 4; +static int const IRQ_PIN = 2; #else # error "No pins defined for your board" #endif diff --git a/src/MacAddress.cpp b/src/MacAddress.cpp index 4cf6e57..e284d9c 100644 --- a/src/MacAddress.cpp +++ b/src/MacAddress.cpp @@ -82,24 +82,10 @@ void get_unique_chip_id_3(uint8_t * uid) uint32_t const samd_uid = *(volatile uint32_t*)(0x0080A048); memcpy(uid, &samd_uid, 3); } -#elif defined(ARDUINO_MINIMA) || defined(ARDUINO_UNOWIFIR4) +#elif defined(ARDUINO_MINIMA) || defined(ARDUINO_UNOWIFIR4) || defined(ARDUINO_PORTENTA_C33) { - #define BSP_FEATURE_BSP_MCU_INFO_POINTER_LOCATION (0x407FB19C) - #define BSP_FEATURE_BSP_UNIQUE_ID_OFFSET (0x14) - #define BSP_FEATURE_BSP_UNIQUE_ID_POINTER ((*(uint32_t *) BSP_FEATURE_BSP_MCU_INFO_POINTER_LOCATION) \ - + \ - BSP_FEATURE_BSP_UNIQUE_ID_OFFSET) - typedef struct st_bsp_unique_id - { - union - { - uint32_t unique_id_words[4]; - uint8_t unique_id_bytes[16]; - }; - } bsp_unique_id_t; - - bsp_unique_id_t const * renesas_unique_id = (bsp_unique_id_t *) BSP_FEATURE_BSP_UNIQUE_ID_POINTER; - memcpy(uid, renesas_unique_id->unique_id_bytes, 3); + const bsp_unique_id_t* t = R_BSP_UniqueIdGet(); + memcpy(uid, t->unique_id_bytes, 3); } #elif defined(ARDUINO_GIGA) || defined(ARDUINO_PORTENTA_H7_M7) || defined(ARDUINO_PORTENTA_H7_M4) { @@ -113,4 +99,10 @@ void get_unique_chip_id_3(uint8_t * uid) #else # error "Retrieving a unique chip ID for MAC generation is not supported on this platform." #endif -} \ No newline at end of file +} + +#if defined(ARDUINO_PORTENTA_C33) +extern "C" int LWIP_RAND() { + return rand(); +} +#endif \ No newline at end of file