py: Allow configurable object representation, with 2 different options.
diff --git a/py/mpconfig.h b/py/mpconfig.h
index d561f80..27ec5dd 100644
--- a/py/mpconfig.h
+++ b/py/mpconfig.h
@@ -49,6 +49,25 @@
// values below.
/*****************************************************************************/
+/* Object representation */
+
+// A Micro Python object is a machine word having the following form:
+// - xxxx...xxx1 : a small int, bits 1 and above are the value
+// - xxxx...xx10 : a qstr, bits 2 and above are the value
+// - xxxx...xx00 : a pointer to an mp_obj_base_t (unless a fake object)
+#define MICROPY_OBJ_REPR_A (0)
+
+// A Micro Python object is a machine word having the following form:
+// - xxxx...xx01 : a small int, bits 2 and above are the value
+// - xxxx...xx11 : a qstr, bits 2 and above are the value
+// - xxxx...xxx0 : a pointer to an mp_obj_base_t (unless a fake object)
+#define MICROPY_OBJ_REPR_B (1)
+
+#ifndef MICROPY_OBJ_REPR
+#define MICROPY_OBJ_REPR (MICROPY_OBJ_REPR_A)
+#endif
+
+/*****************************************************************************/
/* Memory allocation policy */
// Number of words allocated (in BSS) to the GC stack (minimum is 1)