Skip to content

Commit 31cf49c

Browse files
committed
examples/embedding: Add code markup and fix typo in README.md.
1 parent ceff433 commit 31cf49c

1 file changed

Lines changed: 12 additions & 12 deletions

File tree

examples/embedding/README.md

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
1-
Example of embedding MicroPython in a standlone C application
2-
=============================================================
1+
Example of embedding MicroPython in a standalone C application
2+
==============================================================
33

44
This directory contains a (very simple!) example of how to embed a MicroPython
55
in an existing C application.
66

7-
A C application is represented by the file hello-embed.c. It executes a simple
7+
A C application is represented by the file `hello-embed.c`. It executes a simple
88
Python statement which prints to the standard output.
99

1010

@@ -18,27 +18,27 @@ Building the example is as simple as running:
1818
It's worth to trace what's happening behind the scenes though:
1919

2020
1. As a first step, a MicroPython library is built. This is handled by a
21-
separate makefile, Makefile.upylib. It is more or less complex, but the
21+
separate makefile, `Makefile.upylib`. It is more or less complex, but the
2222
good news is that you won't need to change anything in it, just use it
23-
as is, the main Makefile shows how. What may require editing though is
23+
as is, the main `Makefile` shows how. What may require editing though is
2424
a MicroPython configuration file. MicroPython is highly configurable, so
2525
you would need to build a library suiting your application well, while
26-
not bloating its size. Check the options in the file "mpconfigport.h".
26+
not bloating its size. Check the options in the file `mpconfigport.h`.
2727
Included is a copy of the "minimal" Unix port, which should be a good start
2828
for minimal embedding. For the list of all available options, see
29-
py/mpconfig.h.
29+
`py/mpconfig.h`.
3030

3131
2. Once the MicroPython library is built, your application is compiled
3232
and linked it. The main Makefile is very simple and shows that the changes
33-
you would need to do to your application's Makefile (or other build
33+
you would need to do to your application's `Makefile` (or other build
3434
configuration) are also simple:
3535

3636
a) You would need to use C99 standard (you're using this 15+ years old
3737
standard already, not a 25+ years old one, right?).
3838

3939
b) You need to provide a path to MicroPython's top-level dir, for includes.
4040

41-
c) You need to include -DNO_QSTR compile-time flag.
41+
c) You need to include `-DNO_QSTR` compile-time flag.
4242

4343
d) Otherwise, just link with the MicroPython library produced in step 1.
4444

@@ -48,13 +48,13 @@ Out of tree build
4848

4949
This example is set up to work out of the box, being part of the MicroPython
5050
tree. Your application of course will be outside of its tree, but the
51-
only thing you need to do is to pass MPTOP variable pointing to
51+
only thing you need to do is to pass `MPTOP` variable pointing to
5252
MicroPython directory to both Makefiles (in this example, the main Makefile
53-
automatically passes it to Makefile.upylib; in your own Makefile, don't forget
53+
automatically passes it to `Makefile.upylib`; in your own Makefile, don't forget
5454
to use a suitable value).
5555

5656
A practical way to embed MicroPython in your application is to include it
57-
as a git submodule. Suppose you included it as libs/micropython. Then in
57+
as a git submodule. Suppose you included it as `libs/micropython`. Then in
5858
your main Makefile you would have something like:
5959

6060
~~~

0 commit comments

Comments
 (0)