WIP: try removing interrupts within min interarrival

This commit is contained in:
Alwin Berger 2024-10-10 17:56:08 +02:00
parent 2ca6fdf538
commit 8f0e54053b

View File

@ -46,7 +46,9 @@ pub fn input_bytes_to_interrupt_times(buf: &[u8], config: (usize,u32)) -> Vec<u3
if ret[i]==0 {continue;} if ret[i]==0 {continue;}
for j in i+1..ret.len()-1 { for j in i+1..ret.len()-1 {
if ret[j]-ret[i] < config.1 as u32 * QEMU_ISNS_PER_USEC { if ret[j]-ret[i] < config.1 as u32 * QEMU_ISNS_PER_USEC {
ret[j] = u32::saturating_add(ret[i],config.1 * QEMU_ISNS_PER_USEC); // ret[j] = u32::saturating_add(ret[i],config.1 * QEMU_ISNS_PER_USEC);
ret[j] = 0; // remove the interrupt
ret.sort_unstable();
} else {break;} } else {break;}
} }
} }