Skip to content

Commit 6e557f4

Browse files
committed
SDRAM: don't initalize custom allocator if start_address==0
1 parent 03902e6 commit 6e557f4

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

Diff for: libraries/Portenta_SDRAM/SDRAM.cpp

+4-2
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,10 @@ int SDRAMClass::begin(uint32_t start_address) {
2424
mpu_config_end();
2525
}
2626

27-
printf("malloc_addblock: allocate %d bytes\n", SDRAM_END_ADDRESS - start_address);
28-
malloc_addblock((void*)start_address, SDRAM_END_ADDRESS - start_address);
27+
if (start_address) {
28+
printf("malloc_addblock: allocate %d bytes\n", SDRAM_END_ADDRESS - start_address);
29+
malloc_addblock((void*)start_address, SDRAM_END_ADDRESS - start_address);
30+
}
2931

3032
return 1;
3133
}

0 commit comments

Comments
 (0)