diff options
author | Daniel O'Connor <darius@dons.net.au> | 2019-04-15 14:31:15 +0930 |
---|---|---|
committer | Damien George <damien.p.george@gmail.com> | 2019-04-18 11:59:43 +1000 |
commit | d4e182039f61979b22071274149b0ffcea17c370 (patch) | |
tree | f6df958b2f55c0a991e72331cf63a697ee4e8629 | |
parent | a6e5846ba75d20df1795f75423535d9bc280c804 (diff) |
docs/cmodules: Note the various ways MODULE_EXAMPLE_ENABLED can be set.
-rw-r--r-- | docs/develop/cmodules.rst | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/docs/develop/cmodules.rst b/docs/develop/cmodules.rst index 5c0b498ff..ba43c3dc9 100644 --- a/docs/develop/cmodules.rst +++ b/docs/develop/cmodules.rst @@ -117,14 +117,19 @@ Directory:: # This is not actually needed in this example. CFLAGS_USERMOD += -I$(EXAMPLE_MOD_DIR) -Finally you will need to modify the ``mpconfigboard.h`` for your board -to tell the build process to include the new module by adding the -following +Finally you will need to define ``MODULE_EXAMPLE_ENABLED`` to 1. This +can be done by adding ``CFLAGS_EXTRA=-DMODULE_EXAMPLE_ENABLED=1`` to +the ``make`` command, or editing ``mpconfigport.h`` or +``mpconfigboard.h`` to add .. code-block:: c #define MODULE_EXAMPLE_ENABLED (1) +Note that the exact method depends on the port as they have different +structures. If not done correctly it will compile but importing will +fail to find the module. + Compiling the cmodule into MicroPython -------------------------------------- @@ -152,7 +157,7 @@ Building for stm32 port: .. code-block:: bash cd my_project/micropython/ports/stm32 - make USER_C_MODULES=../../../modules all + make USER_C_MODULES=../../../modules CFLAGS_EXTRA=-DMODULE_EXAMPLE_ENABLED=1 all Module usage in MicroPython |