A few tests still fail on PYBLITE, and that's due to differences in the
available peripheral block numbers on the different MCUs (eg I2C(2)
exists on one, but it's I2C(3) on the other).
This new function controls what happens on a hard-fault:
- debugging disabled: board will do a reset
- debugging enabled: board will print registers and stack and flash LEDs
The default is disabled, ie to do a reset. This is different to previous
behaviour which flashed the LEDs and waited indefinitely.
New keyword option in constructor and init() method is "dma=<bool>".
DMA is now disabled by default for I2C transfers because it currently does
not handle I2C bus errors very well (eg if slave device doesn't ACK or
NACK correctly during a transfer).
In non-blocking mode (timeout=0), uart.write() can now transmit all of its
data without raising an exception. uart.read() also works correctly in
this mode.
As part of this patch, timout_char now has a minimum value which is long
enough to transfer 1 character.
Addresses issue #1533.
In particular, dates prior to Mar 1, 2000 are screwed up.
The easiest way to see this is to do:
>>> import time
>>> time.localtime(0)
(2000, 1, 1, 0, 0, 0, 5, 1)
>>> time.localtime(1)
(2000, 1, 2, 233, 197, 197, 6, 2)
With this patch, we instead get:
>>> import time
>>> time.localtime(1)
(2000, 1, 1, 0, 0, 1, 5, 1)
Doh - In C % is NOT a modulo operator, it's a remainder operator.
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.
In tests/pyb is now a suite of tests that tests the pyb module on the
pyboard. They include expected output files because we can't run
CPython on the pyboard to compare against.
run-tests script has now been updated to allow pyboard tests to be run.
Just pass the option --pyboard. This runs all basic, float and pyb
tests. Note that float/math-fun.py currently fails because not all math
functions are implemented in stmhal/.