Skip to content

Commit fd58136

Browse files
DanielOdpgeorge
authored andcommitted
docs/cmodules: Fix example to globally define MODULE_EXAMPLE_ENABLED.
MODULE_EXAMPLE_ENABLED must be globally defined for the module to be seen and referenced by all parts of the code.
1 parent 194d6b6 commit fd58136

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

docs/develop/cmodules.rst

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -71,8 +71,6 @@ Directory::
7171
#include "py/runtime.h"
7272
#include "py/builtin.h"
7373
74-
#define MODULE_EXAMPLE_ENABLED (1)
75-
7674
// This is the function which will be called from Python as example.add_ints(a, b).
7775
STATIC mp_obj_t example_add_ints(mp_obj_t a_obj, mp_obj_t b_obj) {
7876
// Extract the ints from the micropython input objects
@@ -119,6 +117,14 @@ Directory::
119117
# This is not actually needed in this example.
120118
CFLAGS_USERMOD += -I$(EXAMPLE_MOD_DIR)
121119
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
123+
124+
.. code-block:: c
125+
126+
#define MODULE_EXAMPLE_ENABLED (1)
127+
122128
123129
Compiling the cmodule into MicroPython
124130
--------------------------------------

0 commit comments

Comments
 (0)