1315: Add HIL test for timer on nrf r=Dirbaio a=lulf



1325: Update Rust nightly. r=Dirbaio a=Dirbaio

bors r+

Co-authored-by: Ulf Lilleengen <lulf@redhat.com>
Co-authored-by: Dario Nieuwenhuis <dirbaio@dirbaio.net>
This commit is contained in:
bors[bot] 2023-04-03 22:59:33 +00:00 committed by GitHub
commit 117fca84ea
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 26 additions and 1 deletions

View file

@ -1,7 +1,7 @@
# Before upgrading check that everything is available on all tier1 targets here:
# https://rust-lang.github.io/rustup-components-history
[toolchain]
channel = "nightly-2023-02-07"
channel = "nightly-2023-04-02"
components = [ "rust-src", "rustfmt", "llvm-tools-preview" ]
targets = [
"thumbv7em-none-eabi",

View file

@ -0,0 +1,25 @@
#![no_std]
#![no_main]
#![feature(type_alias_impl_trait)]
use defmt::{assert, info};
use embassy_executor::Spawner;
use embassy_time::{Duration, Instant, Timer};
use {defmt_rtt as _, panic_probe as _};
#[embassy_executor::main]
async fn main(_spawner: Spawner) {
let _p = embassy_nrf::init(Default::default());
info!("Hello World!");
let start = Instant::now();
Timer::after(Duration::from_millis(100)).await;
let end = Instant::now();
let ms = (end - start).as_millis();
info!("slept for {} ms", ms);
assert!(ms >= 99);
assert!(ms < 110);
info!("Test OK");
cortex_m::asm::bkpt();
}