Malloc support for allocating to DRAM and/or IRAM.

This commit is contained in:
Our Air Quality 2018-03-01 15:18:39 +11:00
parent 9d57176d8e
commit cc4bd3c58f
18 changed files with 113 additions and 56 deletions

View file

@ -172,9 +172,8 @@ portBASE_TYPE xPortStartScheduler( void )
return pdTRUE;
}
/* Determine free heap size via libc sbrk function & mallinfo
/* Determine free heap size via mallinfo
sbrk gives total size in totally unallocated memory,
mallinfo.fordblks gives free space inside area dedicated to heap.
mallinfo is possibly non-portable, although glibc & newlib both support
@ -183,14 +182,7 @@ portBASE_TYPE xPortStartScheduler( void )
size_t xPortGetFreeHeapSize( void )
{
struct mallinfo mi = mallinfo();
uint32_t brk_val = (uint32_t) sbrk(0);
intptr_t sp = (intptr_t)xPortSupervisorStackPointer;
if (sp == 0) {
/* scheduler not started */
SP(sp);
}
return sp - brk_val + mi.fordblks;
return mi.fordblks;
}
void vPortEndScheduler( void )