py/persistentcode: Select ARMV6M as maximum when __thumb2__ not defined.

If __thumb2__ is defined by the compiler then .mpy files marked as ARMV6M
and above (up to ARMV7EMDP) are supported.  If it's not defined then only
ARMV6M .mpy files are supported.  This makes sure that on CPUs like
Cortex-M0+ (where __thumb2__ is not defined) only .mpy files marked as
ARMV6M can be imported.

Signed-off-by: Damien George <damien@micropython.org>
This commit is contained in:
Damien George 2022-05-23 17:58:30 +10:00
parent a5324a1074
commit 17ac68770c

View File

@ -63,7 +63,7 @@
#define MPY_FEATURE_ARCH (MP_NATIVE_ARCH_ARMV7EM)
#endif
#else
#define MPY_FEATURE_ARCH (MP_NATIVE_ARCH_ARMV7M)
#define MPY_FEATURE_ARCH (MP_NATIVE_ARCH_ARMV6M)
#endif
#define MPY_FEATURE_ARCH_TEST(x) (MP_NATIVE_ARCH_ARMV6M <= (x) && (x) <= MPY_FEATURE_ARCH)
#elif MICROPY_EMIT_ARM