Commit Graph

8516 Commits

Author SHA1 Message Date
Damien George ff927cb106 stmhal/spi: Clean and/or invalidate D-cache before SPI DMA transfers.
On MCUs with a cache (eg F7) this must be done or else the SPI data that is
transferred is incorrect.
2017-03-28 12:54:01 +11:00
Damien George 9a1b3da158 stmhal/board: Fix existing and add more pin defs for NUCLEO_F767ZI. 2017-03-28 12:42:23 +11:00
Damien George 8b36664e17 stmhal/boards: Fix alt-func config for PA5 of STM32F767. 2017-03-28 12:41:55 +11:00
Paul Sokolovsky dbb2aea428 zephyr/prj_base.conf: Disable legacy kernel compatibility.
This keeps dependency on mdef, sysgen and other stuff which complicates
build integration.
2017-03-27 17:06:30 +03:00
Damien George 54507f78ee py/objmap: Convert mp_uint_t to size_t. 2017-03-27 12:19:24 +11:00
Damien George f648e5442b esp8266/modesp: Remove long-obsolete and unused espconn bindings. 2017-03-27 12:05:18 +11:00
Damien George 734775524e tests/basics: Add test for super() when self is closed over. 2017-03-27 11:29:11 +11:00
Damien George 40c1272e55 py/compile: When compiling super(), handle closed-over self variable.
The self variable may be closed-over in the function, and in that case the
call to super() should load the contents of the closure cell using
LOAD_DEREF (before this patch it would just load the cell directly).
2017-03-27 11:27:08 +11:00
Damien George a0973b09ce py/vm: Fix VM opcode tracing to print correct stack pointer.
Also const_table is now moved to the code_state->fun_bc structure.
2017-03-27 10:52:04 +11:00
Paul Sokolovsky 220df8544b zephyr/zephyr_getchar: Use native k_sem instead of legacy nano_sem. 2017-03-27 00:41:58 +03:00
Glenn Ruben Bakke 06af64a78a nrf5/bluetooth: Adding template functions for service discovery in bluetooth driver. 2017-03-26 22:59:30 +02:00
Glenn Ruben Bakke 0914b34193 nrf5/bluetooth: Adding function to register gattc event handler (central). 2017-03-26 22:57:07 +02:00
Glenn Ruben Bakke 025f07dbab nrf5/bluetooth: Adding intermediate gattc callback function type in bluetooth driver. 2017-03-26 22:51:10 +02:00
Glenn Ruben Bakke 49cce723a9 nrf5/bluetooth: Turning off debug logging in bluetooth driver, which does not work well with bluetooth REPL mode. 2017-03-26 21:06:17 +02:00
Glenn Ruben Bakke 2f2e67e9bd nrf5/bluetooth: Fixing some smaller tab errors in the bluetooth driver. 2017-03-26 21:05:06 +02:00
Glenn Ruben Bakke cd2149a47f nrf5/bluetooth: Updating bluetooth le driver to handle GAP conn param update request. Also updating minor syntax in previous switch case. 2017-03-26 21:02:25 +02:00
Glenn Ruben Bakke fb983c7692 nrf5/boards: Inrease heap size in the nrf52832 w/s132 bluetooth stack linker script. 2017-03-26 20:46:23 +02:00
Glenn Ruben Bakke c230bc021a nrf5/modules/ubluepy: Update connect method to parse dev_addr parameter and pass it to the bluetooth driver, going through a allocated heap buffer. Adding call to the bluetooth driver to issue a connect. Hardcoding address type for now. 2017-03-26 20:45:21 +02:00
Glenn Ruben Bakke bcf4631e0a nrf5/bluetooth: Updating connect function in the bluetooth driver to do a successful connect to a peripheral device. 2017-03-26 20:43:43 +02:00
Damien George 3f810daeb3 py/obj: Change mp_uint_t to size_t for mp_obj_get_array_fixed_n len arg. 2017-03-26 19:20:06 +11:00
Damien George 9c388f66cf esp8266/modesp: Use mp_obj_str_get_str instead of mp_obj_str_get_data. 2017-03-26 19:19:48 +11:00
Damien George b568448306 extmod/modlwip: Use mp_obj_str_get_str instead of mp_obj_str_get_data. 2017-03-26 19:19:35 +11:00
Damien George fb139a4ba6 README: Change Travis & Coveralls badges to not use link references.
Link references don't seem to work anymore.
2017-03-26 17:03:54 +11:00
Paul Sokolovsky 99866a00a0 py/nlrx86: Better check for Zephyr (requires 1.7). 2017-03-26 00:33:23 +03:00
Glenn Ruben Bakke 4d147beedb nrf5/modules/ubluepy: Adding template function for central connect() in peripheral object. 2017-03-25 17:51:52 +01:00
Glenn Ruben Bakke 098e64b122 nrf5/modules/ubluepy: Adding locals dict to Scan Entry introducing function to retreive Scan Data. Not working as expected together with .attr. It looks like locals dict functions are treated to be attributes and cannot be resolved. 2017-03-25 17:39:44 +01:00
Paul Sokolovsky fa17eabce9 README: Describe extmod/ dir. 2017-03-25 17:12:24 +03:00
Paul Sokolovsky c16d1c07ca README: Add link to docs.micropython.org. 2017-03-25 17:07:57 +03:00
Damien George 29424304d9 unix: Use mp_obj_str_get_str instead of mp_obj_str_get_data. 2017-03-25 19:54:07 +11:00
Damien George ab5689bc9d py/objarray: Use mp_obj_str_get_str instead of mp_obj_str_get_data. 2017-03-25 19:53:31 +11:00
Damien George 64a4f11b2d py: Remove MP_STATE_CTX, use MP_STATE_THREAD instead (it's an alias).
MP_STATE_CTX was recently aliased to MP_STATE_THREAD and can now be
removed.
2017-03-24 18:43:28 +11:00
Damien George 707f16b05c py: Use mp_locals/mp_globals accessor funcs instead of MP_STATE_CTX.
To improve maintainability of the code.
2017-03-24 18:41:11 +11:00
Damien George f4ee1ba9b4 py/objnamedtuple: Use size_t where appropriate, instead of mp_uint_t. 2017-03-24 17:25:25 +11:00
Damien George d1b93ced78 py/objtype: Use size_t where appropriate, instead of mp_uint_t or uint. 2017-03-24 16:58:13 +11:00
Damien George bfb48c1620 tests/float: Add tests for round() of inf, nan and large number. 2017-03-24 11:00:45 +11:00
Damien George c236ebfea7 py/modbuiltins: Allow round() to return a big int if necessary.
Previous to this patch, if the result of the round function overflowed a
small int, or was inf or nan, then a garbage value was returned.  With
this patch the correct big-int is returned if necessary and exceptions are
raised for inf or nan.
2017-03-24 11:00:45 +11:00
Damien George 125eae1ba3 py/modbuiltins: For round() builtin use nearbyint instead of round.
The C nearbyint function has exactly the semantics that Python's round()
requires, whereas C's round() requires extra steps to handle rounding of
numbers half way between integers.  So using nearbyint reduces code size
and potentially eliminates any source of errors in the handling of half-way
numbers.

Also, bare-metal implementations of nearbyint can be more efficient than
round, so further code size is saved (and efficiency improved).

nearbyint is provided in the C99 standard so it should be available on all
supported platforms.
2017-03-24 11:00:45 +11:00
Damien George fb161aa45a lib/libm: Add implementation of nearbyintf, from musl-1.1.16. 2017-03-24 10:38:11 +11:00
Glenn Ruben Bakke f38b0ba037 nrf5/bluetooth: Adding function for connecting to a device (in central role). Not yet tested. 2017-03-23 21:03:40 +01:00
Damien George bacb52aa2d tests/float: Add tests for math funcs that return ints.
One should test bigint, inf and nan to make sure all cases are covered.
2017-03-23 23:54:10 +11:00
Damien George c073519ec8 py/objint: Handle special case of -0 when classifying fp as int.
Otherwise -0.0 is classified as a bigint, which for builds without bigints
will lead unexpectedly to an overflow.
2017-03-23 23:51:35 +11:00
Damien George febeff4af4 py/modmath: Allow trunc/ceil/floor to return a big int if necessary.
Previous to this patch, if the result of the trunc/ceil/floor functions
overflowed a small int, or was inf or nan, then a garbage value was
returned.  With this patch the correct big-int is returned if necessary,
and exceptions are raised for inf or nan.
2017-03-23 22:57:08 +11:00
Damien George f64a3e296e py/lexer: Remove obsolete comment, since lexer can now raise exceptions. 2017-03-23 16:40:24 +11:00
Damien George 60656eaea4 py: Define and use MP_OBJ_ITER_BUF_NSLOTS to get size of stack iter buf.
It improves readability of code and reduces the chance to make a mistake.

This patch also fixes a bug with nan-boxing builds by rounding up the
calculation of the new NSLOTS variable, giving the correct number of slots
(being 4) even if mp_obj_t is larger than the native machine size.
2017-03-23 16:36:08 +11:00
Damien George 507119f4d8 py/sequence: Convert mp_uint_t to size_t where appropriate. 2017-03-23 16:23:20 +11:00
Damien George c88cfe165b py: Use size_t as len argument and return type of mp_get_index.
These values are used to compute memory addresses and so size_t is the
more appropriate type to use.
2017-03-23 16:17:40 +11:00
stijn 3f3df43501 msvc: Remove directory with generated files when cleaning.
This assures after cleaning all build artefacts (qstr related files,
generated version header) have been removed.
2017-03-23 15:49:57 +11:00
stijn c61131380d windows: Make msvc project file support any version from VS2013 to VS2017
Instead of having the PlatformToolset property hardcoded to a specific
version just set it to the value of DefaultPlatformToolset: this gets
defined according to the commandline environment in which the build was
started.
Instead of just supporting VS2015 the project can now be built by any
version from VS2013 to VS2017 and normally future versions as well, without
quirks like VS asking whether you want to upgrade the project to the latest
version (as was the case when opening the project in VS2017) or not being
able to build at all (as was the case when opening the project in VS2013).

Also adjust the .gitignore file to ignore any artefacts from VS2017.
2017-03-23 15:44:27 +11:00
Damien George 92cd000842 minimal/Makefile: Change C standard from gnu99 to c99. 2017-03-23 15:41:38 +11:00
Damien George 4afa782fb4 bare-arm/Makefile: Change C standard from gnu99 to c99. 2017-03-23 15:41:04 +11:00