Skip to content

Commit 18b494b

Browse files
committed
Merge pull request #551 from sg-/enet_status
Net: K64F - Add phy_link_status() to link status in emac driver
2 parents bc5397a + 3af1e65 commit 18b494b

File tree

2 files changed

+17
-0
lines changed

2 files changed

+17
-0
lines changed

libraries/net/eth/lwip-eth/arch/TARGET_Freescale/k64f_emac.c

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -723,6 +723,13 @@ typedef struct {
723723
enet_phy_duplex_t duplex;
724724
} PHY_STATE;
725725

726+
int phy_link_status() {
727+
bool connection_status;
728+
enet_dev_if_t * enetIfPtr = (enet_dev_if_t*)&enetDevIf[BOARD_DEBUG_ENET_INSTANCE];
729+
phy_get_link_status(enetIfPtr, &connection_status);
730+
return (int)connection_status;
731+
}
732+
726733
static void k64f_phy_task(void *data) {
727734
struct netif *netif = (struct netif*)data;
728735
bool connection_status;

libraries/net/eth/lwip-eth/arch/TARGET_Freescale/k64f_emac_config.h

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,5 +44,15 @@
4444

4545
#define ENET_ETH_MAX_FLEN (1522) // recommended size for a VLAN frame
4646

47+
#if defined(__cplusplus)
48+
extern "C" {
49+
#endif
50+
51+
int phy_link_status(void);
52+
53+
#if defined(__cplusplus)
54+
}
55+
#endif
56+
4757
#endif // #define K64F_EMAC_CONFIG_H__
4858

0 commit comments

Comments
 (0)