aboutsummaryrefslogtreecommitdiffstats
path: root/heap.c
diff options
context:
space:
mode:
authorClyne Sullivan <tullivan99@gmail.com>2018-01-04 11:47:43 -0500
committerClyne Sullivan <tullivan99@gmail.com>2018-01-04 11:47:43 -0500
commite5ae7f10f3e144f4a08ee7a66b4105a5aa86e6e7 (patch)
treeae084444f0ea8c91f9b29683f26e09699f11d3f3 /heap.c
parent058c283919424ef8b4425cdf74739535dd1d8072 (diff)
initrd, lcd, file cleanup
Diffstat (limited to 'heap.c')
-rw-r--r--heap.c38
1 files changed, 0 insertions, 38 deletions
diff --git a/heap.c b/heap.c
deleted file mode 100644
index 0433a1f..0000000
--- a/heap.c
+++ /dev/null
@@ -1,38 +0,0 @@
-#include <heap.h>
-#include <stm32l476xx.h>
-
-#define RAM_END 0x20018000
-
-//extern void *end;
-//extern uint32_t _total_ram;
-static uint32_t offset = 0;
-
-__attribute__ ((section(".data")))
-uint8_t heap[8192];
-void *end = heap;
-
-void heap_init(void)
-{
- // what to do...
-}
-
-uint32_t heap_available(void)
-{
- return 0;// return _total_ram - offset;
-}
-
-void *hmalloc(uint32_t size)
-{
- void *alloc = end + offset;
- offset += size;
- return alloc;
-}
-
-void *hcalloc(uint32_t count, uint32_t size)
-{
- uint32_t total = count * size;
- void *alloc = hmalloc(total);
- for (uint32_t i = 0; i < total; i++)
- ((uint8_t *)alloc)[i] = 0;
- return alloc;
-}