Fix ReadScratch command buffer size (#494)

This commit is contained in:
g 2024-10-21 22:42:22 +03:00 committed by GitHub
parent ff343b67f3
commit 7d5e233ac9
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -161,7 +161,7 @@ fn ds18b20_get_temperature<'a>(addr: &OWAddress, bus: &OWDriver) -> Result<f32,
ds18b20_send_command(addr, bus, Ds18b20Command::ReadScratch as u8)?;
let mut buf = [0u8; 10];
let mut buf = [0u8; 9];
bus.read(&mut buf)?;
let lsb = buf[0];
let msb = buf[1];