aboutsummaryrefslogtreecommitdiffstats
path: root/os/various/lwip_bindings
diff options
context:
space:
mode:
authorGiovanni Di Sirio <gdisirio@gmail.com>2015-04-05 10:14:51 +0000
committerGiovanni Di Sirio <gdisirio@gmail.com>2015-04-05 10:14:51 +0000
commit2381a7019072f8f6983f323a2bc0913ac115aed3 (patch)
tree86418ad601fa8bd20549736d93ea4b4fc46b537d /os/various/lwip_bindings
parent60d63e9970553058597fd78941a7fa0ecb4f374b (diff)
downloadChibiOS-2381a7019072f8f6983f323a2bc0913ac115aed3.tar.gz
ChibiOS-2381a7019072f8f6983f323a2bc0913ac115aed3.tar.bz2
ChibiOS-2381a7019072f8f6983f323a2bc0913ac115aed3.zip
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
Diffstat (limited to 'os/various/lwip_bindings')
-rw-r--r--os/various/lwip_bindings/lwipthread.c15
1 files changed, 11 insertions, 4 deletions
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(&ETHD1);
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;
}
/** @} */