5353
5454// Dup'd to avoid CYW43 dependency
5555// Generate a mac address if one is not set in otp
56- extern " C" {
57- static void cyw43_hal_generate_laa_mac (__unused int idx, uint8_t buf[6 ]) {
58- pico_unique_board_id_t board_id;
59- pico_get_unique_board_id (&board_id);
60- memcpy (buf, &board_id.id [2 ], 6 );
61- buf[0 ] &= (uint8_t )~0x1 ; // unicast
62- buf[0 ] |= 0x2 ; // locally administered
63- }
64- };
56+ static void _cyw43_hal_generate_laa_mac (__unused int idx, uint8_t buf[6 ]) {
57+ pico_unique_board_id_t board_id;
58+ pico_get_unique_board_id (&board_id);
59+ memcpy (buf, &board_id.id [2 ], 6 );
60+ buf[0 ] &= (uint8_t )~0x1 ; // unicast
61+ buf[0 ] |= 0x2 ; // locally administered
62+ }
6563
6664
6765
@@ -71,8 +69,6 @@ enum EthernetLinkStatus {
7169 LinkOFF
7270};
7371
74- extern " C" void cyw43_hal_generate_laa_mac (__unused int idx, uint8_t buf[6 ]);
75-
7672template <class RawDev >
7773class LwipIntfDev : public LwipIntf , public RawDev {
7874public:
@@ -356,7 +352,7 @@ bool LwipIntfDev<RawDev>::begin(const uint8_t* macAddress, const uint16_t mtu) {
356352#if 1
357353 // forge a new mac-address from the esp's wifi sta one
358354 // I understand this is cheating with an official mac-address
359- cyw43_hal_generate_laa_mac (0 , _macAddress);
355+ _cyw43_hal_generate_laa_mac (0 , _macAddress);
360356#else
361357 // https://serverfault.com/questions/40712/what-range-of-mac-addresses-can-i-safely-use-for-my-virtual-machines
362358 memset(_macAddress, 0, 6);
0 commit comments