diff --git a/boards/msba2-common/drivers/msba2-uart0.c b/boards/msba2-common/drivers/msba2-uart0.c index 0e2504a12..70e718584 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 3b316d912..31f9b3eac 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 1e3cf98db..000000000 --- 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 - */ - -#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 45100b673..000000000 --- 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 - */ - -#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 2720aeb8a..63ca355ec 100644 --- a/cpu/arm_common/syscalls.c +++ b/cpu/arm_common/syscalls.c @@ -26,10 +26,10 @@ #include #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 437bde804..000000000 --- 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 - * @author Hinnerk van Bruinehsen - * - * @} - */ - -#include - -#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 a7a2732a0..000000000 --- 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 - * - * @} - */ - -#include - -#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 0e4827b7c..000000000 --- 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 - * - * @} - */ - -#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 645ebd6bf..000000000 --- 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 - * - * @} - */ - -#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 ed63cb8da..000000000 --- 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 - * - * @} - */ - -#include - -#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 b3ce2c34f..000000000 --- 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 - * - * @} - */ - -#include - -#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 a77719139..000000000 --- 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 - * - * @} - */ - -#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 a0ef4daf8..000000000 --- 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 - * - * @} - */ - -#include - -#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 b03d390a3..000000000 --- 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 - * - * @} - */ - -#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 0e80f82b1..000000000 --- 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 - * - * @} - */ - -#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 134c6503c..c52b7a659 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 }