diff --git a/src/params.rs b/src/params.rs index 2acc7e1..f733b61 100644 --- a/src/params.rs +++ b/src/params.rs @@ -4,7 +4,7 @@ use crate::param::SendParam; pub trait SendParams { fn len(&self, long: bool) -> usize { - self.param_len(long) + if long { 2 } else { 1 } + self.param_len(long) + 1 } fn param_len(&self, long: bool) -> usize; diff --git a/src/transport/spi.rs b/src/transport/spi.rs index 41db49b..b3bdd57 100644 --- a/src/transport/spi.rs +++ b/src/transport/spi.rs @@ -81,7 +81,7 @@ where // Pad to 4 byte boundary let mut total_len = send_params.len(long_send) + 3; while 0 != total_len % 4 { - Self::send_byte(spi, 0)?; + Self::send_byte(spi, 0xff)?; total_len += 1; }