diff options
author | Andrew Leech <andrew.leech@planetinnovation.com.au> | 2022-08-17 08:43:17 +1000 |
---|---|---|
committer | Andrew Leech <andrew.leech@planetinnovation.com.au> | 2022-08-29 12:38:49 +1000 |
commit | d521899e18c305a4cf3870449e3dd12308f7a806 (patch) | |
tree | 2258e65d8778a9be2ae9d8c3d0865f10f5ccbfb2 /py/persistentcode.c | |
parent | bd4e45fd68e20af3f965b403e643fa5f71aa1b08 (diff) |
py/persistentcode: Clarify ValueError when native emitter disabled.
Diffstat (limited to 'py/persistentcode.c')
-rw-r--r-- | py/persistentcode.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/py/persistentcode.c b/py/persistentcode.c index 82ef0c499..1b1741f26 100644 --- a/py/persistentcode.c +++ b/py/persistentcode.c @@ -402,7 +402,13 @@ mp_compiled_module_t mp_raw_code_load(mp_reader_t *reader, mp_module_context_t * if (MPY_FEATURE_DECODE_ARCH(header[2]) != MP_NATIVE_ARCH_NONE) { byte arch = MPY_FEATURE_DECODE_ARCH(header[2]); if (!MPY_FEATURE_ARCH_TEST(arch)) { - mp_raise_ValueError(MP_ERROR_TEXT("incompatible .mpy arch")); + if (MPY_FEATURE_ARCH_TEST(MP_NATIVE_ARCH_NONE)) { + // On supported ports this can be resolved by enabling feature, eg + // mpconfigboard.h: MICROPY_EMIT_THUMB (1) + mp_raise_ValueError(MP_ERROR_TEXT("native code in .mpy unsupported")); + } else { + mp_raise_ValueError(MP_ERROR_TEXT("incompatible .mpy arch")); + } } } |