1 parent ed56b0b commit 0d31bbcCopy full SHA for 0d31bbc
1 file changed
stmhal/pendsv.c
@@ -31,10 +31,12 @@
31
#include "py/runtime.h"
32
#include "pendsv.h"
33
34
-// Note: this can contain point to the heap but is not traced by GC.
35
-// This is okay because we only ever set it to mp_const_vcp_interrupt
36
-// which is in the root-pointer set.
37
-STATIC void *pendsv_object;
+// This variable is used to save the exception object between a ctrl-C and the
+// PENDSV call that actually raises the exception. It must be non-static
+// otherwise gcc-5 optimises it away. It can point to the heap but is not
+// traced by GC. This is okay because we only ever set it to
38
+// mp_const_vcp_interrupt which is in the root-pointer set.
39
+void *pendsv_object;
40
41
void pendsv_init(void) {
42
// set PendSV interrupt at lowest priority
0 commit comments