Skip to content

Commit d578e65

Browse files
committed
bricks/stm32: fix missing context arg
This fixes a crash due to not passing the context arg to mp_make_function_from_raw_code().
1 parent a08deef commit d578e65

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

bricks/nxt/main.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -178,7 +178,7 @@ int main(int argc, char **argv) {
178178
mp_module_context_t *context = m_new_obj(mp_module_context_t);
179179
context->module.globals = mp_globals_get();
180180
mp_compiled_module_t compiled_module = mp_raw_code_load(&reader, context);
181-
mp_obj_t module_fun = mp_make_function_from_raw_code(compiled_module.rc, MP_OBJ_NULL, MP_OBJ_NULL);
181+
mp_obj_t module_fun = mp_make_function_from_raw_code(compiled_module.rc, context, MP_OBJ_NULL);
182182
mp_hal_set_interrupt_char(3);
183183
mp_call_function_0(module_fun);
184184
mp_hal_set_interrupt_char(-1);

bricks/stm32/main.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -326,7 +326,7 @@ static void run_user_program(uint32_t len, uint8_t *buf, uint32_t free_len) {
326326
mp_module_context_t *context = m_new_obj(mp_module_context_t);
327327
context->module.globals = mp_globals_get();
328328
mp_compiled_module_t compiled_module = mp_raw_code_load(&reader, context);
329-
mp_obj_t module_fun = mp_make_function_from_raw_code(compiled_module.rc, MP_OBJ_NULL, MP_OBJ_NULL);
329+
mp_obj_t module_fun = mp_make_function_from_raw_code(compiled_module.rc, context, MP_OBJ_NULL);
330330
mp_hal_set_interrupt_char(CHAR_CTRL_C); // allow ctrl-C to interrupt us
331331
mp_call_function_0(module_fun);
332332
mp_hal_set_interrupt_char(-1); // disable interrupt

0 commit comments

Comments
 (0)