Skip to content
Snippets Groups Projects
Commit fd58136d authored by Daniel O'Connor's avatar Daniel O'Connor Committed by Damien George
Browse files

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.
parent 194d6b67
No related branches found
No related tags found
No related merge requests found
......@@ -71,8 +71,6 @@ Directory::
#include "py/runtime.h"
#include "py/builtin.h"
#define MODULE_EXAMPLE_ENABLED (1)
// This is the function which will be called from Python as example.add_ints(a, b).
STATIC mp_obj_t example_add_ints(mp_obj_t a_obj, mp_obj_t b_obj) {
// Extract the ints from the micropython input objects
......@@ -119,6 +117,14 @@ 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
.. code-block:: c
#define MODULE_EXAMPLE_ENABLED (1)
Compiling the cmodule into MicroPython
--------------------------------------
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment