Skip to content

Commit dae9029

Browse files
committed
add _malloc_heap_end
1 parent 71396ce commit dae9029

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

library.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
name=FreeRTOS
2-
version=10.3.0-3
2+
version=10.3.0-4
33
author=Richard Barry <info@freertos.org>
44
maintainer=Phillip Stevens <phillip.stevens@gmail.com>
55
sentence=Real Time Operating System implemented for AVR (Uno, Leonardo, Mega).

src/variantHooks.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323
* This file is NOT part of the FreeRTOS distribution.
2424
*
2525
*/
26+
#include <stdlib.h>
2627

2728
#include <avr/io.h>
2829
#include <avr/interrupt.h>
@@ -45,6 +46,10 @@ extern void loop(void);
4546
void initVariant(void) __attribute__ ((OS_main));
4647
void initVariant(void)
4748
{
49+
// as the Task stacks are usually on heap before memory within the task, the normal
50+
// __malloc_heap_end = 0 doesn't work. Allow for a minimal initial stack only.
51+
__malloc_heap_end = (char *)(RAMEND - configMINIMAL_STACK_SIZE);
52+
4853
#if defined(USBCON)
4954
USBDevice.attach();
5055
#endif

0 commit comments

Comments
 (0)