create project from template (cargo generate)
This commit is contained in:
commit
cf7edc3c4b
8 changed files with 324 additions and 0 deletions
21
src/main.rs
Normal file
21
src/main.rs
Normal file
|
@ -0,0 +1,21 @@
|
|||
#![no_std]
|
||||
#![no_main]
|
||||
|
||||
use esp_backtrace as _;
|
||||
use esp_println::println;
|
||||
use hal::{clock::ClockControl, peripherals::Peripherals, prelude::*, Delay};
|
||||
|
||||
#[entry]
|
||||
fn main() -> ! {
|
||||
let peripherals = Peripherals::take();
|
||||
let system = peripherals.DPORT.split();
|
||||
let clocks = ClockControl::boot_defaults(system.clock_control).freeze();
|
||||
let mut delay = Delay::new(&clocks);
|
||||
|
||||
println!("Hello world!");
|
||||
|
||||
loop {
|
||||
println!("Loop...");
|
||||
delay.delay_ms(500u32);
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue