From 638418d43e2a535f962473dac1efab00f5b156b5 Mon Sep 17 00:00:00 2001 From: fridtjof <2780577+fridtjof@users.noreply.github.com> Date: Tue, 8 Oct 2019 10:57:45 +0200 Subject: [PATCH] fix write_many so that native chipselect mechanisms work correctly --- src/lib.rs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/lib.rs b/src/lib.rs index 59c177a..2f4c5e5 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -374,8 +374,9 @@ where fn write_many(&mut self, reg: Register, bytes: &[u8]) -> Result<(), E> { self.with_nss_low(|mfr| { - mfr.spi.write(&[reg.write_address()])?; - mfr.spi.write(bytes)?; + for byte in bytes { + self.spi.write(&[reg.write_address(), *byte])?; + } Ok(()) })