|
|
|
@ -2,6 +2,9 @@
|
|
|
|
|
|
|
|
|
|
#include "systemview.h"
|
|
|
|
|
#include <stdint.h>
|
|
|
|
|
#include <stddef.h>
|
|
|
|
|
#include <string.h>
|
|
|
|
|
#include "mpconfigport.h"
|
|
|
|
|
|
|
|
|
|
#include "SEGGER_SYSVIEW.h"
|
|
|
|
|
#include "SEGGER_SYSVIEW_Conf.h"
|
|
|
|
@ -94,4 +97,19 @@ void enable_systemview() {
|
|
|
|
|
SYSTICK->CSR = 0x07; // enable systick
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
size_t _write(int file, const void *ptr, size_t len);
|
|
|
|
|
|
|
|
|
|
size_t segger_print(const char *str, size_t len) {
|
|
|
|
|
#if SYSTEMVIEW_DEST_SYSTEMVIEW
|
|
|
|
|
static char str_copy[1024];
|
|
|
|
|
size_t copylen = len > 1023 ? 1023 : len;
|
|
|
|
|
memcpy(str_copy, str, copylen);
|
|
|
|
|
str_copy[copylen] = 0;
|
|
|
|
|
SEGGER_SYSVIEW_Print(str_copy);
|
|
|
|
|
return len;
|
|
|
|
|
#else
|
|
|
|
|
_write(0, str, len);
|
|
|
|
|
return len;
|
|
|
|
|
#endif
|
|
|
|
|
}
|
|
|
|
|
#endif
|
|
|
|
|