summaryrefslogtreecommitdiffstatshomepage
path: root/lib/utils/pyexec.h
diff options
context:
space:
mode:
authorYonatan Goldschmidt <yon.goldschmidt@gmail.com>2019-12-25 09:27:38 +0200
committerDamien George <damien.p.george@gmail.com>2019-12-28 00:05:39 +1100
commit61d2b40ad56243585ac2bebef67aff10d4c5583c (patch)
treea845f6cd81f4734aeeae62c79aa20397d917b942 /lib/utils/pyexec.h
parentaca8873bb841860c0b62d36afe42501eb4505199 (diff)
downloadmicropython-61d2b40ad56243585ac2bebef67aff10d4c5583c.tar.gz
micropython-61d2b40ad56243585ac2bebef67aff10d4c5583c.zip
lib/utils/pyexec: Introduce MICROPY_REPL_INFO, wrap debug prints in it.
For the 3 ports that already make use of this feature (stm32, nrf and teensy) this doesn't make any difference, it just allows to disable it from now on. For other ports that use pyexec, this decreases code size because the debug printing code is dead (it can't be enabled) but the compiler can't deduce that, so code is still emitted.
Diffstat (limited to 'lib/utils/pyexec.h')
-rw-r--r--lib/utils/pyexec.h4
1 files changed, 3 insertions, 1 deletions
diff --git a/lib/utils/pyexec.h b/lib/utils/pyexec.h
index 9eb490be54..573cb6d452 100644
--- a/lib/utils/pyexec.h
+++ b/lib/utils/pyexec.h
@@ -51,8 +51,10 @@ int pyexec_frozen_module(const char *name);
void pyexec_event_repl_init(void);
int pyexec_event_repl_process_char(int c);
extern uint8_t pyexec_repl_active;
-mp_obj_t pyb_set_repl_info(mp_obj_t o_value);
+#if MICROPY_REPL_INFO
+mp_obj_t pyb_set_repl_info(mp_obj_t o_value);
MP_DECLARE_CONST_FUN_OBJ_1(pyb_set_repl_info_obj);
+#endif
#endif // MICROPY_INCLUDED_LIB_UTILS_PYEXEC_H