use less memory in print functions
This commit is contained in:
parent
2e12e6a132
commit
afdbea7625
10
src/term.c
10
src/term.c
|
@ -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);
|
||||
|
||||
|
|
Loading…
Reference in New Issue