embassy/tests/rp/src/bin/bootsel.rs

26 lines
713 B
Rust
Raw Normal View History

2023-10-07 01:47:25 +02:00
#![no_std]
#![no_main]
teleprobe_meta::target!(b"rpi-pico");
use defmt::{assert_eq, *};
use embassy_executor::Spawner;
use embassy_time::Timer;
2023-10-07 01:47:25 +02:00
use {defmt_rtt as _, panic_probe as _};
#[embassy_executor::main]
async fn main(_spawner: Spawner) {
let mut p = embassy_rp::init(Default::default());
info!("Hello World!");
// add some delay to give an attached debug probe time to parse the
// defmt RTT header. Reading that header might touch flash memory, which
// interferes with flash write operations.
// https://github.com/knurling-rs/defmt/pull/683
Timer::after_millis(10).await;
2023-10-07 01:47:25 +02:00
assert_eq!(p.BOOTSEL.is_pressed(), false);
info!("Test OK");
cortex_m::asm::bkpt();
}