pub fn set_mac_address(mac: [u8; 6]) -> Result<(), SetMacError> {
        if MAC_OVERRIDE_STATE
            .compare_exchange(0, 1, Ordering::Relaxed, Ordering::Relaxed)
            .is_err()
        {
            return Err(SetMacError::AlreadySet);
        }

        unsafe {
            MAC_OVERRIDE = mac;
        }

        MAC_OVERRIDE_STATE.store(2, Ordering::Relaxed);

        Ok(())
    }
Set the base mac address

The new value will be returned by `read_mac_address` instead of the one
hard-coded in eFuse. This does not persist across device resets.

Can only be called once. Returns `Err(SetMacError::AlreadySet)`
otherwise.
esp-hal/src/soc/mod.rs