Skip to content

Commit

Permalink
WriteConfig length fix
Browse files Browse the repository at this point in the history
  • Loading branch information
Nikita Orlov authored and andelf committed Nov 18, 2024
1 parent c7a7434 commit 08ab9bf
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/protocol.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 08ab9bf

Please sign in to comment.