clippy: remove unnecessary casts
Some checks failed
Rust/va108xx-hal/pipeline/head There was a failure building this commit
Some checks failed
Rust/va108xx-hal/pipeline/head There was a failure building this commit
This commit is contained in:
parent
6131458a13
commit
b776bd2823
@ -119,14 +119,14 @@ impl TimingCfg {
|
|||||||
}
|
}
|
||||||
|
|
||||||
pub fn reg(&self) -> u32 {
|
pub fn reg(&self) -> u32 {
|
||||||
((self.tbuf as u32) << 28
|
(self.tbuf as u32) << 28
|
||||||
| (self.thd_sta as u32) << 24
|
| (self.thd_sta as u32) << 24
|
||||||
| (self.tsu_sta as u32) << 20
|
| (self.tsu_sta as u32) << 20
|
||||||
| (self.tsu_sto as u32) << 16
|
| (self.tsu_sto as u32) << 16
|
||||||
| (self.tlow as u32) << 12
|
| (self.tlow as u32) << 12
|
||||||
| (self.thigh as u32) << 8
|
| (self.thigh as u32) << 8
|
||||||
| (self.tf as u32) << 4
|
| (self.tf as u32) << 4
|
||||||
| (self.tr as u32)) as u32
|
| (self.tr as u32)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -354,7 +354,7 @@ impl<UART: Instance> UartBase<UART> {
|
|||||||
};
|
};
|
||||||
let x = sys_clk.0 as f32 / (config.baudrate.0 * baud_multiplier) as f32;
|
let x = sys_clk.0 as f32 / (config.baudrate.0 * baud_multiplier) as f32;
|
||||||
let integer_part = floorf(x) as u32;
|
let integer_part = floorf(x) as u32;
|
||||||
let frac = floorf((64.0 * (x - integer_part as f32) + 0.5) as f32) as u32;
|
let frac = floorf(64.0 * (x - integer_part as f32) + 0.5) as u32;
|
||||||
self.uart
|
self.uart
|
||||||
.clkscale
|
.clkscale
|
||||||
.write(|w| unsafe { w.bits(integer_part * 64 + frac) });
|
.write(|w| unsafe { w.bits(integer_part * 64 + frac) });
|
||||||
|
Reference in New Issue
Block a user