Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
M
mock-turtle
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
image/svg+xml
Discourse
Discourse
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Commits
Open sidebar
hdl-core-lib
mock-turtle
Commits
b9d9779a
Commit
b9d9779a
authored
May 04, 2018
by
Federico Vaga
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
sw:py: bugfix use integer errcheck
Signed-off-by:
Federico Vaga
<
federico.vaga@cern.ch
>
parent
36e000e4
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
16 deletions
+13
-16
PyMockTurtle.py
software/lib/PyMockTurtle/PyMockTurtle/PyMockTurtle.py
+13
-16
No files found.
software/lib/PyMockTurtle/PyMockTurtle/PyMockTurtle.py
View file @
b9d9779a
...
...
@@ -211,39 +211,39 @@ class TrtlDevice(object):
POINTER
(
c_int
),
c_size_t
,
c_uint
]
self
.
libtrtl
.
trtl_smem_read
.
restype
=
c_int
self
.
libtrtl
.
trtl_smem_read
.
errcheck
=
self
.
errcheck
self
.
libtrtl
.
trtl_smem_read
.
errcheck
=
self
.
__errcheck_int
# SHM WRITE
self
.
libtrtl
.
trtl_smem_write
.
argtypes
=
[
c_void_p
,
c_uint
,
POINTER
(
c_int
),
c_size_t
,
c_uint
]
self
.
libtrtl
.
trtl_smem_write
.
restype
=
c_int
self
.
libtrtl
.
trtl_smem_write
.
errcheck
=
self
.
errcheck
self
.
libtrtl
.
trtl_smem_write
.
errcheck
=
self
.
__errcheck_int
# CPU Enable
self
.
libtrtl
.
trtl_cpu_enable
.
argtypes
=
[
c_void_p
,
c_uint
]
self
.
libtrtl
.
trtl_cpu_enable
.
restype
=
c_int
self
.
libtrtl
.
trtl_cpu_enable
.
errcheck
=
self
.
errcheck
self
.
libtrtl
.
trtl_cpu_enable
.
errcheck
=
self
.
__errcheck_int
# CPU Disable
self
.
libtrtl
.
trtl_cpu_disable
.
argtypes
=
[
c_void_p
,
c_uint
]
self
.
libtrtl
.
trtl_cpu_disable
.
restype
=
c_int
self
.
libtrtl
.
trtl_cpu_disable
.
errcheck
=
self
.
errcheck
self
.
libtrtl
.
trtl_cpu_disable
.
errcheck
=
self
.
__errcheck_int
# CPU Is Enable
self
.
libtrtl
.
trtl_cpu_is_enable
.
argstypes
=
[
c_void_p
,
c_uint
,
POINTER
(
c_int
)]
self
.
libtrtl
.
trtl_cpu_is_enable
.
restype
=
c_int
self
.
libtrtl
.
trtl_cpu_is_enable
.
errcheck
=
self
.
errcheck
self
.
libtrtl
.
trtl_cpu_is_enable
.
errcheck
=
self
.
__errcheck_int
# CPU Load
self
.
libtrtl
.
trtl_cpu_load_application_file
.
argtypes
=
[
c_void_p
,
c_uint
,
c_char_p
]
self
.
libtrtl
.
trtl_cpu_load_application_file
.
restype
=
c_int
self
.
libtrtl
.
trtl_cpu_load_application_file
.
errcheck
=
self
.
errcheck
self
.
libtrtl
.
trtl_cpu_load_application_file
.
errcheck
=
self
.
__errcheck_int
# CPU Dump
self
.
libtrtl
.
trtl_cpu_dump_application_file
.
argtypes
=
[
c_void_p
,
c_uint
,
c_char_p
]
self
.
libtrtl
.
trtl_cpu_dump_application_file
.
restype
=
c_int
self
.
libtrtl
.
trtl_cpu_dump_application_file
.
errcheck
=
self
.
errcheck
self
.
libtrtl
.
trtl_cpu_dump_application_file
.
errcheck
=
self
.
__errcheck_int
# GET CONFIG
self
.
libtrtl
.
trtl_config_get
.
argtypes
=
[
c_void_p
,
]
self
.
libtrtl
.
trtl_config_get
.
restype
=
POINTER
(
TrtlConfig
)
...
...
@@ -255,7 +255,7 @@ class TrtlDevice(object):
POINTER
(
TrtlMessage
),
c_uint
]
self
.
libtrtl
.
trtl_msg_async_recv
.
restype
=
c_int
self
.
libtrtl
.
trtl_msg_async_recv
.
errcheck
=
self
.
errcheck
self
.
libtrtl
.
trtl_msg_async_recv
.
errcheck
=
self
.
__errcheck_int
# ASYNC SEND
self
.
libtrtl
.
trtl_msg_async_send
.
argtypes
=
[
c_void_p
,
c_uint
,
...
...
@@ -263,7 +263,7 @@ class TrtlDevice(object):
POINTER
(
TrtlMessage
),
c_uint
]
self
.
libtrtl
.
trtl_msg_async_send
.
restype
=
c_int
self
.
libtrtl
.
trtl_msg_async_send
.
errcheck
=
self
.
errcheck
self
.
libtrtl
.
trtl_msg_async_send
.
errcheck
=
self
.
__errcheck_int
# SYNC SEND and RECEIVE
self
.
libtrtl
.
trtl_msg_sync
.
argtypes
=
[
c_void_p
,
c_uint
,
...
...
@@ -272,13 +272,13 @@ class TrtlDevice(object):
POINTER
(
TrtlMessage
),
c_uint
]
self
.
libtrtl
.
trtl_msg_sync
.
restype
=
c_int
self
.
libtrtl
.
trtl_msg_sync
.
errcheck
=
self
.
errcheck
self
.
libtrtl
.
trtl_msg_sync
.
errcheck
=
self
.
__errcheck_int
# FLUSH
self
.
libtrtl
.
trtl_hmq_flush
.
argtypes
=
[
c_void_p
,
c_uint
,
c_uint
]
self
.
libtrtl
.
trtl_hmq_flush
.
restype
=
c_int
self
.
libtrtl
.
trtl_hmq_flush
.
errcheck
=
self
.
errcheck
self
.
libtrtl
.
trtl_hmq_flush
.
errcheck
=
self
.
__errcheck_int
# FW PING
self
.
libtrtl
.
trtl_fw_ping
.
argtypes
=
[
c_void_p
,
c_uint
,
c_uint
]
self
.
libtrtl
.
trtl_fw_ping
.
restype
=
c_int
...
...
@@ -294,8 +294,8 @@ class TrtlDevice(object):
# self.libtrtl.trtl_hmq_filter_add.restype = c_int
# self.libtrtl.trtl_hmq_filter_clean.restype = c_int
# # Error
# self.libtrtl.trtl_hmq_filter_add.errcheck = self.
errcheck
# self.libtrtl.trtl_hmq_filter_clean.errcheck = self.
errcheck
# self.libtrtl.trtl_hmq_filter_add.errcheck = self.
__errcheck_int
# self.libtrtl.trtl_hmq_filter_clean.errcheck = self.
__errcheck_int
def
__errcheck_pointer
(
self
,
ret
,
func
,
args
):
"""Generic error handler for functions returning pointers"""
...
...
@@ -314,9 +314,6 @@ class TrtlDevice(object):
else
:
return
ret
def
errcheck
(
self
,
ret
,
func
,
args
):
self
.
__errcheck_int
class
TrtlCpu
(
object
):
"""
...
...
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