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 | ||
.. _stm32_temp_sensor:
STM32 Temperature Sensor
########################
Overview
********
This sample periodically reads temperature from the STM32 Internal
Temperature Sensor and display the results.
Building and Running
********************
In order to run this sample, make sure to enable ``stm32_temp`` node in your
board DT file.
.. zephyr-app-commands::
:zephyr-app: samples/sensor/stm32_temp_sensor
:board: nucleo_f103rb
:goals: build
:compact:
Sample Output
=============
.. code-block:: console
Current temperature: 22.6 °C
Current temperature: 22.8 °C
Current temperature: 23.1 °C