Template
Init Template
This commit is contained in:
+37
@@ -0,0 +1,37 @@
|
||||
#![no_std]
|
||||
#![no_main]
|
||||
|
||||
use defmt::*;
|
||||
use defmt_rtt as _;
|
||||
use embassy_executor::Spawner;
|
||||
use embassy_time::Timer;
|
||||
use panic_probe as _;
|
||||
|
||||
// Program metadata for `picotool info`.
|
||||
// This isn't needed, but it's recommended to have these minimal entries.
|
||||
#[unsafe(link_section = ".bi_entries")]
|
||||
#[used]
|
||||
pub static PICOTOOL_ENTRIES: [embassy_rp::binary_info::EntryAddr; 4] = [
|
||||
embassy_rp::binary_info::rp_program_name!(c"Blinky Example"),
|
||||
embassy_rp::binary_info::rp_program_description!(
|
||||
c"This example tests the RP Pico on board LED, connected to gpio 25"
|
||||
),
|
||||
embassy_rp::binary_info::rp_cargo_version!(),
|
||||
embassy_rp::binary_info::rp_program_build_attribute!(),
|
||||
];
|
||||
|
||||
#[embassy_executor::main(
|
||||
executor = "embassy_rp::executor::Executor",
|
||||
entry = "cortex_m_rt::entry"
|
||||
)]
|
||||
async fn main(_spawner: Spawner) {
|
||||
let p = embassy_rp::init(Default::default());
|
||||
|
||||
loop {
|
||||
info!("led on!");
|
||||
Timer::after_millis(500).await;
|
||||
|
||||
info!("led off!");
|
||||
Timer::after_millis(500).await;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user