fix: check if sck is some before setting high or low
This commit is contained in:
parent
046af81a10
commit
bdaf722cb8
1 changed files with 6 additions and 2 deletions
|
@ -165,13 +165,17 @@ impl<'d, T: Instance> Spim<'d, T> {
|
|||
|
||||
match config.mode.polarity {
|
||||
Polarity::IdleHigh => {
|
||||
sck.set_high();
|
||||
if let Some(sck) = &sck {
|
||||
sck.set_high();
|
||||
}
|
||||
if let Some(mosi) = &mosi {
|
||||
mosi.set_high();
|
||||
}
|
||||
}
|
||||
Polarity::IdleLow => {
|
||||
sck.set_low();
|
||||
if let Some(sck) = &sck {
|
||||
sck.set_low();
|
||||
}
|
||||
if let Some(mosi) = &mosi {
|
||||
mosi.set_low();
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue