Skip to content
Snippets Groups Projects
Commit 04bc4089 authored by Kaspar Schleiser's avatar Kaspar Schleiser
Browse files

cpu: msp430: add write() + needed libc header fixes

parent 157f8c93
No related branches found
No related tags found
No related merge requests found
/*
* 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_ */
......@@ -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;
}
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment