You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I want to change the SPI clock speed after initialization but the method access_spi panics:
thread 'main' panicked at core/src/panicking.rs:223:5:
attempted to zero-initialize type `embedded_hal_bus::spi::exclusive::ExclusiveDevice<rppal::spi::Spi, rppal::gpio::pin::OutputPin, rppal::hal::Delay>`, which is invalid
The panic occurs while zero-initializing the SPI device:
let spi = core::mem::zeroed();
I'm on a Raspberry Pi using rppal as embedded-hal implementation and embedded-hal-bus as SpiDevice implementation.
I would suggest wrapping the SPI device in an Option<SPI>. This also allows the unsafe block to be removed. I will open a pull request for it.
The text was updated successfully, but these errors were encountered:
f-bro
added a commit
to f-bro/dw1000-rs
that referenced
this issue
Feb 7, 2025
Hi,
I want to change the SPI clock speed after initialization but the method
access_spi
panics:The panic occurs while zero-initializing the SPI device:
I'm on a Raspberry Pi using
rppal
asembedded-hal
implementation andembedded-hal-bus
asSpiDevice
implementation.I would suggest wrapping the SPI device in an
Option<SPI>
. This also allows the unsafe block to be removed. I will open a pull request for it.The text was updated successfully, but these errors were encountered: