[En-Nut-Discussion] Question about NutInitHeap()...

Michael Jones Michael.Jones at l-s-b.de
Fri Jun 9 21:54:08 CEST 2006


Hello everybody,

Our Nut/Os mega128 board has an extra 16Kbytes above the Banking area that I
would like to use. When checking the Heap functions I found NutHeapAdd(..)
that would, if added to the application setup code, just do fine.

But when I searched for further references to NutHeapAdd(..) I found the
comment below and I am now wondering if this is specific to the function of
the NutInitHeap() or is this a reference to a problem with NutHeapAdd(..)?

Anybody out there this some insight?

Cu,
Michael


void NutInitHeap()
{
#if defined (NUTMEM_STACKHEAP) /* Stack resides in internal memory */
    NutStackAdd((void *) NUTMEM_START, NUTMEM_STACKHEAP);
#endif
    /* Then add the remaining RAM to heap.
     *
     * 20.Aug.2004 haraldkipp: This had been messed up somehow. It's nice to
have
     * one continuous heap area, but we lost the ability to have systems
with
     * a gap between internal and external RAM.
     */
    if ((u_short)NUTMEM_END - (u_short) (&__heap_start) > 384) {
        NutHeapAdd(&__heap_start, (u_short) NUTMEM_END - 256 - (u_short)
(&__heap_start));
    }
}





More information about the En-Nut-Discussion mailing list