Commit Graph

15 Commits

Author SHA1 Message Date
Damien George 317cf18486 stmhal: Remove unnecessary HAL_Delay in readline loop.
The reason for having this delay is to reduce power consumption at the
REPL (HAL_Delay calls __WFI to idle the CPU).  But stdin_rx_chr has a
__WFI in it anyway, so this delay call is not needed.

By removing this call, the readline input can consume characters much
more quickly (before was limited to 1000 chrs/s), and has much reduced
dependency on the specific port.
2014-11-27 17:04:09 +00:00
Damien George 5cbc9e0db0 stmhal: Reduce coupling between USB driver and readline.
This makes it easier to re-use readline.c and pyexec.c from stmhal in
other ports.
2014-11-27 16:58:31 +00:00
Damien George bc1488a05f stmhal: Improve REPL control codes; improve pyboard.py script.
Improvements are:

2 ctrl-C's are now needed to truly kill running script on pyboard, so
make CDC interface allow multiple ctrl-C's through at once (ie sending
b'\x03\x03' to pyboard now counts as 2 ctrl-C's).

ctrl-C in friendly-repl can now stop multi-line input.

In raw-repl mode, use ctrl-D to indicate end of running script, and also
end of any error message.  Thus, output of raw-repl is always at least 2
ctrl-D's and it's much easier to parse.

pyboard.py is now a bit faster, handles exceptions from pyboard better
(prints them and exits with exit code 1), prints out the pyboard output
while the script is running (instead of waiting till the end), and
allows to follow the output of a previous script when run with no
arguments.
2014-10-26 15:39:22 +00:00
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 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 7a37f647a5 Merge branch 'teensy-new' of github.com:dhylands/micropython into dhylands-teensy-new
Conflicts:
	stmhal/pin_named_pins.c
	stmhal/readline.c

Renamed HAL_H to MICROPY_HAL_H.  Made stmhal/mphal.h which intends to
define the generic Micro Python HAL, which in stmhal sits above the ST
HAL.
2014-07-02 13:42:37 +01:00
Paul Sokolovsky 8139494e54 stmhal: Include mpconfig.h before all other includes.
It defines types used by all other headers.

Fixes #691.
2014-06-28 23:32:03 +03:00
Dave Hylands 4f1b7fec9f Updated teensy to build.
Refactored some stmhal files which are shared with teensy.
2014-06-15 22:48:05 -07:00
Damien George b0edec61ac stmhal: Improve handling of out-of-memory in REPL.
Addresses issue #558, but it's likely that other out-of-memory errors
could crash the pyboard.  Reason is that qstrs use m_new and can raise
an exception within the parser.
2014-05-10 17:48:46 +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 38d3430320 stmhal: Add more escape seqs; add debugging output for escape seq. 2014-04-05 11:45:59 +01:00
Paul Sokolovsky cdffa32699 stmhal readline: Parse XTERM Home/End key codes.
Which are ESC O H, ESC O F.
2014-04-05 02:47:26 +03: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 69dee59ce4 stmhal: Add backspace key to readline (along with delete key). 2014-04-02 14:28:58 +01:00
Damien George c9fd6645b0 stmhal: Factor out stdio and readline to separate files.
Adds readline_init() to clear readline history on soft reset.  Addresses
issue #387.
2014-03-29 14:20:05 +00:00