Skip to content

Commit 5bd6840

Browse files
committed
stm32/network_lan: Allow a board to configure the default LAN PHY.
Signed-off-by: Damien George <[email protected]>
1 parent 9f87b79 commit 5bd6840

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

ports/stm32/network_lan.c

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,11 @@
3333

3434
#include "lwip/netif.h"
3535

36+
// A board can customize the default PHY by defining this setting.
37+
#ifndef NETWORK_LAN_PHY
38+
#define NETWORK_LAN_PHY ETH_PHY_LAN8742
39+
#endif
40+
3641
typedef struct _network_lan_obj_t {
3742
mp_obj_base_t base;
3843
eth_t *eth;
@@ -57,7 +62,7 @@ static mp_obj_t network_lan_make_new(const mp_obj_type_t *type, size_t n_args, s
5762
enum { ARG_phy_addr, ARG_phy_type};
5863
static const mp_arg_t allowed_args[] = {
5964
{ MP_QSTR_phy_addr, MP_ARG_KW_ONLY | MP_ARG_INT, {.u_int = 0} },
60-
{ MP_QSTR_phy_type, MP_ARG_KW_ONLY | MP_ARG_INT, {.u_int = ETH_PHY_LAN8742} },
65+
{ MP_QSTR_phy_type, MP_ARG_KW_ONLY | MP_ARG_INT, {.u_int = NETWORK_LAN_PHY} },
6166
};
6267
// Parse args.
6368
mp_arg_val_t args[MP_ARRAY_SIZE(allowed_args)];

0 commit comments

Comments
 (0)