summaryrefslogtreecommitdiff
path: root/main.c
diff options
context:
space:
mode:
authorScott Shawcroft <scott@adafruit.com>2020-11-30 16:00:55 -0800
committerGitHub <noreply@github.com>2020-11-30 16:00:55 -0800
commita975ef497162297fa80658170481f6d3fcfc25bc (patch)
tree6d07bde669a9245c784cc9826ecc80ebd29c41af /main.c
parent299b6efd846e47cc705d2962cefffb5b0af7324c (diff)
parentd6f8a43f6cc755b90376a66b75818744fbe63320 (diff)
Merge pull request #3695 from cwalther/movable
Add movable supervisor allocations
Diffstat (limited to 'main.c')
-rwxr-xr-xmain.c13
1 files changed, 5 insertions, 8 deletions
diff --git a/main.c b/main.c
index 80b163f60..1389f524b 100755
--- a/main.c
+++ b/main.c
@@ -123,15 +123,15 @@ void start_mp(supervisor_allocation* heap) {
// to recover from limit hit. (Limit is measured in bytes.)
mp_stack_ctrl_init();
- if (stack_alloc != NULL) {
- mp_stack_set_limit(stack_alloc->length - 1024);
+ if (stack_get_bottom() != NULL) {
+ mp_stack_set_limit(stack_get_length() - 1024);
}
#if MICROPY_MAX_STACK_USAGE
// _ezero (same as _ebss) is an int, so start 4 bytes above it.
- if (stack_alloc != NULL) {
- mp_stack_set_bottom(stack_alloc->ptr);
+ if (stack_get_bottom() != NULL) {
+ mp_stack_set_bottom(stack_get_bottom());
mp_stack_fill_with_sentinel();
}
#endif
@@ -148,7 +148,7 @@ void start_mp(supervisor_allocation* heap) {
#endif
#if MICROPY_ENABLE_GC
- gc_init(heap->ptr, heap->ptr + heap->length / 4);
+ gc_init(heap->ptr, heap->ptr + get_allocation_length(heap) / 4);
#endif
mp_init();
mp_obj_list_init(mp_sys_path, 0);
@@ -451,9 +451,6 @@ int __attribute__((used)) main(void) {
// initialise the cpu and peripherals
safe_mode_t safe_mode = port_init();
- // Init memory after the port in case the port needs to set aside memory.
- memory_init();
-
// Turn on LEDs
init_status_leds();
rgb_led_status_init();