Commit 7693ac64 authored by Daan Vreeken's avatar Daan Vreeken
Browse files

Add BLOCK_CREATE macros.

	modified:   controller/block/block_counter.c
	modified:   controller/block/block_debug.c
	modified:   controller/block/block_gain_var.c
	modified:   controller/block/block_inverse_proportional.c
	modified:   controller/block/block_random.c
	modified:   controller/block/block_sine.c
	modified:   controller/block/block_trajectplayer.c
	modified:   controller/block/block_trajectplayer.h
parent a8e8f284
......@@ -86,7 +86,8 @@ static struct controller_block_outterm_list outterms[] = {
{ NULL }
};
struct controller_block * block_counter_create(char *name)
struct controller_block * block_counter_create(char *name, int argc,
va_list ap)
{
struct controller_block *counter;
......@@ -120,3 +121,8 @@ err_inputs:
controller_block_free(counter);
return NULL;
}
BLOCK_CREATE(counter) = {
.create = block_counter_create,
.args = { NULL },
};
......@@ -41,7 +41,7 @@ static void calculate(struct controller_block *debug)
fprintf(stderr, "%s.in: %e\n", debug->name, *debug->private->in);
}
struct controller_block * block_debug_create(char *name)
struct controller_block * block_debug_create(char *name, int argc, va_list ap)
{
struct controller_block *debug;
......@@ -72,3 +72,8 @@ err_name:
controller_block_free(debug);
return NULL;
}
BLOCK_CREATE(debug) = {
.create = block_debug_create,
.args = { NULL },
};
......@@ -59,7 +59,8 @@ static struct controller_block_outterm_list outterms[] = {
{ NULL }
};
struct controller_block * block_gain_var_create(char *name)
struct controller_block * block_gain_var_create(char *name, int argc,
va_list ap)
{
struct controller_block *gain;
......@@ -85,3 +86,9 @@ err_block:
controller_block_free(gain);
return NULL;
}
BLOCK_CREATE(gain_var) = {
.create = block_gain_var_create,
.args = { NULL },
};
......@@ -94,7 +94,8 @@ static struct controller_block_outterm_list outterms[] = {
};
struct controller_block * block_inverse_proportional_create(char *name)
struct controller_block * block_inverse_proportional_create(char *name,
int argc, va_list ap)
{
struct controller_block *iprop;
......@@ -135,3 +136,8 @@ err_inputs:
free(iprop);
return NULL;
}
BLOCK_CREATE(inverse_proportional) = {
.create = block_inverse_proportional_create,
.args = { NULL },
};
......@@ -49,7 +49,8 @@ static struct controller_block_outterm_list outterms[] = {
{ NULL }
};
struct controller_block * block_random_create(char *name)
struct controller_block * block_random_create(char *name, int argc,
va_list ap)
{
struct controller_block *random;
......@@ -72,3 +73,8 @@ err_block:
controller_block_free(random);
return NULL;
}
BLOCK_CREATE(random) = {
.create = block_random_create,
.args = { NULL },
};
......@@ -81,7 +81,7 @@ static struct controller_block_outterm_list outterms[] = {
{ NULL }
};
struct controller_block * block_sine_create(char *name)
struct controller_block * block_sine_create(char *name, int argc, va_list ap)
{
struct controller_block *sine;
......@@ -111,3 +111,8 @@ err_block:
controller_block_free(sine);
return NULL;
}
BLOCK_CREATE(sine) = {
.create = block_sine_create,
.args = { NULL },
};
......@@ -218,7 +218,8 @@ static struct controller_block_outterm_list outterms[] = {
};
struct controller_block * block_trajectplayer_create(char *name)
struct controller_block * block_trajectplayer_create(char *name, int argc,
va_list ap)
{
struct controller_block *player;
......@@ -255,3 +256,8 @@ err_block:
controller_block_free(player);
return NULL;
}
BLOCK_CREATE(trajectplayer) = {
.create = block_trajectplayer_create,
.args = { NULL },
};
......@@ -21,7 +21,8 @@
#include <controller/controller_block.h>
struct controller_block * block_trajectplayer_create(char *name);
struct controller_block * block_trajectplayer_create(char *name, int argc,
va_list ap);
struct block_trajectplayer_param {
int nr;
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment