Commit Graph

8133 Commits

Author SHA1 Message Date
Damien George dcdcc43dad py/mpz: Convert mp_uint_t to size_t where appropriate. 2017-02-16 16:51:13 +11:00
Damien George 4e3bac2e42 py/runtime: Convert mp_uint_t to size_t where appropriate. 2017-02-16 16:51:13 +11:00
Glenn Ruben Bakke 18365135f7 nrf5/modules: Updating ubluepy example to turn led2 on and off when receiving connected and disconnect bluetooth event. 2017-02-15 23:58:23 +01:00
Glenn Ruben Bakke d88320b5b3 nrf5/sdk: Updating bluetooth driver to have configurable logs. 2017-02-15 23:57:23 +01:00
Glenn Ruben Bakke 832a7ffd14 nrf5/modules: updating ubluepy and bluetooth driver to support python created event handler. Added registration of callback from ubluepy against the bluetooth driver and dispatching of events to the user supplied python function. 2017-02-15 23:32:42 +01:00
Glenn Ruben Bakke d29539a395 nrf5/modules: Splitting includes to be inside or outside of the compile guard in ubluepy. This way, all micropython specific includes will be outside, and internal will be inside. This way, there will not be any dependency towards ubluepy headers if not compiled in. 2017-02-15 19:33:11 +01:00
Glenn Ruben Bakke db75b5535c nrf5/modules: Adding two new functions to ubluepy peripheral class to set specific handlers for notificaitons and connection related events. 2017-02-15 19:30:45 +01:00
Glenn Ruben Bakke ec517a37f6 nrf5: Set ubluepy to disabled by default in mpconfigport.h if not configured. 2017-02-15 19:13:55 +01:00
Paul Sokolovsky a937750ceb extmod/modlwip: Add my copyright.
Per:

$ git log modlwip.c |grep ^Auth | sort | uniq -c
      9 Author: Damien George
      2 Author: Galen Hazelwood
     43 Author: Paul Sokolovsky
2017-02-15 19:20:46 +03:00
Paul Sokolovsky f980c70997 tests/basic/: Make various tests skippable.
To run the testsuite on small ports.
2017-02-15 18:11:16 +03:00
Paul Sokolovsky b737c9cbc8 tests/gen_yield_from_close: Use range() instead of reversed().
As a "more basic" builtin iterator, present even in smaller ports.
2017-02-15 17:05:27 +03:00
Paul Sokolovsky eb101a2701 examples/embedding/README: Convert to markdown, grammar and clarity fixes. 2017-02-15 13:27:24 +03:00
Damien George e5cc681cb1 stmhal: Use generic interrupt char code. 2017-02-15 16:39:30 +11:00
Damien George 05a4859585 stmhal: Implement a proper thread scheduler.
This patch changes the threading implementation from simple round-robin
with busy waits on mutexs, to proper scheduling whereby threads that are
waiting on a mutex are only scheduled when the mutex becomes available.
2017-02-15 13:28:48 +11:00
Damien George f6c22a0679 py/vm: Add MICROPY_PY_THREAD_GIL_VM_DIVISOR option.
This improves efficiency of GIL release within the VM, by only doing the
release after a fixed number of jump-opcodes have executed in the current
thread.
2017-02-15 11:28:15 +11:00
Damien George 234f07f16c py/modthread: Use system-provided mutexs for _thread locks.
It's more efficient using the system mutexs instead of synthetic ones with
a busy-wait loop.  The system can do proper scheduling and blocking of the
threads waiting on the mutex.
2017-02-15 11:28:02 +11:00
Damien George 06a12ada48 tests/thread: Add stress-test for creating many threads. 2017-02-15 11:12:37 +11:00
Damien George 2847d7431d tests/thread: Replace busy waiting loops with a loop that sleeps.
Depending on the thread scheduler, a busy-wait loop can hog the CPU and
make the tests very slow.  So convert such loops to loops that have an
explicit sleep, allowing the worker threads to do their job.
2017-02-15 11:12:37 +11:00
Glenn Ruben Bakke 8d1b05563c nrf5/modules: Moving includes inside config defines to make non-ubluepy targets compile again. 2017-02-15 00:26:39 +01:00
Glenn Ruben Bakke b493bfda64 nrf5/modules: Adding 'withDelegate' function to peripheral class. 2017-02-15 00:22:00 +01:00
Glenn Ruben Bakke fd4e659da7 nrf5/modules: Adding ubluepy delegate type to modubluepy globals table. 2017-02-15 00:18:32 +01:00
Glenn Ruben Bakke 4f6e235c68 nrf5: Adding ubluepy_delegate.c to list of source files to compile. 2017-02-15 00:17:47 +01:00
Glenn Ruben Bakke 8b21ee762e nrf5/modules: Adding new object struct for delegate class and adding a delegate struct member to Peripheral class to bookeep callback object when event occurs. 2017-02-15 00:17:04 +01:00
Glenn Ruben Bakke 881e90f7b5 nrf5/modules: Adding template for ubluepy delegate class. 2017-02-15 00:15:48 +01:00
Paul Sokolovsky f2d732f459 tests/extmod: Make tests skippable. 2017-02-15 01:56:22 +03:00
Paul Sokolovsky 7bb146350e tests/dict_fromkeys: Revert to use reversed() to run in native codegen mode. 2017-02-15 01:30:16 +03:00
Paul Sokolovsky 83623b2fde tests/basic/[a-f]*: Make skippable.
For small ports which don't have all features enabled.
2017-02-15 00:57:56 +03:00
Paul Sokolovsky 453f98914e zephyr/main: Don't unconditionally dump stats on each GC.
This was a debug output for initial porting, breaks tests.
2017-02-14 23:31:47 +03:00
Paul Sokolovsky d61ce32022 tests/builtin_dir: The most expected thing in sys is exit, test for it. 2017-02-14 23:30:06 +03:00
Paul Sokolovsky 800b163cd8 tests/comprehension1, containment: Split set tests to separate files.
To make skippable.
2017-02-14 22:31:08 +03:00
Glenn Ruben Bakke 66223b4285 nrf5/sdk: Fixing debug print in bluetooth driver to not use >>> prefix. Adding one more print for connection parameter update. 2017-02-14 20:18:53 +01:00
Paul Sokolovsky ce2e0eeb7b tests/run-tests: Allow to skip tests using async/await keywords. 2017-02-14 22:03:25 +03:00
stijn c6fd9ba4f3 tests: Add option to not clear MICROPYPATH when running tests
This allows using the test runner for other scenarios than just
testing uPy itself.
The principle of comparing either to CPython or else to a .exp
file is really handy but to be able to test custom modules not
built into micropython.exe one needs to be able to specify the
module search path a.k.a MICROPYPATH.
2017-02-14 20:19:00 +03:00
Paul Sokolovsky ce2703599f zephyr: Add qemu_cortex_m3 config fragment.
Should work for QEMU networking with soon-to-merged upstream patch.
2017-02-14 17:01:26 +03:00
Paul Sokolovsky 64916436b2 zephyr: Enable IPv6 networking in addition to IPv4. 2017-02-14 16:23:54 +03:00
Paul Sokolovsky ee3615d800 docs/uos: Remove mention of uos.sep.
MicroPython guarantees '/' to be a path separator, so extra constant taking
precious ROM space are not needed. MicroPython never had such constant, only
one vendor port had it (now unmaintained).
2017-02-14 13:14:46 +03:00
Paul Sokolovsky dd00d0134b examples/hwapi/soft_pwm: Use Signal on()/off() methods.
Just one sample is updated with  on()/off() for now, there should be
remaining sample(s) showing .value() use (but more can be converted later,
as long as 1 or so good samples of .value() remains).
2017-02-14 13:13:41 +03:00
Damien George adc80b8f84 py/objtype: Replace non-ASCII single-quote char with ASCII version. 2017-02-14 20:55:31 +11:00
Glenn Ruben Bakke 44f701946b nrf5/sdk: Correcting advertisment packet in bluetooth driver in order to make the device connectable. 2017-02-13 17:06:13 +01:00
Damien George 0c821f7def docs/library/machine: Make separate TOC for WiPy vs non-WiPy.
WiPy is the only port with ADC and SD, so they shouldn't be included in
other ports' documentation.
2017-02-13 13:06:51 +11:00
Damien George 3625afa173 extmod/vfs: Allow to stat the root directory.
os.stat('/') now works and returns a mostly-empty tuple.  Really all that
is useful is the mode which tells that it's a directory.
2017-02-13 12:25:43 +11:00
Dave Hylands 2f76c3ca0a docs/library/pyb.Pin: Minor typo fix, B6 should be A0.
On the PYBv1.0, X1 maps to A0, not B6.
2017-02-13 11:52:44 +11:00
Damien George 39100dc377 esp8266/moduos: Populate release field of uname in case it was GC'd. 2017-02-13 11:47:17 +11:00
Johannes Wågen f92f7dd2bc stmhal/boards: For STM32F411DISC, change I2C pin according to datasheet.
The pin had to be changed to get the I2C sensors on board to work.
2017-02-13 11:32:27 +11:00
Glenn Ruben Bakke a79c5ca7ab nrf5/sdk: Implementing simple event handler for bluetooth stack driver. 2017-02-13 00:18:47 +01:00
Glenn Ruben Bakke 7a43228a2d nrf5/sdk: Disable all sdk components from being included in the build while implementing ubluepy, overlap in IRQ handler symbol. 2017-02-13 00:16:45 +01:00
Glenn Ruben Bakke c4b60e6cf8 nrf5/modules: Shortening down the device name to be advertised in the example to make it fit with a 128-bit complete UUID. 2017-02-12 23:05:32 +01:00
Glenn Ruben Bakke e432ab4842 nrf5/modules: Bugfix in ubluepy_uuid_make_new. Used wrong buffer to register vendor specific uuid to the bluetooth stack. 2017-02-12 23:04:48 +01:00
Glenn Ruben Bakke 0a0ab8344e nrf5/sdk: Updating advertisment function in bluetooth le driver to add 128-bit complete service UUID provided in service list to the advertisment packet. 2017-02-12 23:03:55 +01:00
Paul Sokolovsky 16a3534ad4 unix/moduselect: Implement ipoll() method with no-allocation policy.
ipoll() allows to poll streams without allocating any memory: this method
returns an iterator (a poll object itself), and the iterator yields
preallocated "callee-owned tuple" with polling results for each active
stream. The only operation a caller is allowed to do with this tuple is
extracting values from it (storing the tuple as a whole somewhere is
not allowed).
2017-02-13 00:23:23 +03:00