mirror of https://github.com/ARMmbed/mbed-os.git
Merge pull request #407 from fritzprix/master
[Nucleo, Discovery] Add default heap size( 1 KB) for Nucleo F401RE, DISCOVERY 407pull/409/head
commit
f971aef913
|
@ -7,7 +7,7 @@ namespace mbed {
|
||||||
|
|
||||||
typedef void (*pvoidf)(void);
|
typedef void (*pvoidf)(void);
|
||||||
|
|
||||||
InterruptManager* InterruptManager::_instance = NULL;
|
InterruptManager* InterruptManager::_instance = (InterruptManager*)NULL;
|
||||||
|
|
||||||
InterruptManager* InterruptManager::get() {
|
InterruptManager* InterruptManager::get() {
|
||||||
if (NULL == _instance)
|
if (NULL == _instance)
|
||||||
|
@ -25,7 +25,7 @@ void InterruptManager::destroy() {
|
||||||
// is very likely to occur
|
// is very likely to occur
|
||||||
if (NULL != _instance) {
|
if (NULL != _instance) {
|
||||||
delete _instance;
|
delete _instance;
|
||||||
_instance = NULL;
|
_instance = (InterruptManager*)NULL;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -68,7 +68,7 @@ bool InterruptManager::remove_handler(pFunctionPointer_t handler, IRQn_Type irq)
|
||||||
if (_chains[irq_pos]->size() == 1 && NULL != _chains[irq_pos]->get(0)->get_function()) {
|
if (_chains[irq_pos]->size() == 1 && NULL != _chains[irq_pos]->get(0)->get_function()) {
|
||||||
NVIC_SetVector(irq, (uint32_t)_chains[irq_pos]->get(0)->get_function());
|
NVIC_SetVector(irq, (uint32_t)_chains[irq_pos]->get(0)->get_function());
|
||||||
delete _chains[irq_pos];
|
delete _chains[irq_pos];
|
||||||
_chains[irq_pos] = NULL;
|
_chains[irq_pos] = (CallChain*) NULL;
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
|
@ -72,6 +72,41 @@ defined in linker script */
|
||||||
* @param None
|
* @param None
|
||||||
* @retval : None
|
* @retval : None
|
||||||
*/
|
*/
|
||||||
|
.section .stack
|
||||||
|
.align 3
|
||||||
|
#ifdef __STACK_SIZE
|
||||||
|
.equ Stack_Size, __STACK_SIZE
|
||||||
|
#else
|
||||||
|
.equ Stack_Size, 0xc00
|
||||||
|
#endif
|
||||||
|
.globl __StackTop
|
||||||
|
.globl __StackLimit
|
||||||
|
__StackLimit:
|
||||||
|
.space Stack_Size
|
||||||
|
.size __StackLimit, . - __StackLimit
|
||||||
|
__StackTop:
|
||||||
|
.size __StackTop, . - __StackTop
|
||||||
|
|
||||||
|
.section .heap
|
||||||
|
.align 3
|
||||||
|
#ifdef __HEAP_SIZE
|
||||||
|
.equ Heap_Size, __HEAP_SIZE
|
||||||
|
#else
|
||||||
|
.equ Heap_Size, 0x400
|
||||||
|
#endif
|
||||||
|
.globl __HeapBase
|
||||||
|
.globl __HeapLimit
|
||||||
|
__HeapBase:
|
||||||
|
.if Heap_Size
|
||||||
|
.space Heap_Size
|
||||||
|
.endif
|
||||||
|
.size __HeapBase, . - __HeapBase
|
||||||
|
__HeapLimit:
|
||||||
|
.size __HeapLimit, . - __HeapLimit
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
.section .text.Reset_Handler
|
.section .text.Reset_Handler
|
||||||
.weak Reset_Handler
|
.weak Reset_Handler
|
||||||
|
|
|
@ -58,7 +58,7 @@ __initial_sp EQU 0x20018000 ; Top of RAM
|
||||||
; <o> Heap Size (in Bytes) <0x0-0xFFFFFFFF:8>
|
; <o> Heap Size (in Bytes) <0x0-0xFFFFFFFF:8>
|
||||||
; </h>
|
; </h>
|
||||||
|
|
||||||
Heap_Size EQU 0x00000000
|
Heap_Size EQU 0x00000400
|
||||||
|
|
||||||
AREA HEAP, NOINIT, READWRITE, ALIGN=3
|
AREA HEAP, NOINIT, READWRITE, ALIGN=3
|
||||||
EXPORT __heap_base
|
EXPORT __heap_base
|
||||||
|
|
|
@ -39,6 +39,7 @@
|
||||||
;
|
;
|
||||||
;*******************************************************************************
|
;*******************************************************************************
|
||||||
|
|
||||||
|
|
||||||
__initial_sp EQU 0x20018000 ; Top of RAM
|
__initial_sp EQU 0x20018000 ; Top of RAM
|
||||||
|
|
||||||
PRESERVE8
|
PRESERVE8
|
||||||
|
|
|
@ -52,7 +52,7 @@ __StackTop:
|
||||||
#ifdef __HEAP_SIZE
|
#ifdef __HEAP_SIZE
|
||||||
.equ Heap_Size, __HEAP_SIZE
|
.equ Heap_Size, __HEAP_SIZE
|
||||||
#else
|
#else
|
||||||
.equ Heap_Size, 0
|
.equ Heap_Size, 0x400
|
||||||
#endif
|
#endif
|
||||||
.globl __HeapBase
|
.globl __HeapBase
|
||||||
.globl __HeapLimit
|
.globl __HeapLimit
|
||||||
|
|
|
@ -16,7 +16,7 @@ define region RAM_region = mem:[from __region_RAM_start__ to __region_RAM
|
||||||
|
|
||||||
/* Stack and Heap */
|
/* Stack and Heap */
|
||||||
define symbol __size_cstack__ = 0x400;
|
define symbol __size_cstack__ = 0x400;
|
||||||
define symbol __size_heap__ = 0x200;
|
define symbol __size_heap__ = 0x400;
|
||||||
define block CSTACK with alignment = 8, size = __size_cstack__ { };
|
define block CSTACK with alignment = 8, size = __size_cstack__ { };
|
||||||
define block HEAP with alignment = 8, size = __size_heap__ { };
|
define block HEAP with alignment = 8, size = __size_heap__ { };
|
||||||
define block STACKHEAP with fixed order { block HEAP, block CSTACK };
|
define block STACKHEAP with fixed order { block HEAP, block CSTACK };
|
||||||
|
|
Loading…
Reference in New Issue