Skip to content

Commit

Permalink
Address clippy warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
mciantyre committed Jul 16, 2024
1 parent 1228e2b commit 6de1c0b
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/driver.rs
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,7 @@ impl Driver {
ral::write_reg!(ral::usb, self.usb, ENDPTNAKEN, 0);

while ral::read_reg!(ral::usb, self.usb, ENDPTPRIME) != 0 {}
ral::write_reg!(ral::usb, self.usb, ENDPTFLUSH, u32::max_value());
ral::write_reg!(ral::usb, self.usb, ENDPTFLUSH, u32::MAX);
while ral::read_reg!(ral::usb, self.usb, ENDPTFLUSH) != 0 {}

debug_assert!(
Expand Down
2 changes: 1 addition & 1 deletion src/gpt.rs
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,7 @@ impl<'a> Gpt<'a> {
/// Note that the load count value is not loaded until the next call to `reset()` (one shot mode)
/// or until after the timer elapses (repeat mode).
pub fn set_load(&mut self, us: u32) {
let count = us.min(0xFF_FFFF).max(1).saturating_sub(1);
let count = us.clamp(1, 0xFF_FFFF).saturating_sub(1);
match self.gpt {
Instance::Gpt0 => ral::write_reg!(ral::usb, self.usb, GPTIMER0LD, count),
Instance::Gpt1 => ral::write_reg!(ral::usb, self.usb, GPTIMER1LD, count),
Expand Down

0 comments on commit 6de1c0b

Please sign in to comment.