Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
M
micropython
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Analytics
Analytics
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Commits
Open sidebar
xpstem
micropython
Commits
d4e18203
Commit
d4e18203
authored
Apr 15, 2019
by
Daniel O'Connor
Committed by
Damien George
Apr 18, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
docs/cmodules: Note the various ways MODULE_EXAMPLE_ENABLED can be set.
parent
a6e5846b
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
4 deletions
+9
-4
docs/develop/cmodules.rst
docs/develop/cmodules.rst
+9
-4
No files found.
docs/develop/cmodules.rst
View file @
d4e18203
...
...
@@ -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
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment