mirror of
https://github.com/embassy-rs/embassy.git
synced 2024-11-25 00:02:28 +00:00
oops again
This commit is contained in:
parent
71e49839fc
commit
f571ab9d60
@ -95,15 +95,15 @@ impl<'d, T: GeneralInstance4Channel> SimplePwmChannel<'d, T> {
|
||||
self.timer.set_compare_value(self.channel, duty.into())
|
||||
}
|
||||
|
||||
fn set_duty_cycle_fully_off(&mut self) {
|
||||
pub fn set_duty_cycle_fully_off(&mut self) {
|
||||
self.set_duty_cycle(0);
|
||||
}
|
||||
|
||||
fn set_duty_cycle_fully_on(&mut self) {
|
||||
pub fn set_duty_cycle_fully_on(&mut self) {
|
||||
self.set_duty_cycle((*self).max_duty_cycle());
|
||||
}
|
||||
|
||||
fn set_duty_cycle_fraction(&mut self, num: u16, denom: u16) {
|
||||
pub fn set_duty_cycle_fraction(&mut self, num: u16, denom: u16) {
|
||||
assert!(denom != 0);
|
||||
assert!(num <= denom);
|
||||
let duty = u32::from(num) * u32::from(self.max_duty_cycle()) / u32::from(denom);
|
||||
@ -113,7 +113,7 @@ impl<'d, T: GeneralInstance4Channel> SimplePwmChannel<'d, T> {
|
||||
self.set_duty_cycle(duty as u16);
|
||||
}
|
||||
|
||||
fn set_duty_cycle_percent(&mut self, percent: u8) {
|
||||
pub fn set_duty_cycle_percent(&mut self, percent: u8) {
|
||||
self.set_duty_cycle_fraction(u16::from(percent), 100)
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user