Instead of return 0, which means EOF. There's no good way to detect EOF on
continuously active bus like UART, and treat timeout as just temporary
unvailability of data. .read() method of UART object will return None in
this case (instead of 0, which again measn EOF). This is fully compliant
with unix port.
Another function (like stat) which is problematic to deal with on ABI level
(FFI), as struct statvfs layout may differ unpredictably between OSes and
even different versions of a same OS. So, implement it in C, returning a
10-element tuple of f_bsize, f_frsize, f_blocks, f_bfree, f_bavail, f_files,
f_ffree, f_favail, f_flag, f_namemax. This is exactly the order described
in Python3 docs, https://docs.python.org/3/library/os.html#os.statvfs
(but note that os.statvfs() should make these values available as
attributes).
This allows to build libffi from source together with micropython, and is
useful for cross-compilation. Support for this was already merged
previously, to use:
make libffi
make MICROPY_STANDALONE=1
(To both commands appropriate cross-compilition flags can be added).
Cortex-M0, M0+ and M1 only have ARMv6-M Thumb/Thumb2 instructions. M3,
M4 and M7 have a superset of these, named ARMv7-M. This patch adds a
config option to enable support of the superset of instructions.
These are currently not intended to run with the rest of testsuite, as
they require dependencies and special environment setup anyway (drafted
in tests/jni/README).
This patch allows to configure the DAC resolution in the constructor and
in the init function, eg:
dac = DAC(1, bits=12).
The default resolution is 8 bits for backwards compatibility. The bits
sets the maximum value accepted by write and write_timed methods, being
2**bits - 1.
When using write_timed with 12-bit resolution, the input buffer is
treated as an unsigned half-word array, typecode 'H'.
See PR #1130 for discussion.
As we dn't export constants for TCSANOW, etc., zero makes a good "don't
care" param, and now it will work also under Android Bionic and any other
libc.