53
53
54
54
// Dup'd to avoid CYW43 dependency
55
55
// 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
+ }
65
63
66
64
67
65
@@ -71,8 +69,6 @@ enum EthernetLinkStatus {
71
69
LinkOFF
72
70
};
73
71
74
- extern " C" void cyw43_hal_generate_laa_mac (__unused int idx, uint8_t buf[6 ]);
75
-
76
72
template <class RawDev >
77
73
class LwipIntfDev : public LwipIntf , public RawDev {
78
74
public:
@@ -356,7 +352,7 @@ bool LwipIntfDev<RawDev>::begin(const uint8_t* macAddress, const uint16_t mtu) {
356
352
#if 1
357
353
// forge a new mac-address from the esp's wifi sta one
358
354
// 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);
360
356
#else
361
357
// https://serverfault.com/questions/40712/what-range-of-mac-addresses-can-i-safely-use-for-my-virtual-machines
362
358
memset(_macAddress, 0, 6);
0 commit comments