fix (workaround) drtioaux packets being corrupted #176

Merged
sb10q merged 3 commits from mwojcik/artiq-zynq:fix_drtio_corruption into master 2022-04-01 14:15:14 +08:00
Showing only changes of commit ad3aeb5109 - Show all commits

View File

@ -66,6 +66,13 @@ pub fn copy_work_buffer(src: *mut u16, dst: *mut u16, len: isize) {
*dst.offset(i) = *src.offset(i);
*dst.offset(i+1) = *src.offset(i+1);
}
Outdated
Review

I think the compiler is allowed to reorder those, unless the memory is marked as volatile.

I think the compiler is allowed to reorder those, unless the memory is marked as volatile.
// workaround for corrupted writes
// check and re-write
for i in 0..len {
if *dst.offset(i) != *src.offset(i) {
*dst.offset(i) = *src.offset(i);
}
}
}
}