rp/clocks: handle fractional gpout dividers
This commit is contained in:
parent
f97b591831
commit
1379eb4e70
@ -821,11 +821,10 @@ impl<'d, T: GpoutPin> Gpout<'d, T> {
|
|||||||
};
|
};
|
||||||
|
|
||||||
let div = unsafe { c.clk_gpout_div(self.gpout.number()).read() };
|
let div = unsafe { c.clk_gpout_div(self.gpout.number()).read() };
|
||||||
let int = if div.int() == 0 { 65536 } else { div.int() };
|
let int = if div.int() == 0 { 65536 } else { div.int() } as u64;
|
||||||
// TODO handle fractional clock div
|
let frac = div.frac() as u64;
|
||||||
let _frac = div.frac();
|
|
||||||
|
|
||||||
base / int
|
((base as u64 * 256) / (int * 256 + frac)) as u32
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user