Fix unsigned hardware divide/modulo

This commit is contained in:
Rudo2204 2021-07-29 23:20:31 +07:00 committed by 9names
parent ae8fe512bd
commit 2d1086915c

View file

@ -68,9 +68,9 @@ impl HwDivider {
/// Perform hardware unsigned divide/modulo operation /// Perform hardware unsigned divide/modulo operation
pub fn unsigned(&self, dividend: u32, divisor: u32) -> DivResult<u32> { pub fn unsigned(&self, dividend: u32, divisor: u32) -> DivResult<u32> {
let sio = unsafe { &(*pac::SIO::ptr()) }; let sio = unsafe { &(*pac::SIO::ptr()) };
sio.div_sdividend.write(|w| unsafe { w.bits(dividend) }); sio.div_udividend.write(|w| unsafe { w.bits(dividend) });
sio.div_sdivisor.write(|w| unsafe { w.bits(divisor) }); sio.div_udivisor.write(|w| unsafe { w.bits(divisor) });
cortex_m::asm::delay(8); cortex_m::asm::delay(8);