From d52256b60fe0c5b4990d742ec2655fddd9d77e19 Mon Sep 17 00:00:00 2001 From: Palmer Dabbelt Date: Mon, 12 Jun 2017 09:18:05 -0700 Subject: Call puts instead of printf when printing constants printf doesn't fit in the scratchpad, but since there's really no reason to call it on constant strings it can be replaced with puts. With this change, the "hello" example fits in the scratchpad. --- bsp/env/coreplexip-e31-arty/init.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'bsp/env') diff --git a/bsp/env/coreplexip-e31-arty/init.c b/bsp/env/coreplexip-e31-arty/init.c index 05b2b3e..84ae09e 100644 --- a/bsp/env/coreplexip-e31-arty/init.c +++ b/bsp/env/coreplexip-e31-arty/init.c @@ -6,12 +6,16 @@ #include "platform.h" #include "encoding.h" +#define CPU_FREQ 65000000 +#define XSTR(x) #x +#define STR(x) XSTR(x) + extern int main(int argc, char** argv); extern void trap_entry(); static unsigned long get_cpu_freq() { - return 65000000; + return CPU_FREQ; } unsigned long get_timer_freq() @@ -83,7 +87,7 @@ void _init() #ifndef NO_INIT uart_init(115200); - printf("core freq at %d Hz\n", get_cpu_freq()); + puts("core freq at " STR(CPU_FREQ) " Hz\n"); write_csr(mtvec, &trap_entry); #endif -- cgit v1.2.1-18-gbd029