diff --git a/3rd-party/segger-rtt/SEGGER_RTT_Syscalls_GCC.c b/3rd-party/segger-rtt/SEGGER_RTT_Syscalls_GCC.c index 27292de50..c573ed764 100644 --- a/3rd-party/segger-rtt/SEGGER_RTT_Syscalls_GCC.c +++ b/3rd-party/segger-rtt/SEGGER_RTT_Syscalls_GCC.c @@ -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 // 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 *************************************************/