segger-rtt: fix compile for arm-none-eabi-gcc

This commit is contained in:
Matthias Ringwald 2018-01-12 16:37:05 +01:00
parent 7dc86dfd35
commit dd13ed293d

View File

@ -59,12 +59,16 @@ Purpose : Low-level functions for using printf() via RTT in GCC.
Revision: $Rev: 4351 $
----------------------------------------------------------------------
*/
#include "btstack_config.h"
#ifdef ENABLE_SEGGER_RTT
#if (defined __GNUC__) && !(defined __SES_ARM) && !(defined __CROSSWORKS_ARM)
#include <reent.h> // required for _write_r
#include "SEGGER_RTT.h"
/*********************************************************************
*
* Types
@ -84,7 +88,7 @@ struct _reent;
**********************************************************************
*/
int _write(int file, char *ptr, int len);
int _write_r(struct _reent *r, int file, const void *ptr, int len);
_ssize_t _write_r(struct _reent *r, int file, const void *ptr, size_t len);
/*********************************************************************
*
@ -119,12 +123,14 @@ int _write(int file, char *ptr, int len) {
* including stdout.
* Write data via RTT.
*/
int _write_r(struct _reent *r, int file, const void *ptr, int len) {
_ssize_t _write_r(struct _reent *r, int file, const void *ptr, size_t len) {
(void) file; /* Not used, avoid warning */
(void) r; /* Not used, avoid warning */
SEGGER_RTT_Write(0, ptr, len);
return len;
}
#endif
#endif
/****** End Of File *************************************************/