py: Add config option MICROPY_COMP_MODULE_CONST for module consts.
Compiler optimises lookup of module.CONST when enabled (an existing
feature). Disabled by default; enabled for unix, windows, stmhal.
Costs about 100 bytes ROM on stmhal.
diff --git a/py/mpconfig.h b/py/mpconfig.h
index bf1a8bd..dcc116d 100644
--- a/py/mpconfig.h
+++ b/py/mpconfig.h
@@ -152,6 +152,11 @@
/*****************************************************************************/
/* Compiler configuration */
+// Whether to enable lookup of constants in modules; eg module.CONST
+#ifndef MICROPY_COMP_MODULE_CONST
+#define MICROPY_COMP_MODULE_CONST (0)
+#endif
+
// Whether to enable constant optimisation; id = const(value)
#ifndef MICROPY_COMP_CONST
#define MICROPY_COMP_CONST (1)