14249 Commits

Author SHA1 Message Date
Amir Gonnen
e8fb6581ba Update LVGL. Enable FFMPEG if available 2022-08-26 22:53:11 +03:00
Amir Gonnen
31d12a2f7d py/qstr: Remove MP_QSTR_SEARCH_THRESHOLD.
MP_QSTR_SEARCH_THRESHOLD doesn't provide improvement with sorted hashes.
Remove MP_QSTR_SEARCH_THRESHOLD and simlify the binary search.

Sequential search is still needed in case of hash collisions, or
unsorted pools.

Signed-off-by: Amir Gonnen <amirgonnen@gmail.com>
2022-08-07 01:13:35 +03:00
Amir Gonnen
d6a96bcd3f Update lv_bindings 2022-08-07 00:24:08 +03:00
Amir Gonnen
4111f1b5f0 py/qstr: Fix hash collision corner case.
This fixes a corner case where both hash and lengths of two qstrs are
equal. In such case, if the binary search lower bound is the second
instance of the same hash, the search will miss the first instance.
To overcome this, when lower bound hash equals the requested hash, we move
the lower bound backwards to cover all previous hashes which are also equal
to the requested hash.
Also removed length comparison since it's no longer needed.

Related: https://github.com/lvgl/lv_binding_micropython/issues/224

Signed-off-by: Amir Gonnen <amirgonnen@gmail.com>
2022-08-06 02:03:33 +03:00
Amir Gonnen
e9d398c02e fix unix port standard variant
Don't disable some macros that conflict with ports/unix/mpconfigport.h

Related: https://github.com/lvgl/lv_binding_micropython/issues/224#issuecomment-1205764647
2022-08-05 00:29:43 +03:00
Amir Gonnen
0e2023e502 Update lv_bindings 2022-08-03 22:13:22 +03:00
Amir Gonnen
0c889ab157 README fixes 2022-07-30 23:06:51 +03:00
Amir Gonnen
6c7c3515ce Update LVGL 2022-07-30 22:57:12 +03:00
Amir Gonnen
5ce3c08e5a Update LVGL and bindings
Fixes https://github.com/amirgon/lvgl/pull/new/fix/spurious_enums
2022-07-30 01:54:49 +03:00
embeddedt
58948c2fb1
Switch JS port GitHub actions to track v9 2022-07-26 20:07:56 -04:00
Amir Gonnen
04bb42e61f Update LVGL and bindings to v9
Related: https://github.com/lvgl/lv_binding_micropython/pull/225
Also update README.md
2022-07-26 23:42:23 +03:00
Amir Gonnen
6ebf96a903 Update lv_bindings 2022-07-16 00:35:07 +03:00
Gabor Peresztegi
7dd2e728c8
Update ESP32-M5Core2 board documentation (#58) 2022-07-14 10:53:44 +03:00
Gabor Peresztegi
60f57d2133
Fix ESP32-M5Core2 board build error (#56) 2022-07-14 09:00:32 +03:00
Amir Gonnen
2e880fb7eb Merge branch 'update_micropython_v1.19' 2022-07-12 23:05:59 +03:00
Amir Gonnen
0303091b48 Merge branch 'update_micropython_v1.19' 2022-07-12 23:03:41 +03:00
Amir Gonnen
e10854be8b Update lv_bindings to origin/master 2022-07-12 22:45:18 +03:00
Amir Gonnen
dbb8b2e556 Align to LVGL v8.3 2022-07-09 23:35:11 +03:00
Amir Gonnen
fde80ec041 stm32: Fix MP_REGISTER_MODULE 2022-07-03 00:45:08 +03:00
Amir Gonnen
8f4705eabb Remove workflows
Remove Micropython upstream workflows that are not refactored for lv_micropython
2022-07-03 00:35:21 +03:00
Amir Gonnen
b912b45c15 Merge branch 'qstr_bsearch' into update_micropython_v1.19 2022-07-03 00:22:59 +03:00
Amir Gonnen
477c1c3a4e py/qstr: Optimize hash sort.
In case cmp == 0 there could be a hash collision. To save program size
Instead of checking for hash collisions, simply revert to linear search
which also compares strings.
2022-07-02 23:40:22 +03:00
Amir Gonnen
b7e692c8e4 py/qstr: Sort qstrs by hash.
Instead of sorting by string, sort qstrs by (hash, len).
This allows faster binary serach on qstr_find_strn, since it's faster
to compare hashes than strings.
A few strings needed to be moved to special string pool (QDEF0)
because their qstr is assumed to be small (8 bit) on py/scope.c
2022-07-02 23:40:22 +03:00
Amir Gonnen
497e519cbc py/makeqstrdata.py: Refactor qstr class.
Use Qstr class instead of tuple, where properties are calculated only when
accessed.
This is needed as preparation to using hash as the sort key instead the
qstr string. It also makes the code more readable when referring to a qstr
in py/makeqstrdata.py and tools/mpy-tool.py (for example, refer to q.order
instead of q[0], or q.qstr instead of q[2])

Signed-off-by: Amir Gonnen <amirgonnen@gmail.com>
2022-07-02 23:40:22 +03:00
Amir Gonnen
18eefe7621 py: Faster qstr search.
Today qstr implementation scans strings sequntially.
In cases there are many strings this can become very inefficient.
This change improves qstr search performance by using binary search in
sorted qstr pools, when possible.

This change introduces an option to create a sorted string pool, which
is then searched by a binary search instead of sequential search.

qstr pool can be either "sorted" or "unsorted", whereas the unsorted is
searched sequentally as today.
Native modules (MP_ROM_QSTR) and frozen modules generate sorted pools.
Currently runtime strings are unsorted.

The constant string pools is split into two and a new pool is introduced,
"special_const_pool". This is required because the first sequence of
strings already requires special ordering therefore created unsorted,
while the rest of the constants are generated sorted.

qstr_find_strn searches strings in each pool. If the pool is sorted and
larger than a threshold, it will be search using binary search instead
of sequential search, significantly improving performance.
2022-07-02 23:38:13 +03:00
Amir Gonnen
3619e5a284 lv_bindings: v1.19 fixes 2022-06-29 00:11:01 +03:00
Amir Gonnen
b4ef72e043 uftpd bugfix: bind API requires string, not int 2022-06-29 00:03:27 +03:00
Amir Gonnen
5118122946 esp32 CMakeLists: Remove redundant include 2022-06-29 00:02:30 +03:00
wyapx
c9f4dfeaf8
fix: typo (#54) 2022-06-28 08:21:24 +03:00
Amir Gonnen
38c5106a9d Merge tag 'v1.19.1' into update_micropython_v1.19
Bug fix for esp32 SoftI2C

This is a bug fix release.  The changes are:

- extmod/machine_i2c: only use WRITE1 option if transfer supports it

  This fixes the machine.SoftI2C.readfrom_mem() method on esp32, so it
  writes the address to read from.
2022-06-26 00:42:09 +03:00
Damien George
9b486340da all: Bump version to 1.19.1.
Some checks failed
esp32 port / build_idf44 (push) Has been cancelled
esp8266 port / build (push) Has been cancelled
javascript port / build (push) Has been cancelled
mimxrt port / build (push) Has been cancelled
nrf port / build (push) Has been cancelled
powerpc port / build (push) Has been cancelled
qemu-arm port / build_and_test (push) Has been cancelled
renesas-ra port / build_renesas_ra_board (push) Has been cancelled
rp2 port / build (push) Has been cancelled
samd port / build (push) Has been cancelled
stm32 port / build_pyb (push) Has been cancelled
stm32 port / build_nucleo (push) Has been cancelled
teensy port / build (push) Has been cancelled
unix port / minimal (push) Has been cancelled
unix port / reproducible (push) Has been cancelled
unix port / standard (push) Has been cancelled
unix port / dev (push) Has been cancelled
unix port / coverage (push) Has been cancelled
unix port / coverage_32bit (push) Has been cancelled
unix port / nanbox (push) Has been cancelled
unix port / float (push) Has been cancelled
unix port / stackless_clang (push) Has been cancelled
unix port / float_clang (push) Has been cancelled
unix port / settrace (push) Has been cancelled
unix port / settrace_stackless (push) Has been cancelled
unix port / macos (push) Has been cancelled
unix port / qemu_mips (push) Has been cancelled
unix port / qemu_arm (push) Has been cancelled
windows port / build (push) Has been cancelled
zephyr port / build (push) Has been cancelled
Signed-off-by: Damien George <damien@micropython.org>
v1.19.1
2022-06-17 12:57:59 +10:00
Damien George
5233fb3a3d extmod/machine_i2c: Only use WRITE1 option if transfer supports it.
When MICROPY_PY_MACHINE_I2C_TRANSFER_WRITE1 is enabled the port's hardware
I2C transfer functions should support the MP_MACHINE_I2C_FLAG_WRITE1
option, but software I2C will not.  So add a flag to the I2C protocol
struct so each individual protocol can indicate whether it supports this
option or not.

Fixes issue #8765.

Signed-off-by: Damien George <damien@micropython.org>
2022-06-17 11:57:57 +10:00
Damien George
d7919ea71e all: Bump version to 1.19.
Some checks failed
esp32 port / build_idf44 (push) Has been cancelled
esp8266 port / build (push) Has been cancelled
javascript port / build (push) Has been cancelled
mimxrt port / build (push) Has been cancelled
nrf port / build (push) Has been cancelled
powerpc port / build (push) Has been cancelled
qemu-arm port / build_and_test (push) Has been cancelled
renesas-ra port / build_renesas_ra_board (push) Has been cancelled
rp2 port / build (push) Has been cancelled
samd port / build (push) Has been cancelled
stm32 port / build_pyb (push) Has been cancelled
stm32 port / build_nucleo (push) Has been cancelled
teensy port / build (push) Has been cancelled
unix port / minimal (push) Has been cancelled
unix port / reproducible (push) Has been cancelled
unix port / standard (push) Has been cancelled
unix port / dev (push) Has been cancelled
unix port / coverage (push) Has been cancelled
unix port / coverage_32bit (push) Has been cancelled
unix port / nanbox (push) Has been cancelled
unix port / float (push) Has been cancelled
unix port / stackless_clang (push) Has been cancelled
unix port / float_clang (push) Has been cancelled
unix port / settrace (push) Has been cancelled
unix port / settrace_stackless (push) Has been cancelled
unix port / macos (push) Has been cancelled
unix port / qemu_mips (push) Has been cancelled
unix port / qemu_arm (push) Has been cancelled
windows port / build (push) Has been cancelled
zephyr port / build (push) Has been cancelled
Signed-off-by: Damien George <damien@micropython.org>
v1.19
2022-06-16 15:11:02 +10:00
Damien George
096954337f stm32/mboot: Only include UI code if at least one board LED is defined.
Otherwise the board must provide dummy definitions of MBOOT_LED1.

Signed-off-by: Damien George <damien@micropython.org>
2022-06-16 14:31:09 +10:00
Damien George
d75892c0b0 zephyr/modusocket: Fix function object wrapper for listen method.
This was missed by 919f696ad254bcc39effe7ce7fddae8cf406c954

Signed-off-by: Damien George <damien@micropython.org>
2022-06-15 11:38:09 +10:00
Amir Gonnen
53e528dfb8 Update bindings (SDL fixes) 2022-06-15 00:26:29 +03:00
Amir Gonnen
5947f8dd43 unix/window: Support new SDL driver
See: https://github.com/lvgl/lv_binding_micropython/pull/215
2022-06-14 23:47:07 +03:00
Amir Gonnen
70494165d2 Update LVGL 2022-06-14 22:26:49 +03:00
Phil Howard
37d5114cec py/makemoduledefs.py: Emit useful error for legacy MP_REGISTER_MODULE.
Catch calls to legacy:

MP_REGISTER_MODULE(name, module, enable)

Emit a friendly error suggesting they be rewritten to:

MP_REGISTER_MODULE(name, module).

Signed-off-by: Phil Howard <phil@pimoroni.com>
2022-06-14 15:05:37 +01:00
Andrew Scheller
cedb93c179 docs: Update Raspberry Pi URLs from .org to .com. 2022-06-14 11:41:13 +10:00
iabdalkader
99d3a73d59 nrf/modules/uos/microbitfs: Fix MICROPY_MBFS build to use mp_obj_malloc.
Changes introduced in 0e7bfc88c6ac6b5d64240f91183a3cfe2ab67ade missed
changing this call to mp_obj_malloc.
2022-06-11 21:09:58 +10:00
iabdalkader
58b35c9abd extmod/extmod.cmake: Fix hard-coded mbedtls config file path.
* The mbedtls config file path is hard-coded to the config file in
the stm32 port. Any port using this cmake fragment is not actually
using its own config file.
2022-06-11 21:00:13 +10:00
Damien George
cf7d962cf3 docs/reference/mpyfiles: Update .mpy description to match latest format.
Signed-off-by: Damien George <damien@micropython.org>
2022-06-10 16:42:43 +10:00
Damien George
1f1afae622 examples/natmod/features3: Add example to test more natmod features.
Signed-off-by: Damien George <damien@micropython.org>
2022-06-10 16:42:43 +10:00
Damien George
0e556f22a2 py/dynruntime: Add macros to access more types and mp_const_empty_bytes.
Signed-off-by: Damien George <damien@micropython.org>
2022-06-10 16:42:43 +10:00
Jeremy Herbert
148d12252b py/dynruntime: Add macros to create a new dict and store to dicts. 2022-06-10 16:42:43 +10:00
Damien George
17a0d65ee4 tools/mpy_ld.py: Support GOT entries that reference inside mp_fun_table.
Signed-off-by: Damien George <damien@micropython.org>
2022-06-10 16:42:43 +10:00
Damien George
ee9feacc00 drivers/sdcard: Fix address calculation on v2 SDSC cards.
For v2 cards that are standard capacity the read/write/erase commands take
byte address values.  Use the result of CMD58 to distinguish SDSC from
SDHC/SDXC.

Signed-off-by: Damien George <damien@micropython.org>
2022-06-10 12:56:31 +10:00
Damien George
203b98c42b drivers/sdcard: Make ioctl(4), ioctl(5) return num blocks, block size.
For CSD v1.0 the computed size is in bytes, so convert it to number of
512-byte blocks, and then ioctl(4) will return the correct value.

Also implement ioctl(5) to return the block size, which is always 512.

Signed-off-by: Damien George <damien@micropython.org>
2022-06-10 12:56:30 +10:00
Yukai Li
ab6ad86793 drivers/sdcard: Fix CSD version 1.0 device size calculation.
Signed-off-by: Yukai Li <yukaili.geek@gmail.com>
2022-06-10 12:56:15 +10:00