Wykres commitów

11423 Commity (093fd807606d088cfaf874e79060a6c68484cbfa)

Autor SHA1 Wiadomość Data
David Lechner 093fd80760 py/modsys: Use consistent naming pattern for module-level const objects.
This renames a few identifiers to follow the usual naming convention of
mp_<module>_<name>.  This makes them easier to find, e.g. when grep'ing.
2020-05-28 10:02:14 +10:00
stijn 9523ca92e0 windows: Make appveyor.yml self-contained.
Add configuration which otherwise has to be set via the UI so the file is
more self-contained, and remove configuration which is not needed because
it's the same as the default.  The major change here is that for a while
now Appveyor has been using Visual Studio 2015 by default while we still
want to support 2013.
2020-05-28 09:56:35 +10:00
stijn 97ccde0c43 py/ringbuf: Fix compilation with msvc.
Older versions do not have "inline" so fetch the definition from
mpconfigport.h.
2020-05-28 09:56:18 +10:00
stijn 81db22f693 py/modmath: Work around msvc float bugs in atan2, fmod and modf.
Older implementations deal with infinity/negative zero incorrectly.  This
commit adds generic fixes that can be enabled by any port that needs them,
along with new tests cases.
2020-05-28 09:54:54 +10:00
Damien George a902b69dd5 py/py.mk: Use additional CFLAGS to compile string0.c.
Otherwise functions like memset might get optimised to call themselves (eg
with gcc 10).  And provide CFLAGS_BUILTIN so these options can be changed
by a port if needed.

Fixes issue #6053.
2020-05-27 23:10:23 +10:00
Damien George 4bbba3060d lib/utils: Lock the scheduler when executing hard callback functions.
Otherwise scheduled functions may execute during the hard callback and then
fail if they try to allocate heap memory.
2020-05-27 17:53:31 +10:00
Joel Stanley d6803067c0 travis: Set build name so it appears in the web interfaces.
The env NAME="foo" syntax doesn't appear to set the name in the Travis web
interface.  Instead use the syntax from the docs:

 https://docs.travis-ci.com/user/build-stages/#naming-your-jobs-within-build-stages
2020-05-27 17:06:10 +10:00
Joel Stanley a9d96499b8 travis: Run apt commands once, to slightly speed up the CI. 2020-05-27 17:05:50 +10:00
Joel Stanley b65482ffa8 powerpc: Set better default compiler.
Most developers use a compiler which is called powerpc64le-linux-gnu-gcc.
2020-05-27 17:02:04 +10:00
Joel Stanley 25bc42e754 powerpc: Fix Makefile rule when linking.
The linker script was included in the "$^" inputs, causing the build to
fail:

 LINK build/firmware.elf
 powerpc64le-linux-gnu-ld: error: linker script file 'powerpc.lds' appears multiple times

As a fix the linker script is left as a dependency of the elf, but only the
object files are linked.
2020-05-27 17:00:44 +10:00
Albort Xue b3bc9808f2 mimxrt/boards: Add MIMXRT1060_EVK board. 2020-05-27 16:49:52 +10:00
Olivier Ortigues e32302c1a6 esp8266/esppwm: Fix PWM glitch when setting duty on different channel.
The PWM driver uses a double buffer for the PWM timing array, one in
current use and the other one to update when changing duty parameters.
The issue was that once the duty parameters were changed the updated buffer
was applied immediately without synchronising to the start of the PWM
period.  By moving the buffer toggling/swapping to the interrupt when the
cycle is done there are no more glitches.
2020-05-27 16:15:28 +10:00
Damien George cae77daf00 docs/develop: Fix module/source name in Makefile of native example. 2020-05-16 15:00:46 +10:00
Yu-Ming Chang dd8db974d7 unix/main: Enter REPL when inspect active, even with stdin redirected.
This is how CPython behaves.
2020-05-16 14:13:15 +10:00
Jim Mussared cd9a8c1742 nrf: Add openocd as a supported flasher.
Tested with the Particle Debugger on a Xenon.
2020-05-15 15:06:02 +10:00
Jim Mussared 1f1b78752f travis: Build more boards as part of nrf job.
Specifically:
- pca10040: It was already the default.
- microbit: It uses nRF51, has a Cortex-M0, and has additional libraries.
- pca10056: It has USB CDC.
2020-05-15 15:06:02 +10:00
Jim Mussared e7f8c7d9a3 nrf: Update to work with nrfx v2.0.0, to match TinyUSB.
Commit 6cea369b89 updated the TinyUSB
submodule to a version based on nrfx v2.0.0.  This commit updates the nrf
port to work with the latest TinyUSB and nrfx v2.0.0.
2020-05-15 15:06:02 +10:00
Damien George 9ee5aff334 lib/nrfx: Upgrade to nrfx v2.0.0. 2020-05-15 15:06:02 +10:00
Damien George 8f348778e1 nrf/mphalport: Remove need for "syntax unified" in mp_hal_delay_us.
Because it can confuse older versions of gcc.  Instead use the correct
instruction for Thumb vs Thumb-2 (sub vs subs) so the assembler emits the
2-byte instruction.

Related to commit 1aa9ff9141.
2020-05-15 15:04:49 +10:00
Damien George eb5e9c00f8 nrf/Makefile: Don't use -fno-builtin for Cortex-M0 builds.
So that error string compression is optimised correctly (it needs strcmp to
be optimised away by the compiler).
2020-05-15 13:39:12 +10:00
Damien George 7dffbfd22a extmod/vfs_lfsx: Fix import_stat so it takes into account current dir.
CPython semantics require searching the current directory if the import is
not absolute (when "" is in sys.path).

Fixes issue #6037.
2020-05-15 11:31:32 +10:00
Thomas Roberts 463c0fb2f4 stm32/boards: Add board config for Nucleo-F412ZG development board. 2020-05-15 10:48:48 +10:00
Thomas Roberts d7399679de stm32: Add support for F412 MCUs. 2020-05-15 10:08:30 +10:00
Rafael Römhild 8f3167a962 esp8266/boards: Allow configuring btree/FAT/LFS2 support when building.
Prior to e0905e85a7 it was possible to
disable btree support on build.  This patch allows to configure btree
support on make again and also the two new introduced options for FAT and
LFS2 filesystems.
2020-05-14 22:16:01 +10:00
Damien George 801f7dca78 py/nativeglue.h: Rename "setjmp" entry to "setjmp_" to avoid any clash.
Because some compilers may define setjmp to something.

Fixes issue #6032.
2020-05-14 21:48:05 +10:00
Thomas Friebel 18fb5b4432 extmod/nimble: Make error code mapping default to MP_EIO.
Before this change, any NimBLE error that does not appear in the
ble_hs_err_to_errno_table maps to return code 0, meaning success.  If we
miss adding an error code to the table we end up returning success in case
of failure.

Instead, handle the zero case explicitly and default to MP_EIO.  This
allows removing the now-redundant MP_EIO entries from the mapping.
2020-05-11 22:31:30 +10:00
Hannah Suarez/hcs0 c9611b280f README: Change --help option to -h to match micropython executable.
The behaviour was changed in 83439e38fc
2020-05-11 21:57:38 +10:00
Damien George 3b6c9119eb extmod/modbluetooth: Add support for changing the GAP device name.
This commit allows the user to set/get the GAP device name used by service
0x1800, characteristic 0x2a00.  The usage is:

    BLE.config(gap_name="myname")
    print(BLE.config("gap_name"))

As part of this change the compile-time setting
MICROPY_PY_BLUETOOTH_DEFAULT_NAME is renamed to
MICROPY_PY_BLUETOOTH_DEFAULT_GAP_NAME to emphasise its link to GAP and this
new "gap_name" config value.  And the default value of this for the NimBLE
bindings is changed from "PYBD" to "MPY NIMBLE" to be more generic.
2020-05-11 21:30:41 +10:00
Thorsten von Eicken f385b7bfa8 stm32/README: Reorg DFU flashing instructions with addition for PYBD. 2020-05-11 21:23:41 +10:00
Thorsten von Eicken ab4e197707 esp32/modsocket: Fix getaddrinfo to raise on error.
This commit fixes the behaviour of socket.getaddrinfo on the ESP32 so it
raises an OSError when the name resolution fails instead of returning a []
or a resolution for 0.0.0.0.

Tests are added (generic and ESP32-specific) to verify behaviour consistent
with CPython, modulo the different types of exceptions per MicroPython
documentation.
2020-05-09 16:43:48 +10:00
Damien George adb6733022 tests/run-tests: Skip REPL feature checks when running via pyboard.py. 2020-05-09 16:20:40 +10:00
Damien George 172fc040aa py/parse: Make mp_parse_node_extract_list return size_t instead of int.
Because this function can only return non-negative values, and having the
correct return type gives more information to the caller.
2020-05-09 00:55:44 +10:00
Damien George 035059eaf5 tests/run-multitests.py: Add TRACE banner and move TEST output to end.
To make it easier to understand the output when both -s and -t are used.
2020-05-09 00:06:06 +10:00
Damien George 67fca2b715 esp8266/uart: Move a few functions from iRAM to iROM.
They call functions in iROM so do not need to be in iRAM.
2020-05-08 23:44:57 +10:00
Damien George f2218c2fbd esp8266/esp_mphal: Move most functions in esp_mphal.c from iRAM to iROM.
The ones that are moved out of iRAM should not need to be there, because
either they call functions in iROM (eg mp_hal_stdout_tx_str), or they are
only ever called from a function in iROM and not from an interrupt (eg
ets_esf_free_bufs).

This frees up about 800 bytes of iRAM.
2020-05-08 23:44:57 +10:00
Damien George caa7725642 esp8266/boards: Move py/pairheap.c code from iRAM to iROM.
It doesn't need to be in iRAM.
2020-05-08 23:40:22 +10:00
Damien George e12de1fd9d esp8266: Clean up Pin intr handler by moving all code to machine_pin.c.
The macro MP_FASTCODE is used to explicitly place required functions in
iRAM, instead of needing a separate .c file.
2020-05-08 23:40:22 +10:00
Damien George f792e6c283 py/scheduler: Convert mp_sched_full and mp_sched_num_pending to macros.
So they are guaranteed to be inlined within functions like
mp_sched_schedule which may be located in a special memory region.
2020-05-08 23:20:45 +10:00
robert 0f83ef395c extmod/vfs_lfsx: Fix rename to respect cur dir for new path.
If the new name start with '/', cur_dir is not prepened any more, so that
the current working directory is respected.  And extend the test cases for
rename to cover this functionality.
2020-05-08 21:54:04 +10:00
robert d3ea28d04a extmod/vfs_lfsx: Normalize path name in chdir.
This change scans for '.', '..' and multiple '/' and normalizes the new
path name.  If the resulting path does not exist, an error is raised.
Non-existing interim path elements are ignored if they are removed during
normalization.
2020-05-08 21:52:15 +10:00
robert a5ea4b9f3f extmod/vfs_lfsx: Fix path handling in uos.stat() to consider cur dir.
This fixes the bug, that stat(filename) would not consider the current
working directory.  So if e.g. the cwd is "lib", then stat("main.py") would
return the info for "/main.py" instead of "/lib/main.py".
2020-05-08 21:37:51 +10:00
Damien George 037c83b0ed tests/multi_bluetooth: Fix typo printing wrong IRQ type. 2020-05-08 13:23:45 +10:00
Damien George e2def200bf stm32/boards/PYBD_SF2: Put BTstack library in external QSPI XIP flash.
In the same way the nimble stack is put there.
2020-05-05 20:21:15 +10:00
Maureen Helm 25434e976b zephyr: Use zephyr build system to merge configurations.
The zephyr build system supports merging application-level board
configurations, so there is no need to reproduce this functionality in
MicroPython.

If CONF_FILE is not explicitly set, then the zephyr build system looks for
prj.conf in the application directory.  Therefore we rename the MicroPython
prj_base.conf to prj.conf.

Furthermore, if the zephyr build system finds boards/$(BOARD).conf in the
application directory, it merges that configuration with prj.conf.
Therefore we rename all the MicroPython board .conf files and move them
into a boards/ directory.

The minimal configuration, prj_minimal.conf, is left in the application
directory because it is used as an explicitly set CONF_FILE in
make-minimal.
2020-05-05 00:48:44 +10:00
yangfl 138a28dc07 tests/thread/thread_stacksize1.py: Increase stack size for CPython.
On arm64 with CPython:

  >>> _thread.stack_size(32*1024)
  Traceback (most recent call last):
    File "<stdin>", line 1, in <module>
  ValueError: size not valid: 32768 bytes

So increase the CPython value in the test to 512k so it runs on more
systems (on modern Linux the default stack size is usually 8MB).
2020-05-05 00:43:24 +10:00
Damien George 4ede703687 py/parse: Support constant folding of power operator for integers.
Constant expression like "2 ** 3" will now be folded, and the special form
"X = const(2 ** 3)" will now compile because the argument to the const is
now a constant.

Fixes issue #5865.
2020-05-03 16:23:19 +10:00
Thorsten von Eicken 40e9227733 esp32/partitions: Update comments in files regarding offset. 2020-05-03 15:01:26 +10:00
Thorsten von Eicken 952ff8a8ea esp32: Improve support for OTA updates.
This commit adds several small items to improve the support for OTA
updates on an esp32:

- a partition table for 4MB flash modules that has two OTA partitions ready
  to go to do updates
- a GENERIC_OTA board that uses that partition table and that enables
  automatic roll-back in the bootloader
- a new esp32.Partition.mark_app_valid_cancel_rollback() class-method to
  signal that the boot is successful and should not be rolled back at the
  next reset
- an automated test for doing an OTA update
- documentation updates
2020-05-03 15:00:45 +10:00
Thorsten von Eicken 7d97d241e8 docs/library: Fix docs for machine.WDT to specify millisecond timeout. 2020-05-02 22:55:48 +10:00
Jim Mussared 309c19d39b tests/cpydiff: Add cpydiff test for __all__ used in imported package. 2020-05-02 17:41:04 +10:00