summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel O'Connor <darius@dons.net.au>2019-04-13 21:27:22 +0930
committerDamien George <damien.p.george@gmail.com>2019-04-15 11:56:22 +1000
commitfd58136d6bffe422f4afb6bc08973ecfb6ff8f1d (patch)
tree3b2ca055daad4c0f4896654c23cece43d727dbcd
parent194d6b6788e73216b9c0b60ced0b9ade1b0cb2dd (diff)
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.
-rw-r--r--docs/develop/cmodules.rst10
1 files changed, 8 insertions, 2 deletions
diff --git a/docs/develop/cmodules.rst b/docs/develop/cmodules.rst
index 919f51824..5c0b498ff 100644
--- a/docs/develop/cmodules.rst
+++ b/docs/develop/cmodules.rst
@@ -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
--------------------------------------