projects
/
libsigrokdecode.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
808c6e7
)
spi: Throw an error if neither MISO nor MOSI was supplied.
author
Uwe Hermann
<uwe@hermann-uwe.de>
Sun, 2 Feb 2014 20:10:23 +0000
(21:10 +0100)
committer
Uwe Hermann
<uwe@hermann-uwe.de>
Sun, 9 Feb 2014 18:38:20 +0000
(19:38 +0100)
decoders/spi/pd.py
patch
|
blob
|
history
diff --git
a/decoders/spi/pd.py
b/decoders/spi/pd.py
index cd40946c791ec5a1fb13edea8fbe6df75ed20e1f..3bebc7d6efa70e822069eeb5002a47ddc1e31748 100644
(file)
--- a/
decoders/spi/pd.py
+++ b/
decoders/spi/pd.py
@@
-266,6
+266,10
@@
class Decoder(srd.Decoder):
self.have_mosi = (mosi in (0, 1))
self.have_cs = (cs in (0, 1))
+ # Either MISO or MOSI (but not both) can be omitted.
+ if not (self.have_miso or self.have_mosi):
+ raise Exception('Either MISO or MOSI (or both) pins required.')
+
# State machine.
if self.state == 'IDLE':
self.find_clk_edge(miso, mosi, clk, cs)