Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 5 additions & 4 deletions adding-module.rst
Original file line number Diff line number Diff line change
Expand Up @@ -133,10 +133,11 @@ actually add that function object to our module:

Micropython uses the QSTR-macros to define constant strings. This is used to
identify strings and store only unique ones for preserving memory (as it is
very limited on the PyBoard-Hardware). Your port has a file ``qstrdefsport.h``.
In our case add ``Q(hello)`` to the list (on a new line). This will define the
string ``hello`` for Micropython. Failing to do so will result in a missing
file on compilation.
very limited on the PyBoard-Hardware).
The string ``hello`` will be auto-generated by ``py/makeqstrdata.py`` upon
compilation. This may fail if a string contains special characters; In this
case, add ``Q(the_funky+string<>)`` to ``qstrdefsport.h``. Failing to do so will
result in a missing file on compilation.

Now when you compile and flash the firmware, you will be able to import the
module and call the function inside it.
Expand Down