summaryrefslogtreecommitdiff
path: root/py/obj.h
diff options
context:
space:
mode:
authorDamien George <damien.p.george@gmail.com>2019-12-16 15:40:05 +1100
committerDamien George <damien.p.george@gmail.com>2019-12-27 22:51:17 +1100
commit09376f0e47b3ab4a5a2a3c2c768ff913e1835cc8 (patch)
tree4fd6399e318c977b3ddd20c13659f176b70f3f5b /py/obj.h
parentf5eec903fa961135296e2656821450979e413248 (diff)
py: Introduce MP_ROM_NONE macro for ROM to refer to None object.
This helps to prevent mistakes, and allows easily changing the ROM value of None if needed.
Diffstat (limited to 'py/obj.h')
-rw-r--r--py/obj.h4
1 files changed, 4 insertions, 0 deletions
diff --git a/py/obj.h b/py/obj.h
index 7c6815a3c..189f37d07 100644
--- a/py/obj.h
+++ b/py/obj.h
@@ -242,6 +242,10 @@ typedef union _mp_rom_obj_t { uint64_t u64; struct { const void *lo, *hi; } u32;
// Macros to create objects that are stored in ROM.
+#ifndef MP_ROM_NONE
+#define MP_ROM_NONE MP_ROM_PTR(&mp_const_none_obj)
+#endif
+
#ifndef MP_ROM_INT
typedef mp_const_obj_t mp_rom_obj_t;
#define MP_ROM_INT(i) MP_OBJ_NEW_SMALL_INT(i)