change ruduino to arduino-hal

using_hal
kirbylife 2022-12-11 00:24:24 -06:00
parent 5b2648440f
commit 6244ace8f0
2 changed files with 12 additions and 10 deletions

View File

@ -4,7 +4,8 @@ version = "0.1.0"
edition = "2021"
[dependencies]
ruduino = { git = "https://github.com/avr-rust/ruduino", branch = "master" }
arduino-hal = { git = "https://github.com/rahix/avr-hal", features = ["arduino-uno"] }
panic-halt = "0.2.0"
[profile.release]
lto = true

View File

@ -1,18 +1,19 @@
#![no_std]
#![no_main]
use ruduino::cores::current::port::B5 as led;
use ruduino::delay::delay_ms;
use ruduino::Pin;
use arduino_hal::delay_ms;
use panic_halt as _;
#[no_mangle]
pub extern "C" fn main() -> ! {
led::set_output();
#[arduino_hal::entry]
fn main() -> ! {
let peripherals = arduino_hal::Peripherals::take().unwrap();
let pins = arduino_hal::pins!(peripherals);
let mut led = pins.d13.into_output();
led.set_high();
loop {
led::set_high();
delay_ms(1000);
led::set_low();
led.toggle();
delay_ms(1000);
}
}