From 798173dce521e3fe6c25933296a09f8e59478c2d Mon Sep 17 00:00:00 2001 From: Damien George Date: Wed, 1 Oct 2025 12:22:48 +1000 Subject: [PATCH] zephyr/mpconfigport: Enable MICROPY_PY_MATH_POW_FIX_NAN. This is needed because zephyr incorrectly has `pow(-1, NaN) = 1`. Signed-off-by: Damien George --- ports/zephyr/mpconfigport.h | 1 + ports/zephyr/mpconfigport_minimal.h | 1 + 2 files changed, 2 insertions(+) diff --git a/ports/zephyr/mpconfigport.h b/ports/zephyr/mpconfigport.h index f6b78e64f0..6f55b0d788 100644 --- a/ports/zephyr/mpconfigport.h +++ b/ports/zephyr/mpconfigport.h @@ -61,6 +61,7 @@ #define MICROPY_PY_BUILTINS_HELP_TEXT zephyr_help_text #define MICROPY_PY_ARRAY_SLICE_ASSIGN (1) #define MICROPY_PY_MICROPYTHON_MEM_INFO (1) +#define MICROPY_PY_MATH_POW_FIX_NAN (1) #define MICROPY_PY_MACHINE (1) #define MICROPY_PY_MACHINE_INCLUDEFILE "ports/zephyr/modmachine.c" #define MICROPY_PY_MACHINE_I2C (1) diff --git a/ports/zephyr/mpconfigport_minimal.h b/ports/zephyr/mpconfigport_minimal.h index c802ba5254..2744119204 100644 --- a/ports/zephyr/mpconfigport_minimal.h +++ b/ports/zephyr/mpconfigport_minimal.h @@ -50,6 +50,7 @@ #define MICROPY_LONGINT_IMPL (MICROPY_LONGINT_IMPL_LONGLONG) #define MICROPY_FLOAT_IMPL (MICROPY_FLOAT_IMPL_FLOAT) #define MICROPY_PY_BUILTINS_COMPLEX (0) +#define MICROPY_PY_MATH_POW_FIX_NAN (1) // These features are enabled to get the test suite passing. #define MICROPY_FULL_CHECKS (1)