Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
P
Production Test Suite
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
9
Issues
9
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Wiki
Wiki
image/svg+xml
Discourse
Discourse
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Projects
Production Test Suite
Commits
58ccbf2c
Commit
58ccbf2c
authored
Jul 03, 2013
by
Matthieu Cattin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
common: Fix exception class call. Was calling I2C exeptions instead of SPI ones.
parent
b60697d6
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
2 deletions
+2
-2
spi.py
common/spi.py
+2
-2
No files found.
common/spi.py
View file @
58ccbf2c
...
...
@@ -69,7 +69,7 @@ class COpenCoresSPI:
init_time
=
time
.
time
()
while
(
self
.
rd_reg
(
self
.
R_CTRL
)
&
self
.
CTRL_BSY
):
if
(
time
.
time
()
-
init_time
)
>
self
.
WAIT_TIME_OUT
:
raise
I2C
DeviceOperationError
(
self
.
base_addr
,
"Wait timeout"
)
raise
SPI
DeviceOperationError
(
self
.
base_addr
,
"Wait timeout"
)
def
config
(
self
,
ass
,
rx_neg
,
tx_neg
,
lsb
,
ie
):
self
.
conf
=
0
...
...
@@ -96,7 +96,7 @@ class COpenCoresSPI:
self
.
wr_reg
(
self
.
R_TX
[
i
],
txrx
[
i
])
#print '[SPI] data length: 0x%X' % len(data)
if
slave
>
len
(
self
.
SS_SEL
):
raise
I2C
DeviceOperationError
(
self
.
base_addr
,
"Maximum number of slaves is
%
d"
%
len
(
self
.
SS_SEL
))
raise
SPI
DeviceOperationError
(
self
.
base_addr
,
"Maximum number of slaves is
%
d"
%
len
(
self
.
SS_SEL
))
self
.
wr_reg
(
self
.
R_SS
,
self
.
SS_SEL
[
slave
])
self
.
wr_reg
(
self
.
R_CTRL
,
(
self
.
LGH_MASK
&
(
len
(
data
)
<<
3
))
|
self
.
CTRL_GO
|
self
.
conf
)
self
.
wait_busy
()
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment