Skip to content

Commit

Permalink
rename & unify hello-world-* (#478)
Browse files Browse the repository at this point in the history
  • Loading branch information
kaspar030 authored Oct 22, 2024
2 parents 3b29d7d + e20ff84 commit b8e3aa2
Show file tree
Hide file tree
Showing 13 changed files with 42 additions and 42 deletions.
3 changes: 2 additions & 1 deletion examples/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@ This directory contains example applications that showcase how to use RIOT-rs.
- [embassy-net-tcp/](./embassy-net-tcp): TCP echo example
- [embassy-http-server/](./embassy-http-server): HTTP server example
- [embassy-usb-keyboard/](./embassy-usb-keyboard): USB HID example
- [hello-world/](./hello-world): a classic
- [hello-world/](./hello-world): a classic, async version
- [hello-world-threading/](./hello-world-threading): a classic, using a thread
- [minimal/](./minimal): minimized to the max RIOT-rs config
- [threading/](./threading): how to start and use preemptively scheduled threads

Expand Down
11 changes: 0 additions & 11 deletions examples/hello-world-async/README.md

This file was deleted.

4 changes: 0 additions & 4 deletions examples/hello-world-async/laze.yml

This file was deleted.

11 changes: 0 additions & 11 deletions examples/hello-world-async/src/main.rs

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[package]
name = "hello-world-async"
name = "hello-world-threading"
version = "0.1.0"
authors.workspace = true
license.workspace = true
Expand All @@ -12,5 +12,3 @@ workspace = true
[dependencies]
riot-rs = { path = "../../src/riot-rs" }
riot-rs-boards = { path = "../../src/riot-rs-boards" }

embassy-executor = { workspace = true, default-features = false }
13 changes: 13 additions & 0 deletions examples/hello-world-threading/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# hello-world

## About

This application is the most basic test application.
It prints "Hello World!" _via debug console_.
It needs to be run within a debug session.

## How to run

In this folder, run

laze build -b nrf52840dk run
5 changes: 5 additions & 0 deletions examples/hello-world-threading/laze.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
apps:
- name: hello-world-threading
selects:
- ?release
- sw/threading
12 changes: 12 additions & 0 deletions examples/hello-world-threading/src/main.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
#![no_main]
#![no_std]
#![feature(used_with_arg)]

use riot_rs::debug::{exit, log::*};

#[riot_rs::thread(autostart)]
fn main() {
info!("Hello World!");

exit(Ok(()));
}
2 changes: 2 additions & 0 deletions examples/hello-world/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,5 @@ workspace = true
[dependencies]
riot-rs = { path = "../../src/riot-rs" }
riot-rs-boards = { path = "../../src/riot-rs-boards" }

embassy-executor = { workspace = true, default-features = false }
6 changes: 2 additions & 4 deletions examples/hello-world/README.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,8 @@
# hello-world
# hello-world-async

## About

This application is the most basic test application.
It prints "Hello World!" _via debug console_.
It needs to be run within a debug session.
This application is the classic example using async Rust.

## How to run

Expand Down
1 change: 0 additions & 1 deletion examples/hello-world/laze.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,3 @@ apps:
- name: hello-world
selects:
- ?release
- sw/threading
10 changes: 4 additions & 6 deletions examples/hello-world/src/main.rs
Original file line number Diff line number Diff line change
@@ -1,15 +1,13 @@
#![no_main]
#![no_std]
#![feature(impl_trait_in_assoc_type)]
#![feature(used_with_arg)]

use riot_rs::debug::{exit, log::*};

#[riot_rs::thread(autostart)]
fn main() {
info!(
"Hello from main()! Running on a {} board.",
riot_rs::buildinfo::BOARD,
);
#[riot_rs::task(autostart)]
async fn main() {
info!("Hello World!");

exit(Ok(()));
}
2 changes: 1 addition & 1 deletion examples/laze.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ subdirs:
- embassy-usb-keyboard
- gpio
- hello-world
- hello-world-async
- hello-world-threading
- log
- minimal
- random
Expand Down

0 comments on commit b8e3aa2

Please sign in to comment.