fw-rust: Minimal hello world

This commit is contained in:
finga 2022-03-01 21:34:36 +01:00
parent af3790be0d
commit aa75712418
7 changed files with 305 additions and 0 deletions

20
firmware/rust/src/main.rs Normal file
View 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);
}
}