summaryrefslogtreecommitdiffstatshomepage
path: root/py
diff options
context:
space:
mode:
authorrobert-hh <robert@hammelrath.com>2024-07-06 09:18:22 +0200
committerDamien George <damien@micropython.org>2024-07-11 23:38:07 +1000
commit2be45dd682f0ce01e4a1061375e96ce2c501a187 (patch)
treeedcd31a5a52f46093171f3cb5c0d3e2926addbe9 /py
parent358e501e75c028133cff1045d2062ae31206a22c (diff)
downloadmicropython-2be45dd682f0ce01e4a1061375e96ce2c501a187.tar.gz
micropython-2be45dd682f0ce01e4a1061375e96ce2c501a187.zip
extmod/modmachine: Allow more than one argument to machine.freq().
The limit is set by a `MICROPY_PY_MACHINE_FREQ_NUM_ARGS_MAX` define, which defaults to 1 and is set for stm32 to 4. For stm32 this fixes a regression introduced in commit e1ec6af654b1c5c4a973b6c6b029ee68bb92eb89 where the maximum number of arguments was changed from 4 to 1. Signed-off-by: robert-hh <robert@hammelrath.com>
Diffstat (limited to 'py')
-rw-r--r--py/mpconfig.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/py/mpconfig.h b/py/mpconfig.h
index bc6bf75fe5..346d0c21e1 100644
--- a/py/mpconfig.h
+++ b/py/mpconfig.h
@@ -1736,6 +1736,11 @@ typedef double mp_float_t;
#define MICROPY_PY_MACHINE_RESET (0)
#endif
+// Maximum number of arguments for machine.freq()
+#ifndef MICROPY_PY_MACHINE_FREQ_NUM_ARGS_MAX
+#define MICROPY_PY_MACHINE_FREQ_NUM_ARGS_MAX (1)
+#endif
+
// Whether to include: bitstream
#ifndef MICROPY_PY_MACHINE_BITSTREAM
#define MICROPY_PY_MACHINE_BITSTREAM (0)