sipo
Ondřej Hruška 6 years ago
parent 69443613fc
commit 0ef1134aa0
Signed by: MightyPork
GPG Key ID: 2C5FD5035250423D
  1. 2
      debug.c
  2. 1
      debug.h
  3. 3
      platform/debug_uart.c
  4. 4
      platform/plat_compat.h
  5. 11
      utils/stacksmon.c

@ -23,7 +23,7 @@ void _DO_PRINTF(const char *format, ...)
len = DBG_BUF_LEN-1;
}
_write_r(NULL, 2, dbg_buf, (size_t) len);
debug_write(dbg_buf, (uint16_t) len);
va_end(args);
}

@ -55,6 +55,7 @@ static inline void PUTCHAR(char ch)
#define PRINTF(format, ...) do {} while (0)
#define PUTSN(string, len) do {} while (0)
#define PUTS(string) do {} while (0)
#define PUTNL() do {} while (0)
#define PUTCHAR(ch) do {} while (0)
#endif

@ -117,8 +117,7 @@ void debug_write(const char *buf, uint16_t len)
/** Debug print, used by debug / newlib */
ssize_t _write_r(struct _reent *rptr, int fd, const void *buf, size_t len)
{
(void)rptr;
debug_write(buf, len);
trap("Use of newlib printf");
return len;
}

@ -12,10 +12,10 @@
#if DISABLE_MSC
#define TSK_STACK_MAIN 100 // without MSC the stack usage is significantly lower
#else
#define TSK_STACK_MAIN 170
#define TSK_STACK_MAIN 160
#endif
#define TSK_STACK_MSG 220 // TF message handler task stack size (all unit commands run on this thread)
#define TSK_STACK_MSG 180 // TF message handler task stack size (all unit commands run on this thread)
#define BULK_READ_BUF_LEN 256 // Buffer for TF bulk reads
#define UNIT_TMP_LEN 512 // Buffer for internal unit operations

@ -56,18 +56,19 @@ void stackmon_dump(void)
uint32_t words = ((stack->len-free)>>2)+1;
if (words>stack->len>>2) words=stack->len>>2;
PRINTF(" Used: \033[33m%"PRIu32" / %"PRIu32" bytes\033[m (\033[33m%"PRIu32" / %"PRIu32" words\033[m) ~ \033[33m%"PRIu32" %%\033[m\r\n",
PRINTF(" Used: \033[33m%"PRIu32" / %"PRIu32" bytes\033[m (\033[33m%"PRIu32" / %"PRIu32" words\033[m)",
(stack->len-free),
stack->len,
words,
stack->len>>2,
(stack->len-free)*100/stack->len
stack->len>>2
);
PRINTF(" ~ \033[33m%"PRIu32" %%\033[m\r\n",
(stack->len-free)*100/stack->len);
}
PUTS("\033[36m>> MSG+JOB QUEUE\033[m\r\n");
PRINTF(" Used slots: \033[33m%"PRIu32"\033[m\r\n",
msgQueHighWaterMark);
PRINTF(" Used slots: \033[33m%"PRIu32" / %d\033[m\r\n",
msgQueHighWaterMark, RX_QUE_CAPACITY);
PRINTF("\033[1m---------------------------\033[m\r\n\r\n");
}

Loading…
Cancel
Save