Skip to content

Commit 46006b9

Browse files
authored
i2c: allow writing 0 bytes (typically used to ping for devices) (#295)
1 parent f93b505 commit 46006b9

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/i2c.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -303,7 +303,7 @@ where
303303

304304
fn write(&mut self, addr: u8, bytes: &[u8]) -> Result<(), Error> {
305305
// TODO support transfers of more than 255 bytes
306-
assert!(bytes.len() < 256 && bytes.len() > 0);
306+
assert!(bytes.len() < 256);
307307

308308
// Wait for any previous address sequence to end
309309
// automatically. This could be up to 50% of a bus

0 commit comments

Comments
 (0)