X-Git-Url: https://robinkrens.nl/gitweb/?a=blobdiff_plain;f=sysinfo.c;h=2792f1423e47000f0e2f4c8dd9b16642b40b7c42;hb=43b1749173f70bdf67884d920b93f6a5b1f19a1d;hp=bd5d1bb45d778da249f7f83548e33caa2150a647;hpb=811b81ae2d0cc24f6c8203e81d2e9a00a98d936b;p=cortex-from-scratch diff --git a/sysinfo.c b/sysinfo.c index bd5d1bb..2792f14 100644 --- a/sysinfo.c +++ b/sysinfo.c @@ -2,7 +2,9 @@ * * $LOG$ * 2019/7/20 - ROBIN KRENS - * Initial version + * Initial version + * Display some system information, calculate + * the amount of SRAM available * * */ @@ -50,18 +52,12 @@ void sysinfo() { uint32_t current_stack = get_msp(); uint32_t stack_usage = (SRAM_OFFSET + SRAM_SIZE) - current_stack; - uint32_t data_bss = &_endofbss - SRAM_OFFSET; + uint32_t data_bss = (uint32_t) &_endofbss - SRAM_OFFSET; uint32_t mem_free = SRAM_SIZE - stack_usage - data_bss; printf("# TOTAL MEMORY: %#x\n", SRAM_SIZE); -// cputs(regtohex(SRAM_SIZE)); -// cputchar('\n'); printf("# FREE MEMORY: %#x\n", mem_free); -// cputs(regtohex(mem_free)); -// cputchar('\n'); printf("# STACK USAGE: %#x\n", stack_usage); -// cputs(regtohex(stack_usage)); -// cputchar('\n'); }