Commit Graph

27193 Commits

Author SHA1 Message Date
Damien George
2c139bbf4e py/mpz: Fix bugs with bitwise of -0 by ensuring all 0's are positive.
This commit makes sure that the value zero is always encoded in an mpz_t as
neg=0 and len=0 (previously it was just len=0).

This invariant is needed for some of the bitwise operations that operate on
negative numbers, because they cannot handle -0.  For example
(-((1<<100)-(1<<100)))|1 was being computed as -65535, instead of 1.

Fixes issue #8042.

Signed-off-by: Damien George <damien@micropython.org>
2021-12-21 18:00:05 +11:00
Damien George
05bea70979 esp8266/etshal.h: Remove unneeded function declarations.
These removed ones are either unused by MicroPython or provided by osapi.h
in the SDK.  In particular ets_delay_us() has different signatures for
different versions of the SDK, so best to let it provide the declaration.

Fixes issue #8095.

Signed-off-by: Damien George <damien@micropython.org>
2021-12-21 14:37:16 +11:00
Hosted Weblate
5d4fbec072
Merge remote-tracking branch 'origin/main' 2021-12-21 03:24:54 +01:00
Dan Halbert
b60a806968
Merge pull request #5752 from jepler/ci-python3
make github-ci install python version "3.x" everywhere we use actions/setup-python (and upgrade to setup-python@v2)
2021-12-20 21:24:47 -05:00
Jeff Epler
d61d8b1020
set up python 3.x and use setup-python@v2 2021-12-20 19:05:51 -06:00
Hosted Weblate
99ada903d1
Merge remote-tracking branch 'origin/main' 2021-12-21 00:41:55 +01:00
Jeff Epler
6072016c7b
Merge pull request #5749 from FoamyGuy/tilegrid_size_props
Tilegrid size properties
2021-12-20 16:41:45 -07:00
dronecz
5e523c498d
Translated using Weblate (Czech)
Currently translated at 4.5% (47 of 1029 strings)

Translation: CircuitPython/main
Translate-URL: https://hosted.weblate.org/projects/circuitpython/main/cs/
2021-12-20 22:53:46 +01:00
Scott Shawcroft
bd207e4ef9
Merge pull request #5735 from tannewt/kb2040_clk_pin
Add alternative clock pin name to match silkscreen
2021-12-20 12:37:10 -08:00
Scott Shawcroft
1ec3e023d7
Merge pull request #5744 from jepler/update-protomatter
Update protomatter & re-enable rgbmatrix on esp32s2
2021-12-20 12:34:02 -08:00
foamyguy
d08ba86fc4 Revert "code format"
This reverts commit 577358ae99.
2021-12-20 12:09:14 -06:00
foamyguy
8b71519317 code format 2021-12-20 10:48:08 -06:00
Jeff Epler
4125a10d69
pin specific versions of cascadetoml & tomlkit, temporarily 2021-12-20 09:57:26 -06:00
foamyguy
577358ae99 code format 2021-12-20 07:38:16 -06:00
foamyguy
2ce9dc7680 Merge branch 'adafruit_main' into tilegrid_size_props 2021-12-20 07:31:08 -06:00
Matt Trentini
f2b5c99fde stm32/boards/OLIMEX_H407: Fix typo in OLIMEX H407 board.json.
Appears incorrectly as E407 in the download manager.
2021-12-20 12:32:46 +11:00
iabdalkader
bedd9c5463 stm32/boards/make-pins.py: Generate empty ADC table if needed.
If ADCx pins are hidden, print an empty table to prevent linker errors.
2021-12-20 09:41:46 +11:00
iabdalkader
1dc532019b stm32/qspi: Fix typo in address comment. 2021-12-19 17:48:00 +11:00
iabdalkader
f9e5b0d93d stm32/factoryreset: Init vfs flags before calling pyb_flash_init_vfs.
The vfs flags could have any random value from stack.  This bug was
introduced back in 7723dac337
2021-12-19 17:42:15 +11:00
Jeff Epler
4eb780732b
Merge pull request #5748 from dhalbert/pixelbuf-packed-int-error-7.1.x
Explicitly cast float to mp_int_t - 7.1.x
2021-12-18 18:02:58 -07:00
Damien George
fe9ffff9c0 py/mpstate.h: Only include sys.path/argv objects in state when enabled.
The mp_sys_path_obj and mp_sys_argv_obj objects are only used by the
runtime and accessible from Python if MICROPY_PY_SYS is enabled.  So
exclude them from the runtime state if this option is disabled.

Signed-off-by: Damien George <damien@micropython.org>
2021-12-19 08:55:40 +11:00
Jeff Epler
7f189b3e30
Merge pull request #5747 from adafruit/7.1.x
Merge 7.1.x fixes and updates into main
2021-12-17 20:44:43 -07:00
George Waters
0ce5265624 Explicitly cast float to mp_int_t
Not sure why this is necessary, but it prevents an off-by-one error in
some (rare?) circumstances.
2021-12-17 22:41:48 -05:00
Dan Halbert
0ec839a956
Merge pull request #5746 from dunkmann00/pixelbuf-packed-int-error
Explicitly cast float to mp_int_t
2021-12-17 22:40:01 -05:00
George Waters
c615daff30
Explicitly cast float to mp_int_t
Not sure why this is necessary, but it prevents an off-by-one error in
some (rare?) circumstances.
2021-12-17 16:23:58 -05:00
Dan Halbert
b2189d3590
Merge pull request #5741 from dhalbert/5738-backport-to-7.1.x
Backport #5738 and #5742 to 7.1.x
2021-12-17 16:04:44 -05:00
Jeff Epler
60c2018262
Update protomatter & re-enable rgbmatrix on esp32s2
.. not enabled on s3 & c3 as I did not test there.
2021-12-17 12:04:39 -06:00
Dan Halbert
9096833366
Merge pull request #5740 from jepler/update-ulab
Update ulab
2021-12-17 11:47:40 -05:00
lady ada
654414e57e fix colororder 2021-12-17 10:41:06 -05:00
Dan Halbert
14b24f405f
Merge pull request #5742 from ladyada/main
fix colororder
2021-12-17 10:38:18 -05:00
Jeff Epler
bd282bb1be
do not backslash-escape forward slashes 2021-12-17 09:34:47 -06:00
Jeff Epler
da4f5bdaef
fix ci matrix when ulab is modified
When the submodule is modified, the modified 'filename' is simply the
submodule path `extmod/ulab`, not the specific file(s) in the submodule
that are modified.
2021-12-17 09:32:53 -06:00
lady ada
26c2acae12 nuudge 2021-12-17 09:47:44 -05:00
lady ada
8e540a1738 fix final qtpys2 and s2tft feather pinouts 2021-12-17 09:47:44 -05:00
lady ada
1c1559f5af fix colororder 2021-12-17 09:41:44 -05:00
Jeff Epler
21298237e2
Update ulab
This fixes a doc-building bug and also a bug with any()/all().
2021-12-17 08:28:49 -06:00
Damien George
de43b500bd py/runtime: Allow initialising sys.path/argv with defaults.
If MICROPY_PY_SYS_PATH_ARGV_DEFAULTS is enabled (which it is by default)
then sys.path and sys.argv will be initialised and populated with default
values.  This keeps all bare-metal ports aligned.

Signed-off-by: Damien George <damien@micropython.org>
2021-12-18 00:08:07 +11:00
Jim Mussared
86394f70fc docs/library/sys.rst: Add note about '.frozen' as an entry in sys.path.
Signed-off-by: Jim Mussared <jim.mussared@gmail.com>
2021-12-18 00:08:07 +11:00
Jim Mussared
86ce442607 ports: Add '.frozen' as the first entry in sys.path.
Frozen modules will be searched preferentially, but gives the user the
ability to override this behavior.

This matches the previous behavior where "" was implicitly the frozen
search path, but the frozen list was checked before the filesystem.

Signed-off-by: Jim Mussared <jim.mussared@gmail.com>
2021-12-18 00:08:07 +11:00
Jim Mussared
d6d4a5819b py/mkrules.cmake: Set frozen preprocessor defs early.
This ensures MICROPY_QSTR_EXTRA_POOL and MICROPY_MODULE_FROZEN_MPY are set
if necessary before the CFLAGS are extracted for QSTR generation.

Signed-off-by: Jim Mussared <jim.mussared@gmail.com>
2021-12-18 00:05:18 +11:00
Jim Mussared
e0bf4611c3 py: Only search frozen modules when '.frozen' is found in sys.path.
This changes makemanifest.py & mpy-tool.py to merge string and mpy names
into the same list (now mp_frozen_names).

The various paths for loading a frozen module (mp_find_frozen_module) and
checking existence of a frozen module (mp_frozen_stat) use a common
function that searches this list.

In addition, the frozen lookup will now only take place if the path starts
with ".frozen", which needs to be added to sys.path.

This fixes issues #1804, #2322, #3509, #6419.

Signed-off-by: Jim Mussared <jim.mussared@gmail.com>
2021-12-18 00:01:59 +11:00
Jim Mussared
f853e3e106 tools/makemanifest.py: Merge make-frozen.py.
Takes the functionality from tools/make-frozen.py, adds support for
multiple frozen directories, and moves it to tools/makemanifest.py.

Signed-off-by: Jim Mussared <jim.mussared@gmail.com>
2021-12-17 23:54:05 +11:00
Jim Mussared
92353c2911 all: Remove support for FROZEN_DIR and FROZEN_MPY_DIR.
These have been deprecated for over two years in favour of FROZEN_MANIFEST
and manifest.py.

Signed-off-by: Jim Mussared <jim.mussared@gmail.com>
2021-12-17 23:54:05 +11:00
Jim Mussared
f241db7efe teensy: Switch to use manifest.py instead of FROZEN_DIR.
Signed-off-by: Jim Mussared <jim.mussared@gmail.com>
2021-12-17 23:54:05 +11:00
Jim Mussared
cc23e99f32 py/modio: Remove io.resource_stream function.
This feature is not enabled on any port, it's not in CPython's io module,
and functionality is better suited to the micropython-lib implementation of
pkg_resources.
2021-12-17 23:53:44 +11:00
Dan Halbert
b3d4f2efcc
Merge pull request #5738 from ladyada/main
fix final qtpys2 and s2tft feather pinouts
2021-12-17 07:53:03 -05:00
lady ada
c088090319 nuudge 2021-12-17 01:17:35 -05:00
lady ada
12e72ef406 fix final qtpys2 and s2tft feather pinouts 2021-12-17 00:24:19 -05:00
Jeff Epler
9622457615
Merge pull request #5736 from weblate/weblate-circuitpython-main
Translations update from Hosted Weblate
2021-12-16 17:46:54 -07:00
Jonny Bergdahl
e72470f905
Translated using Weblate (Swedish)
Currently translated at 100.0% (1029 of 1029 strings)

Translation: CircuitPython/main
Translate-URL: https://hosted.weblate.org/projects/circuitpython/main/sv/
2021-12-16 23:53:27 +01:00