pic32: Add option to use hal _sbrk
pic32 BSPs still use private _sbrk().
This adds option to call hal provided _sbrk() version
that other architectures use now.
This will be needed for new BSPs that have more
common mynewt features.
#include "xc.h"
#include <cp0defs.h>
+#include <syscfg/syscfg.h>
#ifdef __LIBBUILD__
# Replace the standard debugging information with a simple filename. This
@@ -571,6 +572,13 @@ _cache_err_vector:
.align 2
.ent _main_entry
_main_entry:
+#if MYNEWT_VAL_HAL_SBRK
+ la a0, __HeapBase
+ la a1, __HeapLimit
+ la t0, _sbrkInit
+ jalr t0
+ nop
+#endif
#if defined(CPP_INIT)
.weak _init
