diff options
| author | Dario Nieuwenhuis <[email protected]> | 2023-10-07 01:47:25 +0200 |
|---|---|---|
| committer | Dario Nieuwenhuis <[email protected]> | 2023-10-07 01:47:25 +0200 |
| commit | b67b179933806f270465dcf5f246c605eba15dd9 (patch) | |
| tree | 1a1d9d8f81f43a065da3eb6f91fc6a9ed89c1c8b /tests | |
| parent | d4ed8e5779d5e09ea57728a48fc8654d93b786f8 (diff) | |
rp/bootsel: add test.
Diffstat (limited to 'tests')
| -rw-r--r-- | tests/rp/src/bin/bootsel.rs | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/tests/rp/src/bin/bootsel.rs b/tests/rp/src/bin/bootsel.rs new file mode 100644 index 000000000..df1ed8d2e --- /dev/null +++ b/tests/rp/src/bin/bootsel.rs | |||
| @@ -0,0 +1,26 @@ | |||
| 1 | #![no_std] | ||
| 2 | #![no_main] | ||
| 3 | #![feature(type_alias_impl_trait)] | ||
| 4 | teleprobe_meta::target!(b"rpi-pico"); | ||
| 5 | |||
| 6 | use defmt::{assert_eq, *}; | ||
| 7 | use embassy_executor::Spawner; | ||
| 8 | use embassy_time::{Duration, Timer}; | ||
| 9 | use {defmt_rtt as _, panic_probe as _}; | ||
| 10 | |||
| 11 | #[embassy_executor::main] | ||
| 12 | async fn main(_spawner: Spawner) { | ||
| 13 | let mut p = embassy_rp::init(Default::default()); | ||
| 14 | info!("Hello World!"); | ||
| 15 | |||
| 16 | // add some delay to give an attached debug probe time to parse the | ||
| 17 | // defmt RTT header. Reading that header might touch flash memory, which | ||
| 18 | // interferes with flash write operations. | ||
| 19 | // https://github.com/knurling-rs/defmt/pull/683 | ||
| 20 | Timer::after(Duration::from_millis(10)).await; | ||
| 21 | |||
| 22 | assert_eq!(p.BOOTSEL.is_pressed(), false); | ||
| 23 | |||
| 24 | info!("Test OK"); | ||
| 25 | cortex_m::asm::bkpt(); | ||
| 26 | } | ||
