From 822c68c74ebc3ac3694f87d516f1e91f2ce1d0fe Mon Sep 17 00:00:00 2001 From: Josh Rahm Date: Sat, 21 Nov 2020 21:57:14 -0700 Subject: Fix mem.c to use the address of DATA_SEGMENT_START instead of the value --- 02-usart/include/mem.h | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to '02-usart/include/mem.h') diff --git a/02-usart/include/mem.h b/02-usart/include/mem.h index f376e7d..d150744 100644 --- a/02-usart/include/mem.h +++ b/02-usart/include/mem.h @@ -4,8 +4,11 @@ #include "arch.h" #include +#define DATA_SEGMENT_STOP_ADDR ((uint8_t*) &DATA_SEGMENT_STOP) +#define DATA_SEGMENT_START_ADDR ((uint8_t*) &DATA_SEGMENT_START) + #define MAX_HEAP_SIZE \ - ((16384 - (DATA_SEGMENT_STOP - DATA_SEGMENT_START)) / 4 * 4) + ((16384 - (DATA_SEGMENT_STOP_ADDR - DATA_SEGMENT_START_ADDR)) / 4 * 4) /* allocates memory on the head, which is stored in sram2 */ void* halloc(size_t n); -- cgit