japaric / stm32f103xx-hal

HAL for the STM32F103xx family of microcontrollers
Apache License 2.0
115 stars 40 forks source link

[I2C] Allow read-/write-only transactions in write_read #126

Closed kellerkindt closed 5 years ago

kellerkindt commented 5 years ago

For WriteRead::write_read only:

Allow transactions, with only read or write requests. More importantly, don't panic anymore (there is no mention of a valid panic at https://github.com/rust-embedded/embedded-hal/blob/master/src/blocking/i2c.rs#L75). Also use .is_empty() instead of == 0