kopia lustrzana https://github.com/micropython/micropython
py/persistentcode: Clarify ValueError when native emitter disabled.
rodzic
bd4e45fd68
commit
d521899e18
|
@ -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) {
|
if (MPY_FEATURE_DECODE_ARCH(header[2]) != MP_NATIVE_ARCH_NONE) {
|
||||||
byte arch = MPY_FEATURE_DECODE_ARCH(header[2]);
|
byte arch = MPY_FEATURE_DECODE_ARCH(header[2]);
|
||||||
if (!MPY_FEATURE_ARCH_TEST(arch)) {
|
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"));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Ładowanie…
Reference in New Issue