mirror of
https://github.com/RIOT-OS/RIOT.git
synced 2025-12-25 06:23:53 +01:00
Merge pull request #2048 from haukepetersen/rem_ioarch
core/cpu/boards: removed fw_puts from RIOT
This commit is contained in:
commit
b4c3a06a8e
@ -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)
|
||||
{
|
||||
|
||||
@ -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);
|
||||
|
||||
@ -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 */
|
||||
/** @} */
|
||||
@ -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 */
|
||||
@ -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:
|
||||
|
||||
@ -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;
|
||||
}
|
||||
@ -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;
|
||||
}
|
||||
@ -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;
|
||||
}
|
||||
@ -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;
|
||||
}
|
||||
@ -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;
|
||||
}
|
||||
@ -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;
|
||||
}
|
||||
@ -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;
|
||||
}
|
||||
@ -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;
|
||||
}
|
||||
@ -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;
|
||||
}
|
||||
@ -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;
|
||||
}
|
||||
@ -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
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user