summaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2020-04-29extmod/modbluetooth: Fix sign compare and unused variable warnings.Jim Mussared
2020-04-29lib/btstack: Update to c8b9823 for USB HCI reset timeout fix.Jim Mussared
2020-04-29unix: Enable modbluetooth on the "dev" and "coverage" variants.Jim Mussared
And MICROPY_PY_URANDOM_EXTRA_FUNCS is enabled on "dev" so tha the Bluetooth examples all run.
2020-04-29tests/run-multitests.py: Add shortcuts for local Python instances.Jim Mussared
One can now use `-i micropython` and `-i cpython` to add instances using the `MICROPYTHON` and `CPYTHON3` variables (which can be overridden by env vars).
2020-04-29tests/multi_bluetooth/ble_gap_advertise: Fix bytes/str compare warning.Jim Mussared
2020-04-29tests/run-multitests.py: Allow filtering out lines from stdout.Jim Mussared
And use this new feature to filter out certain lines in the Bluetooth multitests.
2020-04-29unix: Add support for modbluetooth and BLE using btstack.Jim Mussared
This commit adds full support to the unix port for Bluetooth using the common extmod/modbluetooth Python bindings. This uses the libusb HCI transport, which supports many common USB BT adaptors.
2020-04-29extmod/btstack: Implement more robust init/deinit sequencing.Jim Mussared
2020-04-29stm32/main: Peform a clean shutdown of btstack on soft reset.Jim Mussared
Not just NimBLE.
2020-04-29extmod/modbluetooth: Don't hold atomic section during mp_sched_schedule.Jim Mussared
Because, for example, on unix the atomic section isn't re-entrant, and mp_sched_schedule() will try to re-acquire the atomic section.
2020-04-29stm32/Makefile: Rename SRC_LIB to LIB_SRC_C to match other ports.Jim Mussared
2020-04-29unix/modmachine: Add machine.idle(), implemented using sched_yield.Jim Mussared
Also add a definition of MICROPY_EVENT_POLL_HOOK so the unix port can build against modules that require this.
2020-04-27tests/extmod: Add btree test for errors raised by btree DB library.Damien George
This test now passes given the previous two commits.
2020-04-27py/modio: Allow uio.IOBase streams to return errno for read/write error.Damien George
This allows user code that inherits from uio.IOBase to return an errno error code from the user readinto/write function, by returning a negative value. Eg returning -123 means an errno of 123. This is already how the custom ioctl works.
2020-04-27py/stream: Remove mp_stream_errno and use system errno instead.Damien George
This change is made for two reasons: 1. A 3rd-party library (eg berkeley-db-1.xx, axtls) may use the system provided errno for certain errors, and yet MicroPython stream objects that it calls will be using the internal mp_stream_errno. So if the library returns an error it is not known whether the corresponding errno code is stored in the system errno or mp_stream_errno. Using the system errno in all cases (eg in the mp_stream_posix_XXX wrappers) fixes this ambiguity. 2. For systems that have threading the system-provided errno should always be used because the errno value is thread-local. For systems that do not have an errno, the new lib/embed/__errno.c file is provided.
2020-04-27py/objdict: Fix popitem for ordered dicts.Jim Mussared
The popitem method wasn't implemented for ordered dicts and would result in an invalid state. Fixes issue #5956.
2020-04-27extmod/nimble: Update to work with NimBLE 1.3.Jim Mussared
2020-04-27lib/mynewt-nimble: Update submodule to NimBLE release 1.3.0.Jim Mussared
2020-04-23README: Fix small typo, dfeault -> default.Krsna Mahapatra
2020-04-23all: Format code to add space after C++-style comment start.stijn
Note: the uncrustify configuration is explicitly set to 'add' instead of 'force' in order not to alter the comments which use extra spaces after // as a means of indenting text for clarity.
2020-04-23all: Remove commented-out include statements.stijn
2020-04-23esp32: Consolidate check_esp_err functions and add IDF error string.Thorsten von Eicken
This commit consolidates a number of check_esp_err functions that check whether an ESP-IDF return code is OK and raises an exception if not. The exception raised is an OSError with the error code as the first argument (negative if it's ESP-IDF specific) and the ESP-IDF error string as the second argument. This commit also fixes esp32.Partition.set_boot to use check_esp_err, and uses that function for a unit test.
2020-04-23esp32/modesp32: Add idf_heap_info(capabilities) to esp32 module.Thorsten von Eicken
This commit adds an idf_heap_info(capabilities) method to the esp32 module which returns info about the ESP-IDF heaps. It's useful to get a bit of a picture of what's going on when code fails because ESP-IDF can't allocate memory anymore. Includes documentation and a test.
2020-04-22README: Update Travis CI links to point to travis-ci.com.Damien George
MicroPython now build at the .com rather than the .org.
2020-04-22tools/check_code_size.sh: Remove unused script.Damien George
It's now replaced by tools/metrics.py.
2020-04-22travis: Use tools/metrics.py to compute size diff of minimal ports.Damien George
This is to make the Travis CI size check more robust, by not relying on the saved firmware from a previous build (which may use a different compiler, environment, etc) but rather compile both master and the PR and diff them. This size check now checks both bare-arm and minimal x86-32 builds (before it just checked minimal Cortex-M build).
2020-04-22tools/metrics.py: Use OrderedDict when reading build log.Damien George
So that the output (eg of the diff command) always has the lines in the same order.
2020-04-22tools/metrics.py: Don't build mpy-cross if not needed by any ports.Damien George
To save build time.
2020-04-22tools/metrics.py: Add option to diff to error if delta above threshold.Damien George
Useful for things like CI where the size check is automated.
2020-04-20py/makecompresseddata.py: Make compression deterministic.Damien George
Error string compression is not deterministic in certain cases: it depends on the Python version (whether dicts are ordered by default or not) and probably also the order files are passed to this script, leading to a difference in which words are included in the top 128 most common. The changes in this commit use OrderedDict to keep parsed lines in a known order, and, when computing how many bytes are saved by a given word, it uses the word itself to break ties (which would otherwise be "random").
2020-04-19docs/library: Document that char_data/notify_data are also references.Thomas Friebel
2020-04-18stm32/mboot: Expose custom DFU USB VID/PID values at makefile level.Andrew Leech
In mboot, the ability to override the USB vendor/product id's was added back in 5688c9ba09ea8f9ffeeb25bd577a08b57828ffa7. However, when the main firmware is turned into a DFU file the default VID/PID are used there. pydfu.py doesn't care about this but dfu-util does and prevents its use when the VID/PID don't match. This commit exposes BOOTLOADER_DFU_USB_VID/PID as make variables, for use on either command line or mpconfigboard.mk, to set VID/PID in both mboot and DFU files.
2020-04-18all: Enable extra conversion warnings where applicable.stijn
Add -Wdouble-promotion and -Wfloat-conversion for most ports to ban out implicit floating point conversions, and add extra Travis builds using MICROPY_FLOAT_IMPL_FLOAT to uncover warnings which weren't found previously. For the unix port -Wsign-comparison is added as well but only there since only clang supports this but gcc doesn't.
2020-04-18py/objint: Do not use fpclassify.stijn
For combinations of certain versions of glibc and gcc the definition of fpclassify always takes float as argument instead of adapting itself to float/double/long double as required by the C99 standard. At the time of writing this happens for instance for glibc 2.27 with gcc 7.5.0 when compiled with -Os and glibc 3.0.7 with gcc 9.3.0. When calling fpclassify with double as argument, as in objint.c, this results in an implicit narrowing conversion which is not really correct plus results in a warning when compiled with -Wfloat-conversion. So fix this by spelling out the logic manually.
2020-04-18all: Fix implicit floating point to integer conversions.stijn
These are found when building with -Wfloat-conversion.
2020-04-18all: Fix implicit conversion from double to float.stijn
These are found when building with -Wfloat-conversion.
2020-04-18py/objarray: Fix sign mismatch in comparison.stijn
Found when compiling with clang and -Wsign-compare.
2020-04-18tests/float: Fix cmath_fun_special for MICROPY_FLOAT_IMPL_FLOAT.stijn
When the unix and windows ports use MICROPY_FLOAT_IMPL_FLOAT instead of MICROPY_FLOAT_IMPL_DOUBLE, the test output has for example complex(-0.15052, 0.34109) instead of the expected complex(-0.15051, 0.34109). Use one decimal place less for the output printing to fix this.
2020-04-18all: Fix implicit floating point promotion.stijn
Initially some of these were found building the unix coverage variant on MacOS because that build uses clang and has -Wdouble-promotion enabled, and clang performs more vigorous promotion checks than gcc. Additionally the codebase has been compiled with clang and msvc (the latter with warning level 3), and with MICROPY_FLOAT_IMPL_FLOAT to find the rest of the conversions. Fixes are implemented either as explicit casts, or by using the correct type, or by using one of the utility functions to handle floating point casting; these have been moved from nativeglue.c to the public API.
2020-04-18Revert "all: Fix implicit casts of float/double, and signed comparison."stijn
This reverts commit a2110bd3fca59df8b16a2b5fe4645a4af30b06ed. There's nothing inherently wrong with it, but upcoming commits will apply similar fixes in a slightly different way.
2020-04-18travis: Finish jobs early after test failure.stijn
For jobs which run tests multiple times terminate after the first run fails otherwise the next test run overwrites the previous results, making --print-failures useless.
2020-04-18travis: Decrease build duration by starting OSX build early.stijn
Looking at the recent build history the time it takes just to complete the OSX build is already 12 minutes so make it start early, which brings down the total build time from about 20 minutes to 14 minutes.
2020-04-16stm32/mboot/README: Clarify that mboot can access FAT formatted FS only.Martin Fischer
2020-04-16stm32/storage: Fix start address of second, internal block device.Martin Fischer
2020-04-16mpy-cross/main: Print uncaught nlr jump to stderr.David Lechner
This is to be consistent with the same change in the unix port, 4ab8bee82f7d095c10c624de93da12a7aa1af8fd.
2020-04-16mpy-cross/main: Fix stderr_print_strn parameter type.David Lechner
Change mp_uint_t to size_t to match the mp_print_strn_t function prototype. This fixes a compiler warning when mp_uint_t and size_t are not the same size.
2020-04-14esp32: Update to ESP IDF v3.3.2.Damien George
2020-04-14py: Always give noop defines when MICROPY_ROM_TEXT_COMPRESSION disabled.Damien George
This commit provides a typedef for mp_rom_error_text_t, and a macro define for MP_COMPRESSED_ROM_TEXT, when MICROPY_ROM_TEXT_COMPRESSION is disabled. This simplifies the configuration (it no longer has a special case for MICROPY_ENABLE_DYNRUNTIME) and makes it work for other cases that don't use compression (eg examples/embedding). This commit also ensures MICROPY_ROM_TEXT_COMPRESSION is defined during qstr processing.
2020-04-14extmod/uasyncio: Change cannot to can't in error message, and test exp.Damien George
Follow up to 8e048d2548867aac743866ca5a4c244b7b5aac09 which missed these.
2020-04-13py/scope: Add assert to check that low numbered qstrs do fit in uint8_t.Romain Goyet