Damien George
183edefddd
py: Add object repr "C", where 30-bit floats are stuffed in obj word.
...
This new object representation puts floats into the object word instead
of on the heap, at the expense of reducing their precision to 30 bits.
It only makes sense when the word size is 32-bits.
2015-10-20 12:38:54 +01:00
Damien George
aedb859177
py: Make float representation configurable with object representation.
2015-10-20 12:35:40 +01:00
Damien George
7e359c648b
py: Move float e/pi consts to objfloat and make mp_obj_float_t private.
2015-10-20 12:35:17 +01:00
Damien George
aaef1851a7
py: Add mp_obj_is_float function (macro) and use it where appropriate.
2015-10-20 12:35:17 +01:00
Damien George
60401d461a
stmhal/rtc: Fix indentation to use spaces rather than tabs.
2015-10-20 12:05:27 +01:00
Peter Hinch
b106532b32
stmhal/rtc: Init uses YMD rather than backup register to detect powerup.
2015-10-20 12:05:16 +01:00
Paul Sokolovsky
8e6e9eaea5
unix: Use "Ctrl" as a name of the key, not "CTRL".
2015-10-20 12:30:36 +03:00
Paul Sokolovsky
acea9352a9
tests/extmod: Add tests for sleep_ms/us(), ticks_ms/us/diff().
...
Simple smoke tests, mostly for coverage. Added to extmod based on the fact
that they're extensions to standard modules.
2015-10-20 01:54:20 +03:00
Paul Sokolovsky
9058a7031f
travis: Build "deplibs" in unix port.
2015-10-20 01:50:27 +03:00
Tom Soulanille
a787467569
tools/pyboard: Add -c argument to run a program passed as a string.
2015-10-19 23:20:59 +01:00
Damien George
4078336d38
teensy: Update to compile with latest changes to stmhal Pin class.
2015-10-19 23:11:48 +01:00
Damien George
2f96b1982a
stmhal: Bring Pin class close to new machine module specification.
...
Looks like we can use the same Pin class for legacy pyb module and new
machine module.
2015-10-19 22:50:59 +01:00
Paul Sokolovsky
bedab235f9
stmhal/uart: If char is not received within timeout, return EAGAIN error.
...
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.
2015-10-20 00:27:07 +03:00
Damien George
83158e0e7f
stmhal: Implement os.dupterm (was pyb.repl_uart).
...
pyb.repl_uart still exists but points to os.dupterm.
2015-10-19 21:57:41 +01:00
Damien George
d8066e999d
stmhal: Add sleep_{ms,us} and ticks_{ms,us,cpu,diff} to time module.
...
pyb module still has pyb.delay and pyb.udelay, but these now point to
time.sleep_ms and time.sleep_us respectively.
2015-10-19 21:45:51 +01:00
Dave Hylands
504420c51d
stmhal: Early version of machine module for stmhal.
2015-10-19 21:12:42 +01:00
Paul Sokolovsky
2c040edef8
libffi: Skip building docs.
...
This requires makeinfo installed and wastes time (especially in CI).
2015-10-19 22:30:03 +03:00
danicampora
9c72c71c05
cc3200: WLAN class can retrieve the existing instance.
2015-10-19 21:17:15 +02:00
danicampora
f4c50f1cfc
tests/wipy: Make WLAN test more stable.
2015-10-19 21:17:15 +02:00
danicampora
ae70e98ed4
cc3200: Fix time.ticks_* functions.
2015-10-19 21:17:15 +02:00
danicampora
8faf2dc75b
docs/wipy: Add wipy tutorials section.
2015-10-19 21:17:15 +02:00
danicampora
36ae417c9f
docs: Add wipy and network.server documentation.
2015-10-19 21:17:15 +02:00
danicampora
2e0cd20a1d
cc3200: Refactor network module to make the server a propper object.
2015-10-19 21:17:15 +02:00
danicampora
65f6324573
cc3200: Increase stack sizes a bit.
2015-10-19 21:17:15 +02:00
danicampora
d8137178bb
cc3200: Create wipy module, remove HeartBeat class.
...
The heartbeat is now controllable via a single function within the
wipy module.
2015-10-19 21:17:15 +02:00
Paul Sokolovsky
39a380b621
unix/modos: Android Bionic lacks statvfs(), has BSD statfs().
2015-10-19 21:43:20 +03:00
Paul Sokolovsky
e0f5df579b
all: Make netutils.h available to all ports by default.
...
Generally, ports should inherit INC from py.mk, append to it, not
overwrite it. TODO: Likely should do the same for other vars too.
2015-10-19 18:32:42 +03:00
Paul Sokolovsky
8ee153f234
unix/modtime: Implement ticks_ms(), ticks_us() and ticks_diff().
...
All of these functions return positive small int, thus range is 2 bits less
than word size (30 bit on 32-bit systems, 62 bit on 64-bit systems).
2015-10-19 17:48:27 +03:00
Paul Sokolovsky
fd379db286
unix/modtime: Implement sleep_ms(), sleep_us().
2015-10-19 17:48:27 +03:00
Damien George
096d1e4512
py: Add lsl/lsr/asr opcode support to inline Thumb2 assembler.
2015-10-19 14:26:19 +01:00
Paul Sokolovsky
949c5c9180
unix/unix_mphal: Implement HAL_Delay() and HAL_GetTick().
2015-10-19 00:31:37 +03:00
Paul Sokolovsky
7799410950
py/stream: Allow to reuse is_nonblocking_error().
2015-10-18 15:39:33 +03:00
Paul Sokolovsky
2ca7b05552
unix/modos: Checking config macros requires mpconfig.h.
2015-10-18 03:05:47 +03:00
Paul Sokolovsky
f8e9ef5cd0
unix/modos: Guard sys/statvfs.h include with MICROPY_PY_OS_STATVFS check.
...
E.g. Windows lacks this header.
2015-10-18 02:54:20 +03:00
danicampora
020386b61c
docs: In top index fix machine module link for the WiPy.
2015-10-18 00:31:12 +02:00
Paul Sokolovsky
c3000b6f69
unix/modos: Add statvfs() function.
...
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).
2015-10-18 01:21:23 +03:00
Paul Sokolovsky
6ec6f51326
unix: Build libffi in a directory which is gitgnored.
...
To avoid "-dirty" version previous and spurious "modified" output from
git status, etc.
2015-10-18 00:44:45 +03:00
danicampora
4542643025
docs: Update all WiPy docs to reflect the new API.
2015-10-17 23:29:04 +02:00
danicampora
fca3308cc3
cc3200: Improvements to terminal duplication.
2015-10-17 23:21:44 +02:00
danicampora
e19dfe1c32
cc3200: In scan results rename 'auth' field to 'sec'.
...
As defined by the new API, since 'auth' is actually a tuple
composed by the security type and the key.
2015-10-17 23:21:44 +02:00
Dave Hylands
affcbe4139
stmhal: Make USB serial number actually be unique.
2015-10-17 22:02:57 +01:00
Paul Sokolovsky
6a515b95a8
tools/upip: Update to 0.5.9.
...
MICROPYPATH environment variable is now honored, package are installed to
first path specified in it.
2015-10-17 20:16:41 +03:00
Paul Sokolovsky
c13be69a8e
lib/libffi: Add libffi as a submodule.
...
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).
2015-10-17 15:52:35 +03:00
Damien George
035a0a2b6e
py: Add support for _ in REPL to hold last computed value.
...
Only available when MICROPY_CAN_OVERRIDE_BUILTINS is enabled.
2015-10-17 12:55:25 +01:00
Damien George
e813541e3f
py: Add option for inline assembler to support ARMv7-M instructions.
...
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.
2015-10-16 22:08:57 +01:00
Damien George
4bf3f2d3c0
py: Fix with+for+return bug by popping for-iter when unwinding exc stack.
...
Addresses issue #1182 .
2015-10-15 17:48:28 +01:00
Damien George
556c8a9a4f
unix: Fix coverage build now that mp_plat_print uses write.
2015-10-15 00:23:03 +01:00
Damien George
4300c7dba2
py: Remove dependency on printf/fwrite in mp_plat_print.
...
See issue #1500 .
2015-10-15 00:05:55 +01:00
Paul Sokolovsky
74d0df7324
unix: Allow to build against Android down to 1.5.
...
Bionic libc in Android 1.5 missed log2() and nan() functions.
2015-10-15 00:11:09 +03:00
Damien George
d7e3b36a09
py/compile: Remove unnecessary label in compilation of for statement.
2015-10-14 15:51:12 +01:00