From 2a90697834652eca63b0603d4effc361af346b9d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Robert=20J=C3=B6rdens?= Date: Wed, 4 Aug 2021 10:50:39 +0000 Subject: [PATCH] qspi: expand padding comments --- ad9959/src/lib.rs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/ad9959/src/lib.rs b/ad9959/src/lib.rs index 4c99732..8e691e0 100644 --- a/ad9959/src/lib.rs +++ b/ad9959/src/lib.rs @@ -602,10 +602,14 @@ impl ProfileSerializer { #[inline] fn pad(&mut self) { // Pad the buffer to 32-bit (4 byte) alignment by adding dummy writes to CSR and LSRR. + // In the case of 1 byte padding, this instead pads with 5 bytes as there is no + // valid single-byte write that could be used. if self.index & 1 != 0 { + // Pad with 3 bytes self.add_write(Register::LSRR, &[0, 0]); } if self.index & 2 != 0 { + // Pad with 2 bytes self.add_write(Register::CSR, &[(self.mode as u8) << 1]); } debug_assert_eq!(self.index & 3, 0);