1
0
mirror of https://github.com/RIOT-OS/RIOT.git synced 2025-12-20 20:13:50 +01:00
Mikolai Gütschow 223031e0d6
treewide: update riot-wrappers and riot-sys
diff generated with `find -name Cargo.toml -exec cargo update --manifest-path "{}" --package riot-wrappers --package riot-sys ";"` according to https://github.com/RIOT-OS/RIOT/blob/master/doc/guides/managing-a-release/README.md?plain=1#L31

upcoming release version bump similar to https://github.com/RIOT-OS/RIOT/pull/21133
2025-04-08 14:29:46 +02:00
..
2025-02-21 09:55:24 +01:00
2025-02-21 23:52:11 +01:00
2025-02-21 09:55:24 +01:00

Hello World!

This is a basic example how to use Rust to write your RIOT application. It prints out the famous text Hello World!.

This example should foremost give you an overview how an application built completely in Rust is structured:

  • The Makefile resembles the regular application Makefile, see ../hello-world/ for more introduction to that.

  • The Cargo.toml file describes the Rust code, and declares its dependencies.

    Prominently, it contains a [lib] / crate-type = ["staticlib"] section, which is necessary for how RIOT later links together the C and Rust portions.

  • The file src/lib.rs (and any modules referenced by it) contain Rust code to be run.

    It uses the riot_main! macro provided by the riot-wrappers crate to declare the entry point of the program.

The code itself looks like the usual Rust hello-world example.