File tree Expand file tree Collapse file tree 2 files changed +29
-0
lines changed Expand file tree Collapse file tree 2 files changed +29
-0
lines changed Original file line number Diff line number Diff line change @@ -476,6 +476,32 @@ STATIC mp_obj_t extra_coverage(void) {
476
476
while (mp_sched_num_pending ()) {
477
477
mp_handle_pending (true);
478
478
}
479
+
480
+ // setting the keyboard interrupt and raising it during mp_handle_pending
481
+ mp_keyboard_interrupt ();
482
+ nlr_buf_t nlr ;
483
+ if (nlr_push (& nlr ) == 0 ) {
484
+ mp_handle_pending (true);
485
+ nlr_pop ();
486
+ } else {
487
+ mp_obj_print_exception (& mp_plat_print , MP_OBJ_FROM_PTR (nlr .ret_val ));
488
+ }
489
+
490
+ // setting the keyboard interrupt (twice) and cancelling it during mp_handle_pending
491
+ mp_keyboard_interrupt ();
492
+ mp_keyboard_interrupt ();
493
+ mp_handle_pending (false);
494
+
495
+ // setting keyboard interrupt and a pending event (intr should be handled first)
496
+ mp_sched_schedule (MP_OBJ_FROM_PTR (& mp_builtin_print_obj ), MP_OBJ_NEW_SMALL_INT (10 ));
497
+ mp_keyboard_interrupt ();
498
+ if (nlr_push (& nlr ) == 0 ) {
499
+ mp_handle_pending (true);
500
+ nlr_pop ();
501
+ } else {
502
+ mp_obj_print_exception (& mp_plat_print , MP_OBJ_FROM_PTR (nlr .ret_val ));
503
+ }
504
+ mp_handle_pending (true);
479
505
}
480
506
481
507
// ringbuf
Original file line number Diff line number Diff line change @@ -80,6 +80,9 @@ unlocked
80
80
1
81
81
2
82
82
3
83
+ KeyboardInterrupt:
84
+ KeyboardInterrupt:
85
+ 10
83
86
# ringbuf
84
87
99 0
85
88
98 1
You can’t perform that action at this time.
0 commit comments