-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy pathram.h
52 lines (41 loc) · 1.18 KB
/
ram.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
/**
@file hardware/ram.h
@brief Memory Utilities and safe free for AVR.
@par Edit History
- [1.0] [Mike Gore] Initial revision of file.
@par Copyright © 2014-2020 Mike Gore, Inc. All rights reserved.
*/
#ifndef _RAM_H_
#define _RAM_H_
#undef malloc
#undef calloc
#undef free
extern char * __brkval;
extern char * __malloc_heap_start;
extern char * __malloc_heap_end;
extern size_t __malloc_margin;
extern void *__stack;
#ifdef AVR
extern unsigned int __heap_start;
extern unsigned int __heap_end;
extern unsigned int __bss_start;
extern unsigned int __bss_end;
extern unsigned int __data_start;
extern unsigned int __data_end;
#endif
#ifdef ESP8266
extern unsigned long int __heap_start;
extern unsigned long int __heap_end;
extern unsigned long int __bss_start;
extern unsigned long int __bss_end;
extern unsigned long int __data_start;
extern unsigned long int __data_end;
#endif
/* ram.c */
size_t heaptop ( void );
size_t freeRam ( void );
void PrintFree ( void );
void *safecalloc ( int size , int elements );
void *safemalloc ( size_t size );
void safefree ( void *p );
#endif //_RAM_H_