Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Tammo Jan Dijkema
dt_ctrl
Commits
56aaa559
Commit
56aaa559
authored
Dec 18, 2014
by
Jeroen Vreeken
Browse files
Test update
parent
2d3db21c
Changes
6
Hide whitespace changes
Inline
Side-by-side
common/include/dynarg.h
View file @
56aaa559
...
...
@@ -34,6 +34,7 @@
struct
_va_dyn
{
unsigned
char
regs
[
176
];
unsigned
char
overflow_area
[
256
];
size_t
overflow
;
unsigned
gp_offset
;
unsigned
fp_offset
;
...
...
@@ -47,7 +48,7 @@ do {\
(list)[0].gp_offset = 8;\
(list)[0].fp_offset = 48;\
(list)[0].reg_save_area = vadyn->regs;\
(list)[0].overflow_arg_area =
NULL
;\
(list)[0].overflow_arg_area =
vadyn->overflow_area
;\
vadyn->overflow = 0;\
vadyn->gp_offset = 8;\
vadyn->fp_offset = 48;\
...
...
@@ -70,10 +71,15 @@ do {\
/* *(double *)&vadyn->regs[vadyn->fp_offset] = u.d;*/
\
vadyn->fp_offset += sizeof(long double);\
} else { \
memcpy(&vadyn->regs[vadyn->gp_offset], &u.ul, sizeof(u.ul)); \
/* *(unsigned long *)&vadyn->regs[vadyn->gp_offset] = \
(unsigned long)u.ul;*/
\
vadyn->gp_offset += sizeof(unsigned long);\
if (vadyn->gp_offset < 48) { \
memcpy(&vadyn->regs[vadyn->gp_offset], &u.ul, sizeof(u.ul)); \
/* *(unsigned long *)&vadyn->regs[vadyn->gp_offset] = \
(unsigned long)u.ul;*/
\
vadyn->gp_offset += sizeof(unsigned long);\
} else { \
memcpy(&vadyn->overflow_area[vadyn->gp_offset], &u.ul, sizeof(u.ul)); \
vadyn->gp_offset += sizeof(unsigned long);\
} \
} \
} while (0)
...
...
controller/block/block_command_bool.c
View file @
56aaa559
...
...
@@ -23,12 +23,12 @@
#include
<log/log.h>
#include
<controller/controller_block.h>
//#include <controller/controller_sample.h>
#include
<controller/controller_command.h>
struct
controller_block_private
{
bool
value
;
uint32_t
id
;
struct
controller_command
*
command
;
};
...
...
@@ -40,12 +40,16 @@ static void command_calculate(struct controller_block *cmd)
if
(
!
controller_command_queue_read
(
priv
->
command
,
&
c_entry
))
{
priv
->
value
=
c_entry
.
value
.
b
;
priv
->
id
=
c_entry
.
id
;
}
else
{
priv
->
id
=
COMMAND_ID_NONE
;
}
}
static
struct
controller_block_outterm_list
outterms
[]
=
{
{
"value"
,
CONTROLLER_BLOCK_TERM_BOOL
,
offsetof
(
struct
controller_block_private
,
value
)
},
{
"id"
,
CONTROLLER_BLOCK_TERM_UINT32
,
offsetof
(
struct
controller_block_private
,
id
)
},
{
NULL
},
};
...
...
@@ -58,6 +62,7 @@ struct controller_block * block_command_bool_create(char *name)
return
NULL
;
cmd
->
private
->
value
=
false
;
cmd
->
private
->
id
=
COMMAND_ID_NONE
;
if
(
controller_block_outterm_list_init
(
cmd
,
outterms
))
goto
err_block
;
...
...
controller/block/block_command_bool.test.ctrl
0 → 100644
View file @
56aaa559
frequency 10
trigger {
{ "immediate" }
}
blocks {
{ "command_bool", "command_bool" }
{ "test_output_bool", "value" }
{ "test_output_uint32", "id" }
{ "test_command", "command" }
}
links {
{ "command_bool", "value", "value", "value", true }
{ "command_bool", "id", "id", "value", true }
}
set SETPOINT 4
set SPEED 5
set SETPOINT_TIME 6
set COMMAND_ID_NONE (int)0xffffffff
params {
{ "command", "command", "command_bool", $[SETPOINT_TIME], 123, true, 0, 500000000 }
{ "command", "command", "command_bool", $[SETPOINT], 234, true }
{ "command", "command", "command_bool", $[SETPOINT], 567, false }
{ "command", "command", "command_bool", $[SETPOINT], 666, true }
{ "command", "command", "command_bool", $[SETPOINT], 777, false }
{ "value", "value", 10,
(int) { false, true, true, false, true, false, false, false, false, false }
}
{ "id", "value", 10,
(int) { $[COMMAND_ID_NONE], 123, 234, 567, 666, 777, $[COMMAND_ID_NONE], $[COMMAND_ID_NONE], $[COMMAND_ID_NONE], $[COMMAND_ID_NONE] }
}
}
controller/block/block_setpoint_generator_1d.test.ctrl
View file @
56aaa559
...
...
@@ -58,7 +58,7 @@ params {
}
{ "x", "value", 20,
(float) { 50.0, 52.0, 54.0, 56.0, 58.0, 60.0, 58.0, 60.0, 61.0, 62.1,
-94.0,-9
5
.0,-9
7
.0,-
99
.0,-100.0, -100.0, -100.0, -100.0, -100.0, -100.0},
-94.0,-9
6
.0,-9
8
.0,-
100
.0,-100.0, -100.0, -100.0, -100.0, -100.0, -100.0},
(float) { 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ,
0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 }
}
...
...
@@ -69,6 +69,6 @@ params {
{ "id", "value", 20,
(int) { (int)0xffffffff, 123, 123, 123, 123, 123, 124, 125, 126, 200,
(int)0xffffffff,
127, 201
,(int)0xffffffff,(int)0xffffffff,(int)0xffffffff,(int)0xffffffff,(int)0xffffffff,(int)0xffffffff,(int)0xffffffff}
(int)0xffffffff,
201,(int)0xffffffff
,(int)0xffffffff,(int)0xffffffff,(int)0xffffffff,(int)0xffffffff,(int)0xffffffff,(int)0xffffffff,(int)0xffffffff}
}
}
controller/block/block_setpoint_generator_3d.test.ctrl
View file @
56aaa559
...
...
@@ -90,6 +90,6 @@ params {
{ "id", "value", 20,
(int) { (int)0xffffffff, 123, 123, 123, 123, 123, 124, 125, 126, 200,
(int)0xffffffff,
127, 201
,(int)0xffffffff,(int)0xffffffff,(int)0xffffffff,(int)0xffffffff,(int)0xffffffff,(int)0xffffffff,(int)0xffffffff}
(int)0xffffffff,
201,(int)0xffffffff
,(int)0xffffffff,(int)0xffffffff,(int)0xffffffff,(int)0xffffffff,(int)0xffffffff,(int)0xffffffff,(int)0xffffffff}
}
}
controller/block/build.mk
View file @
56aaa559
...
...
@@ -80,6 +80,7 @@ CLEAN += $(BLOCK_TARGETS) $(BLOCK_OBJS)
SRCS
+=
$(BLOCK_SRCS)
CTRL_TESTS
+=
\
$(DIR)
/block_command_bool.test.ctrl
\
$(DIR)
/block_gain.test.ctrl
\
$(DIR)
/block_limit.test.ctrl
\
$(DIR)
/block_matrix_2x2.test.ctrl
\
...
...
Write
Preview
Supports
Markdown
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