From efe23aca7154d21a9e8f283313c7a1ac29e05d86 Mon Sep 17 00:00:00 2001 From: Damien George Date: Tue, 31 May 2022 22:56:11 +1000 Subject: all: Remove third argument to MP_REGISTER_MODULE. It's no longer needed because this macro is now processed after preprocessing the source code via cpp (in the qstr extraction stage), which means unused MP_REGISTER_MODULE's are filtered out by the preprocessor. Signed-off-by: Damien George --- docs/develop/porting.rst | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) (limited to 'docs/develop/porting.rst') diff --git a/docs/develop/porting.rst b/docs/develop/porting.rst index d08fd74e4..bc25f47ed 100644 --- a/docs/develop/porting.rst +++ b/docs/develop/porting.rst @@ -280,12 +280,7 @@ To add a custom module like ``myport``, first add the module definition in a fil .globals = (mp_obj_dict_t *)&myport_module_globals, }; - MP_REGISTER_MODULE(MP_QSTR_myport, myport_module, 1); - -Note: the "1" as the third argument in ``MP_REGISTER_MODULE`` enables this new module -unconditionally. To allow it to be conditionally enabled, replace the "1" by -``MICROPY_PY_MYPORT`` and then add ``#define MICROPY_PY_MYPORT (1)`` in ``mpconfigport.h`` -accordingly. + MP_REGISTER_MODULE(MP_QSTR_myport, myport_module); You will also need to edit the Makefile to add ``modmyport.c`` to the ``SRC_C`` list, and a new line adding the same file to ``SRC_QSTR`` (so qstrs are searched for in this new file), -- cgit v1.2.3