Commit Graph

10362 Commits

Author SHA1 Message Date
Scott Shawcroft 7ecbc3a148 shared-bindings: Fix two more try_locks. Copy and paste failed me. 2017-02-28 12:31:27 +01:00
glennrub c1ffac9998 Merge pull request #1 from ajbaabf/nrf5_no_sdk
added support for hardware temperature sensor
2017-02-28 08:33:11 +01:00
Peter Hinch 1f549a3496 docs/library/lcd160cr: Add note about supported JPEG format/encodings. 2017-02-28 17:45:24 +11:00
Bander Ajba 0e723091f9 minor documentation and extra tabs removal fixes 2017-02-28 09:34:13 +03:00
Glenn Ruben Bakke 382f718cfc nrf5/sdk: Updating BLE UART implementation by swapping TX and RX uuid and characterisitic handling. Removed dummy write delay of 10 ms. 2017-02-27 23:47:47 +01:00
Glenn Ruben Bakke b032d765ff nrf5/sdk: Backing up progress in bluetooth le driver. Adding new gap and gatts handlers. Added handling of tx complete events when using notification, responding to MTU request, and setting of default connection parameters. 2017-02-27 23:40:39 +01:00
Paul Sokolovsky ed81574fe9 docs/machine: Fix formatting of Constants section.
Render related constants grouped together, with common description.
2017-02-28 00:38:15 +03:00
Bander Ajba 12a6cb0fbf fixed temp module to allow for instance support 2017-02-27 21:46:53 +03:00
Bander Ajba e52ebb095c fixed temp module to allow for instance support 2017-02-27 21:37:32 +03:00
Scott Shawcroft d598c2a919 atmel-samd: Add USB HID mouse and keyboard support. 2017-02-27 15:43:58 +01:00
Damien George 528aeb3bf3 drivers/display/lcd160cr: Add check that JPEG size is less than 65536. 2017-02-27 18:39:35 +11:00
Damien George f4a12dca58 py/objarray: Disallow slice-assignment to read-only memoryview.
Also comes with a test for this.  Fixes issue #2904.
2017-02-27 16:09:57 +11:00
Krzysztof Blazewicz 23ccb3e12e tools/gen-cpydiff.py: configurable CPython and micropython executables 2017-02-27 15:39:55 +11:00
Krzysztof Blazewicz ae116c2430 docs/Makefile: define and use PYTHON as the interpreter for CPYDIFF
User can override PYTHON executable before running script,
gen-cpydiff.py works only with Python3 and most systems register
its executable as 'python3'.
2017-02-27 15:39:55 +11:00
Damien George ad81a2e6cf minimal: Add ability and description to build without the compiler. 2017-02-27 15:09:15 +11:00
Damien George 3b2fd4df31 lib/utils/pyexec: Allow to compile when the uPy compiler is disabled. 2017-02-27 15:02:32 +11:00
glennrub 56cf514627 Merge pull request #2 from dhylands/fix-makefile
Fix up Makefile dependencies
2017-02-26 17:39:09 +01:00
Bander Ajba 66542c34b9 did required modification to merge the temperature sensore module 2017-02-26 11:17:07 +03:00
Bander Ajba 378c40b4da did required modification to merge the temperature sensore module 2017-02-26 11:14:17 +03:00
Dave Hylands d3c3fa4a74 Fix up Makefile dependencies
I also didn't see any real reason for mkrules.mk to exist,
so I merged the contents into Makefile.

Now you can do:
```
make BOARD=pca10028 clean
make BOARD=pca10028 flash
```
and it will work properly.
2017-02-25 16:52:46 -08:00
Glenn Ruben Bakke dcd980381d nrf5: Updating Makefile to use correct variable for setting directory of file to freeze as mpy. 2017-02-26 01:30:33 +01:00
Glenn Ruben Bakke 65f3e16775 nrf5: Setting stack top in main.c. Thanks dhylands for pointing this out. 2017-02-26 01:29:13 +01:00
Scott Shawcroft 062fac1d43 atmel-samd: Use link time optimization to reduce code size of builds which
share space with the file system.

"Express" builds with SPI flash crash the compiler for some reason so its
currently disabled for them.
2017-02-26 01:00:33 +01:00
Paul Sokolovsky e2f1a8a7ee docs/uhashlib: Provide port-neutral description.
TODO: Remove WiPy-specific chunks.
2017-02-26 00:55:33 +03:00
Scott Shawcroft 3fd19c60cc py: Fix recursion exception. 2017-02-24 17:47:25 +01:00
Scott Shawcroft aef0586ee1 py: Fix varg helpers by adding vlist variant of mp_obj_new_exception_msg 2017-02-24 17:47:02 +01:00
Scott Shawcroft 48d7fca25e atmel-samd: Fix linking by providing cpu info. 2017-02-24 17:45:33 +01:00
Scott Shawcroft 7dbe4e98a7 Make slice make_new match mp_make_new_fun_t exactly, check the input type and enable it for qemu tests. 2017-02-24 16:48:01 +01:00
Scott Shawcroft 75d6abe3bb Correct name of mp_raise_NotImplementedError to make error name. 2017-02-24 16:46:38 +01:00
Paul Sokolovsky 0982884655 extmod/modurandom: Use mp_raise_ValueError().
For the standard unix x86_64 build, this saves 11 bytes on object file
level, but no difference in executable size due to (bloaty) code alignment.
2017-02-24 10:04:23 -05:00
Scott Shawcroft 35071b3681 Make the build quieter by default. 2017-02-24 15:59:59 +01:00
Paul Sokolovsky 4b3da60324 py/runtime: mp_raise_msg(): Accept NULL argument for message.
In this case, raise an exception without a message.

This would allow to shove few code bytes comparing to currently used
mp_raise_msg(..., "") pattern. (Actual savings depend on function code
alignment used by a particular platform.)
2017-02-24 09:57:25 -05:00
Scott Shawcroft baf3ff377e Make more type structures const to save RAM. 2017-02-24 15:23:26 +01:00
Glenn Ruben Bakke 64b23e1127 nrf5/sdk: Backing up progress in BLE UART driver. Adding ringbuffer in order to poll bytes from recieved data in REPL main loop. 2017-02-24 15:14:12 +01:00
Scott Shawcroft e0ef7e3092 Add indices() support to slice. 2017-02-24 15:13:56 +01:00
Scott Shawcroft 12fa5b3a66 Switch exception throwing to mp_raise helpers. It saves a little code space each time to share the call. 2017-02-24 15:13:07 +01:00
Glenn Ruben Bakke bfda169dfe nrf5/modules: Updating ubluepy example to print out gatts write events with data. 2017-02-24 15:08:32 +01:00
Glenn Ruben Bakke e60a06563e nrf5/boards: Updating pca10028 bluetooth stack targets to have a MCU_SUB_VARIANT. 2017-02-24 15:03:53 +01:00
Scott Shawcroft efd429464e atmel-samd: Switch to nano newlib and add size script to build. 2017-02-24 14:55:34 +01:00
Damien George 6771adc75f esp8266/mpconfigport.h: Enable help('modules') feature. 2017-02-24 18:26:51 +11:00
Damien George 8400d0461d drivers/display/lcd160cr: Fix bug with save_to_flash method. 2017-02-24 17:22:57 +11:00
Paul Sokolovsky f5ee4d95a9 cc3200/moduos: Remove uos.sep, as it's strictly optional.
In MicroPython, the path separator is guaranteed to be "/", extra unneeded
things take precious code space (in the port which doesn't have basic things
like floating-port support).
2017-02-23 22:10:58 -08:00
Damien George f615d82d5b py/parse: Simplify handling of errors by raising them directly.
The parser was originally written to work without raising any exceptions
and instead return an error value to the caller.  But it's now required
that a call to the parser be wrapped in an nlr handler, so we may as well
make use of that fact and simplify the parser so that it doesn't need to
keep track of any memory errors that it had.  The parser anyway explicitly
raises an exception at the end if there was an error.

This patch simplifies the parser by letting the underlying memory
allocation functions raise an exception if they fail to allocate any
memory.  And if there is an error parsing the "<id> = const(<val>)" pattern
then that also raises an exception right away instead of trying to recover
gracefully and then raise.
2017-02-24 14:56:37 +11:00
Damien George 5255255fb9 py: Create str/bytes objects in the parser, not the compiler.
Previous to this patch any non-interned str/bytes objects would create a
special parse node that held a copy of the str/bytes data.  Then in the
compiler this data would be turned into a str/bytes object.  This actually
lead to 2 copies of the data, one in the parse node and one in the object.
The parse node's copy of the data would be freed at the end of the compile
stage but nevertheless it meant that the peak memory usage of the
parse/compile stage was higher than it needed to be (by an amount equal to
the number of bytes in all the non-interned str/bytes objects).

This patch changes the behaviour so that str/bytes objects are created
directly in the parser and the object stored in a const-object parse node
(which already exists for bignum, float and complex const objects).  This
reduces peak RAM usage of the parse/compile stage, simplifies the parser
and compiler, and reduces code size by about 170 bytes on Thumb2 archs,
and by about 300 bytes on Xtensa archs.
2017-02-24 13:43:43 +11:00
Damien George f62503dc47 tests/micropython: Add test for consts that are bignums. 2017-02-24 13:08:18 +11:00
Damien George 74f4d2c659 py/parse: Allow parser/compiler consts to be bignums.
This patch allows uPy consts to be bignums, eg:

    X = const(1 << 100)

The infrastructure for consts to be a bignum (rather than restricted to
small integers) has been in place for a while, ever since constant folding
was upgraded to allow bignums.  It just required a small change (in this
patch) to enable it.
2017-02-24 13:03:44 +11:00
Bander Ajba 3882b0e2ff added support for hardware temperature sensor 2017-02-24 00:38:08 +03:00
Glenn Ruben Bakke 6b898d1d67 nrf5/sdk: Adding macro based ringbuffer written by Philip Thrasher. source: https://github.com/pthrasher/c-generic-ring-buffer/blob/master/ringbuffer.h. Copyright noticed copied into the file, and file reviewed by Philip. 2017-02-23 21:52:23 +01:00
Scott Shawcroft 75d0b02b3f Throw an error when sleep time is negative. 2017-02-22 20:41:00 +01:00
Scott Shawcroft 4c05086661 Check that neopixel write is actually given a DigitalInOut. 2017-02-22 20:10:10 +01:00