summaryrefslogtreecommitdiffstatshomepage
path: root/py/qstrdefs.h
diff options
context:
space:
mode:
authorDamien George <damien.p.george@gmail.com>2014-10-25 18:19:55 +0100
committerDamien George <damien.p.george@gmail.com>2014-10-25 23:37:57 +0100
commit124df6f8d07b53542b6960dbeea9b63bff469a67 (patch)
tree39ea11d0bed72ed828c406d2b4a8fc069b00ca4e /py/qstrdefs.h
parentd7353fe6fe9c9d421ef045c0eea8d4591710e1ba (diff)
downloadmicropython-124df6f8d07b53542b6960dbeea9b63bff469a67.tar.gz
micropython-124df6f8d07b53542b6960dbeea9b63bff469a67.zip
py: Add mp_pending_exception global variable, for VM soft interrupt.
This allows to implement KeyboardInterrupt on unix, and a much safer ctrl-C in stmhal port. First ctrl-C is a soft one, with hope that VM will notice it; second ctrl-C is a hard one that kills anything (for both unix and stmhal). One needs to check for a pending exception in the VM only for jump opcodes. Others can't produce an infinite loop (infinite recursion is caught by stack check).
Diffstat (limited to 'py/qstrdefs.h')
-rw-r--r--py/qstrdefs.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/py/qstrdefs.h b/py/qstrdefs.h
index c87a7a83c1..64658b587c 100644
--- a/py/qstrdefs.h
+++ b/py/qstrdefs.h
@@ -108,6 +108,7 @@ Q(GeneratorExit)
Q(ImportError)
Q(IndentationError)
Q(IndexError)
+Q(KeyboardInterrupt)
Q(KeyError)
Q(LookupError)
Q(MemoryError)