From ec2aaecb480cd288a15ba7efb122f74c3ebd46fb Mon Sep 17 00:00:00 2001 From: Ryan Summers Date: Thu, 17 Dec 2020 14:11:28 +0100 Subject: [PATCH] Adding safety documentation --- src/dac.rs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/dac.rs b/src/dac.rs index ef65d19..f21ccfd 100644 --- a/src/dac.rs +++ b/src/dac.rs @@ -138,6 +138,8 @@ macro_rules! dac_output { // AXISRAM is uninitialized. As such, we manually zero-initialize it here before // starting the transfer. + // Note(unsafe): We currently own all DAC_BUF[index] buffers and are not using them + // elsewhere, so it is safe to access them here. for buf in unsafe { DAC_BUF[$index].iter_mut() } { for byte in buf.iter_mut() { *byte = 0;