From 5fcae86be351f64aa7bfceadb3172c73eb84ad62 Mon Sep 17 00:00:00 2001 From: salvopitru Date: Wed, 19 Jan 2011 09:13:06 +0000 Subject: [PATCH] Now it is putchar that has to be redefined (instead of __io_putchar), like other platforms. --- cpu/stm32w108/dev/uart1-putchar.c | 14 +++++++------- tools/stm32w/uip6_bridge/uip6-bridge-tap.c | 12 ++++-------- 2 files changed, 11 insertions(+), 15 deletions(-) diff --git a/cpu/stm32w108/dev/uart1-putchar.c b/cpu/stm32w108/dev/uart1-putchar.c index b0da0ac15..323e3d476 100644 --- a/cpu/stm32w108/dev/uart1-putchar.c +++ b/cpu/stm32w108/dev/uart1-putchar.c @@ -18,19 +18,19 @@ # endif #endif -void __io_putchar(char c) -{ - uart1_writeb(c); -} - #undef putchar -int putchar(int c) +int __attribute__(( weak )) putchar(int c) { - __io_putchar((char) c); + uart1_writeb(c); return c; } +void __io_putchar(char c) +{ + putchar(c); +} + size_t _write(int handle, const unsigned char * buffer, size_t size) { size_t nChars = 0; diff --git a/tools/stm32w/uip6_bridge/uip6-bridge-tap.c b/tools/stm32w/uip6_bridge/uip6-bridge-tap.c index 4a933fd1f..02366972b 100644 --- a/tools/stm32w/uip6_bridge/uip6-bridge-tap.c +++ b/tools/stm32w/uip6_bridge/uip6-bridge-tap.c @@ -26,7 +26,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $Id: uip6-bridge-tap.c,v 1.1 2010/10/25 10:42:41 salvopitru Exp $ + * $Id: uip6-bridge-tap.c,v 1.2 2011/01/19 09:13:06 salvopitru Exp $ * */ @@ -140,11 +140,9 @@ PROCESS_THREAD(uip6_bridge, ev, data) } /*---------------------------------------------------------------------------*/ -#ifdef __ICCARM__ + +#undef putchar int putchar(int c) -#else -void __io_putchar(char c) -#endif { #define SLIP_END 0300 static char debug_frame = 0; @@ -166,8 +164,6 @@ void __io_putchar(char c) debug_frame = 0; } -#ifdef __ICCARM__ - return c; -#endif + return c; } /*---------------------------------------------------------------------------*/