summaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2020-10-01py/makeversionhdr.py: Match only git tags which look like versions.Mike Wadsten
Some downstream projects may use tags in their repositories for more than just designating MicroPython releases. In those cases, the makeversionhdr.py script would end up using a different tag than intended. So tell `git describe` to only match tags that look like a MicroPython version tag, such as `v1.12` or `v2.0`.
2020-09-30docs/reference/packages.rst: Fix typo, remove duplicate "port".David Lechner
Fixes #6485.
2020-09-30zephyr: Update build instructions to v2.4.0.Maureen Helm
Updates the zephyr port build instructions to use the latest zephyr release tag. Signed-off-by: Maureen Helm <maureen.helm@nxp.com>
2020-09-30travis: Update zephyr build to v2.4.0.Maureen Helm
Updates CI to use the latest zephyr release tag. Signed-off-by: Maureen Helm <maureen.helm@nxp.com>
2020-09-30zephyr: Const-ify struct device instance pointers.Maureen Helm
Zephyr v2.4.0 added a const qualifier to usages of struct device to allow storing device driver instances exclusively in flash and thereby reduce ram footprint. Signed-off-by: Maureen Helm <maureen.helm@nxp.com>
2020-09-30zephyr: Replace zephyr integer types with C99 types.Maureen Helm
Zephyr v2.4.0 stopped using custom integer types in favor of C99 types instead. Signed-off-by: Maureen Helm <maureen.helm@nxp.com>
2020-09-30extmod/modure: Allow \\ in re.sub replacements.Andrew Leech
2020-09-26examples/bluetooth: Update to use positional-only args to irq().Jim Mussared
To match 6a6a5f9e151473bdcc1d14725d680691ff665a82.
2020-09-25tests/run-tests: Use -BS flags when running CPython.Damien George
The use of -S ensures that only the CPython standard library is accessible, which makes tests run the same regardless of any site-packages that are installed. It also improves start-up time of CPython, reducing the overall time spent running the test suite. tests/basics/containment.py is updated to work around issue with old Python versions not being able to str-format a dict-keys object, which becomes apparent when -S is used. Signed-off-by: Damien George <damien@micropython.org>
2020-09-25docs/develop: Add notes on prerequisite tools for building native .mpy.Damien George
Signed-off-by: Damien George <damien@micropython.org>
2020-09-25extmod/modbluetooth: Change module-owned bytes objects to memoryview.Damien George
A read-only memoryview object is a better representation of the data, which is owned by the ubluetooth module and may change between calls to the user's irq callback function. Signed-off-by: Damien George <damien@micropython.org>
2020-09-25py/objarray.h: Add mp_obj_memoryview_init() helper function.Damien George
Signed-off-by: Damien George <damien@micropython.org>
2020-09-24py/objstr: Make bytes(bytes_obj) return bytes_obj.Iyassou Shimels
Calling the bytes constructor on a bytes object returns the original bytes object. This saves allocating a new instance, and matches CPython. Signed-off-by: Iyassou Shimels <s.iyassou@gmail.com>
2020-09-23windows: Update build instructions in README.stijn
Make the instructions more complete by documenting all needed steps for starting from scratch. Also add a section for MSYS2 since the Travis build uses it as well and it's a good alternative for Cygwin. Remove the mingw32 reference since it's not readily available anymore in most Linux distros nor compiles successfully.
2020-09-23extmod/vfs: Fix lookup of entry in root dir so it fails correctly.Damien George
Prior to this commit, uos.chdir('/') followed by uos.stat('noexist') would succeed that stat even though the entry did not exist (some other functions like listdir would have similar issues). This is because, if the current directory was the root and the path was relative, mp_vfs_lookup_path would return success for bad paths. Signed-off-by: Damien George <damien@micropython.org>
2020-09-22stm32/rfcore: Fix FUS layout and size of ipcc_device_info_table_t.Damien George
The device info table has a different layout when core 2 is in FUS mode. In particular it's larger than the 32 bytes used when in WS mode and if the correct amount of space is not allocated then the end of the table may be overwritten with other data (eg with FUS version 0.5.3). So update the structure to fix this. Also update rfcore.py to disable IRQs (which are enabled by rfcore.c), to not depend on uctypes, and to not require the asm_thumb emitter. Signed-off-by: Damien George <damien@micropython.org>
2020-09-18tests/basics: Add test for MICROPY_PY_ALL_INPLACE_SPECIAL_METHODS ops.Damien George
And enable this feature on unix, the coverage variant. The .exp test file is needed so the test can run on CPython versions prior to "@=" operator support. Signed-off-by: Damien George <damien@micropython.org>
2020-09-18tests/basics: Enable == and != special-method tests now that they work.Damien George
These work since 3aab54bf434e7f025a91ea05052f1bac439fad8c Signed-off-by: Damien George <damien@micropython.org>
2020-09-18stm32/led: Support PWM output without TIM3.Tweako
For example, the STM32WB55 doesn't have TIM3 but can still drive LEDs using PWM on other timers.
2020-09-18py/dynruntime.h: Add mp_import_* and mp_load/store_*.Jim Mussared
These functions already exist in the fun table, and this commit just adds convenience macros for them.
2020-09-18all: Rename absolute time-based functions to include "epoch".Damien George
For time-based functions that work with absolute time there is the need for an Epoch, to set the zero-point at which the absolute time starts counting. Such functions include time.time() and filesystem stat return values. And different ports may use a different Epoch. To make it clearer what functions use the Epoch (whatever it may be), and make the ports more consistent with their use of the Epoch, this commit renames all Epoch related functions to include the word "epoch" in their name (and remove references to "2000"). Along with this rename, the following things have changed: - mp_hal_time_ns() is now specified to return the number of nanoseconds since the Epoch, rather than since 1970 (but since this is an internal function it doesn't change anything for the user). - littlefs timestamps on the esp8266 have been fixed (they were previously off by 30 years in nanoseconds). Otherwise, there is no functional change made by this commit. Signed-off-by: Damien George <damien@micropython.org>
2020-09-18ports: Add utime.gmtime() function.Damien George
To portably get the Epoch. This is simply aliased to localtime() on ports that are not timezone aware. Signed-off-by: Damien George <damien@micropython.org>
2020-09-18esp8266: Remove release-specific manifest, disable osdebug by default.Damien George
This commit removes release-specific builds for the esp8266 and makes the normal build of the GENERIC board more like the release build. This makes esp8266 like all the other ports, for which there is no difference between a daily build and a release build, making things less confusing. Release builds were previously defined by UART_OS=-1 (disable OS messages) and using manifest_release.py to include more frozen modules. The changes in this commit are: - Remove manifest_release.py. - Add existing modules from manifest_release.py (except example code) to the GENERIC board's manifest.py file. - Change UART_OS default to -1 to disable OS messages by default. Signed-off-by: Damien George <damien@micropython.org>
2020-09-18esp32/modnetwork: Re-enable PPP support for IDF-SDK >=v4.Mirko Vogt
PPP support was disabled in 96008ff59a8af9883af17d01b951029d9d02eec9 - marked as "unsupported" due to an early IDF v4 release. With the currently supported IDF v4.x version - 4c81978a - it appears to be working just fine.
2020-09-18esp32/boards/sdkconfig.base: Set default IDF log level to ERROR.Jim Mussared
This commit changes the default logging level on all esp32 boards to ERROR. The esp32 port is now stable enough that it makes sense to remove the info logs to make the output cleaner, and to match other ports. More verbose logging can always be reenabled via esp.osdebug(). This also fixes issue #6354, error messages from NimBLE: the problem is that ble.active(True) will cause the IDF's NimBLE port to reset the "NimBLE" tag back to the default level (which was INFO prior to this commit). Even if the user had previously called esp.osdebug(None), because the IDF is setting the "NimBLE" tag back to the default (INFO), the messages will continue to be shown. The one quirk is that if the user does want to see the additional logging, then they must call esp.osdebug(0, 3) after ble.active(True) to undo the IDF setting the level back to the default (now ERROR). This means that it's impossible (via Python/esp.osdebug) to see stack-startup logging, you'd have to recompile with the default level changed back to INFO.
2020-09-18travis: Install setuptools for black code formatting.Damien George
Signed-off-by: Damien George <damien@micropython.org>
2020-09-18tests/multi_bluetooth/ble_mtu.py: Add multitest for BLE MTU.Jim Mussared
2020-09-18tests/run-multitests.py: Show test/truth diff.Jim Mussared
2020-09-18extmod/modbluetooth: Implement MTU.Jim Mussared
2020-09-18docs/library/ubluetooth.rst: Add docs for MTU API.Jim Mussared
2020-09-18tests/multi_bluetooth: Update UUID format in .exp files.Jim Mussared
2020-09-15docs/library/ubluetooth.rst: Clarify peripheral/central vs server/clientJim Mussared
Previously this documentation assumed peripheral=server and central=client, but this is not accurate or true to the implementation.
2020-09-15extmod/modbluetooth: Print UUIDs correctly.Jim Mussared
In particular, the printed string can now be re-evaluated to construct the same UUID object.
2020-09-15docs/library/ubluetooth.rst: Clarify position/kw arguments.Jim Mussared
Almost all ubluetooth functions are positional-only, but some have optional args. Make this clearer and show what the defaults are.
2020-09-15extmod/modbluetooth: Make BLE.irq() method positional only.Jim Mussared
Simplifcation now that the trigger arg has been removed.
2020-09-15extmod/modbluetooth: Fix handling of optional data/uuid args.Jim Mussared
For the following 3 functions, previously the code relied on whether the arg was passed at all, to make it optional. Now it allows them to be explicitly `None` to indicate they are not used: - gatts_notify(..., [data]) - gattc_discover_services(..., [uuid]) - gattc_discover_characteristics(..., [uuid]) Also ensure that the uuid arguments are actually instances of the uuid type, and fix handling of the 5th arg in gattc_discover_characteristics().
2020-09-12stm32/servo: Fix angle and speed methods to work again with -ve args.Damien George
Fixes a regression introduced by 70affd9ba22e7f62666a9a2fafc2a3c0be9ef95a Fixes issue #6403 Signed-off-by: Damien George <damien@micropython.org>
2020-09-11py/parse: Pass in an mp_print_t to mp_parse_node_print.Damien George
So the output can be redirected if needed. Signed-off-by: Damien George <damien@micropython.org>
2020-09-11py/showbc: Pass in an mp_print_t struct to all bytecode-print functions.Damien George
So the output can be redirected if needed. Signed-off-by: Damien George <damien@micropython.org>
2020-09-11esp32/mpconfigport.h: Remove duplicate uhashlib registration.Jim Mussared
2020-09-11windows: Show test failures in the Appveyor builds.stijn
2020-09-11windows/Makefile: Support freezing modules.stijn
Alter the build flags as needed to support freezing modules with a manifest. This makes freezing works just like it does for e.g. the unix port.
2020-09-11windows/msvc: Support freezing modules.stijn
Support freezing modules via manifest.py for consistency with the other ports. In essence this comes down to calling makemanifest.py and adding the resulting .c file to the build. Note the file with preprocessed qstrs has been renamed to match what makemanifest.py expects and which is also the name all other ports use.
2020-09-11tools: Write msvc-compatible frozen content.stijn
The msvc compiler doesn't accept zero-sized arrays so let the freezing process generate compatible C code in case no modules are found and the involved arrays are all empty. This doesn't affect the functionality in any way because those arrays only get accessed when mp_frozen_mpy_names contains names, i.e. when modules are actually found.
2020-09-11extmod/modussl_axtls: Reduce size of code that makes exception.Damien George
Change in code size (for ports that use axtls) is: unix x64: -152 -0.030% [incl -160(data)] unix nanbox: -112 -0.025% [incl -96(data)] esp8266: -64 -0.009% GENERIC Signed-off-by: Damien George <damien@micropython.org>
2020-09-11py: Fix handling of NaN in certain pow implementations.stijn
Adds a new compile-time option MICROPY_PY_MATH_POW_FIX_NAN for use with toolchains that don't handle pow-of-NaN correctly.
2020-09-11py/objfloat: Fix handling of negative float to power of nan.Damien George
Prior to this commit, pow(-2, float('nan')) would return (nan+nanj), or raise an exception on targets that don't support complex numbers. This is fixed to return simply nan, as CPython does. Signed-off-by: Damien George <damien@micropython.org>
2020-09-10stm32/rtc.h: Include py/obj.h to make header self contained.Damien George
Signed-off-by: Damien George <damien@micropython.org>
2020-09-10stm32/usb: Don't nul pyb_hid_report_desc if MICROPY_HW_USB_HID disabled.Damien George
So this code can be used if pyb_hid_report_desc is not included in the port's root pointer list. Signed-off-by: Damien George <damien@micropython.org>
2020-09-09nrf: Remove unnecessary includes of mpconfigport.h and its header guard.Damien George
The mpconfigport.h file is an internal header and should only ever be included once by mpconfig.h. Signed-off-by: Damien George <damien@micropython.org>