fix(eth): Set the ETH properties at the correct time #11182
Merged
Add this suggestion to a batch that can be applied as a single commit. This suggestion is invalid because no changes were made to the code. Suggestions cannot be applied while the pull request is closed. Suggestions cannot be applied while viewing a subset of changes. Only one suggestion per line can be applied in a batch. Add this suggestion to a batch that can be applied as a single commit. Applying suggestions on deleted lines is not supported. You must change the existing code in this line in order to create a valid suggestion. Outdated suggestions cannot be applied. This suggestion has been applied or marked resolved. Suggestions cannot be applied from pending reviews. Suggestions cannot be applied on multi-line comments. Suggestions cannot be applied while the pull request is queued to merge. Suggestion cannot be applied right now. Please check back later.
This pull request includes several changes to the
ETHClass
in thelibraries/Ethernet/src/ETH.cpp
andlibraries/Ethernet/src/ETH.h
files. The changes primarily focus on adding support for configuring Ethernet settings such as full duplex mode, link speed, and auto-negotiation, as well as ensuring these settings are properly managed during the Ethernet initialization and shutdown processes.Enhancements to Ethernet Configuration:
_eth_started
,_link_speed
,_full_duplex
, and_auto_negotiation
to theETHClass
to store Ethernet configuration settings.setFullDuplex
,setLinkSpeed
, andsetAutoNegotiation
to allow configuration of Ethernet settings before callingETH.begin()
. Each method includes validation to ensure settings are applied correctly. [1] [2] [3]_setFullDuplex
,_setLinkSpeed
, and_setAutoNegotiation
to apply the settings to the Ethernet hardware.Initialization and Shutdown Process:
ETHClass::begin
andETHClass::beginSPI
methods to apply the Ethernet configuration settings (full duplex, link speed, and auto-negotiation) during the initialization process if auto-negotiation is disabled. [1] [2]ETHClass::end
method to reset the_eth_started
flag when shutting down the Ethernet interface.Code Refactoring:
ETHClass
constructor to initialize the new member variables._eth_started
flag is set to true after successful initialization and set to false during shutdown. [1] [2] [3]Reference: #10923