Blame view

build1/epsilon-master/python/port/mphalport.c 406 Bytes
6663b6c9   adorian   projet complet av...
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
  #include "py/mpstate.h"
  #include "py/mphal.h"
  
  #if MICROPY_KBD_EXCEPTION
  
  int mp_interrupt_char;
  
  void mp_hal_set_interrupt_char(int c) {
    if (c != -1) {
      mp_obj_exception_clear_traceback(MP_OBJ_FROM_PTR(&MP_STATE_VM(mp_kbd_exception)));
    }
    mp_interrupt_char = c;
  }
  
  void mp_keyboard_interrupt(void) {
    MP_STATE_VM(mp_pending_exception) = MP_OBJ_FROM_PTR(&MP_STATE_VM(mp_kbd_exception));
  }
  
  #endif