From 08ab9bfc994161a48554b9f70271465fc6ca5ce6 Mon Sep 17 00:00:00 2001 From: Nikita Orlov Date: Sun, 17 Nov 2024 13:22:54 +0300 Subject: [PATCH] WriteConfig length fix --- src/protocol.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/protocol.rs b/src/protocol.rs index 699eef1..a49a4b0 100644 --- a/src/protocol.rs +++ b/src/protocol.rs @@ -209,7 +209,7 @@ impl Command { Command::WriteConfig { bit_mask, data } => { let mut buf = vec![0u8; 1 + 2 + 2 + data.len()]; buf[0] = commands::WRITE_CONFIG; - buf.pwrite_with(1 + data.len() as u16, 1, scroll::LE)?; + buf.pwrite_with(2 + data.len() as u16, 1, scroll::LE)?; buf[3] = bit_mask; buf[5..].copy_from_slice(&data); Ok(buf)