lwmem/docs/examples_src/example_regions_definitions.c

18 lines
519 B
C
Raw Normal View History

2019-09-29 10:09:22 +02:00
#include "lwmem/lwmem.h"
/*
* \brief Define regions for memory manager
*/
static
lwmem_region_t regions[] = {
/* Set start address and size of each region */
{ (void *)0x10000000, 0x00001000 },
{ (void *)0xA0000000, 0x00008000 },
{ (void *)0xC0000000, 0x00008000 },
};
/* Later in the initialization process */
/* Assign regions for manager */
2020-02-02 18:57:59 +01:00
lwmem_assignmem(regions, sizeof(regions) / sizeof(regions[0]));
/* or */
lwmem_assignmem_ex(NULL, regions, sizeof(regions) / sizeof(regions[0]));