mirror of
https://github.com/espressif/esp-idf
synced 2025-03-09 17:19:09 -04:00
Openeth driver did not consider the possibility that the MAC address was specified when launching QEMU, and would always overwrite that address with the address obtained from esp_read_mac. When running QEMU, setting the MAC address via QEMU arguments is more convenient than crafting an eFuse file with the correct MAC address. This change modifies openeth driver to first check if an address has been set in QEMU and uses it if so. Otherwise it falls back to the address obtained from esp_read_mac. As part of this change, also removed the unnecessary variable emac_opencores_t::addr, the address is only kept in the registers of the emulated peripheral now. For full effect this also requires changes in QEMU, see https://github.com/espressif/qemu/issues/107 for background. Without changes in QEMU, this commit keeps the same behavior.