diff --git a/cpu/msp430-common/include/sys/types.h b/cpu/msp430-common/include/sys/types.h new file mode 100644 index 0000000000000000000000000000000000000000..d50105720c03a094e2736d918fc34c4624efa4a5 --- /dev/null +++ b/cpu/msp430-common/include/sys/types.h @@ -0,0 +1,22 @@ +/* + * Copyright (C) 2014 INRIA + * + * 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. + */ + +#ifndef SYS_TYPES_H_ +#define SYS_TYPES_H_ + +#include "msp430_types.h" + +#ifdef __cplusplus +extern "C" { +#endif + +#ifdef __cplusplus +} +#endif + +#endif /* SYS_TYPES_H_ */ diff --git a/cpu/msp430fxyz/msp430_stdio.c b/cpu/msp430fxyz/msp430_stdio.c index 17619dd1d5d30b41c567c0e2a9eea85859ad6259..31f783a669493c85aadf6a1a2bd5f4b20a4f85f6 100644 --- a/cpu/msp430fxyz/msp430_stdio.c +++ b/cpu/msp430fxyz/msp430_stdio.c @@ -18,6 +18,9 @@ * @} */ +#include <sys/types.h> +#include <unistd.h> + #include "uart_stdio.h" /** @@ -37,6 +40,18 @@ int getchar(void) int putchar(int c) { char _c = c; - uart_stdio_write(&_c, 1); - return 1; + return uart_stdio_write(&_c, 1); +} + +/** + * @brief Write nbyte characters to the STDIO UART interface + */ +ssize_t write(int fildes, const void *buf, size_t nbyte) +{ + if (fildes == STDOUT_FILENO) { + return uart_stdio_write(buf, nbyte); + } + else { + return -1; + } }