Commit Graph

8010 Commits

Author SHA1 Message Date
Glenn Ruben Bakke b93644221e nrf5/sdk: Adding new function to the softdevice handler driver to add vendor specific uuids and return an index to the entry back by reference. 2017-02-09 23:57:30 +01:00
Glenn Ruben Bakke 8a551e1354 nrf5/modules: Updating ubluepy UUID class with constructor that can construct an object based on hex value of 16-bit or string of 16-bit prefixed with '0x'. 2017-02-09 23:05:12 +01:00
Damien George 8f1c6d952a extmod/vfs: Raise OSError(EEXIST) on attempt to mkdir a mount point. 2017-02-09 15:51:34 +11:00
Damien George c66c393130 examples/hwapi: Be sure to import Signal when it's used. 2017-02-09 15:21:57 +11:00
Kai Fricke c8febe631a examples/hwapi: Add hwconfig_pyboard.py for pyboard. 2017-02-09 15:19:28 +11:00
dmazzella 18e6569166 py/objtype: Implement __delattr__ and __setattr__.
This patch implements support for class methods __delattr__ and __setattr__
for customising attribute access.  It is controlled by the config option
MICROPY_PY_DELATTR_SETATTR and is disabled by default.
2017-02-09 12:40:15 +11:00
Damien George ec7dc7f8d7 extmod/vfs: Allow to mount a block device, not just a VFS object.
If the mounted object doesn't have a "mount" method then assume it's a
block device and try to detect the filesystem.  Since we currently only
support FAT filesystems, the behaviour is to just try and create a VfsFat
object automatically, using the given block device.
2017-02-09 12:03:12 +11:00
Glenn Ruben Bakke ddc31d4084 nrf5/modules: Adding Peripheral, Service and UUID class to the ubluepy module globals table. 2017-02-08 18:49:29 +01:00
Glenn Ruben Bakke 0264f68698 nrf5/modules: Extending the implementation of Peripheral class in ubluepy. 2017-02-08 18:48:35 +01:00
Glenn Ruben Bakke 9057fe550b nrf5/modules: Extending the implementation of UUID class in ubluepy. 2017-02-08 18:47:33 +01:00
Glenn Ruben Bakke 323533c3d3 nrf5/sdk: Adding configuration to enable the ubluepy peripheral class when using softdevice 132 from the SDK. 2017-02-08 18:45:49 +01:00
Paul Sokolovsky 181f7d1450 extmod/machine_signal: Implement Signal .on() and .off() methods.
Each method asserts and deasserts signal respectively. They are equivalent
to .value(1) and .value(0) but conceptually simpler (and may help to avoid
confusion with inverted signals, where "asserted" state means logical 0
output).
2017-02-08 11:14:23 +03:00
Damien George 7ae9bee790 stmhal/Makefile: Drop use of -mabi=aapcs-linux; link libgcc by default.
The aapcs-linux ABI is not required, instead the default aapcs ABI is
enough.  And using the default ABI means that the provided libgcc will now
link with the firmware without warnings about variable vs fixed enums.

Although the binary size increases by about 1k, RAM usage is slightly
decreased.  And libgcc may prove useful in the future for things like
long-long division.
2017-02-08 11:50:22 +11:00
Dave Hylands aa34c553ec py/nlr: Fix execstack builds for ARM.
It seems that the gcc toolchain on the RaspberryPi
likes %progbits instead of @progbits. I verified that
%progbits also works under x86, so this should
fix #2848 and fix #2842

I verified that unix and mpy-cross both compile
on my RaspberryPi and on my x64 machine.
2017-02-08 11:12:26 +11:00
Damien George af622eb2a6 py/map: Change mp_uint_t to size_t where appropriate.
The internal map/set functions now use size_t exclusively for computing
addresses.  size_t is enough to reach all of available memory when
computing addresses so is the right type to use.  In particular, for
nanbox builds it saves quite a bit of code size and RAM compared to the
original use of mp_uint_t (which is 64-bits on nanbox builds).
2017-02-08 11:00:15 +11:00
Damien George a25aa2bcc3 py/asmxtensa.h: Explicitly cast args to 32-bits so left-shift is legal.
For archs that have 16-bit pointers, the asmxtensa.h file can give compiler
warnings about left-shift being greater than the width of the type (due to
the inline functions in this header file).  Explicitly casting the
constants to uint32_t stops these warnings.
2017-02-08 10:48:51 +11:00
Glenn Ruben Bakke 35a7aa1331 nrf5: Adding ubluepy module to builtins if bluetooth stack is selected. Disable NUS profile by default. Adding source for ubluepy module into makefile to be included in build. The source is only linked if MICROPY_PY_UBLUEPY is set. 2017-02-08 00:05:37 +01:00
Glenn Ruben Bakke 0f609cd799 nrf5: Aligning code after upmerge with master. Mostly FAT FS related updates. Not tested after merge. 2017-02-07 23:30:54 +01:00
Glenn Ruben Bakke 122d0430db Merge branch 'nrf52' into nrf5_no_sdk 2017-02-07 22:27:32 +01:00
Glenn Ruben Bakke 4cf7fd151e Merge branch 'master' into nrf52 2017-02-07 22:26:13 +01:00
Glenn Ruben Bakke 723943abde nrf5/modules: Adding new and print function to ubluepy peripheral class. Template functions only. 2017-02-07 22:17:55 +01:00
Damien George 21f08524ba docs: Add M-logo as favicon. 2017-02-07 20:04:40 +11:00
Damien George 3217bbe491 docs/esp8266/tutorial: Specify the baudrate in picocom example command. 2017-02-07 16:58:43 +11:00
Damien George 9779c99317 stmhal: Add ability to skip booting from SD card via /flash/SKIPSD file. 2017-02-07 12:35:39 +11:00
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