Subsequent calls to SpiBus::write
corrupt previous writes without flushing
#1369
Labels
SpiBus::write
corrupt previous writes without flushing
#1369
Subsequent calls to
SpiBus::write
seem to corrupt previous (unfinished) writes without callingSpiBus::flash()
inbetween.While this is somewhat documented, it does not follow the requirements by
embedded-hal
:This gets problematic with
embedded-hal-bus
transactions, where operations are just called one after eachother and only.flush()
ed in the end: https://github.com/rust-embedded/embedded-hal/blob/5e21d566e25049a85a74010e0c92708f732b2a7f/embedded-hal-bus/src/spi/shared.rs#L23-L36.Therefore something like the following example results in corrupted data on the bus:
The simplest solutions I would come up with is to call
self.flush()
before doing anything inInstance::write_bytes
, but I don't know the inner workings of the SPI driver well enough to be sure this doesn't have any unwanted side-affects.The text was updated successfully, but these errors were encountered: