Skip to content

Commit 1448b87

Browse files
committed
[LPC4088] Making it possible to reserve stack space by weak function.
1 parent 3157d5a commit 1448b87

File tree

2 files changed

+36
-0
lines changed

2 files changed

+36
-0
lines changed
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
/* mbed Microcontroller Library - stackheap
2+
* Copyright (C) 2009-2011 ARM Limited. All rights reserved.
3+
*
4+
*/
5+
6+
#include "sys_helper.h"
7+
8+
/* This function specifies the amount of memory of the internal RAM to
9+
reserve for the stack. The default implementation will reserve 0 bytes
10+
which gives the normal behaviour where the stack and heap share all the
11+
internal RAM.
12+
13+
You can override this function in your code to reserve a number of bytes
14+
for the stack.
15+
*/
16+
extern "C" WEAK uint32_t __reserved_stack_size();
17+
extern "C" WEAK uint32_t __reserved_stack_size() {
18+
return 0; // return 0 to indicate that nothing is reserved
19+
}
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
#ifndef SYS_HELPER_H
2+
#define SYS_HELPER_H
3+
4+
#include <stdint.h>
5+
#include "toolchain.h"
6+
7+
#ifdef __cplusplus
8+
extern "C" {
9+
#endif
10+
11+
uint32_t __reserved_stack_size();
12+
13+
#ifdef __cplusplus
14+
}
15+
#endif
16+
17+
#endif

0 commit comments

Comments
 (0)