fw-rust: Minimal hello world
This commit is contained in:
parent
af3790be0d
commit
aa75712418
7 changed files with 305 additions and 0 deletions
20
firmware/rust/src/main.rs
Normal file
20
firmware/rust/src/main.rs
Normal file
|
@ -0,0 +1,20 @@
|
|||
#![no_std]
|
||||
#![no_main]
|
||||
|
||||
use atmega_hal::{clock::MHz8, delay::Delay, pins, Peripherals};
|
||||
use embedded_hal::blocking::delay::DelayMs;
|
||||
use panic_halt as _;
|
||||
|
||||
#[atmega_hal::entry]
|
||||
fn main() -> ! {
|
||||
let dp = Peripherals::take().unwrap();
|
||||
let pins = pins!(dp);
|
||||
|
||||
let mut led = pins.pd5.into_output();
|
||||
let mut delay = Delay::<MHz8>::new();
|
||||
|
||||
loop {
|
||||
led.toggle();
|
||||
delay.delay_ms(255_u8);
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue