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
Issues
1
Issues
1
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
Mock Turtle
Commits
e6deb071
Commit
e6deb071
authored
Apr 16, 2018
by
Federico Vaga
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
demos:svec: make the compiler happy (but still not working)
Signed-off-by:
Federico Vaga
<
federico.vaga@cern.ch
>
parent
e696b936
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
27 additions
and
23 deletions
+27
-23
libsvec-internal.h
demos/fmc-svec-carrier/software/lib/libsvec-internal.h
+3
-0
libsvec.c
demos/fmc-svec-carrier/software/lib/libsvec.c
+24
-23
No files found.
demos/fmc-svec-carrier/software/lib/libsvec-internal.h
View file @
e6deb071
...
...
@@ -12,6 +12,9 @@
#include <stdlib.h>
#include <libsvec.h>
#define SVEC_CPU_AUTO 0
#define SVEC_CPU_MANUAL 1
#define SVEC_CPU_MANUAL_HMQ 0
/**
* Description of a fmc-svec-carrier device
...
...
demos/fmc-svec-carrier/software/lib/libsvec.c
View file @
e6deb071
...
...
@@ -131,10 +131,10 @@ int svec_lemo_dir_set(struct svec_node *dev, uint32_t value)
{
struct
svec_desc
*
svec
=
(
struct
svec_desc
*
)
dev
;
uint32_t
fields
[]
=
{
SVEC_VAR_LEMO_DIR
,
value
};
struct
trtl_proto_header
hdr
=
hdr_tmpl
;
hdr
.
len
=
2
;
return
trtl_rt_variable_set
(
svec
->
trtl
,
&
hdr
,
fields
,
1
);
return
trtl_rt_variable_set
(
svec
->
trtl
,
SVEC_CPU_MANUAL
,
SVEC_CPU_MANUAL_HMQ
,
fields
,
1
);
}
int
svec_lemo_set
(
struct
svec_node
*
dev
,
uint32_t
value
)
...
...
@@ -142,10 +142,10 @@ int svec_lemo_set(struct svec_node *dev, uint32_t value)
struct
svec_desc
*
svec
=
(
struct
svec_desc
*
)
dev
;
uint32_t
fields
[]
=
{
SVEC_VAR_LEMO_SET
,
value
,
SVEC_VAR_LEMO_CLR
,
~
value
};
struct
trtl_proto_header
hdr
=
hdr_tmpl
;
hdr
.
len
=
4
;
return
trtl_rt_variable_set
(
svec
->
trtl
,
&
hdr
,
fields
,
2
);
return
trtl_rt_variable_set
(
svec
->
trtl
,
SVEC_CPU_MANUAL
,
SVEC_CPU_MANUAL_HMQ
,
fields
,
2
);
}
...
...
@@ -184,10 +184,10 @@ int svec_led_set(struct svec_node *dev, uint32_t value, enum svec_color color)
uint32_t
real_value
=
svec_apply_color
(
value
,
color
);
uint32_t
fields
[]
=
{
SVEC_VAR_LED_SET
,
real_value
,
SVEC_VAR_LED_CLR
,
~
real_value
};
struct
trtl_proto_header
hdr
=
hdr_tmpl
;
hdr
.
len
=
6
;
return
trtl_rt_variable_set
(
svec
->
trtl
,
&
hdr
,
fields
,
2
);
return
trtl_rt_variable_set
(
svec
->
trtl
,
SVEC_CPU_MANUAL
,
SVEC_CPU_MANUAL_HMQ
,
fields
,
2
);
}
...
...
@@ -200,12 +200,11 @@ int svec_status_get(struct svec_node *dev, struct svec_status *status)
uint32_t
fields
[]
=
{
SVEC_VAR_LEMO_STA
,
0
,
SVEC_VAR_LED_STA
,
0
,
SVEC_VAR_LEMO_DIR
,
0
};
struct
trtl_proto_header
hdr
=
hdr_tmpl
;
int
err
;
hdr
.
flags
=
TRTL_HEAD_FLAG_SYNC
;
hdr
.
len
=
6
;
err
=
trtl_rt_variable_get
(
svec
->
trtl
,
&
hdr
,
fields
,
3
);
err
=
trtl_rt_variable_get
(
svec
->
trtl
,
SVEC_CPU_MANUAL
,
SVEC_CPU_MANUAL_HMQ
,
fields
,
3
);
if
(
err
)
return
err
;
...
...
@@ -220,18 +219,19 @@ int svec_run_autosvec(struct svec_node *dev, uint32_t run)
{
struct
svec_desc
*
svec
=
(
struct
svec_desc
*
)
dev
;
uint32_t
fields
[]
=
{
SVEC_VAR_AUTO
,
run
};
struct
trtl_proto_header
hdr
=
hdr_tmpl
;
hdr
.
len
=
2
;
return
trtl_rt_variable_set
(
svec
->
trtl
,
&
hdr
,
fields
,
1
);
return
trtl_rt_variable_set
(
svec
->
trtl
,
SVEC_CPU_MANUAL
,
SVEC_CPU_MANUAL_HMQ
,
fields
,
1
);
}
int
svec_version
(
struct
svec_node
*
dev
,
struct
trtl_rt_version
*
version
)
{
struct
svec_desc
*
svec
=
(
struct
svec_desc
*
)
dev
;
return
trtl_rt_version_get
(
svec
->
trtl
,
version
,
SVEC_HMQ_IN
,
SVEC_HMQ_OUT
);
return
trtl_rt_version_get
(
svec
->
trtl
,
SVEC_CPU_MANUAL
,
SVEC_CPU_MANUAL_HMQ
,
version
);
}
int
svec_test_struct_get
(
struct
svec_node
*
dev
,
struct
svec_structure
*
test
)
...
...
@@ -242,10 +242,10 @@ int svec_test_struct_get(struct svec_node *dev, struct svec_structure *test)
.
size
=
sizeof
(
struct
svec_structure
),
.
buf
=
test
,
};
struct
trtl_proto_header
hdr
=
hdr_tmpl
;
hdr
.
flags
=
TRTL_HEAD_FLAG_SYNC
;
return
trtl_rt_buffer_get
(
svec
->
trtl
,
&
hdr
,
&
tlv
,
1
);
return
trtl_rt_buffer_get
(
svec
->
trtl
,
SVEC_CPU_MANUAL
,
SVEC_CPU_MANUAL_HMQ
,
&
tlv
,
1
);
}
int
svec_test_struct_set
(
struct
svec_node
*
dev
,
struct
svec_structure
*
test
)
...
...
@@ -256,7 +256,8 @@ int svec_test_struct_set(struct svec_node *dev, struct svec_structure *test)
.
size
=
sizeof
(
struct
svec_structure
),
.
buf
=
test
,
};
struct
trtl_proto_header
hdr
=
hdr_tmpl
;
return
trtl_rt_buffer_set
(
svec
->
trtl
,
&
hdr
,
&
tlv
,
1
);
return
trtl_rt_buffer_set
(
svec
->
trtl
,
SVEC_CPU_MANUAL
,
SVEC_CPU_MANUAL_HMQ
,
&
tlv
,
1
);
}
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