Skip to content

Commit

Permalink
PWM: fix test
Browse files Browse the repository at this point in the history
  • Loading branch information
Joel Aschmann committed Mar 20, 2023
1 parent 7bb5bee commit 6e43cee
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 6 deletions.
3 changes: 0 additions & 3 deletions tests/pwm/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,3 @@ panic = "abort"
riot-wrappers = { version = "*", features = [ "set_panic_handler" ] }
riot-sys = "*"
embedded-hal = { version = "0.2.4", features = ["unproven"] }

[patch.crates-io]
riot-sys = { git = "https://github.com/RIOT-OS/rust-riot-sys" }
6 changes: 3 additions & 3 deletions tests/pwm/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
#![no_std]

use embedded_hal::Pwm;
use riot_wrappers::pwm::{HertzU32, PWMChannel, PWMDevice, PWMMode};
use riot_wrappers::pwm::{HertzU32, PWMDevice, PWMMode};
use riot_wrappers::riot_main;

riot_main!(main);

fn main() {
let mut pwm = PWMDevice::<0>::new(0, PWMMode::Left, HertzU32::Hz(10), 10).unwrap();
let mut pwm = PWMDevice::<0>::new(0, PWMMode::Left, HertzU32::Hz(10), 100).unwrap();
let channel_0 = pwm.get_channel(0).unwrap();
pwm.set_duty(channel_0, 32768); // 50% duty_cycle
pwm.set_duty(channel_0, 50); // 50% duty_cycle
}

0 comments on commit 6e43cee

Please sign in to comment.