aboutsummaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2020-03-11extmod/modbluetooth: Unify error handling in remaining places.Thomas Friebel
Most error handling is done via `bluetooth_handle_errno()` already. Replace the remaining few manual checks with calls to that function.
2020-03-11extmod/nimble: Clarify active state and check for active in all methods.Jim Mussared
This commit ensures that the BLE stack is active before allowing operations that may otherwise crash if it's not active. It also clarifies the state better (adding the "stopping" state) and renames mp_bluetooth_is_enabled to the more self-explanatory mp_bluetooth_is_active.
2020-03-10esp8266/machine_pin: Disable ets_loop_iter during hard IRQ handler.Damien George
Otherwise ets_loop_iter may be reentered. Related to issue #5714.
2020-03-10tests/multi_bluetooth: Add initial tests for bluetooth BLE.Damien George
2020-03-10travis: Run multi_net tests as part of coverage job.Damien George
2020-03-10tests/multi_net: Add initial set of multi-instance tests for network.Damien George
2020-03-10tests/run-multitests.py: Add new test runner for multiple Py instances.Damien George
This commit adds a test runner and initial test scripts which run multiple Python/MicroPython instances (eg executables, target boards) in parallel. This is useful for testing, eg, network and Bluetooth functionality. Each test file has a set of functions called instanceX(), where X ranges from 0 up to the maximum number of instances that are needed, N-1. Then run-multitests.py will execute this script on N separate instances (eg micropython executables, or attached boards via pyboard.py) at the same time, synchronising their start in the right order, possibly passing IP address (or other address like bluetooth MAC) from the "server" instance to the "client" instances so they can connect to each other. It then runs them to completion, collects the output, and then tests against what CPython gives (or what's in a provided .py.exp file). The tests will be run using the standard unix executable for all instances by default, eg: $ ./run-multitests.py multi_net/*.py Or they can be run with a board and unix executable via: $ ./run-multitests.py --instance pyb:/dev/ttyACM0 --instance exec:micropython multi_net/*.py
2020-03-10travis: Build stm32 PYBD_SF6 with BTstack as bluetooth stack.Damien George
2020-03-10stm32: Refactor Bluetooth HCI RX to be independent of transport layer.Damien George
Now all HCI specific code (eg UART vs WB55 internal messaging) is confined to modbluetooth_hci.c.
2020-03-10extmod/btstack: Implement notifications/indications for GATT clients.Damien George
Work done in collaboration with Jim Mussared aka @jimmo.
2020-03-10extmod/btstack: Implement scan and gatt client, connect and disconnect.Damien George
Work done in collaboration with Jim Mussared aka @jimmo.
2020-03-10extmod/btstack: Implement gatts_db for btstack.Damien George
Work done in collaboration with Jim Mussared aka @jimmo.
2020-03-10extmod/btstack: Implement service registration.Damien George
Work done in collaboration with Jim Mussared aka @jimmo.
2020-03-10extmod/btstack: Implement advertising.Damien George
Work done in collaboration with Jim Mussared aka @jimmo.
2020-03-10stm32/boards/PYBD: Allow building with BTstack (via make command line).Damien George
Work done in collaboration with Jim Mussared aka @jimmo.
2020-03-10stm32: Add bindings for BTstack implementation.Damien George
Work done in collaboration with Jim Mussared aka @jimmo.
2020-03-10extmod/btstack: Add empty modbluetooth implementation.Damien George
Work done in collaboration with Jim Mussared aka @jimmo.
2020-03-10lib: Add BlueKitchen BTstack submodule.Damien George
2020-03-10extmod/modbluetooth: Extract out gatts_db functionality from nimble.Damien George
For use by other stacks, if they need it. Work done in collaboration with Jim Mussared aka @jimmo.
2020-03-10stm32: Refactor bluetooth stack/hci/driver bindings.Damien George
This makes a cleaner separation between the: driver, HCI UART and BT stack. Also updated the naming to be more consistent (mp_bluetooth_hci_*). Work done in collaboration with Jim Mussared aka @jimmo.
2020-03-06extmod/modbluetooth_nimble: Move nimble specific code, factor nimble.mk.Damien George
Move extmod/modbluetooth_nimble.* to extmod/nimble. And move common Makefile lines to extmod/nimble/nimble.mk (which was previously only used by stm32). This allows (upcoming) btstack to follow a similar structure. Work done in collaboration with Jim Mussared aka @jimmo.
2020-03-06stm32/modnetwork: Remove redundant call to nimble_poll in lwip poll.Damien George
The bluetooth stack has its own dedicated polling function, see mod_bluetooth_nimble_poll_wrapper().
2020-03-05tools/makemanifest.py: Fix build on Windows by adding .exe to mpy-cross.MikeTeachman
When using a manifest on Windows the reference to mpy-cross compiler was missing the .exe file extension, so add it when appropriate. Also allow the default path to mpy-cross to be overridden by the (optional) MICROPY_MPYCROSS environment variable, to allow full flexibility on any OS.
2020-03-04unix/file: Don't raise OSError(EINVAL) on sys.stdin/out/err.flush().Damien George
sys.stdout.flush() is needed on CPython to flush the output, and the change in this commit makes such an expression also work on MicroPython (although MicroPython doesn't actual need to do any flushing).
2020-03-03examples/natmod: Add .gitignore to ignore generated example .mpy files.Damien George
2020-02-28py/builtinevex: Support passing in a bytearray/buffer to eval/exec.Damien George
CPython allows this and it's a simple generalisation of the existing code which just supported str/bytes. Fixes issue #5704.
2020-02-28CODECONVENTIONS.md: Update to reflect use of new tools/codeformat.py.Damien George
2020-02-28travis: Add CI job to check code formatting.Damien George
The CI job will fail if there is any code which does not conform to the style encoded by tools/codeformat.py. And it will list any changes required. uncrustify is built from source because Ubuntu bionic has uncrustify-0.66.1 which is from 2017/11/22 and is missing many options needed here.
2020-02-28all: Reformat C and Python source code with tools/codeformat.py.Damien George
This is run with uncrustify 0.70.1, and black 19.10b0.
2020-02-28all: Add *FORMAT-OFF* in various places.Damien George
This string is recognised by uncrustify, to disable formatting in the region marked by these comments. This is necessary in the qstrdef*.h files to prevent modification of the strings within the Q(...). In other places it is used to prevent excessive reformatting that would make the code less readable.
2020-02-28py/parse: Add parenthesis around calculated bit-width in struct.Damien George
To improve interaction with uncrustify formatter.
2020-02-28examples/bluetooth/ble_temperature_central.py: Shorten comment.Damien George
So the line length is less than 100 characters.
2020-02-28examples/accellog.py: Shift long comments to their own line.Damien George
To improve interaction with black formatter.
2020-02-28py: Un-nest configuration #if/#endif's for selection of complex code.Damien George
Because un-nested #if's are simpler to handle with formatting tools.
2020-02-28py/malloc: Put { on separate line for funcs that have selective sigs.Damien George
To ensure there are balanced {}'s in the file, and to help with formatting.
2020-02-28unix/unix_mphal: Adjust #if in mp_hal_stdin_rx_chr to improve format.Damien George
2020-02-28py/builtinimport: Adjust if-block order in find_file to clean up #if's.Damien George
2020-02-28py/bc0.h: Shift comment to start of line to improve format consistency.Damien George
2020-02-28py: Removing dangling "else" to improve code format consistency.Damien George
2020-02-28tools/codeformat.py: Add formatter using uncrustify for C, black for Py.Damien George
This commit adds a tool, codeformat.py, which will reformat C and Python code to fit a certain style. By default the tool will reformat (almost) all the original (ie not 3rd-party) .c, .h and .py files in this repository. Passing filenames on the command-line to codeformat.py will reformat only those. Reformatting is done in-place. uncrustify is used for C reformatting, which is available for many platforms and can be easily built from source, see https://github.com/uncrustify/uncrustify. The configuration for uncrustify is also added in this commit and values are chosen to best match the existing code style. A small post-processing stage on .c and .h files is done by codeformat.py (after running uncrustify) to fix up some minor items: - space inserted after * when used as multiplication with sizeof - #if/ifdef/ifndef/elif/else/endif are dedented by one level when they are configuring if-blocks and case-blocks. For Python code, the formatter used is black, which can be pip-installed; see https://github.com/psf/black. The defaults are used, except for line- length which is set at 99 characters to match the "about 100" line-length limit used in C code. The formatting tools used and their configuration were chosen to strike a balance between keeping existing style and not changing too many lines of code, and enforcing a relatively strict style (especially for Python code). This should help to keep the code consistent across everything, and reduce cognitive load when writing new code to match the style.
2020-02-21stm32/mpconfigport.h: Add option to have custom help text.hahmadi
Define MICROPY_PY_BUILTINS_HELP_TEXT in <yourboard>/mpconfigboard.h for a custom help text.
2020-02-21tests/basics/array1.py: Add equality testing for array.Jim Mussared
2020-02-21py/objarray: Turn on MP_TYPE_FLAG_EQ_CHECKS_OTHER_TYPE for memoryview.Jim Mussared
And add corresponding tests. Fixes #5674 (comparison of memoryview against bytes).
2020-02-21travis: Add OSX build to CI.stijn
Add a standard unix port build in an OSX environment using clang. Should help in catching build failures due to platform differences early on.
2020-02-21extmod/modframebuf: Allow blit source to be a subclass of FrameBuffer.Jim Mussared
2020-02-21py/dynruntime.h: Add implementation of mp_obj_cast_to_native_base.Damien George
2020-02-21py/objtype: Allow mp_instance_cast_to_native_base to take native obj.Damien George
And rename it to mp_obj_cast_to_native_base() to indicate this. This allows users of this function to easily support native and native-subclass objects in the same way (by just passing the object through this function).
2020-02-20py/objtuple: Remove code that handles tuple-subclass equality test.Damien George
Since commit 3aab54bf434e7f025a91ea05052f1bac439fad8c this piece of code is no longer needed because the top-level function mp_obj_equal_not_equal() now handles the case of user types, and will never call tuple's binary_op function with MP_BINARY_OP_EQUAL and a non-tuple on the RHS.
2020-02-20tests/basics: Add test for tuple compare with class derived from tuple.Damien George
Only the "==" operator was tested by the test suite in for such arguments. Other comparison operators like "<" take a different path in the code so need to be tested separately.
2020-02-20tools/makemanifest.py: Support freezing with empty list of mpy files.Damien George
Fixes issue #5655.