Commit Graph

12 Commits

Author SHA1 Message Date
Damien George ccacdf44b6 stmhal: Clean up reset/soft-reset code; fix bug init'ing VCP exc.
Make a clearer distinction between init functions that must be done
before any scripts can run (xxx_init0) and those that can be safely
deferred (xxx_init).

Fix bug initialising USB VCP exception.  Addresses issue #788.

Re-order some init function to improve reliability of
reset/soft-reset.
2014-08-04 11:09:51 +01:00
Damien George 8362bffb2e stmhal: Document behaviour of usb_vcp_recv_byte. 2014-08-03 17:30:26 +01:00
Damien George 3c4db9f91c stmhal: Add USB_VCP class/object, for direct USB VCP control.
Before, pyb.stdin/pyb.stdout allowed some kind of access to the USB VCP
device, but it was basic access.

This patch adds a proper USB_VCP class and object with much more control
over the USB VCP device.  Create an object with pyb.USB_VCP(), then use
this object as if it were a UART object.  It has send, recv, read,
write, and other methods.  send and recv allow a timeout to be specified.

Addresses issue 774.
2014-07-31 10:30:42 +01:00
Damien George 951ed9d02f stmhal: Fix REPL printing by cooking output sent to stdout_obj.
Recent changes to builtin print meant that print was printing to the
mp_sys_stdout_obj, which was sending data raw to the USB CDC device.
The data should be cooked so that \n turns into \r\n.
2014-07-20 13:57:43 +01:00
Damien George 6d197740cf stmhal: Stop USB before entering DFU by software. 2014-05-21 19:25:34 +01:00
Damien George 04b9147e15 Add license header to (almost) all files.
Blanket wide to all .c and .h files.  Some files originating from ST are
difficult to deal with (license wise) so it was left out of those.

Also merged modpyb.h, modos.h, modstm.h and modtime.h in stmhal/.
2014-05-03 23:27:38 +01:00
Damien George 3996611c1b stmhal: Add home/end cursor support in readline.
Home/end work in picocom and screen (different codes in those 2
programs).  Also, CTRL-A (for non-empty liny) and CTRL-E act as
home/end.
2014-04-03 23:30:24 +01:00
Damien George 038df43183 stmhal: Implement selector for USB device mode; improve boot up.
Can now choose at boot up whether the USB device is CDC+MSC or CDC+HID.
Choice is made by an option in boot.py, with default being CDC+MSC.
HID+MSC is not currently supported, but should be easy to implement.

Boot up now has ability to change the reset mode: hold down USR switch
while booting and LEDs will count from 1 to 7 to indicate the boot mode.
Release USR when correct mode is selected.  Current modes are 1 (normal
boot), 2 (safe mode), 3 (reset FS mode).
2014-03-30 00:00:15 +00:00
Damien George 2fb37847a7 stmhal: Tidy up USB CDC+MSC device some more. 2014-03-22 13:21:58 +00:00
Damien George 8913c04831 stmhal: Add support for USB MSC device.
This gives a functioning, independent MSC device.
2014-03-21 23:32:01 +00:00
Damien George 07174c6fca stmhal: Fix escape sequences in USB CDC input. 2014-03-15 12:53:51 +00:00
Damien George b30c02afa0 stmhal: Get USB enumerating a CDC device.
Enumerates CDC device over USB, but doesn't transmit/receive yet.
2014-03-14 00:30:37 +00:00