Skip to content

Commit f004c66

Browse files
committed
malloc_heap_end align margin to malloc
1 parent d961e81 commit f004c66

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
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-4
2+
version=10.3.0-5
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: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -46,16 +46,16 @@ extern void loop(void);
4646
void initVariant(void) __attribute__ ((OS_main));
4747
void initVariant(void)
4848
{
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);
49+
// As the Task stacks are on heap before Task allocated heap variables,
50+
// the library default __malloc_heap_end = 0 doesn't work.
51+
__malloc_heap_end = (char *)(RAMEND - __malloc_margin);
5252

5353
#if defined(USBCON)
5454
USBDevice.attach();
5555
#endif
5656

57-
setup(); // the normal Arduino setup() function is run here.
58-
vTaskStartScheduler(); // initialise and run the freeRTOS scheduler. Execution should never return here.
57+
setup(); // the normal Arduino setup() function is run here.
58+
vTaskStartScheduler(); // initialise and run the freeRTOS scheduler. Execution should never return here.
5959
}
6060

6161

@@ -73,7 +73,7 @@ void vApplicationIdleHook( void ) __attribute__((weak));
7373

7474
void vApplicationIdleHook( void )
7575
{
76-
loop(); // the normal Arduino loop() function is run here.
76+
loop(); // the normal Arduino loop() function is run here.
7777
if (serialEventRun) serialEventRun();
7878
}
7979

0 commit comments

Comments
 (0)