Commit 85094e0
Fix SPI pin matching check
This looks up the SPI module corresponding to each of pins passed and
then uses `pinmap_merge_peripheral()` to merge this in a single pin. If
not all pins map to the same SPI module, this should abort.
The `pinmap_merge_peripheral` function returns NP to indicate a mismatch
between the passed peripherals. However, when one of the arguments is
already NP, this is not propagated into the function result, instead the
other argument is simplly returned.
In this case, the merging happens in two levels: First MISO and MOSI are
merged, then SCK and SS are merged and finally the merged results are
again merged. That means that if MISO and MISO mismatch, but SCK and SS
match (or the other way around), the NP returned due to the mismatch is
ignored and the final result is not NP, so no error is raised.
This changes the code to also check the intermediate merge results for
NP, to properly detect mismatches.1 parent c670e31 commit 85094e0
1 file changed
+1
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
181 | 181 | | |
182 | 182 | | |
183 | 183 | | |
184 | | - | |
| 184 | + | |
185 | 185 | | |
186 | 186 | | |
187 | 187 | | |
| |||
0 commit comments