Commit Graph

9017 Commits

Author SHA1 Message Date
Damien George 4abe3731e3 stmhal: Add initial implementation of Pin.irq() method.
This method follows the new HW API and allows to set a hard or soft IRQ
callback when a Pin has a level change.  It still remains to make this
method return a IRQ object.
2017-06-15 17:17:36 +10:00
Damien George e269cabe3e py/objint: In to_bytes(), allow length arg to be any int and check sign. 2017-06-15 14:21:02 +10:00
Damien George 8c5632a869 py/objint: Support "big" byte-order in int.to_bytes(). 2017-06-15 13:56:21 +10:00
Damien George 2bf5a947b2 stmhal: Make error messages more consistent across peripherals. 2017-06-15 12:02:14 +10:00
Damien George 48d867b4a6 all: Make more use of mp_raise_{msg,TypeError,ValueError} helpers. 2017-06-15 11:54:41 +10:00
Damien George 1e70fda69f py/compile: Raise SyntaxError if positional args are given after */**.
In CPython 3.4 this raises a SyntaxError.  In CPython 3.5+ having a
positional after * is allowed but uPy has the wrong semantics and passes
the arguments in the incorrect order.  To prevent incorrect use of a
function going unnoticed it is important to raise the SyntaxError in uPy,
until the behaviour is fixed to follow CPython 3.5+.
2017-06-14 18:18:01 +10:00
Damien George 696fcde800 cc3200/modusocket: Simplify socket.makefile() function.
Following how extmod/modlwip.c does it.
2017-06-14 17:40:02 +10:00
Damien George 3bedff0b3c lib/libm/math: Remove implementations of float conversion functions.
These implementations are incorrect (eg f2d and d2f don't handle special
values like 0.0) and proper versions can be provided by libgcc (or
equivalent depending on the toolchain).

libgcc is now linked with the stmhal port so that library will provide
these functions from now on.
2017-06-14 17:18:23 +10:00
Damien George c064f0a36a stmhal/mpconfigport.h: Remove config of PY_THREAD_GIL to use default.
The default for the GIL is to enable it if threading is enabled, and this
is the recommended way to use threading with the stmhal port.
2017-06-14 14:47:53 +10:00
Damien George e374cfff80 py/modthread: Raise RuntimeError in release() if lock is not acquired. 2017-06-14 14:43:50 +10:00
Paul Sokolovsky a47b871131 esp8266/Makefile: Bump axTLS TLS record buffer size to 5K.
The latest fashion is pushing certificate sub-chains, instead of a single
certificate, during TLS handshake. These are pushed via single TLS record
and effectively put minimum size limit on TLS record buffer. Recently,
these commonly grew over 4K, so we have little choice but to adjust.
2017-06-14 01:28:22 +03:00
Paul Sokolovsky 82b9915b34 extmod/modussl_axtls: Implement server_hostname arg to wrap_socket().
As enabled by SNI support in axTLS v2+.
2017-06-14 01:01:12 +03:00
Paul Sokolovsky 75c3f2a7ab extmod/modussl_axtls: Update for axTLS 2.1.3.
ssl_client_new() accepts new SSL_EXTENSIONS* argument.
2017-06-13 17:41:46 +03:00
Paul Sokolovsky f01c1c6b35 lib/axtls: Upgrade to axTLS 2.1.3 + MicroPython patchset.
axTLS 2.1.3 brings support for TLS 1.2 and SNI. With MicroPython patchset
on top of it, the code size growth (x86) is ~2K.
2017-06-13 17:39:20 +03:00
Damien George 6ed4581f54 py/formatfloat: Fix number of digits and exponent sign when rounding.
This patch fixes 2 things when printing a floating-point number that
requires rounding up of the mantissa:
- retain the correct precision; eg 0.99 becomes 1.0, not 1.00
- if the exponent goes from -1 to 0 then render it as +0, not -0
2017-06-13 13:36:56 +10:00
Paul Sokolovsky d42b80fd64 unix/modtime: Replace strftime() with localtime().
Baremetal ports standardized on providing localtime(). localtime() offers
more functionality, in particular, strftime() can be completely implemented
in Python with localtime().
2017-06-11 21:16:35 +03:00
Paul Sokolovsky 08c73d9734 docs/btree: Typo/wording fixes. 2017-06-11 18:23:13 +03:00
Paul Sokolovsky 6ca086a89a docs/btree: Add hints about opening db file and need to flush db. 2017-06-11 17:44:11 +03:00
Damien George 869cdcfdfc docs: Bump version to 1.9.1. 2017-06-11 23:04:00 +10:00
Damien George f55dcddbc7 tests/extmod/vfs_basic: Allow test to pass on embedded targets. 2017-06-11 22:56:27 +10:00
Paul Sokolovsky 0a7735f1a6 extmod/modframebuf: Fix signed/unsigned comparison pendantic warning.
Happened with 32-bit gcc 4.8.4.
2017-06-10 20:34:38 +03:00
Paul Sokolovsky 85d809d1f4 tests: Convert remaining "sys.exit()" to "raise SystemExit". 2017-06-10 20:34:38 +03:00
Paul Sokolovsky a2803b74f4 tests/basics: Convert "sys.exit()" to "raise SystemExit". 2017-06-10 20:03:01 +03:00
Paul Sokolovsky 0161939ed1 zephyr/machine_pin: Use native Zephyr types for Zephyr API calls.
In 1.8, Zephyr made a controversial change of dumping C99 stdint types
and switching to its own types.
2017-06-10 19:40:31 +03:00
Paul Sokolovsky 52410ef5b3 esp8266/Makefile: Add clean-modules target.
Helpful when dealing with frozen modules (and whole applications).
2017-06-10 18:13:43 +03:00
Daniel Tralamazza 1ac8f67e3b Merge pull request #81 from tralamazza/readme_update_ble_repl
nrf5: Updating readme with BLE REPL
2017-06-09 22:34:57 +02:00
glennrub 3193bcc7ee nrf5: Updating readme with BLE REPL 2017-06-09 22:33:51 +02:00
Daniel Tralamazza a6b138c9ef Merge pull request #78 from glennrub/fixes
Fixes
2017-06-09 22:27:13 +02:00
Glenn Ruben Bakke c9a7a50c74 Merge remote-tracking branch 'upstream/master' into fixes 2017-06-09 17:05:46 +02:00
Paul Sokolovsky 07241cd37a py/objstringio: If created from immutable object, follow copy on write policy.
Don't create copy of immutable object's contents until .write() is called
on BytesIO.
2017-06-09 17:33:01 +03:00
Ben Whitten 60ad0157f7 nrf/boards: Add DVK BL652 from Laird
To build run 'make BOARD=dvk_bl652 SD=s132'
To flash with jlink run 'make sd BOARD=dvk_bl652 SD=s132'
This will remove the existing licences in the bl652
2017-06-09 15:15:19 +02:00
Ben Whitten 8326d777cc nrf/drivers/bluetooth: Allow s132 to use LFCLK 2017-06-09 15:15:19 +02:00
Ben Whitten decb260890 nrf: Add nordic sd folders to the .gitignore 2017-06-09 15:15:19 +02:00
Damien George b24ccfc639 py/makeqstrdefs.py: Make script run correctly with Python 2.6. 2017-06-09 13:42:13 +10:00
Damien George a8a5d1e8c8 py: Provide mp_decode_uint_skip() to help reduce stack usage.
Taking the address of a local variable leads to increased stack usage, so
the mp_decode_uint_skip() function is added to reduce the need for taking
addresses.  The changes in this patch reduce stack usage of a Python call
by 8 bytes on ARM Thumb, by 16 bytes on non-windowing Xtensa archs, and by
16 bytes on x86-64.  Code size is also slightly reduced on most archs by
around 32 bytes.
2017-06-09 13:36:33 +10:00
Glenn Ruben Bakke 72a564b065 nrf/boards: Updating microbit pin mapping for SPI and I2C. 2017-06-09 00:48:37 +02:00
Glenn Ruben Bakke 30b27b1370 nrf/boards: Correcting feather52 I2C SDA pin assigned to the board. 2017-06-09 00:06:26 +02:00
Glenn Ruben Bakke 708571834a nrf/examples: Update ssd1306 modification example to import correct class. 2017-06-09 00:05:31 +02:00
Glenn Ruben Bakke 5d28a99114 nrf/boards: Activate RTC and Timer module and HAL on pca10056. Also swapping out UART with UART DMA variant on this target board. 2017-06-08 21:42:13 +02:00
Glenn Ruben Bakke 8906084d80 nrf/boards: Activate RTC, Timer, I2C, ADC and HW_SPI module and HAL on pca10031. 2017-06-08 21:23:30 +02:00
Glenn Ruben Bakke 362e2946a5 nrf/boards: Activate RTC, Timer, I2C and ADC module and HAL on pca10001. 2017-06-08 21:06:42 +02:00
Glenn Ruben Bakke 4b4fee8b78 nrf/boards: Adding RTC and Timer module and HAL to pca10000. 2017-06-08 20:58:19 +02:00
Paul Sokolovsky 4352b944d2 zephyr: Define MICROPY_PY_SYS_PLATFORM (to "zephyr"). 2017-06-08 17:58:55 +03:00
Paul Sokolovsky e094200750 tests/float/builtin_float_minmax: PEP8 fixes. 2017-06-08 17:23:22 +03:00
Damien George fde54350a8 tests/float: Convert "sys.exit()" to "raise SystemExit".
The latter is shorter and simpler because it doesn't require importing the
sys module.
2017-06-08 14:00:57 +10:00
Tamas TEVESZ d80c951f71 unix/Makefile: replace references to make with $(MAKE)
make is not always GNU make; the latter  may go by different names.
This helps builds on systems where the default make is not GNU make.
2017-06-08 13:42:23 +10:00
Tamas TEVESZ 1dd18c5260 esp8266/Makefile: replace references to make with $(MAKE)
make is not always GNU make; the latter  may go by different names.
This helps builds on systems where the default make is not GNU make.
2017-06-08 13:42:23 +10:00
Damien George 22cedef95f stmhal/usbdev: For MSC implement SCSI SYNCHRONIZE_CACHE command.
Currently just a dummy command that returns "success", but it's needed for
some O/S's to correctly talk with the SCSI layer.
2017-06-08 12:29:10 +10:00
Daniel Tralamazza f730ea9602 Merge pull request #76 from glennrub/readme_update
nrf: Updating README.
2017-06-07 21:57:37 +02:00
Daniel Tralamazza 52f1fbdd70 Merge pull request #75 from glennrub/remove_unused_file
nrf: Removing unused font header.
2017-06-07 21:56:33 +02:00