diff options
author | Damien George <damien.p.george@gmail.com> | 2014-02-01 16:04:34 +0000 |
---|---|---|
committer | Damien George <damien.p.george@gmail.com> | 2014-02-01 16:04:34 +0000 |
commit | 01156d510c728408be4fd3100bcee18e8985ac00 (patch) | |
tree | 00474b76a63214870d88c82249db9d17c64f2f71 /stm/usb.h | |
parent | 532f2c30f66c9ff1e4f2aded29b98ba0db5ec341 (diff) | |
download | micropython-01156d510c728408be4fd3100bcee18e8985ac00.tar.gz micropython-01156d510c728408be4fd3100bcee18e8985ac00.zip |
stm: Add support for ctrl-C to interrupt running Python.
Using PendSV interrupt at lowest priority, code can now raise an
exception during an interrupt by calling pendsv_nlr_jump. The exception
will be raised when all interrupts are finished. This is used to trap
ctrl-C from the USB VCP to break out of running Python code.
Diffstat (limited to 'stm/usb.h')
-rw-r--r-- | stm/usb.h | 5 |
1 files changed, 5 insertions, 0 deletions
@@ -1,5 +1,10 @@ +#define VCP_CHAR_NONE (0) +#define VCP_CHAR_CTRL_C (3) +#define VCP_CHAR_CTRL_D (4) + void pyb_usb_dev_init(void); bool usb_vcp_is_enabled(void); +void usb_vcp_set_interrupt_char(int c); int usb_vcp_rx_any(void); char usb_vcp_rx_get(void); void usb_vcp_send_str(const char* str); |