Skip to content

Commit

Permalink
SDRAM: don't initalize custom allocator if start_address==0
Browse files Browse the repository at this point in the history
  • Loading branch information
facchinm committed Oct 27, 2020
1 parent 03902e6 commit 6e557f4
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions libraries/Portenta_SDRAM/SDRAM.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,10 @@ int SDRAMClass::begin(uint32_t start_address) {
mpu_config_end();
}

printf("malloc_addblock: allocate %d bytes\n", SDRAM_END_ADDRESS - start_address);
malloc_addblock((void*)start_address, SDRAM_END_ADDRESS - start_address);
if (start_address) {
printf("malloc_addblock: allocate %d bytes\n", SDRAM_END_ADDRESS - start_address);
malloc_addblock((void*)start_address, SDRAM_END_ADDRESS - start_address);
}

return 1;
}
Expand Down

0 comments on commit 6e557f4

Please sign in to comment.