fix clippy, run fmt

This commit is contained in:
Andrea Nall 2021-06-26 23:45:28 -05:00 committed by 9names
parent 0d19834b2e
commit 90a6f8414d
2 changed files with 21 additions and 21 deletions

View file

@ -4,7 +4,7 @@ macro_rules! int_division {
($name:ident, $div:ident, $u:ty) => {
impl IntegerDivision for $name {
fn set_int_div(&mut self, div: usize) {
unsafe { self.shared_dev.get() }.$div.modify(|_,w| unsafe {
unsafe { self.shared_dev.get() }.$div.modify(|_, w| unsafe {
w.int().bits(div as $u);
w
});
@ -17,7 +17,7 @@ macro_rules! frac_division {
($name:ident, $div:ident, $u:ty) => {
impl FractionDivision for $name {
fn set_frac_div(&mut self, div: usize) {
unsafe { self.shared_dev.get() }.$div.modify(|_,w| unsafe {
unsafe { self.shared_dev.get() }.$div.modify(|_, w| unsafe {
w.frac().bits(div as $u);
w
});
@ -30,21 +30,21 @@ macro_rules! clock_generator {
($name:ident, $ctrl:ident) => {
impl ClockGenerator for $name {
fn enable(&mut self) {
unsafe { self.shared_dev.get() }.$ctrl.modify(|_,w| {
unsafe { self.shared_dev.get() }.$ctrl.modify(|_, w| {
w.enable().set_bit();
w
});
}
fn disable(&mut self) {
unsafe { self.shared_dev.get() }.$ctrl.modify(|_,w| {
unsafe { self.shared_dev.get() }.$ctrl.modify(|_, w| {
w.enable().clear_bit();
w
});
}
fn kill(&mut self) {
unsafe { self.shared_dev.get() }.$ctrl.modify(|_,w| {
unsafe { self.shared_dev.get() }.$ctrl.modify(|_, w| {
w.kill().set_bit();
w
});
@ -57,7 +57,7 @@ macro_rules! xosc_source {
($name:ident, $ctrl:ident) => {
impl XOSCClockSource for $name {
fn set_xosc_src(&mut self) {
unsafe { self.shared_dev.get() }.$ctrl.modify(|_,w| {
unsafe { self.shared_dev.get() }.$ctrl.modify(|_, w| {
w.src().xosc_clksrc();
w
});
@ -70,7 +70,7 @@ macro_rules! rosc_source {
($name:ident, $ctrl:ident) => {
impl ROSCClockSource for $name {
fn set_rosc_src(&mut self) {
unsafe { self.shared_dev.get() }.$ctrl.modify(|_,w| {
unsafe { self.shared_dev.get() }.$ctrl.modify(|_, w| {
w.src().rosc_clksrc_ph();
w
});
@ -83,7 +83,7 @@ macro_rules! selfaux_source {
($name:ident, $ctrl:ident, $self:ident) => {
impl SelfAuxClockSource for $name {
fn set_self_aux_src(&mut self) {
unsafe { self.shared_dev.get() }.$ctrl.modify(|_,w| {
unsafe { self.shared_dev.get() }.$ctrl.modify(|_, w| {
w.src().$self();
w
});
@ -96,7 +96,7 @@ macro_rules! clockref_source {
($name:ident, $ctrl:ident) => {
impl ClockREFClockSource for $name {
fn set_clkref_src(&mut self) {
unsafe { self.shared_dev.get() }.$ctrl.modify(|_,w| {
unsafe { self.shared_dev.get() }.$ctrl.modify(|_, w| {
w.src().clk_ref();
w
});
@ -109,7 +109,7 @@ macro_rules! clocksys_auxsource {
($name:ident, $ctrl:ident) => {
impl ClockSYSClockAuxSource for $name {
fn set_clksys_auxsrc(&mut self) {
unsafe { self.shared_dev.get() }.$ctrl.modify(|_,w| {
unsafe { self.shared_dev.get() }.$ctrl.modify(|_, w| {
w.auxsrc().clk_sys();
w
});
@ -122,7 +122,7 @@ macro_rules! xosc_auxsource {
($name:ident, $ctrl:ident) => {
impl XOSCClockAuxSource for $name {
fn set_xosc_auxsrc(&mut self) {
unsafe { self.shared_dev.get() }.$ctrl.modify(|_,w| {
unsafe { self.shared_dev.get() }.$ctrl.modify(|_, w| {
w.auxsrc().xosc_clksrc();
w
});
@ -135,7 +135,7 @@ macro_rules! rosc_auxsource {
($name:ident, $ctrl:ident) => {
impl ROSCClockAuxSource for $name {
fn set_rosc_auxsrc(&mut self) {
unsafe { self.shared_dev.get() }.$ctrl.modify(|_,w| {
unsafe { self.shared_dev.get() }.$ctrl.modify(|_, w| {
w.auxsrc().rosc_clksrc();
w
});
@ -148,7 +148,7 @@ macro_rules! rosc_ph_auxsource {
($name:ident, $ctrl:ident) => {
impl ROSCPHClockAuxSource for $name {
fn set_rosc_ph_auxsrc(&mut self) {
unsafe { self.shared_dev.get() }.$ctrl.modify(|_,w| {
unsafe { self.shared_dev.get() }.$ctrl.modify(|_, w| {
w.auxsrc().rosc_clksrc_ph();
w
});
@ -161,7 +161,7 @@ macro_rules! gpin0_auxsource {
($name:ident, $ctrl:ident) => {
impl Gpin0ClockAuxSource for $name {
fn set_gpin0_auxsrc(&mut self) {
unsafe { self.shared_dev.get() }.$ctrl.modify(|_,w| {
unsafe { self.shared_dev.get() }.$ctrl.modify(|_, w| {
w.auxsrc().clksrc_gpin0();
w
});
@ -174,7 +174,7 @@ macro_rules! gpin1_auxsource {
($name:ident, $ctrl:ident) => {
impl Gpin1ClockAuxSource for $name {
fn set_gpin1_auxsrc(&mut self) {
unsafe { self.shared_dev.get() }.$ctrl.modify(|_,w| {
unsafe { self.shared_dev.get() }.$ctrl.modify(|_, w| {
w.auxsrc().clksrc_gpin1();
w
});
@ -187,7 +187,7 @@ macro_rules! pll_usb_auxsource {
($name:ident, $ctrl:ident) => {
impl PLLUSBClockAuxSource for $name {
fn set_pll_usb_auxsrc(&mut self) {
unsafe { self.shared_dev.get() }.$ctrl.modify(|_,w| {
unsafe { self.shared_dev.get() }.$ctrl.modify(|_, w| {
w.auxsrc().clksrc_pll_usb();
w
});
@ -200,7 +200,7 @@ macro_rules! pll_sys_auxsource {
($name:ident, $ctrl:ident) => {
impl PLLSYSClockAuxSource for $name {
fn set_pll_sys_auxsrc(&mut self) {
unsafe { self.shared_dev.get() }.$ctrl.modify(|_,w| {
unsafe { self.shared_dev.get() }.$ctrl.modify(|_, w| {
w.auxsrc().clksrc_pll_sys();
w
});

View file

@ -33,7 +33,7 @@ impl ClocksManager {
let shared_clocks = ShareableClocks::new(&mut clocks_block);
ClocksManager {
clocks: clocks_block,
shared_clocks: shared_clocks,
shared_clocks,
}
}
@ -45,21 +45,21 @@ impl ClocksManager {
/// Getter for the Reference Clock.
pub fn ref_clock(&self) -> ReferenceClock {
ReferenceClock {
shared_dev: self.shared_clocks.clone(),
shared_dev: self.shared_clocks,
}
}
/// Getter for the System Clock
pub fn sys_clock(&self) -> SystemClock {
SystemClock {
shared_dev: self.shared_clocks.clone(),
shared_dev: self.shared_clocks,
}
}
/// Getter for the PeripheralClock
pub fn peripheral_clock(&self) -> PeripheralClock {
PeripheralClock {
shared_dev: self.shared_clocks.clone(),
shared_dev: self.shared_clocks,
}
}
}