File tree 1 file changed +5
-5
lines changed
1 file changed +5
-5
lines changed Original file line number Diff line number Diff line change 57
57
#warning "This wrapper was verified for newlib version 2.5.0; please ensure newlib's external requirements for malloc-family are unchanged!"
58
58
#endif
59
59
60
- #include "freeRTOS .h" // defines public interface we're implementing here
60
+ #include "FreeRTOS .h" // defines public interface we're implementing here
61
61
#if !defined(configUSE_NEWLIB_REENTRANT ) || (configUSE_NEWLIB_REENTRANT != 1 )
62
62
#warning "#define configUSE_NEWLIB_REENTRANT 1 // Required for thread-safety of newlib sprintf, strtok, etc..."
63
63
// If you're *really* sure you don't need FreeRTOS's newlib reentrancy support, remove this warning...
71
71
#ifndef NDEBUG
72
72
static int totalBytesProvidedBySBRK = 0 ;
73
73
#endif
74
- extern char __HeapBase , __HeapLimit , HEAP_SIZE ; // make sure to define these symbols in linker command file
75
- static int heapBytesRemaining = ( int ) & HEAP_SIZE ; // that's (&__HeapLimit)-(&__HeapBase)
74
+ extern char _end ; // Defined in the linker script
75
+ static int heapBytesRemaining = configTOTAL_HEAP_SIZE ; // that's (&__HeapLimit)-(&__HeapBase)
76
76
77
77
//! sbrk/_sbrk version supporting reentrant newlib (depends upon above symbols defined by linker control file).
78
78
char * sbrk (int incr ) {
79
- static char * currentHeapEnd = & __HeapBase ;
79
+ static char * currentHeapEnd = & _end ;
80
80
vTaskSuspendAll (); // Note: safe to use before FreeRTOS scheduler started
81
81
char * previousHeapEnd = currentHeapEnd ;
82
- if (currentHeapEnd + incr > & __HeapLimit ) {
82
+ if (currentHeapEnd + incr > & _end + configTOTAL_HEAP_SIZE ) {
83
83
#if ( configUSE_MALLOC_FAILED_HOOK == 1 )
84
84
{
85
85
extern void vApplicationMallocFailedHook ( void );
You can’t perform that action at this time.
0 commit comments