summaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
authorPaul Sokolovsky <pfalcon@users.sourceforge.net>2014-06-25 03:16:17 +0300
committerPaul Sokolovsky <pfalcon@users.sourceforge.net>2014-06-27 00:03:55 +0300
commit7a8ab5a730437118a65352a1ad22ed82ce8f3a24 (patch)
treec9dcd13e1cb2ffb8f683d4c5da262d1f313158dd
parent23668698cba9bf861c697e65e3d07f9433396b8b (diff)
downloadmicropython-7a8ab5a730437118a65352a1ad22ed82ce8f3a24.tar.gz
micropython-7a8ab5a730437118a65352a1ad22ed82ce8f3a24.zip
stmhal: Use stackctrl framework.
-rw-r--r--stmhal/main.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/stmhal/main.c b/stmhal/main.c
index e264fdf4b3..4e50daba41 100644
--- a/stmhal/main.c
+++ b/stmhal/main.c
@@ -40,6 +40,7 @@
#include "parse.h"
#include "obj.h"
#include "runtime.h"
+#include "stackctrl.h"
#include "gc.h"
#include "gccollect.h"
#include "pybstdio.h"
@@ -186,6 +187,11 @@ static const char fresh_readme_txt[] =
int main(void) {
// TODO disable JTAG
+ stack_ctrl_init();
+ // Stack limit should be less than real stack size, so we
+ // had chance to recover from limit hit.
+ stack_set_limit(&_ram_end - &_heap_end - 512);
+
/* STM32F4xx HAL library initialization:
- Configure the Flash prefetch, instruction and Data caches
- Configure the Systick to generate an interrupt each 1 msec