summaryrefslogtreecommitdiffstatshomepage
path: root/extmod
diff options
context:
space:
mode:
authorDaniël van de Giessen <daniel@dvdgiessen.nl>2024-02-28 12:41:41 +0100
committerDaniël van de Giessen <daniel@dvdgiessen.nl>2024-02-29 14:28:58 +0100
commitbc424ddc4165ffd8203b4e781f7c686598601e15 (patch)
tree2cd881caccdb3605fa4f68d71e23d4d820c66b47 /extmod
parent678707c8b07323c5b914778708a2858387c3b60c (diff)
downloadmicropython-bc424ddc4165ffd8203b4e781f7c686598601e15.tar.gz
micropython-bc424ddc4165ffd8203b4e781f7c686598601e15.zip
py/modthread: Move thread state initialisation to shared function.
Signed-off-by: Daniël van de Giessen <daniel@dvdgiessen.nl>
Diffstat (limited to 'extmod')
-rw-r--r--extmod/modbluetooth.c10
1 files changed, 1 insertions, 9 deletions
diff --git a/extmod/modbluetooth.c b/extmod/modbluetooth.c
index 32a15bf511..91e4e62213 100644
--- a/extmod/modbluetooth.c
+++ b/extmod/modbluetooth.c
@@ -34,7 +34,6 @@
#include "py/objarray.h"
#include "py/qstr.h"
#include "py/runtime.h"
-#include "py/stackctrl.h"
#include "extmod/modbluetooth.h"
#include <string.h>
@@ -1272,14 +1271,7 @@ STATIC mp_obj_t invoke_irq_handler(uint16_t event,
mp_state_thread_t ts;
if (ts_orig == NULL) {
- mp_thread_set_state(&ts);
- mp_stack_set_top(&ts + 1); // need to include ts in root-pointer scan
- mp_stack_set_limit(MICROPY_PY_BLUETOOTH_SYNC_EVENT_STACK_SIZE);
- ts.gc_lock_depth = 0;
- ts.nlr_jump_callback_top = NULL;
- ts.mp_pending_exception = MP_OBJ_NULL;
- mp_locals_set(mp_state_ctx.thread.dict_locals); // set from the outer context
- mp_globals_set(mp_state_ctx.thread.dict_globals); // set from the outer context
+ mp_thread_init_state(&ts, MICROPY_PY_BLUETOOTH_SYNC_EVENT_STACK_SIZE, NULL, NULL);
MP_THREAD_GIL_ENTER();
}