mirror of
https://github.com/embassy-rs/embassy.git
synced 2024-11-22 06:42:32 +00:00
fix: check if sck is some before setting high or low
This commit is contained in:
parent
046af81a10
commit
bdaf722cb8
@ -165,13 +165,17 @@ impl<'d, T: Instance> Spim<'d, T> {
|
||||
|
||||
match config.mode.polarity {
|
||||
Polarity::IdleHigh => {
|
||||
if let Some(sck) = &sck {
|
||||
sck.set_high();
|
||||
}
|
||||
if let Some(mosi) = &mosi {
|
||||
mosi.set_high();
|
||||
}
|
||||
}
|
||||
Polarity::IdleLow => {
|
||||
if let Some(sck) = &sck {
|
||||
sck.set_low();
|
||||
}
|
||||
if let Some(mosi) = &mosi {
|
||||
mosi.set_low();
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user