Commit Graph

8641 Commits

Author SHA1 Message Date
Damien George 37bd3b4f4c stmhal/modmachine: Add machine.UART class, linking to pyb.UART.
pyb.UART has a superset of machine.UART functionality so can be used to
provide compatibility with other ports that also implement machine.UART.
2017-05-16 17:40:22 +10:00
puuu 4b235800a4 esp8266/modnetwork: In connect, fix potential buffer overflows. 2017-05-16 17:30:45 +10:00
Glenn Ruben Bakke 02e215dc59 nrf5/modules/ubluepy: Making peripheral conn_handle volatile. Upon connection event, the variable is accessed in thread mode. However, the main-loop is blocking on conn_handle != 0xFFFF. If this is not volatile, optimized code will not exit the loop. 2017-05-15 23:01:29 +02:00
Glenn Ruben Bakke 36d9c0cb83 nrf5/drivers/bluetooth: As callback functions are in most usecases are set to NULL upon last event to get public API function out of blocking mode, these function pointers has to be set as volatile, as they are updated to NULL in interrupt context, but read in blocking main-thread. 2017-05-15 23:01:10 +02:00
Tom Collins 162a0f942b tests/io/bytesio_ext: Test read() after seek() past end of BytesIO object. 2017-05-15 23:58:06 +03:00
Tom Collins 53461deb04 py/objstringio: Fix StringIO reads at or beyond EOF.
Existing code failed if seek() went past EOF (which is acceptable when writing).
2017-05-15 23:58:04 +03:00
Glenn Ruben Bakke e6b49af27e nrf5/examples: Fixing overlapping function names and variable names inside the object. Also removing some print statements. Tuning max angle from -7/7 to -25/25. 2017-05-15 21:59:00 +02:00
Glenn Ruben Bakke acce3a59d5 Merge remote-tracking branch 'upstream/master' into nrf5_no_sdk 2017-05-15 20:15:32 +02:00
Paul Sokolovsky d5713c8618 docs/library/index: Add important summary of the intro section as warning.
To make them harder to miss.
2017-05-15 00:26:44 +03:00
glennrub 9b76983af9 Powerup (#26)
* nrf5/examples: Adding python example template for PowerUp 3.0 Bluetooth LE controlled Paper Airplane.

* nrf5: Enable bluetooth le central while developing powerup 3.0 example.

* nrf5/examples: Backing up powerup 3.0 progress.

* nrf5/examples: Adding working example on how to control PowerUp 3.0 paper airplane using bluetooth le.

* nrf5/bluetooth: Disable central role.
2017-05-14 23:02:10 +02:00
Paul Sokolovsky 0ba136fbe9 docs/machine.Signal: Add initial draft description of Signal class. 2017-05-14 23:12:06 +03:00
Paul Sokolovsky c19f07bd52 docs/machine.Pin: There's no toggle() method in MicroPython hardware API.
May be a port-specific method, not portable, not part of the official
specification.
2017-05-14 22:52:16 +03:00
Glenn Ruben Bakke 63805bac9c nrf5/modules/ubluepy: Correcting alignment of enum values in modubluepy.h. 2017-05-14 19:58:10 +02:00
Glenn Ruben Bakke d96e2a3e08 nrf5/drivers/bluetooth: Add implementation of client attribute write without response. 2017-05-14 19:58:10 +02:00
Glenn Ruben Bakke 8f423c26d0 nrf5/modules/ubluepy: Pass on buffer to write in characteristic write central mode. 2017-05-14 19:58:10 +02:00
Glenn Ruben Bakke ceb2602005 nrf5/modules/ubluepy: Updating characteristic object write function to be role aware. Either peripheral or central (gatts or gattc). Adding dummy call to attr_c_write if central is compiled in. Still in progress to be implemented. 2017-05-14 19:58:10 +02:00
Glenn Ruben Bakke 1f8ceaa6fb nrf5/drivers/bluetooth: Adding template function for attr_c_write. 2017-05-14 19:58:10 +02:00
Glenn Ruben Bakke fd52691f02 nrf5/drivers/bluetooth: Renaming attr_write and attr_notify to attr_s_write and attr_s_notify to prepare for introduction of attribute write for gatt client. 2017-05-14 19:58:10 +02:00
Glenn Ruben Bakke 5d9c191a19 nrf5/modules/ubluepy: Fixing type in ubluepy_peripheral.c. 2017-05-14 19:58:10 +02:00
Glenn Ruben Bakke cf0d2bb457 nrf5/modules/ubluepy: Setting peripheral role upon advertise() or connect(). 2017-05-14 19:58:10 +02:00
Glenn Ruben Bakke f8c0ff6413 nrf5/drivers/bluetooth: Adding role member to peripheral object to indicate whether Peripheral object is Peripheral or Central role. 2017-05-14 19:58:10 +02:00
Glenn Ruben Bakke 78c0821216 nrf5/modules/ubluepy: Continue characteristic discovery until nothing more is found during connect proceedure. 2017-05-14 18:06:42 +02:00
Glenn Ruben Bakke 653f4a86d5 nrf5/drivers/bluetooth: Refactoring code to group statics for s130 and s132 into the same ifdef. Also adding two empty lines in discovery functions to make it more easy to read. 2017-05-14 18:06:42 +02:00
Glenn Ruben Bakke e8cd010f59 nrf5/drivers/bluetooth: Updating characteristic discovery to signal whether anything was found or not. 2017-05-14 18:06:42 +02:00
Tom Collins f06d0839bd py/modsys: update conditionals for code referencing sys.stdout
Working on a build with PY_IO enabled (for PY_UJSON support) but PY_SYS_STDFILES disabled (no filesystem).  There are multiple references to mp_sys_stdout_obj that should only be enabled if both PY_IO and PY_SYS_STDFILES are enabled.
2017-05-14 18:24:50 +03:00
Paul Sokolovsky 55491031be tools/mpy_cross_all.py: Helper tool to run mpy-cross on the entire project. 2017-05-14 17:51:12 +03:00
Glenn Ruben Bakke 370c20ff6c nrf5/modules/ubluepy: Continue primary service discovery until nothing more is found in connect proceedure. 2017-05-13 18:12:15 +02:00
Glenn Ruben Bakke b4f96a1dc3 nrf5/drivers/bluetooth: Updating primary service discovery api to take in start handle from where to start the service discovery. Also adjusting return parameter to signal whether anything was found or not. 2017-05-13 18:12:15 +02:00
Glenn Ruben Bakke 3420843774 nrf5/modules/ubluepy: Remove duplication GAP event handler registration in peripheral.connect(). 2017-05-13 16:17:03 +02:00
glennrub 4584ef4ace Support address types (#18)
* nrf5/modules/ubluepy: Adding new enumeration of address types.

* nrf5/modules/ubluepy: Adding constants that can be used from micropython for public and random static address types.

* nrf5/modules/ubluepy: Adding support for optionally setting address type in Peripheral.connect(). Public address is used as default. Address types can be retrieved from 'constants'. Either constants.ADDR_TYPE_PUBLIC or constants.ADDR_TYPE_RANDOM_STATIC.

* nrf5/modules/ubluepy: Register central GAP event handler before issuing connect to a peripheral. Has to be done before connect() function as a connected event will be propergated upon successfull connection. The handler will set the connection handle which gets connect function out of the busy loop waiting for connection to succeed.

* nrf5/modules/ubluepy: Removing duplicate setting of GAP event handler in connect().
2017-05-13 16:12:14 +02:00
Paul Sokolovsky 0c57979ce2 zephyr/modusocket: Implement getaddrinfo(). 2017-05-13 16:42:35 +03:00
Paul Sokolovsky 86c4544ef9 zephyr/modusocket: If there're no packets in recv_q, cancel waiter.
This solves a case when socker_read() has blocked on fifo, and then peer
closed event arrives.
2017-05-13 16:22:14 +03:00
Glenn Ruben Bakke 0865fbd92d nrf5/modules/ubluepy: Register central GAP event handler before issuing connect to a peripheral. Has to be done before connect() function as a connected event will be propergated upon successfull connection. The handler will set the connection handle which gets connect function out of the busy loop waiting for connection to succeed. 2017-05-13 15:06:58 +02:00
Paul Sokolovsky 69f0b4ad5b zephyr/modusocket: Switch to net_pkt_append() returning length.
Requires patch in review.
2017-05-13 16:05:10 +03:00
Paul Sokolovsky 39d3335606 zephyr/modusocket: Update for net_pkt refactor. 2017-05-13 15:47:47 +03:00
Paul Sokolovsky c022c9a2f0 zephyr/modusocket: Wrap pkt_get_info() call.
The most important info it returns are numbers of free buffers
in different pools (rx/tx packet headers, data fragments).
2017-05-13 15:23:31 +03:00
Paul Sokolovsky 054a381d7c tests/extmod/vfs_fat_more: Make skippable is uos is not available.
Fixes Zephyr tests.
2017-05-13 14:13:53 +03:00
Damien George cda09727b4 tests/extmod/vfs_fat: Add test for ilistdir of a non-existent directory. 2017-05-13 19:10:15 +10:00
Damien George f95e4e7782 extmod/vfs_fat_misc: Remove dot-dirs filter since FatFS already does it. 2017-05-13 18:58:46 +10:00
Robert HH 71df60cf42 esp8266/ets_alt_task.c: Prevent spurious large increment of ticks_ms()
This happened when the overflow counter for ticks_ms() was interrupted
by an external hard interrupt (issue #3076).
2017-05-13 17:56:16 +10:00
Damien George ec534609f6 tools/mpy-tool.py: Use MP_ROM_xxx macros to support nanbox builds. 2017-05-13 10:08:13 +10:00
Paul Sokolovsky 5383a50072 zephyr/README: Update to require Zephyr 1.8.
There're a lot of changes and fixes in 1.8 regarding IP stack,
incompatible with previous Zephyr versions, so supporting them
doesn't make sense.

This is  the last commit which should build with Zephyr 1.7.
2017-05-12 22:05:07 +03:00
Paul Sokolovsky d57c6564dc zephyr/prj_qemu_x86.conf: Bump RAM size to 320K. 2017-05-12 21:58:51 +03:00
Paul Sokolovsky 50d7ed325a zephyr/modusocket: Add SOL_SOCKET and SO_REUSEADDR constants. 2017-05-12 21:55:42 +03:00
Paul Sokolovsky 1659c0645d zephyr/modusocket: Add dummy setsockopt() implementation. 2017-05-12 21:54:32 +03:00
Glenn Ruben Bakke 18e73d4214 nrf5/modules/ubluepy: Fixing compilation bug of wrong variable name when registering gattc event handler in ublupy peripheral connect function (central mode). 2017-05-12 20:11:30 +02:00
Paul Sokolovsky a4e38db30d unix: Move upip to frozen bytecode dir.
For x86_64 build, this saves only 128 bytes on the final executable
size, but still an improvement.
2017-05-12 18:32:25 +03:00
Paul Sokolovsky 5c312861a6 unix/Makefile: Enable frozen bytecode modules dir. 2017-05-12 18:31:22 +03:00
Paul Sokolovsky ddf0b7dbc3 esp8266/scripts: Move initsetup & port_diag tools to modules/. 2017-05-12 17:58:50 +03:00
Paul Sokolovsky e9308c189a esp8266/scripts: Move drivers/modules to modules/ (frozen bytecode). 2017-05-12 17:57:23 +03:00