In order to bring consistency in-tree, migrate all samples to the use
the new prefix <zephyr/...>. Note that the conversion has been scripted:
```python
from pathlib import Path
import re
EXTENSIONS = ("c", "h", "cpp", "rst")
for p in Path(".").glob("samples/**/*"):
if not p.is_file() or p.suffix and p.suffix[1:] not in EXTENSIONS:
continue
content = ""
with open(p) as f:
for line in f:
m = re.match(r"^(.*)#include <(.*)>(.*)$", line)
if (m and
not m.group(2).startswith("zephyr/") and
(Path(".") / "include" / "zephyr" / m.group(2)).exists()):
content += (
m.group(1) +
"#include <zephyr/" + m.group(2) +">" +
m.group(3) + "\n"
)
else:
content += line
with open(p, "w") as f:
f.write(content)
```
Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
|
||
|---|---|---|
| .. | ||
| boards | ||
| src | ||
| CMakeLists.txt | ||
| prj.conf | ||
| README.rst | ||
| sample.yaml | ||
.. _spi-nor-sample: JEDEC SPI-NOR Sample #################### Overview ******** This sample demonstrates using the flash API on a SPI NOR serial flash memory device. While trivial it is an example of direct access and allows confirmation that the flash is working and that automatic power savings is correctly implemented. Building and Running ******************** The application will build only for a target that has a :ref:`devicetree <dt-guide>` entry with ``jedec,spi-nor`` as a compatible. .. zephyr-app-commands:: :zephyr-app: samples/drivers/spi_flash :board: nrf52840dk_nrf52840 :goals: build flash :compact: Sample Output ============= .. code-block:: console *** Booting Zephyr OS build zephyr-v2.3.0-2142-gca01d2e1d748 *** JEDEC QSPI-NOR SPI flash testing ========================== Test 1: Flash erase Flash erase succeeded! Test 2: Flash write Attempting to write 4 bytes Data read matches data written. Good!