ryankurte / embedded-hal-compat

Rust embedded-hal inter-version compatibility layer
MIT License
15 stars 11 forks source link

Remove non-blocking SPI code #28

Closed natrow closed 1 year ago

natrow commented 1 year ago

Code from the current Forward<T> implementation calls non-blocking SPI traits in embedded_hal-0.2.7, potentially returning nb::Error::WouldBlock and then getting caught in an infinite recursion.

Note: I haven't tested it extremely thoroughly but at least reading and writing seem to work. Looking at the implementation in embedded_hal-0.2.7, their transfer function essentially calls the non-blocking .send() and .read() functions until successful, accomplishing essentially what the previous version of this code was trying to do.

Fixes #27

natrow commented 1 year ago

It could be that your hal implementation never returns WouldBlock while using SPI