diff options
| author | Damien George | 2014-11-29 15:23:21 +0000 |
|---|---|---|
| committer | Damien George | 2014-11-29 15:23:21 +0000 |
| commit | 19fb1b4dd7173ad2cf4b2bb1b0f0c06498499bd2 (patch) | |
| tree | 0f557d2d687fad065dd4ad11a3ff3f3b35a83a0f /docs | |
| parent | b395220ef00ccf9700a37e470f4d4cf021743572 (diff) | |
stmhal: Add USB_VCP.setinterrupt method, to disable CTRL-C.
Diffstat (limited to 'docs')
| -rw-r--r-- | docs/library/pyb.USB_VCP.rst | 9 | ||||
| -rw-r--r-- | docs/tutorial/pass_through.rst | 1 |
2 files changed, 10 insertions, 0 deletions
diff --git a/docs/library/pyb.USB_VCP.rst b/docs/library/pyb.USB_VCP.rst index 733064072..4d87be4a3 100644 --- a/docs/library/pyb.USB_VCP.rst +++ b/docs/library/pyb.USB_VCP.rst @@ -17,6 +17,15 @@ Constructors Methods ------- +.. method:: usb_vcp.setinterrupt(chr) + + Set the character which interrupts running Python code. This is set + to 3 (CTRL-C) by default, and when a CTRL-C character is received over + the USB VCP port, a KeyboardInterrupt exception is raised. + + Set to -1 to disable this interrupt feature. This is useful when you + want to send raw bytes over the USB VCP port. + .. method:: usb_vcp.any() Return ``True`` if any characters waiting, else ``False``. diff --git a/docs/tutorial/pass_through.rst b/docs/tutorial/pass_through.rst index 309ef58e7..a94e7363d 100644 --- a/docs/tutorial/pass_through.rst +++ b/docs/tutorial/pass_through.rst @@ -7,6 +7,7 @@ It's as simple as:: import select def pass_through(usb, uart): + usb.setinterrupt(-1) while True: select.select([usb, uart], [], []) if usb.any(): |
