mirror of
https://github.com/embassy-rs/embassy.git
synced 2024-11-25 08:12:30 +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 {
|
match config.mode.polarity {
|
||||||
Polarity::IdleHigh => {
|
Polarity::IdleHigh => {
|
||||||
sck.set_high();
|
if let Some(sck) = &sck {
|
||||||
|
sck.set_high();
|
||||||
|
}
|
||||||
if let Some(mosi) = &mosi {
|
if let Some(mosi) = &mosi {
|
||||||
mosi.set_high();
|
mosi.set_high();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Polarity::IdleLow => {
|
Polarity::IdleLow => {
|
||||||
sck.set_low();
|
if let Some(sck) = &sck {
|
||||||
|
sck.set_low();
|
||||||
|
}
|
||||||
if let Some(mosi) = &mosi {
|
if let Some(mosi) = &mosi {
|
||||||
mosi.set_low();
|
mosi.set_low();
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user