Works with pins declared normally in mpconfigboard.h, eg. (pin_XX), as well
as (pyb_pin_XX).
Provides new mp_hal_pin_config_alt_static(pin_obj, mode, pull, fn_type)
function declared in pin_static_af.h to allow configuring pin alternate
functions by name at compile time.
This mechanism will scale to to an arbitrary number of pollable objects, so
long as they implement the MP_STREAM_GET_FILENO ioctl. Since ussl objects
pass through ioctl requests transparently to the underlying socket object,
it will allow ussl sockets to be polled. And a user object with uio.IOBase
as a base could support polling.
The underlying socket can handling polling, and any other transparent ioctl
requests. Note that CPython handles the case of polling an ssl object by
polling the file descriptor of the underlying socket file, and that
behaviour is emulated here.
Otherwise they may be called on a socket that no longer exists.
For example, if the GC calls the finaliser on the socket and then reuses
its heap memory, the "callback" entry of the old socket may contain invalid
data. If lwIP then calls the TCP callback the code may try to call the
user callback object which is now invalid. The lwIP callbacks must be
deregistered during the closing of the socket, before all the pcb pointers
are set to NULL.
The code was dereferencing 0x800 and loading a value from there, trying to
use a literal value (not address) defined in the linker script
(_ram_fs_cache_block_size) which was 0x800.
This change brings the following benefits:
- all existing tests and test behaviour is be retained
- can now use Travis parallel build mechanism
- total time for tests is about 5 mins 30 secs, down from around 10 mins
- two additional test suites are now run: standard (non coverage) unix
build and nanbox unix build
- much easier to see what is failing: if you click through to the Travis CI
details each parallel build job is displayed with pass/fail
- scales much better when adding new test targets
Adding MICROPY_FATFS as makefile flag in order to explicitly
include oofatfs files to be compiled into the build.
The flag is set to 0 by default. Must be set in addition to
MICROPY_VFS and MICROPY_VFS_FAT in mpconfigport.h.
Temporarly solving the issue of
"differ from the size of original declaration [-Werror=lto-type-mismatch]
until linker is fixed in upcomming release of gcc.
Bug is reported by others, and will be fixed in next version of arm-gcc.
However, this patch makes it possible to use modmusic and modimage
with current compilers.
Alternativly, the code can be compiled with LTO=0, but uses valuable 9K
more on this already squeezed target (microbit).
Support added for s132/s140 v6 in linker scripts and boards.
Support removed for s132 v2/3/5.
Download script updated to fetch new stacks and removed the
non-supported ones.
ble_drv.c updated to only handle s110 v8, and s132/s140 v6.
ubluepy updated to continue scanning after each individual scan
report reported to the module to keep old behaviour of the
Scanner class.
This patch generalize the feather52 target to be a board without
an in-built Bluetooth stack or bootloader giving all flash memory to
micropython code.
This way the feather52 target can run any supported Bluetooth LE
stack the port supports for other nrf52832 targets. Hence, this
make Makefiles/linker scripts and BLE driver support easier
to maintain in the future.
Current adoption on top of nrfx only reads the GPIO->IN register.
In order to read back an output state, nrf_gpio_pin_out_read has
to be called.
This patch concatinate the two read functions such that, if
either IN or OUT register has a value 1 it will return this,
else 0.
Updating lib/nrfx submodule to latest version of master to get
the new GPIO API to read pin direction.
(nrfx: d37b16f2b894b0928395f6f56ca741287a31a244)
Cleaning up use of "pyb" module.
Moving the file to a new folder and updating the
makefile accordingly. New module created called
"board" to take over the functionality of the legacy
"pyb" module.
Updating outdated documentation referring to pyb.Pin,
to now point to machine.Pin.
As EasyDMA variant of SPI(M) might clock out an additional byte
in single byte transactions this patch moves the nrf52832 to
use SPI and not SPIM to get more stable data transactions.
Ref: nrf52832 rev2 errata v1.1, suggested workaround is:
"Use the SPI module (deprecated but still available) or
use the following workaround with SPIM ..."
Current nrfx SPIM driver does not contain this workaround,
and in the meanwhile moving back to SPI fixes the issue.
Also, tabbing the nrfx_config.h a bit to make it more readable.
This patch moves the check of SPI configuration before
including any SPI header files. As targets might disable SPI
support, current code ends up in including SPIM if not SPI
is configured. Hence, this is why the check whether the module is
enabled should be done before including headers.
dfu-gen .PHONY target is run unconditionally as first build
target when included, and might fail if the hex file is not
yet generated.
To prevent this, the dfu-gen and dfu-flash targets are moved
to the main Makefile and only exposed if feather52 is the
defined BOARD.
Update configuration define from
MICROPY_HW_HAS_BUILTIN_FLASH to MICROPY_MBFS.
MICROPY_MBFS will enable the builtin flash as
part of enabling the micro:bit FS.
Clang understands only -fshort-enums, not --short-enums. As
--short-enums isn't even mentioned in the gcc man page, I think this
alias exists more for backwards compatibility.
Removing unused nrf52832_512k_64k_s132_5.0.0.ld.
Adding new linker script s132_5.0.0 following new
linker script scheme.
Updating ble_drv.c to handle de-increment of
outstanding tx packets on hvx for s132 v5.
After nrfx 1.0.0 a new macro was introduced to do a common
hardware timeout. The macro function triggers a counter of
retries or a timeout in us. However, in many cases, like in
nrfx_adc.c the timeout value is set to 0, leading to a infinite
loop in mp_hal_delay_us. This patch prevents this from happening.
Path of error:
nrfx_adc.c -> NRFX_WAIT_FOR -> NRFX_DELAY_US -> mp_hal_delay_us.
This patch also opens up for all arguments to be set as positional
arguments such that an external user of the make_new function can set
provide all parameters as positional arguments.
machine/i2c already uses mp_hal_get_pin_obj which
points to pin_find function in order to locate correct
pin object to use.
The pin_find function was recently updated to also
being able to locate pins based on an integer value,
such that pin number can be used as argument to object
constructors.
This patch modfies and uniforms pin object lookup for
SPI, music and pwm.
Renaming config for enabling random module with hw
random number generator from MICROPY_PY_HW_RNG to
MICROPY_PY_RANDOM_HW_RNG to indicate which module it
is configuring.
Also, disabling the config by default in mpconfigport.h.
Adding the enable of RNG in all board configs.
Moving ifdef in modrandom, which test for the config being
set, earlier in the code. This is to prevent un-necessary
includes if not needed.
Increase the maximum number of queued notifications from 1 to 6. This
massively speeds up the NUS console - especially when printing large
amounts of text. The reason is that multiple transfers can be done in a
single connection event, in ideal cases 6 at a time.