2023-09-09 12:58:57 +08:00
|
|
|
|
|
|
|
|
#define HEAP_SIZE 4
|
2023-09-24 19:26:05 +08:00
|
|
|
#define STACK_SIZE 1024 * 3
|
2023-09-09 12:58:57 +08:00
|
|
|
|
|
|
|
|
#if defined(__CC_ARM)
|
|
|
|
|
#define HEAP_ATTR SECTION("HEAP") __attribute__((zero_init))
|
|
|
|
|
#define STACK_ATTR SECTION("STACK") __attribute__((zero_init))
|
|
|
|
|
#elif defined(__GNUC__)
|
|
|
|
|
#define HEAP_ATTR __attribute__((__section__(".bss.heap")))
|
|
|
|
|
#define STACK_ATTR __attribute__((__section__(".bss.stack")))
|
|
|
|
|
#elif defined(__IAR_SYSTEMS_ICC__)
|
|
|
|
|
#define HEAP_ATTR
|
|
|
|
|
#define STACK_ATTR
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
__attribute__((used)) HEAP_ATTR static char heap[HEAP_SIZE];
|
|
|
|
|
__attribute__((used)) STACK_ATTR static char stack[STACK_SIZE];
|