File tree Expand file tree Collapse file tree 1 file changed +9
-4
lines changed
Expand file tree Collapse file tree 1 file changed +9
-4
lines changed Original file line number Diff line number Diff line change @@ -117,14 +117,19 @@ Directory::
117117 # This is not actually needed in this example.
118118 CFLAGS_USERMOD += -I$(EXAMPLE_MOD_DIR)
119119
120- Finally you will need to modify the ``mpconfigboard.h `` for your board
121- to tell the build process to include the new module by adding the
122- following
120+ Finally you will need to define ``MODULE_EXAMPLE_ENABLED `` to 1. This
121+ can be done by adding ``CFLAGS_EXTRA=-DMODULE_EXAMPLE_ENABLED=1 `` to
122+ the ``make `` command, or editing ``mpconfigport.h `` or
123+ ``mpconfigboard.h `` to add
123124
124125.. code-block :: c
125126
126127 #define MODULE_EXAMPLE_ENABLED (1)
127128
129+ Note that the exact method depends on the port as they have different
130+ structures. If not done correctly it will compile but importing will
131+ fail to find the module.
132+
128133
129134Compiling the cmodule into MicroPython
130135--------------------------------------
@@ -152,7 +157,7 @@ Building for stm32 port:
152157.. code-block :: bash
153158
154159 cd my_project/micropython/ports/stm32
155- make USER_C_MODULES=../../../modules all
160+ make USER_C_MODULES=../../../modules CFLAGS_EXTRA=-DMODULE_EXAMPLE_ENABLED=1 all
156161
157162
158163 Module usage in MicroPython
You can’t perform that action at this time.
0 commit comments