diff --git a/boards/msba2-common/drivers/msba2-uart0.c b/boards/msba2-common/drivers/msba2-uart0.c index 0e2504a121de1959904d2b51a877b27e6a2259c3..70e718584eac7b783eae0aa7b85d064a7aaa615e 100644 --- a/boards/msba2-common/drivers/msba2-uart0.c +++ b/boards/msba2-common/drivers/msba2-uart0.c @@ -150,7 +150,7 @@ void UART0_IRQHandler(void) VICVectAddr = 0; // Acknowledge Interrupt } -static inline int uart0_puts(char *astring, int length) +int uart0_puts(char *astring, int length) { /* while (queue_items == (QUEUESIZE-1)) {} ; U0IER = 0; @@ -176,11 +176,6 @@ static inline int uart0_puts(char *astring, int length) return length; } -int fw_puts(char *astring, int length) -{ - return uart0_puts(astring, length); -} - int bl_uart_init(void) { diff --git a/boards/redbee-econotag/drivers/redbee_uart.c b/boards/redbee-econotag/drivers/redbee_uart.c index 3b316d912a8c4a44adeaa5e38c4ee847e3931cac..31f9b3eaca095afd7c17d8f83607e4178e83b62d 100644 --- a/boards/redbee-econotag/drivers/redbee_uart.c +++ b/boards/redbee-econotag/drivers/redbee_uart.c @@ -144,7 +144,7 @@ void uart_init(volatile struct UART_struct *uart, uint32_t baudrate) } -static inline uint32_t uart0_puts(uint8_t *astring, uint32_t length) +int uart0_puts(uint8_t *astring, uint32_t length) { uint32_t i = 0; @@ -172,12 +172,6 @@ void stdio_flush(void) ITC->INTENABLEbits.UART2 = 1; } - -int fw_puts(char *astring, int length) -{ - return uart0_puts((uint8_t *) astring, (uint32_t) length); -} - void bl_uart_init(void) { uart_init(UART1, BAUTRATE_UART1); diff --git a/core/include/arch/io_arch.h b/core/include/arch/io_arch.h deleted file mode 100644 index 1e3cf98db50e1e2bb95af9ee427cb15519182f77..0000000000000000000000000000000000000000 --- a/core/include/arch/io_arch.h +++ /dev/null @@ -1,56 +0,0 @@ -/* - * Copyright (C) 2014 Freie Universität Berlin - * - * This file is subject to the terms and conditions of the GNU Lesser - * General Public License v2.1. See the file LICENSE in the top level - * directory for more details. - */ - -/** - * @ingroup core_arch - * @{ - * - * @file io_arch.h - * @brief Architecture dependent interface for the standard output - * - * @author Hauke Petersen <hauke.petersen@fu-berlin.de> - */ - -#ifndef __IO_ARCH_H -#define __IO_ARCH_H - -#ifdef __cplusplus - extern "C" { -#endif - -/** - * @brief Define mapping between kernel internal and arch interfaces - * - * This mapping is done for compatibility of existing platforms, - * new platforms should always use the *_arch_* interfaces. - * @{ - */ -#ifdef COREIF_NG -#define fw_puts io_arch_puts -#endif -/** @} */ - -/** - * @brief Write a number of characters to the std-out - * - * The stdout is on most platforms mapped to the UART0. This is however only a - * weak convention and must not be true for all platforms. - * - * @param[in] data the data that is to be written - * @param[in] count the number of bytes to write - * - * @return the number of bytes that were actually written - */ -int io_arch_puts(char *data, int count); - -#ifdef __cplusplus -} -#endif - -#endif /* __IO_ARCH_H */ -/** @} */ diff --git a/core/include/io.h b/core/include/io.h deleted file mode 100644 index 45100b6737ae2008c56e4ca0361e1b0703e42bfa..0000000000000000000000000000000000000000 --- a/core/include/io.h +++ /dev/null @@ -1,41 +0,0 @@ -/* - * Copyright (C) 2014 Freie Universität Berlin - * - * This file is subject to the terms and conditions of the GNU Lesser - * General Public License v2.1. See the file LICENSE in the top level - * directory for more details. - */ - -/** - * @defgroup core_io IO Interface - * @brief Interface to system io functions - * @ingroup core - * @{ - * - * @file io.h - * @brief Prototypes for system io functions - * - * @author Oliver Hahm <oliver.hahm@inria.fr> - */ - -#ifndef IO_H -#define IO_H - -#ifdef __cplusplus - extern "C" { -#endif - -/** - * @brief Firmware putstring implementation - * - * @param[in] data characters to be written - * @param[in] count number of characters to be written - */ -int fw_puts(char *data, int count); - -#ifdef __cplusplus -} -#endif - -/** @} */ -#endif /* IO_H */ diff --git a/cpu/arm_common/syscalls.c b/cpu/arm_common/syscalls.c index 2720aeb8a4c7c129ed516c879e0ef563248c327a..63ca355ec5fbf681db7c97a3b39ca16ff8c3d415 100644 --- a/cpu/arm_common/syscalls.c +++ b/cpu/arm_common/syscalls.c @@ -26,10 +26,10 @@ #include <sys/time.h> #include "arm_cpu.h" +#include "board_uart0.h" // core #include "kernel.h" #include "irq.h" -#include "io.h" #if defined MODULE_RTC #include "rtc.h" #elif defined MODULE_VTIMER @@ -147,7 +147,7 @@ int _write_r(struct _reent *r, int fd, const void *data, unsigned int count) switch(fd) { case STDOUT_FILENO: case STDERR_FILENO: - result = fw_puts((char *)data, count); + result = uart0_puts((char *)data, count); break; default: diff --git a/cpu/atmega2560/io_arch.c b/cpu/atmega2560/io_arch.c deleted file mode 100644 index 437bde8041668e9a3363d829c93900a3626b6828..0000000000000000000000000000000000000000 --- a/cpu/atmega2560/io_arch.c +++ /dev/null @@ -1,35 +0,0 @@ -/* - * Copyright (C) 2014 Freie Universität Berlin, Hinnerk van Bruinehsen - * - * This file is subject to the terms and conditions of the GNU Lesser - * General Public License v2.1. See the file LICENSE in the top level - * directory for more details. - */ - -/** - * @ingroup cpu_atmega2560 - * @{ - * - * @file io_arch.c - * @brief Implementation of the kernel's architecture dependent IO interface - * - * @author Hauke Petersen <hauke.petersen@fu-berlin.de> - * @author Hinnerk van Bruinehsen <h.v.bruinehsen@fu-berlin.de> - * - * @} - */ - -#include <stdio.h> - -#include "arch/io_arch.h" - -int io_arch_puts(char *data, int size) -{ - int i = 0; - - for (; i < size; i++) { - putchar(data[i]); - } - - return i; -} diff --git a/cpu/cc2538/io_arch.c b/cpu/cc2538/io_arch.c deleted file mode 100644 index a7a2732a0efcdbb08636c0ffbcee0a345f01745b..0000000000000000000000000000000000000000 --- a/cpu/cc2538/io_arch.c +++ /dev/null @@ -1,34 +0,0 @@ -/* - * Copyright (C) 2014 Freie Universität Berlin - * - * This file is subject to the terms and conditions of the GNU Lesser - * General Public License v2.1. See the file LICENSE in the top level - * directory for more details. - */ - -/** - * @ingroup cpu_cc2538 - * @{ - * - * @file io_arch.c - * @brief Implementation of the kernel's architecture dependent IO interface - * - * @author Hauke Petersen <hauke.petersen@fu-berlin.de> - * - * @} - */ - -#include <stdio.h> - -#include "arch/io_arch.h" - -int io_arch_puts(char *data, int size) -{ - int i = 0; - - for (; i < size; i++) { - putchar(data[i]); - } - - return i; -} diff --git a/cpu/lpc1768/io_arch.c b/cpu/lpc1768/io_arch.c deleted file mode 100644 index 0e4827b7cd3751da8807209d458eab499c4364f4..0000000000000000000000000000000000000000 --- a/cpu/lpc1768/io_arch.c +++ /dev/null @@ -1,32 +0,0 @@ -/* - * Copyright (C) 2014 Freie Universität Berlin - * - * This file is subject to the terms and conditions of the GNU Lesser General - * Public License v2.1. See the file LICENSE in the top level directory for more - * details. - */ - -/** - * @ingroup cpu_lpc1768 - * @{ - * - * @file - * @brief Implementation of the kernel's architecture dependent IO interface - * - * @author Hauke Petersen <hauke.petersen@fu-berlin.de> - * - * @} - */ - -#include "board.h" -#include "arch/io_arch.h" -#include "periph/uart.h" - -int io_arch_puts(char *data, int size) -{ - int i = 0; - for (; i < size; i++) { - uart_write_blocking(STDIO, data[i]); - } - return i; -} diff --git a/cpu/nrf51822/io_arch.c b/cpu/nrf51822/io_arch.c deleted file mode 100644 index 645ebd6bfbf33ce7408b0f2b7e186feafb1c3118..0000000000000000000000000000000000000000 --- a/cpu/nrf51822/io_arch.c +++ /dev/null @@ -1,31 +0,0 @@ -/* - * Copyright (C) 2014 Freie Universität Berlin - * - * This file is subject to the terms and conditions of the GNU Lesser General - * Public License v2.1. See the file LICENSE in the top level directory for more - * details. - */ - -/** - * @ingroup cpu_nrf51822 - * @{ - * - * @file io_arch.c - * @brief Implementation of the kernel's architecture dependent IO interface - * - * @author Hauke Petersen <hauke.petersen@fu-berlin.de> - * - * @} - */ - -#include "arch/io_arch.h" -#include "periph/uart.h" - -int io_arch_puts(char *data, int size) -{ - int i = 0; - for (; i < size; i++) { - uart_write_blocking(UART_0, data[i]); - } - return i; -} diff --git a/cpu/sam3x8e/io_arch.c b/cpu/sam3x8e/io_arch.c deleted file mode 100644 index ed63cb8da0fd32c818becc7491b29ac926b9ca13..0000000000000000000000000000000000000000 --- a/cpu/sam3x8e/io_arch.c +++ /dev/null @@ -1,32 +0,0 @@ -/* - * Copyright (C) 2014 Freie Universität Berlin - * - * This file is subject to the terms and conditions of the GNU Lesser - * General Public License v2.1. See the file LICENSE in the top level - * directory for more details. - */ - -/** - * @ingroup cpu_sam3x8e - * @{ - * - * @file io_arch.c - * @brief Implementation of the kernel's architecture dependent IO interface - * - * @author Hauke Petersen <hauke.petersen@fu-berlin.de> - * - * @} - */ - -#include <stdio.h> - -#include "arch/io_arch.h" - -int io_arch_puts(char *data, int size) -{ - int i = 0; - for (; i < size; i++) { - putchar(data[i]); - } - return i; -} diff --git a/cpu/samd21/io_arch.c b/cpu/samd21/io_arch.c deleted file mode 100644 index b3ce2c34fbdc5853f941d937d609267f960a1f74..0000000000000000000000000000000000000000 --- a/cpu/samd21/io_arch.c +++ /dev/null @@ -1,32 +0,0 @@ -/* - * Copyright (C) 2014 Freie Universität Berlin - * - * This file is subject to the terms and conditions of the GNU Lesser - * General Public License v2.1. See the file LICENSE in the top level - * directory for more details. - */ - -/** - * @ingroup cpu_samd21 - * @{ - * - * @file io_arch.c - * @brief Implementation of the kernel's architecture dependent IO interface - * - * @author Thomas Eichinger <thomas.eichinger@fu-berlin.de> - * - * @} - */ - -#include <stdio.h> - -#include "arch/io_arch.h" - -int io_arch_puts(char *data, int size) -{ - int i = 0; - for (; i < size; i++) { - putchar(data[i]); - } - return i; -} diff --git a/cpu/stm32f0/io_arch.c b/cpu/stm32f0/io_arch.c deleted file mode 100644 index a777191398cfb135ec015c88a45b286c50607da6..0000000000000000000000000000000000000000 --- a/cpu/stm32f0/io_arch.c +++ /dev/null @@ -1,33 +0,0 @@ -/* - * Copyright (C) 2014 Freie Universität Berlin - * - * This file is subject to the terms and conditions of the GNU Lesser General - * Public License v2.1. See the file LICENSE in the top level directory for more - * details. - */ - -/** - * @ingroup cpu_stm32f0 - * @{ - * - * @file - * @brief Implementation of the kernel's architecture dependent IO interface - * - * @author Hauke Petersen <hauke.petersen@fu-berlin.de> - * - * @} - */ - -#include "board.h" -#include "arch/io_arch.h" -#include "periph/uart.h" - - -int io_arch_puts(char *data, int size) -{ - int i = 0; - for (; i < size; i++) { - uart_write_blocking(STDIO, data[i]); - } - return i; -} diff --git a/cpu/stm32f1/io_arch.c b/cpu/stm32f1/io_arch.c deleted file mode 100644 index a0ef4daf88216984310e28c6e3a455c2d378fc76..0000000000000000000000000000000000000000 --- a/cpu/stm32f1/io_arch.c +++ /dev/null @@ -1,32 +0,0 @@ -/* - * Copyright (C) 2014 Freie Universität Berlin - * - * This file is subject to the terms and conditions of the GNU Lesser General - * Public License v2.1. See the file LICENSE in the top level directory for more - * details. - */ - -/** - * @ingroup cpu_stm32f1 - * @{ - * - * @file io_arch.c - * @brief Implementation of the kernel's architecture dependent IO interface - * - * @author Hauke Petersen <hauke.petersen@fu-berlin.de> - * - * @} - */ - -#include <stdio.h> - -#include "arch/io_arch.h" - -int io_arch_puts(char *data, int size) -{ - int i = 0; - for (; i < size; i++) { - putchar(data[i]); - } - return i; -} diff --git a/cpu/stm32f3/io_arch.c b/cpu/stm32f3/io_arch.c deleted file mode 100644 index b03d390a3df951b45ba2a572361fc338b1b3127a..0000000000000000000000000000000000000000 --- a/cpu/stm32f3/io_arch.c +++ /dev/null @@ -1,33 +0,0 @@ -/* - * Copyright (C) 2014 Freie Universität Berlin - * - * This file is subject to the terms and conditions of the GNU Lesser General - * Public License v2.1. See the file LICENSE in the top level directory for more - * details. - */ - -/** - * @ingroup cpu_stm32f3 - * @{ - * - * @file - * @brief Implementation of the kernel's architecture dependent IO interface - * - * @author Hauke Petersen <hauke.petersen@fu-berlin.de> - * - * @} - */ - -#include "board.h" -#include "arch/io_arch.h" -#include "periph/uart.h" - - -int io_arch_puts(char *data, int size) -{ - int i = 0; - for (; i < size; i++) { - uart_write_blocking(STDIO, data[i]); - } - return i; -} diff --git a/cpu/stm32f4/io_arch.c b/cpu/stm32f4/io_arch.c deleted file mode 100644 index 0e80f82b1dea44a99a996caea2f323f9b66b51d2..0000000000000000000000000000000000000000 --- a/cpu/stm32f4/io_arch.c +++ /dev/null @@ -1,31 +0,0 @@ -/* - * Copyright (C) 2014 Freie Universität Berlin - * - * This file is subject to the terms and conditions of the GNU Lesser General - * Public License v2.1. See the file LICENSE in the top level directory for more - * details. - */ - -/** - * @ingroup cpu_stm32f4 - * @{ - * - * @file - * @brief Implementation of the kernel's architecture dependent IO interface - * - * @author Hauke Petersen <hauke.petersen@fu-berlin.de> - * - * @} - */ - -#include "board.h" -#include "arch/io_arch.h" -#include "periph/uart.h" - -int io_arch_puts(char *data, int size) -{ - for (int i = 0; i < size; i++) { - uart_write_blocking(STDIO, data[i]); - } - return size; -} diff --git a/sys/include/board_uart0.h b/sys/include/board_uart0.h index 134c6503c04a38b6fc5e3a812cdadc0e264f9f24..c52b7a659abcda7c1bae9e4a8fd7708985a56de6 100644 --- a/sys/include/board_uart0.h +++ b/sys/include/board_uart0.h @@ -35,6 +35,7 @@ void uart0_notify_thread(void); int uart0_readc(void); void uart0_putc(int c); +int uart0_puts(char *astring, int length); #ifdef __cplusplus }