From 119291d083deb73e9bc053e38ff6d6482b5f38ab Mon Sep 17 00:00:00 2001 From: Jens Dede Date: Mon, 2 May 2016 19:13:26 +0200 Subject: [PATCH 1/3] Fix putchar include when using IPv4 --- cpu/msp430/dev/uart0-putchar.c | 5 ++++- cpu/msp430/dev/uart1-putchar.c | 3 +++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/cpu/msp430/dev/uart0-putchar.c b/cpu/msp430/dev/uart0-putchar.c index 819f627d2..c9fa974a6 100644 --- a/cpu/msp430/dev/uart0-putchar.c +++ b/cpu/msp430/dev/uart0-putchar.c @@ -1,9 +1,12 @@ -#include "dev/uart0.h" #include +#include "dev/uart0.h" +#ifndef NETSTACK_CONF_WITH_IPV4 +/* In case of IPv4: putchar() is defined by the SLIP driver */ int putchar(int c) { uart0_writeb((char)c); return c; } +#endif /* NETSTACK_CONF_WITH_IPV4 */ diff --git a/cpu/msp430/dev/uart1-putchar.c b/cpu/msp430/dev/uart1-putchar.c index 3d7f65c7b..c966b920d 100644 --- a/cpu/msp430/dev/uart1-putchar.c +++ b/cpu/msp430/dev/uart1-putchar.c @@ -1,9 +1,12 @@ #include #include "dev/uart1.h" +#ifndef NETSTACK_CONF_WITH_IPV4 +/* In case of IPv4: putchar() is defined by the SLIP driver */ int putchar(int c) { uart1_writeb((char)c); return c; } +#endif /* NETSTACK_CONF_WITH_IPV4 */ From 59afae85e201701f5450a83bd0ceb4b191665203 Mon Sep 17 00:00:00 2001 From: Jens Dede Date: Mon, 2 May 2016 22:34:58 +0200 Subject: [PATCH 2/3] Use if instead of ifdef. Is more contiki standard-compliant --- cpu/msp430/dev/uart0-putchar.c | 4 ++-- cpu/msp430/dev/uart1-putchar.c | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/cpu/msp430/dev/uart0-putchar.c b/cpu/msp430/dev/uart0-putchar.c index c9fa974a6..e797e8b28 100644 --- a/cpu/msp430/dev/uart0-putchar.c +++ b/cpu/msp430/dev/uart0-putchar.c @@ -1,7 +1,7 @@ #include #include "dev/uart0.h" -#ifndef NETSTACK_CONF_WITH_IPV4 +#if !NETSTACK_CONF_WITH_IPV4 /* In case of IPv4: putchar() is defined by the SLIP driver */ int putchar(int c) @@ -9,4 +9,4 @@ putchar(int c) uart0_writeb((char)c); return c; } -#endif /* NETSTACK_CONF_WITH_IPV4 */ +#endif /* ! NETSTACK_CONF_WITH_IPV4 */ diff --git a/cpu/msp430/dev/uart1-putchar.c b/cpu/msp430/dev/uart1-putchar.c index c966b920d..e005ff255 100644 --- a/cpu/msp430/dev/uart1-putchar.c +++ b/cpu/msp430/dev/uart1-putchar.c @@ -1,7 +1,7 @@ #include #include "dev/uart1.h" -#ifndef NETSTACK_CONF_WITH_IPV4 +#if !NETSTACK_CONF_WITH_IPV4 /* In case of IPv4: putchar() is defined by the SLIP driver */ int putchar(int c) @@ -9,4 +9,4 @@ putchar(int c) uart1_writeb((char)c); return c; } -#endif /* NETSTACK_CONF_WITH_IPV4 */ +#endif /* ! NETSTACK_CONF_WITH_IPV4 */ From 7f80b1ad5718ce3615efbe5458e67d8b9d355608 Mon Sep 17 00:00:00 2001 From: Jens Dede Date: Wed, 4 May 2016 11:12:37 +0200 Subject: [PATCH 3/3] Remove include of stdio.h --- cpu/msp430/dev/uart0-putchar.c | 1 - cpu/msp430/dev/uart1-putchar.c | 1 - 2 files changed, 2 deletions(-) diff --git a/cpu/msp430/dev/uart0-putchar.c b/cpu/msp430/dev/uart0-putchar.c index e797e8b28..96f24abf0 100644 --- a/cpu/msp430/dev/uart0-putchar.c +++ b/cpu/msp430/dev/uart0-putchar.c @@ -1,4 +1,3 @@ -#include #include "dev/uart0.h" #if !NETSTACK_CONF_WITH_IPV4 diff --git a/cpu/msp430/dev/uart1-putchar.c b/cpu/msp430/dev/uart1-putchar.c index e005ff255..5cb631190 100644 --- a/cpu/msp430/dev/uart1-putchar.c +++ b/cpu/msp430/dev/uart1-putchar.c @@ -1,4 +1,3 @@ -#include #include "dev/uart1.h" #if !NETSTACK_CONF_WITH_IPV4