Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bricks/_common/mpconfigport: enable unicode support #271

Merged
merged 2 commits into from
Dec 5, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
state.

### Changed

- Enabled UTF-8 support for `str` objects.
- The method `DriveBase.angle()` now returns a float ([support#1844]). This
makes it properly equivalent to `hub.imu.heading`.
- Re-implemented tilt using the gyro data by default. Pure accelerometer tilt
Expand Down
47 changes: 24 additions & 23 deletions bricks/_common/mpconfigport.h
Original file line number Diff line number Diff line change
Expand Up @@ -15,15 +15,15 @@
#define MICROPY_ENABLE_COMPILER (PYBRICKS_OPT_COMPILER)

// Enabled modules
#define MICROPY_PY_IO (PYBRICKS_OPT_EXTRA_MOD)
#define MICROPY_PY_IO (PYBRICKS_OPT_EXTRA_LEVEL1)
#define MICROPY_PY_MATH (PYBRICKS_OPT_FLOAT)
#define MICROPY_PY_MICROPYTHON (PYBRICKS_OPT_EXTRA_MOD)
#define MICROPY_PY_STRUCT (PYBRICKS_OPT_EXTRA_MOD)
#define MICROPY_PY_SYS (PYBRICKS_OPT_EXTRA_MOD)
#define MICROPY_PY_MICROPYTHON (PYBRICKS_OPT_EXTRA_LEVEL1)
#define MICROPY_PY_STRUCT (PYBRICKS_OPT_EXTRA_LEVEL1)
#define MICROPY_PY_SYS (PYBRICKS_OPT_EXTRA_LEVEL1)
#define MICROPY_PY_UERRNO (1)
#define MICROPY_PY_UJSON (PYBRICKS_OPT_EXTRA_MOD)
#define MICROPY_PY_URANDOM (PYBRICKS_OPT_EXTRA_MOD)
#define MICROPY_PY_USELECT (PYBRICKS_OPT_EXTRA_MOD)
#define MICROPY_PY_UJSON (PYBRICKS_OPT_EXTRA_LEVEL1)
#define MICROPY_PY_URANDOM (PYBRICKS_OPT_EXTRA_LEVEL1)
#define MICROPY_PY_USELECT (PYBRICKS_OPT_EXTRA_LEVEL1)

#define MICROPY_PY_UERRNO_LIST \
X(EPERM) \
Expand Down Expand Up @@ -67,33 +67,34 @@
#define MICROPY_PY_ASYNC_AWAIT (1)
#define MICROPY_MULTIPLE_INHERITANCE (0)
#define MICROPY_PY_ARRAY (0)
#define MICROPY_PY_BUILTINS_BYTEARRAY (PYBRICKS_OPT_EXTRA_MOD)
#define MICROPY_PY_BUILTINS_BYTEARRAY (PYBRICKS_OPT_EXTRA_LEVEL1)
#define MICROPY_PY_BUILTINS_MEMORYVIEW (0)
#define MICROPY_PY_BUILTINS_ENUMERATE (PYBRICKS_OPT_EXTRA_MOD)
#define MICROPY_PY_BUILTINS_ENUMERATE (PYBRICKS_OPT_EXTRA_LEVEL1)
#define MICROPY_PY_BUILTINS_FILTER (0)
#define MICROPY_PY_BUILTINS_FROZENSET (0)
#define MICROPY_PY_BUILTINS_HELP (PYBRICKS_OPT_EXTRA_MOD)
#define MICROPY_PY_BUILTINS_HELP_MODULES (PYBRICKS_OPT_EXTRA_MOD)
#define MICROPY_PY_BUILTINS_INPUT (PYBRICKS_OPT_EXTRA_MOD)
#define MICROPY_PY_BUILTINS_REVERSED (PYBRICKS_OPT_EXTRA_MOD)
#define MICROPY_PY_BUILTINS_SET (PYBRICKS_OPT_EXTRA_MOD)
#define MICROPY_PY_BUILTINS_SLICE (PYBRICKS_OPT_EXTRA_MOD)
#define MICROPY_PY_BUILTINS_HELP (PYBRICKS_OPT_EXTRA_LEVEL1)
#define MICROPY_PY_BUILTINS_HELP_MODULES (PYBRICKS_OPT_EXTRA_LEVEL1)
#define MICROPY_PY_BUILTINS_INPUT (PYBRICKS_OPT_EXTRA_LEVEL1)
#define MICROPY_PY_BUILTINS_REVERSED (PYBRICKS_OPT_EXTRA_LEVEL1)
#define MICROPY_PY_BUILTINS_SET (PYBRICKS_OPT_EXTRA_LEVEL1)
#define MICROPY_PY_BUILTINS_SLICE (PYBRICKS_OPT_EXTRA_LEVEL1)
#define MICROPY_PY_BUILTINS_PROPERTY (0)
#define MICROPY_PY_BUILTINS_MIN_MAX (1)
#define MICROPY_PY_BUILTINS_STR_UNICODE (PYBRICKS_OPT_EXTRA_LEVEL2)
#define MICROPY_PY___FILE__ (0)
#define MICROPY_PY_MICROPYTHON_MEM_INFO (1)
#define MICROPY_PY_GC (PYBRICKS_OPT_EXTRA_MOD)
#define MICROPY_PY_GC (PYBRICKS_OPT_EXTRA_LEVEL1)
#define MICROPY_PY_ATTRTUPLE (0)
#define MICROPY_PY_COLLECTIONS (0)
#define MICROPY_PY_CMATH (0)
#define MICROPY_PY_ALL_SPECIAL_METHODS (PYBRICKS_OPT_EXTRA_MOD)
#define MICROPY_PY_REVERSE_SPECIAL_METHODS (PYBRICKS_OPT_EXTRA_MOD)
#define MICROPY_PY_ALL_SPECIAL_METHODS (PYBRICKS_OPT_EXTRA_LEVEL1)
#define MICROPY_PY_REVERSE_SPECIAL_METHODS (PYBRICKS_OPT_EXTRA_LEVEL1)
#define MICROPY_PY_SYS_EXIT (0)
#define MICROPY_PY_SYS_MODULES (0)
#define MICROPY_PY_SYS_STDFILES (PYBRICKS_OPT_EXTRA_MOD)
#define MICROPY_PY_SYS_STDIO_BUFFER (PYBRICKS_OPT_EXTRA_MOD)
#define MICROPY_PY_SYS_STDIO_FLUSH (PYBRICKS_OPT_EXTRA_MOD)
#define MICROPY_PY_URANDOM_EXTRA_FUNCS (PYBRICKS_OPT_EXTRA_MOD)
#define MICROPY_PY_SYS_STDFILES (PYBRICKS_OPT_EXTRA_LEVEL1)
#define MICROPY_PY_SYS_STDIO_BUFFER (PYBRICKS_OPT_EXTRA_LEVEL1)
#define MICROPY_PY_SYS_STDIO_FLUSH (PYBRICKS_OPT_EXTRA_LEVEL1)
#define MICROPY_PY_URANDOM_EXTRA_FUNCS (PYBRICKS_OPT_EXTRA_LEVEL1)
#define MICROPY_PY_URANDOM_SEED_INIT_FUNC ({ extern uint32_t pbdrv_clock_get_us(void); pbdrv_clock_get_us(); })
#define MICROPY_PY_UTIME_MP_HAL (0)
#define MICROPY_MODULE_BUILTIN_INIT (1)
Expand All @@ -110,7 +111,7 @@
#define MICROPY_ENABLE_SCHEDULER (0)
#define MICROPY_PY_INSTANCE_ATTRS (1)

#define MICROPY_MODULE_ATTR_DELEGATION (PYBRICKS_OPT_EXTRA_MOD)
#define MICROPY_MODULE_ATTR_DELEGATION (PYBRICKS_OPT_EXTRA_LEVEL1)
#define MICROPY_PERSISTENT_CODE_LOAD (1)
#define MICROPY_ENABLE_EXTERNAL_IMPORT (0)
#define MICROPY_HAS_FILE_READER (0)
Expand Down
3 changes: 2 additions & 1 deletion bricks/cityhub/mpconfigport.h
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,8 @@
#define PYBRICKS_OPT_RAW_REPL (0)
#define PYBRICKS_OPT_FLOAT (1)
#define PYBRICKS_OPT_TERSE_ERR (0)
#define PYBRICKS_OPT_EXTRA_MOD (1)
#define PYBRICKS_OPT_EXTRA_LEVEL1 (1)
#define PYBRICKS_OPT_EXTRA_LEVEL2 (0)
#define PYBRICKS_OPT_CUSTOM_IMPORT (1)
#define PYBRICKS_OPT_NATIVE_MOD (0)

Expand Down
3 changes: 2 additions & 1 deletion bricks/debug/mpconfigport.h
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,8 @@
#define PYBRICKS_OPT_RAW_REPL (0)
#define PYBRICKS_OPT_FLOAT (0)
#define PYBRICKS_OPT_TERSE_ERR (1)
#define PYBRICKS_OPT_EXTRA_MOD (0)
#define PYBRICKS_OPT_EXTRA_LEVEL1 (0)
#define PYBRICKS_OPT_EXTRA_LEVEL2 (0)
#define PYBRICKS_OPT_CUSTOM_IMPORT (1)
#define PYBRICKS_OPT_NATIVE_MOD (0)

Expand Down
3 changes: 2 additions & 1 deletion bricks/essentialhub/mpconfigport.h
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,8 @@
#define PYBRICKS_OPT_RAW_REPL (0)
#define PYBRICKS_OPT_FLOAT (1)
#define PYBRICKS_OPT_TERSE_ERR (0)
#define PYBRICKS_OPT_EXTRA_MOD (1)
#define PYBRICKS_OPT_EXTRA_LEVEL1 (1)
#define PYBRICKS_OPT_EXTRA_LEVEL2 (1)
#define PYBRICKS_OPT_CUSTOM_IMPORT (1)
#define PYBRICKS_OPT_NATIVE_MOD (0)

Expand Down
3 changes: 2 additions & 1 deletion bricks/ev3/mpconfigport.h
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,8 @@
#define PYBRICKS_OPT_RAW_REPL (0)
#define PYBRICKS_OPT_FLOAT (0)
#define PYBRICKS_OPT_TERSE_ERR (0)
#define PYBRICKS_OPT_EXTRA_MOD (1)
#define PYBRICKS_OPT_EXTRA_LEVEL1 (1)
#define PYBRICKS_OPT_EXTRA_LEVEL2 (1)
#define PYBRICKS_OPT_CUSTOM_IMPORT (1)
#define PYBRICKS_OPT_NATIVE_MOD (0)

Expand Down
3 changes: 2 additions & 1 deletion bricks/ev3rt/mpconfigport.h
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,8 @@
#define PYBRICKS_OPT_RAW_REPL (1)
#define PYBRICKS_OPT_FLOAT (1)
#define PYBRICKS_OPT_TERSE_ERR (0)
#define PYBRICKS_OPT_EXTRA_MOD (1)
#define PYBRICKS_OPT_EXTRA_LEVEL1 (1)
#define PYBRICKS_OPT_EXTRA_LEVEL2 (0)
#define PYBRICKS_OPT_CUSTOM_IMPORT (1)
#define PYBRICKS_OPT_NATIVE_MOD (1)

Expand Down
3 changes: 2 additions & 1 deletion bricks/movehub/mpconfigport.h
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,8 @@
#define PYBRICKS_OPT_RAW_REPL (0)
#define PYBRICKS_OPT_FLOAT (0)
#define PYBRICKS_OPT_TERSE_ERR (1)
#define PYBRICKS_OPT_EXTRA_MOD (0)
#define PYBRICKS_OPT_EXTRA_LEVEL1 (0)
#define PYBRICKS_OPT_EXTRA_LEVEL2 (0)
#define PYBRICKS_OPT_CUSTOM_IMPORT (1)
#define PYBRICKS_OPT_NATIVE_MOD (0)

Expand Down
3 changes: 2 additions & 1 deletion bricks/nxt/mpconfigport.h
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,8 @@
#define PYBRICKS_OPT_RAW_REPL (1)
#define PYBRICKS_OPT_FLOAT (1)
#define PYBRICKS_OPT_TERSE_ERR (0)
#define PYBRICKS_OPT_EXTRA_MOD (1)
#define PYBRICKS_OPT_EXTRA_LEVEL1 (1)
#define PYBRICKS_OPT_EXTRA_LEVEL2 (0)
#define PYBRICKS_OPT_CUSTOM_IMPORT (1)
#define PYBRICKS_OPT_NATIVE_MOD (0)

Expand Down
3 changes: 2 additions & 1 deletion bricks/primehub/mpconfigport.h
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,8 @@
#define PYBRICKS_OPT_RAW_REPL (0)
#define PYBRICKS_OPT_FLOAT (1)
#define PYBRICKS_OPT_TERSE_ERR (0)
#define PYBRICKS_OPT_EXTRA_MOD (1)
#define PYBRICKS_OPT_EXTRA_LEVEL1 (1)
#define PYBRICKS_OPT_EXTRA_LEVEL2 (1)
#define PYBRICKS_OPT_CUSTOM_IMPORT (1)
#define PYBRICKS_OPT_NATIVE_MOD (1)

Expand Down
3 changes: 2 additions & 1 deletion bricks/technichub/mpconfigport.h
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,8 @@
#define PYBRICKS_OPT_RAW_REPL (0)
#define PYBRICKS_OPT_FLOAT (1)
#define PYBRICKS_OPT_TERSE_ERR (0)
#define PYBRICKS_OPT_EXTRA_MOD (1)
#define PYBRICKS_OPT_EXTRA_LEVEL1 (1)
#define PYBRICKS_OPT_EXTRA_LEVEL2 (0)
#define PYBRICKS_OPT_CUSTOM_IMPORT (1)
#define PYBRICKS_OPT_NATIVE_MOD (0)

Expand Down
3 changes: 2 additions & 1 deletion bricks/virtualhub/mpconfigvariant.h
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,8 @@
#define PYBRICKS_OPT_RAW_REPL (0)
#define PYBRICKS_OPT_FLOAT (1)
#define PYBRICKS_OPT_TERSE_ERR (0)
#define PYBRICKS_OPT_EXTRA_MOD (1)
#define PYBRICKS_OPT_EXTRA_LEVEL1 (1)
#define PYBRICKS_OPT_EXTRA_LEVEL2 (0)
#define PYBRICKS_OPT_CUSTOM_IMPORT (1)

// Upstream MicroPython options
Expand Down
Loading