Skip to content

Commit

Permalink
Code formatting fix 2
Browse files Browse the repository at this point in the history
  • Loading branch information
AndreySmirnov81 committed Feb 14, 2022
1 parent f0e1040 commit bad675f
Showing 1 changed file with 8 additions and 10 deletions.
18 changes: 8 additions & 10 deletions src/serial.rs
Original file line number Diff line number Diff line change
Expand Up @@ -369,23 +369,21 @@ where
/// register empty (TXE)_ interrupt
pub fn listen(&mut self, event: Event) {
self.usart.cr1.modify(|_, w| match event {
Event::Rxne => w.rxneie().set_bit(),
Event::Txe => w.txeie().set_bit(),
Event::Idle => w.idleie().set_bit(),
}
);
Event::Rxne => w.rxneie().set_bit(),
Event::Txe => w.txeie().set_bit(),
Event::Idle => w.idleie().set_bit(),
});
}

/// Stops listening to the USART by disabling the _Received data
/// ready to be read (RXNE)_ interrupt and _Transmit data
/// register empty (TXE)_ interrupt
pub fn unlisten(&mut self, event: Event) {
self.usart.cr1.modify(|_, w| match event {
Event::Rxne => w.rxneie().clear_bit(),
Event::Txe => w.txeie().clear_bit(),
Event::Idle => w.idleie().clear_bit(),
}
);
Event::Rxne => w.rxneie().clear_bit(),
Event::Txe => w.txeie().clear_bit(),
Event::Idle => w.idleie().clear_bit(),
});
}

/// Returns true if the line idle status is set
Expand Down

0 comments on commit bad675f

Please sign in to comment.