micropython/examples
Christian Walther 3a8f8db38d ports/embed: Enable use of littlefs.
To make use of it, as demonstrated in the embedding-full example:
- Include the word(s) "littlefs1" and/or "littlefs2" in EMBED_EXTRA in
  micropython_embed.mk.
- Enable the desired MICROPY_*VFS* features in mpconfigport.h.
- Add include path "$(EMBED_DIR)/lib/littlefs" to your application build
  system.

For demonstration, a block device implementation containing a small
read-only littlefs2 image is added to the embedding-full example. The block
device could have been written in C and interface to some external,
possibly writable storage medium, but was written in Python and frozen for
simplicity.

What makes this a bit awkward is the fact that the littlefs sources are
located in lib/ and do need to be compiled into the application, unlike all
previous .c files from lib/ that are #included by other C files and must
not be compiled separately. Therefore, introduce a new directory 'libsrc'
in the embed build output that contains these files and can be added to the
application build system as usual, while 'lib' can remain excluded. The
headers need to stay in 'lib' because vfs_lfs.c refers to them under that
path. I am also not entirely happy about having to add an additional
include path to the application build, but see no way around that as long
as vfs_lfs.c refers to "lib/littlefs/lfs2.h" while lfs2.c refers to
"lfs2.h".

Signed-off-by: Christian Walther <cwalther@gmx.ch>
2024-04-21 17:28:52 +02:00
..
SDdatalogger
bluetooth examples/bluetooth: Link to aioble in BLE examples. 2023-09-01 14:05:32 +10:00
embedding examples/embedding-full: Add a more full-featured embedding example. 2024-04-21 17:28:52 +02:00
embedding-full ports/embed: Enable use of littlefs. 2024-04-21 17:28:52 +02:00
hwapi all: Fix various spelling mistakes found by codespell 2.2.6. 2023-10-03 11:24:50 +11:00
natmod examples/natmod/framebuf: Enable FrameBuffer.poly method. 2024-03-28 16:18:09 +11:00
network
rp2 examples: Mark asm, pio, etc. as noqa: F821 (undefined-name). 2023-08-16 16:12:33 +10:00
unix examples/unix/machine_bios.py: Fix typo. 2023-09-29 17:02:15 +10:00
usercmodule all: Remove the "STATIC" macro and just use "static" instead. 2024-03-07 14:20:42 +11:00
accel_i2c.py
accellog.py
asmled.py examples: Mark asm, pio, etc. as noqa: F821 (undefined-name). 2023-08-16 16:12:33 +10:00
asmsum.py examples: Mark asm, pio, etc. as noqa: F821 (undefined-name). 2023-08-16 16:12:33 +10:00
conwaylife.py
ledangle.py
mandel.py
micropython.py
pyb.py
switch.py