Paul Sokolovsky
de48a27d60
unix/main: Properly handle MICROPYPATH starting with ':'.
...
In other words, where first path component is an empty string.
2017-02-07 02:13:01 +03:00
Glenn Ruben Bakke
b6779fa95a
nrf5/modules: Adding ubluepy UUID class template.
2017-02-06 20:51:24 +01:00
Glenn Ruben Bakke
ef5228ae57
nrf5/modules: Adding ubluepy characteristic class template.
2017-02-06 20:48:01 +01:00
Glenn Ruben Bakke
4cda1b37fd
nrf5/modules: Adding missing #endif. Also adding to property templates to the lolcal dict.
2017-02-06 20:41:42 +01:00
Glenn Ruben Bakke
c2fb8bf9c2
nrf5/modules: Adding ubluepy service class template.
2017-02-06 20:36:36 +01:00
Glenn Ruben Bakke
3cd518af3a
nrf5/modules: Updating ubluepy with class function placeholders.
2017-02-06 20:19:06 +01:00
Nikita Melentev
5bea6ea808
unix: Fix freedos port build problems.
2017-02-06 15:25:42 +11:00
Damien George
8400351d5a
stmhal: Use MICROPY_EVENT_POLL_HOOK instead of __WFI where appropriate.
2017-02-06 15:10:03 +11:00
Damien George
dee47949cc
extmod/machine_spi: Remove EVENT_POLL_HOOK from soft-SPI transfer func.
...
SPI needs to be fast, and calling the EVENT_POLL_HOOK every byte makes it
unusable for ports that need to do non-trivial work in the EVENT_POLL_HOOK
call. And individual SPI transfers should be short enough in time that
EVENT_POLL_HOOK doesn't need to be called.
If something like this proves to be needed in practice then we will need
to introduce separate event hook macros, one for "slow" loops (eg
select/poll) and one for "fast" loops (eg software I2C, SPI).
2017-02-06 14:38:33 +11:00
Damien George
d3bb3e38df
tests/pyb: Adjust tests so they can run on PYB and PYBLITE.
...
A few tests still fail on PYBLITE, and that's due to differences in the
available peripheral block numbers on the different MCUs (eg I2C(2)
exists on one, but it's I2C(3) on the other).
2017-02-06 13:50:34 +11:00
Damien George
27c149efe0
stmhal: Add pyb.fault_debug() function, to control hard-fault behaviour.
...
This new function controls what happens on a hard-fault:
- debugging disabled: board will do a reset
- debugging enabled: board will print registers and stack and flash LEDs
The default is disabled, ie to do a reset. This is different to previous
behaviour which flashed the LEDs and waited indefinitely.
2017-02-06 13:22:17 +11:00
Damien George
bffda45154
stmhal: On HardFault, print stack pointer and do a stack dump.
2017-02-06 13:22:17 +11:00
Damien George
b7d27e31e8
cc3200: Refactor "ticks" functions to use common extmod implementation.
...
The port now uses the common mp_utime_ticks_{ms,us,cpu,add,diff} functions
from extmod/utime_mphal.c.
The mp_utime_sleep_XXX functions are still cc3200-specific because they
handle the GIL differently to the ones in extmod.
The files misc/mpsystick.[ch] have been removed because they contain 2
unused functions, and the other remaining function is renamed to
mp_hal_ticks_us and moved to hal/cc3200_hal.c.
2017-02-06 11:14:16 +11:00
Glenn Ruben Bakke
73d00c98a0
nrf5/modules: Renaming ble module folder to ubluepy.
2017-02-05 21:10:44 +01:00
Glenn Ruben Bakke
21c4e4633b
nrf5/modules: Adding new template file for ubluepy Peripheral class.
2017-02-05 21:10:06 +01:00
Glenn Ruben Bakke
2b1ceadfab
nrf5/pyb: Moving pyb module into modules/pyb.
2017-02-05 20:30:58 +01:00
Glenn Ruben Bakke
2ad9426917
nrf5/utime: Moving utime module into modules/utime.
2017-02-05 20:28:26 +01:00
Glenn Ruben Bakke
65fb0c9829
nrf5/uos: Moving uos module into modules/uos.
2017-02-05 20:25:27 +01:00
Glenn Ruben Bakke
0983f43ae1
nrf5/network: Moving network module into modules/network. Adding include path to network as its needed by the usocket module.
2017-02-05 20:19:52 +01:00
Glenn Ruben Bakke
9fcef29dfa
nrf5/usocket: Moving usocket module into modules/usocket.
2017-02-05 20:15:50 +01:00
Glenn Ruben Bakke
3c71e75461
nrf5/led: Moving led module into modules/machine.
2017-02-05 20:06:24 +01:00
Glenn Ruben Bakke
42e9b0f735
nrf5/led: Moving led module into modules/machine.
2017-02-05 20:06:06 +01:00
Glenn Ruben Bakke
8601963291
nrf5/pwm: Moving pwm module into modules/machine.
2017-02-05 20:03:52 +01:00
Glenn Ruben Bakke
a7103ef551
nrf5/rtc: Moving rtc module into modules/machine.
2017-02-05 20:01:15 +01:00
Glenn Ruben Bakke
9295f2df29
nrf5/timer: Moving timer module into modules/machine.
2017-02-05 19:59:34 +01:00
Glenn Ruben Bakke
93eb533579
nrf5/pin: Moving pin module into modules/machine.
2017-02-05 19:56:24 +01:00
Glenn Ruben Bakke
616d76cb7a
nrf5/adc: Moving adc module into modules/machine.
2017-02-05 16:17:12 +01:00
Paul Sokolovsky
a4a439caa3
examples/button_reaction: Update for time_pulse_us() no longer raising exc.
2017-02-05 18:01:42 +03:00
Paul Sokolovsky
d5e9ab6e61
extmod/machine_pulse: Make time_pulse_us() not throw exceptions.
...
machine.time_pulse_us() is intended to provide very fine timing, including
while working with signal bursts, where each transition is tracked in row.
Throwing and handling an exception may take too much time and "signal loss".
So instead, in case of a timeout, just return negative value. Cases of
timeout while waiting for initial signal stabilization, and during actual
timing, are recognized.
The documentation is updated accordingly, and rewritten somewhat to clarify
the function behavior.
2017-02-05 14:20:17 +03:00
Glenn Ruben Bakke
eea975cd25
nrf5/i2c: Moving i2c module into modules/machine.
2017-02-05 00:05:20 +01:00
Glenn Ruben Bakke
ab1994b2b2
nrf5/spi: Moving spi module into modules/machine.
2017-02-05 00:03:49 +01:00
Glenn Ruben Bakke
cb2d040726
nrf5/uart: Moving uart module into modules/machine to start converting it into machine module and not pyb.
2017-02-05 00:00:42 +01:00
Glenn Ruben Bakke
8c404909e1
nrf5/machine: Moving modmachine into modules/machine folder. Updating Makefile.
2017-02-04 23:56:42 +01:00
Glenn Ruben Bakke
ab21a6a915
nrf5/drivers: Renaming folder to modules.
2017-02-04 23:51:11 +01:00
Glenn Ruben Bakke
e68681804e
nrf5: Renaming python modules folder to freeze to give the folder its right meaning. The scripts put into this folder will be frozen.
2017-02-04 23:46:29 +01:00
Glenn Ruben Bakke
357b21ae72
nrf5/drivers: Adding template for ubluepy module.
2017-02-04 19:32:40 +01:00
Glenn Ruben Bakke
f8a71311ed
nrf5/sdk: Adding compilation config whether to include BLE NUS implementation. Config found in sdk/nrf5_sdk_conf.h. NUS enabled for s132 targets by default.
2017-02-04 16:24:50 +01:00
Glenn Ruben Bakke
b6d54cbcaf
nrf5: Fallback to HW UART when not Bluetooth LE UART has been enabled.
2017-02-04 16:15:49 +01:00
Glenn Ruben Bakke
e9e98e777d
nrf5: Updating main.c to use MICROPY_PY_BLE_NUS as switch for regular uart initialization or bluetooth le uart initialization.
2017-02-04 16:08:42 +01:00
Glenn Ruben Bakke
918617d1eb
nrf5/sdk: Adding work-in-progress script to connect to bluetooth le REPL using bluepy python module in linux.
2017-02-04 01:12:30 +01:00
Glenn Ruben Bakke
4ddc213d7f
nrf5/boards: Updating board makefiles for s132 and s1xx target for pca10040 (nrf52832) by adding sub variant and device define to the makefiles.
2017-02-03 19:28:16 +01:00
Damien George
bd04ed3e8a
py/objcomplex: Fix typo in ternary expression.
...
This typo actually did the correct thing, but it was very obscure (came
about from think in terms of Python's "x if cond else y" expression).
2017-02-04 00:23:56 +11:00
marc hoffman
91eb0153d3
esp8266/uart: Add support for polling uart device.
2017-02-03 17:15:43 +11:00
Damien George
90ab191b65
py/objstr: Convert some instances of mp_uint_t to size_t.
2017-02-03 13:04:56 +11:00
Damien George
50a9dd59f5
docs: For LCD160CR driver and tutorial, add link to positioning image.
2017-02-03 12:48:54 +11:00
Damien George
904732cdc9
stmhal/mpconfigport.h: Enable MICROPY_PY_BUILTINS_POW3 option.
2017-02-03 12:39:33 +11:00
Damien George
d812eb3435
qemu-arm/mpconfigport.h: Enable MICROPY_PY_BUILTINS_POW3 option.
2017-02-03 12:39:09 +11:00
Damien George
a19b5a01ce
py/mpconfig.h: Move PY_BUILTINS_POW3 config option to diff part of file.
...
With so many config options it's good to (at least try to) keep them
grouped into logical sections.
2017-02-03 12:35:48 +11:00
Damien George
84fb292cd5
tests/basics/string_format_modulo: Add more tests for dict formatting.
2017-02-03 12:17:43 +11:00
Damien George
7317e34383
py/objstr: Give correct behaviour when passing a dict to %-formatting.
...
This patch fixes two main things:
- dicts can be printed directly using '%s' % dict
- %-formatting should not crash when passed a non-dict to, eg, '%(foo)s'
2017-02-03 12:13:44 +11:00