diff options
author | gdisirio <gdisirio@35acf78f-673a-0410-8e92-d51de3d6d3f4> | 2012-02-29 14:37:49 +0000 |
---|---|---|
committer | gdisirio <gdisirio@35acf78f-673a-0410-8e92-d51de3d6d3f4> | 2012-02-29 14:37:49 +0000 |
commit | 7664f48ad0bb5de53c5fd20dc0c061b936b13638 (patch) | |
tree | 6934bec5b53f4ccc94982d97eec52579082a76e9 /os/various | |
parent | 737aa2d9dd365f9a88803a40a6098ec93df2d42a (diff) | |
download | ChibiOS-7664f48ad0bb5de53c5fd20dc0c061b936b13638.tar.gz ChibiOS-7664f48ad0bb5de53c5fd20dc0c061b936b13638.tar.bz2 ChibiOS-7664f48ad0bb5de53c5fd20dc0c061b936b13638.zip |
git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@4000 35acf78f-673a-0410-8e92-d51de3d6d3f4
Diffstat (limited to 'os/various')
-rw-r--r-- | os/various/lwip_bindings/lwipthread.c | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/os/various/lwip_bindings/lwipthread.c b/os/various/lwip_bindings/lwipthread.c index 31d9caad4..22cdb7066 100644 --- a/os/various/lwip_bindings/lwipthread.c +++ b/os/various/lwip_bindings/lwipthread.c @@ -275,8 +275,17 @@ msg_t lwip_thread(void *p) { while (TRUE) {
eventmask_t mask = chEvtWaitAny(ALL_EVENTS);
- if (mask & PERIODIC_TIMER_ID)
- (void)macPollLinkStatus(ÐD1);
+ if (mask & PERIODIC_TIMER_ID) {
+ bool_t current_link_status = macPollLinkStatus(ÐD1);
+ if (current_link_status != netif_is_link_up(&thisif)) {
+ if (current_link_status)
+ tcpip_callback_with_block((tcpip_callback_fn) netif_set_link_up,
+ &thisif, 0);
+ else
+ tcpip_callback_with_block((tcpip_callback_fn) netif_set_link_down,
+ &thisif, 0);
+ }
+ }
if (mask & FRAME_RECEIVED_ID) {
struct pbuf *p;
while ((p = low_level_input(&thisif)) != NULL) {
|