Atmel Software Framework

thirdparty/dlmalloc/examples/example2/main.c File Reference
#include "compiler.h"
#include "board.h"
#include "pm.h"
#include "power_clocks_lib.h"
#include "flashc.h"
#include "gpio.h"
#include "sdramc.h"
#include "dlmalloc.h"

Macros

#define FHSB_HZ   FOSC0
 
#define FPBA_HZ   FOSC0
 
#define MEM_SPACE_SIZE   0x2000000
 
#define SDRAM_START_ADDRESS   0xD0000000
 

Functions

static void init_exceptions (void)
 Initializes MCU exceptions. More...
 
static void init_heap (void)
 Initializes the heap. More...
 
static void init_hmatrix (void)
 Initializes the HSB bus matrix. More...
 
int main (void)
 Main function of the example memory manager. More...
 

Variables

 return
 

#define FHSB_HZ   FOSC0

Referenced by main().

#define FPBA_HZ   FOSC0
#define MEM_SPACE_SIZE   0x2000000

Referenced by main().

#define SDRAM_START_ADDRESS   0xD0000000

Referenced by main().

static void init_exceptions ( void  )
static

Initializes MCU exceptions.

References _evba, Enable_global_exception, and Set_system_register.

init_heap ( void  )
static

Initializes the heap.

References __heap_end__, and __heap_start__.

static void init_hmatrix ( void  )
static

Initializes the HSB bus matrix.

Low-level initialization routine called during startup, before the main function.

int main ( void  )

Main function of the example memory manager.

This example shows how memory can be allocated from different memory spaces. The default allocation will get memory from the internal SRAM. By using the "memory space" functionality of the memory manager it is possible to use other memory spaces as resources like an attached SDRAM.

References FHSB_HZ, FOSC0, MEM_SPACE_SIZE, PCL_OSC0, pcl_switch_to_osc(), SDRAM_START_ADDRESS, and sdramc_init().

return