diff options
Diffstat (limited to 'shared-module/wiznet')
| -rw-r--r-- | shared-module/wiznet/wiznet5k.c | 10 | ||||
| -rw-r--r-- | shared-module/wiznet/wiznet5k.h | 4 |
2 files changed, 10 insertions, 4 deletions
diff --git a/shared-module/wiznet/wiznet5k.c b/shared-module/wiznet/wiznet5k.c index 4bf536226..ee732859a 100644 --- a/shared-module/wiznet/wiznet5k.c +++ b/shared-module/wiznet/wiznet5k.c @@ -324,7 +324,7 @@ void wiznet5k_socket_timer_tick(mod_network_socket_obj_t *socket) { } } -static void wiznet5k_start_dhcp(void) { +void wiznet5k_start_dhcp(void) { static DHCP_INIT_BUFFER_TYPE dhcp_buf[DHCP_INIT_BUFFER_SIZE]; if (!wiznet5k_obj.dhcp_active) { @@ -335,15 +335,17 @@ static void wiznet5k_start_dhcp(void) { } } -#if 0 -static void wiznet5k_stop_dhcp(void) { +void wiznet5k_stop_dhcp(void) { if (wiznet5k_obj.dhcp_active) { wiznet5k_obj.dhcp_active = 0; DHCP_stop(); WIZCHIP_EXPORT(close)(0); } } -#endif + +bool wiznet5k_check_dhcp(void) { + return wiznet5k_obj.dhcp_active; +} /// Create and return a WIZNET5K object. mp_obj_t wiznet5k_create(mp_obj_t spi_in, mp_obj_t cs_in, mp_obj_t rst_in) { diff --git a/shared-module/wiznet/wiznet5k.h b/shared-module/wiznet/wiznet5k.h index 04b8872fb..1284a44fd 100644 --- a/shared-module/wiznet/wiznet5k.h +++ b/shared-module/wiznet/wiznet5k.h @@ -60,6 +60,10 @@ void wiznet5k_socket_timer_tick(mod_network_socket_obj_t *socket); mp_obj_t wiznet5k_socket_disconnect(mp_obj_t self_in); mp_obj_t wiznet5k_create(mp_obj_t spi_in, mp_obj_t cs_in, mp_obj_t rst_in); +void wiznet5k_start_dhcp(void); +void wiznet5k_stop_dhcp(void); +bool wiznet5k_check_dhcp(void); + extern const mod_network_nic_type_t mod_network_nic_type_wiznet5k; #endif // MICROPY_INCLUDED_SHARED_MODULE_WIZNET_WIZNET5K_H |
