File tree Expand file tree Collapse file tree 2 files changed +7
-6
lines changed
rtos/TARGET_CORTEX/TOOLCHAIN_GCC_ARM Expand file tree Collapse file tree 2 files changed +7
-6
lines changed Original file line number Diff line number Diff line change @@ -1245,16 +1245,17 @@ extern "C" int errno;
1245
1245
// Weak attribute allows user to override, e.g. to use external RAM for dynamic memory.
1246
1246
extern " C" WEAK caddr_t _sbrk (int incr)
1247
1247
{
1248
- static unsigned char * heap = (unsigned char * ) &__end__;
1249
- unsigned char * prev_heap = heap;
1250
- unsigned char * new_heap = heap + incr;
1248
+ static uint32_t heap = (uint32_t ) &__end__;
1249
+ uint32_t prev_heap = heap;
1250
+ uint32_t new_heap = heap + incr;
1251
1251
1252
1252
/* __HeapLimit is end of heap section */
1253
- if (new_heap >= (unsigned char * ) &__HeapLimit) {
1253
+ if (new_heap >= (uint32_t ) &__HeapLimit) {
1254
1254
errno = ENOMEM;
1255
1255
return (caddr_t ) -1 ;
1256
1256
}
1257
1257
1258
+ heap = new_heap;
1258
1259
return (caddr_t ) prev_heap;
1259
1260
}
1260
1261
#endif
Original file line number Diff line number Diff line change @@ -44,9 +44,9 @@ extern void __libc_init_array(void);
44
44
void software_init_hook (void )
45
45
{
46
46
mbed_stack_isr_start = (unsigned char * ) & __StackLimit ;
47
- mbed_stack_isr_size = (( uint32_t )(( uint32_t ) & __StackTop - (uint32_t ) & __StackLimit )) ;
47
+ mbed_stack_isr_size = (uint32_t ) & __StackTop - (uint32_t ) & __StackLimit ;
48
48
mbed_heap_start = (unsigned char * ) & __end__ ;
49
- mbed_heap_size = (( uint32_t )(( uint32_t ) & __HeapLimit - (uint32_t ) & __end__ )) ;
49
+ mbed_heap_size = (uint32_t ) & __HeapLimit - (uint32_t ) & __end__ ;
50
50
51
51
mbed_init ();
52
52
mbed_rtos_start ();
You can’t perform that action at this time.
0 commit comments