From ad3aeb5109df4e2191eca7d6d96eb8825901e34d Mon Sep 17 00:00:00 2001 From: mwojcik Date: Wed, 23 Mar 2022 10:41:06 +0800 Subject: [PATCH] fix (workaround) drtioaux packets being corrupted --- src/libboard_artiq/src/drtioaux.rs | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/libboard_artiq/src/drtioaux.rs b/src/libboard_artiq/src/drtioaux.rs index 4971502..1e2534a 100644 --- a/src/libboard_artiq/src/drtioaux.rs +++ b/src/libboard_artiq/src/drtioaux.rs @@ -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); } + // 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); + } + } } }