Skip to content

Commit cfe75b2

Browse files
committed
codal_port/drv_display: Raise any pending exc's if animation stopped.
This wait_for_event() function should really be doing (pseudo-code): while (1) { try: mp_handle_pending(true); microbit_hal_idle(); finally: async_stop() } But for efficiency (not to use nlr_push) it doesn't call mp_handle_pending, which could raise. So this function must be called if there is an exception, so that exception can be processed correctly. Fixes issue #134. Signed-off-by: Damien George <[email protected]>
1 parent 1955adb commit cfe75b2

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

src/codal_port/drv_display.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,7 @@ STATIC void wait_for_event() {
6767
// allow CTRL-C to stop the animation
6868
if (MP_STATE_THREAD(mp_pending_exception) != MP_OBJ_NULL) {
6969
async_stop();
70+
mp_handle_pending(true);
7071
return;
7172
}
7273
microbit_hal_idle();

0 commit comments

Comments
 (0)