From 2381a7019072f8f6983f323a2bc0913ac115aed3 Mon Sep 17 00:00:00 2001 From: Giovanni Di Sirio Date: Sun, 5 Apr 2015 10:14:51 +0000 Subject: Board files regenerated with the updated tool. Fixed some errors in demos. git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@7854 35acf78f-673a-0410-8e92-d51de3d6d3f4 --- os/various/lwip_bindings/lwipthread.c | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) (limited to 'os/various') diff --git a/os/various/lwip_bindings/lwipthread.c b/os/various/lwip_bindings/lwipthread.c index ddb476aed..6b3c0975b 100644 --- a/os/various/lwip_bindings/lwipthread.c +++ b/os/various/lwip_bindings/lwipthread.c @@ -260,17 +260,25 @@ THD_FUNCTION(lwip_thread, p) { /* Goes to the final priority after initialization.*/ chThdSetPriority(LWIP_THREAD_PRIORITY); - while (TRUE) { + while (true) { eventmask_t mask = chEvtWaitAny(ALL_EVENTS); if (mask & PERIODIC_TIMER_ID) { bool current_link_status = macPollLinkStatus(ÐD1); if (current_link_status != netif_is_link_up(&thisif)) { - if (current_link_status) + if (current_link_status) { tcpip_callback_with_block((tcpip_callback_fn) netif_set_link_up, &thisif, 0); - else +#if LWIP_DHCP + dhcp_start(&thisif); +#endif + } + else { tcpip_callback_with_block((tcpip_callback_fn) netif_set_link_down, &thisif, 0); +#if LWIP_DHCP + dhcp_stop(&thisif); +#endif + } } } if (mask & FRAME_RECEIVED_ID) { @@ -296,7 +304,6 @@ THD_FUNCTION(lwip_thread, p) { } } } - return 0; } /** @} */ -- cgit v1.2.3