py/mpstate: Make exceptions thread-local.

This moves mp_pending_exception from mp_state_vm_t to mp_state_thread_t.
This allows exceptions to be scheduled on a specific thread.

Signed-off-by: David Lechner <david@pybricks.com>
This commit is contained in:
David Lechner
2021-05-10 21:53:22 -05:00
committed by Damien George
parent 7c51cb2307
commit ca920f7218
13 changed files with 27 additions and 26 deletions

View File

@@ -140,7 +140,7 @@ int switch_get(int sw) {
// TODO need an irq
void uart_rx_irq(void) {
if (c == interrupt_char) {
MP_STATE_VM(mp_pending_exception) = MP_STATE_PORT(keyboard_interrupt_obj);
MP_STATE_THREAD(mp_pending_exception) = MP_STATE_PORT(keyboard_interrupt_obj);
}
}
*/