From 2d1c8e1f4f0e7d438168f0e2cee9b15dc34fc711 Mon Sep 17 00:00:00 2001 From: Astro Date: Sat, 14 Dec 2019 01:07:15 +0100 Subject: [PATCH] zynq::flash: fix txd[123] alignment --- src/zynq/flash/mod.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/zynq/flash/mod.rs b/src/zynq/flash/mod.rs index 4fd44d4..0107e66 100644 --- a/src/zynq/flash/mod.rs +++ b/src/zynq/flash/mod.rs @@ -443,19 +443,19 @@ impl<'a, Args: Iterator, W: Into> Transfer<'a, Args, W> { SpiWord::W8(w) => { // println!("txd1 {:02X}", w); unsafe { - self.flash.regs.txd1.write(w.into()); + self.flash.regs.txd1.write(u32::from(w) << 24); } self.sent += 1; } SpiWord::W16(w) => { unsafe { - self.flash.regs.txd2.write(w.into()); + self.flash.regs.txd2.write(u32::from(w) << 16); } self.sent += 2; } SpiWord::W24(w) => { unsafe { - self.flash.regs.txd3.write(w); + self.flash.regs.txd3.write(w << 8); } self.sent += 3; }