fix crash

This commit is contained in:
Alex Janka 2023-04-24 16:05:07 +10:00
parent c7b7a99cf9
commit a81d082e16

View file

@ -506,8 +506,9 @@ struct Lfsr {
impl Lfsr {
fn update(&mut self) {
self.interval =
(1 << (self.clock_shift as u16)) * (1 + (2 * self.clock_divider as u16)) * 8;
self.interval = (1_u16 << (self.clock_shift as u16))
.wrapping_mul(1 + (2 * self.clock_divider as u16))
.wrapping_mul(8);
}
fn tick(&mut self) {