Eth low power (#1362)

* Align eth low-power mode with upstream PR.

* Add example Eth cable test.
This commit is contained in:
Ibrahim Abd Elkader 2021-06-12 23:12:39 +02:00 committed by GitHub
parent 5f4250e74e
commit 190c708e4c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 21 additions and 1 deletions

View File

@ -0,0 +1,20 @@
# Ethernet Cable Status Example.
#
# This example prints the cable connection status.
import network, time
lan = network.LAN()
# Make sure Eth is not in low-power mode.
lan.config(low_power=False)
# Delay for auto negotiation
time.sleep(3.0)
while (True):
print("Cable is", "connected." if lan.status() else "disconnected.")
time.sleep(1.0)
# Put Eth back in low-power mode if needed.
#lan.config(low_power=True)

@ -1 +1 @@
Subproject commit a954efb9184ec020df2ce7a23f84e158c8b7f628
Subproject commit b814ad51d6b51b94fb7dab01dc111d5053d98a82