mirror of
https://github.com/UpsilonNumworks/Upsilon.git
synced 2026-03-24 16:20:49 +01:00
[python][apps/code] Enable interrupting python execution
Change-Id: Iadf7038f79f0289ce20d7ded42f8fe70894f0c0a
This commit is contained in:
@@ -29,6 +29,11 @@
|
||||
#include <string.h>
|
||||
#include <assert.h>
|
||||
|
||||
/* TODO: We should rather not edit micropython file.
|
||||
* Begining of the edited part */
|
||||
#include "../../port/interrupt_helper.h"
|
||||
/* End of the edited part */
|
||||
|
||||
#include "py/mpstate.h"
|
||||
#include "py/nlr.h"
|
||||
#include "py/emitglue.h"
|
||||
@@ -1278,6 +1283,12 @@ yield:
|
||||
|
||||
pending_exception_check:
|
||||
MICROPY_VM_HOOK_LOOP
|
||||
/* TODO: We should rather not edit micropython file. Find a way to call
|
||||
* shouldInterrupt every now and then in the loop executing byte code without
|
||||
* editing this file.
|
||||
* Begining of the edited part */
|
||||
shouldInterrupt();
|
||||
/* End of the edited part */
|
||||
|
||||
#if MICROPY_ENABLE_SCHEDULER
|
||||
// This is an inlined variant of mp_handle_pending
|
||||
|
||||
Reference in New Issue
Block a user