From 21b7bf3ccf0ca0b04895b0355a06f2a3ffb833d3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Juraj=20Andr=C3=A1ssy?= Date: Tue, 31 Oct 2023 10:49:02 +0100 Subject: [PATCH] Ethernet - apply MAC address in begin(mac) tested with "ENC28J60 Mbed EMAC" and "Nano 33 BLE" --- libraries/Ethernet/src/Ethernet.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/libraries/Ethernet/src/Ethernet.cpp b/libraries/Ethernet/src/Ethernet.cpp index 26d63e5a2..8d9c51a88 100644 --- a/libraries/Ethernet/src/Ethernet.cpp +++ b/libraries/Ethernet/src/Ethernet.cpp @@ -9,6 +9,10 @@ int arduino::EthernetClass::begin(uint8_t *mac, unsigned long timeout, unsigned if (eth_if == nullptr) return 0; } + if (mac != nullptr) { + eth_if->get_emac().set_hwaddr(mac); + } + unsigned long start = millis(); eth_if->set_blocking(false); eth_if->connect();