use less memory in print functions

This commit is contained in:
Babz 2021-09-12 21:47:50 +02:00
parent 2e12e6a132
commit afdbea7625
1 changed files with 5 additions and 5 deletions

View File

@ -146,7 +146,7 @@ int term_printf(const char *restrict format, ...) {
va_list argp;
va_start(argp, format);
char buf[1024];
char buf[256];
const int n = vsnprintf(buf, sizeof(buf), format, argp);
term_print(buf);
@ -159,7 +159,7 @@ int term_eprintf(const char *restrict format, ...) {
va_list argp;
va_start(argp, format);
char buf[1024];
char buf[256];
const int n = vsnprintf(buf, sizeof(buf), format, argp);
term_eprint(buf);
@ -170,8 +170,8 @@ int term_eprintf(const char *restrict format, ...) {
int term_kprint(const char *str) {
int t = rtc_ticks();
char kstr[256];
sprintf(kstr, "[%5d:%03d] %s\n", t / 128, t % 128, str);
char kstr[16];
sprintf(kstr, "[%5d.%03d] %s\n", t / 128, (t % 128) * 100 / 128, str);
const int ret = term_print_opt(kstr, C_RED | C_GREEN, C_BLACK);
@ -181,7 +181,7 @@ int term_kprintf(const char *restrict format, ...) {
va_list argp;
va_start(argp, format);
char buf[1024];
char buf[256];
const int n = vsnprintf(buf, sizeof(buf), format, argp);
term_kprint(buf);