py: Make mp_const_empty_bytes globally available.
stmhal: Overhaul UART class to use read/write, and improve it.

UART object now uses a stream-like interface: read, readall, readline,
readinto, readchar, write, writechar.

Timeouts are configured when the UART object is initialised, using
timeout and timeout_char keyword args.

The object includes optional read buffering, using interrupts.  You can set
the buffer size dynamically using read_buf_len keyword arg.  A size of 0
disables buffering.
stmhal: Change cc3k.recv to only make 1 call to underlying recv().

Also make cc3k.send and cc3k.recv independent functions (not wrapped by
stream write/read).  Also make wiznet5k.recv more memory efficient.

This might address issue #920.
Add pyb.hard_reset, and make sys.exit() or raise SystemExit do a soft reset.
stmhal: Don't return SystemExit value from parse_compile_execute.

There is no need, since we don't (currently) use the value.
Fixed TIM2_CH1 definition.

TIM2_CH1_ETR is really bundling 2 functions to the same pin:
TIM2_CH1 (where its used as a channel)
TIM2_ETR (where iss used as an external trigger).

I fixed most of these a while back, but it looks like I missed this one.
stmhal: Add MMA_INT/PB2 to available pins on PYBV10.

This allows you to register ExtInt on the MMA interrupt pin.
py: Remove unused and unneeded SystemError exception.

It's purpose is for internal errors that are not catastrophic (ie not as
bad as RuntimeError).  Since we don't use it, we don't need it.
py: Deactivate more code without MICROPY_PY_SYS

When compiler optimization has been turned on, gcc knows that this code
block is not going to be executed. But with -O0 it complains about
path_items being used uninitialized.

Signed-off-by: Sven Wegener <sven.wegener@stealer.net>
bare-arm: Add dummy __assert_func and __fatal_error

Required to build bare-arm with debugging.

Signed-off-by: Sven Wegener <sven.wegener@stealer.net>
stmhal: Replace __WFI with __BKPT in __fatal_error

On a fatal error, bring the processor into debug state.

Signed-off-by: Sven Wegener <sven.wegener@stealer.net>
stmhal: Declare variables in include files

Else we end up with several instances of the variable.

Signed-off-by: Sven Wegener <sven.wegener@stealer.net>