3rd-party/segger-rtt:: allow for sys functions to be overwritten

This commit is contained in:
Dirk Helbig 2024-09-06 16:26:27 +02:00 committed by Matthias Ringwald
parent 29f2ca2149
commit c4d011a772

View File

@ -96,7 +96,7 @@ _ssize_t _write_r(struct _reent *r, int file, const void *ptr, size_t len);
* including stdout.
* Write data via RTT.
*/
_ssize_t _write(int file, const void *ptr, size_t len) {
_ssize_t __attribute__((weak)) _write(int file, const void *ptr, size_t len) {
(void) file; /* Not used, avoid warning */
SEGGER_RTT_Write(0, ptr, len);
return len;
@ -112,7 +112,7 @@ _ssize_t _write(int file, const void *ptr, size_t len) {
* including stdout.
* Write data via RTT.
*/
_ssize_t _write_r(struct _reent *r, int file, const void *ptr, size_t len) {
_ssize_t __attribute__((weak)) _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);