Commit eefd8984 authored by Jeroen Vreeken's avatar Jeroen Vreeken
Browse files

Add trigger section to control file.

Use immediate trigger in test.ctrl files.
Fix some bugs
parent 966b1736
......@@ -129,8 +129,7 @@ TARGETS:= $$($(DIR)_TMPTARGETS) $$(TARGETS)
DIR := $(DIR)
endef
CFLAGS := -pthread -Icommon -Icommon/include -Icontroller -Iconsole/console -Iinclude
CFLAGS := -pthread -D_GNU_SOURCE -Icommon -Icommon/include -Icontroller -Iconsole/console -Iinclude
LDFLAGS := -pthread -Lcommon/lib -Lcontroller/lib -Lconsole/console/lib -Llib -Wl,--as-needed
VPATH += common/lib controller/lib console/console/lib lib
VPATH += include
......
......@@ -527,7 +527,7 @@ int trace_handle_recv(struct trace *trace)
int trace_handle(struct trace *trace, fd_set *set)
{
if (!set || FD_ISSET(trace->fd, set)) {
if (trace->fd >= 0 && (!set || FD_ISSET(trace->fd, set))) {
trace_handle_recv(trace);
}
return 0;
......
......@@ -29,8 +29,9 @@
#include <netdb.h>
#include <errno.h>
#include <sys/ioctl.h>
#include <sys/socket.h>
#include <sys/types.h>
#include <sys/socket.h>
#include <sys/select.h>
#ifdef __linux__
#include <linux/sockios.h>
......
......@@ -14,7 +14,6 @@
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#define _GNU_SOURCE
#include <stdio.h>
#include <stdlib.h>
......@@ -189,7 +188,7 @@ static int status_reconnect(struct status *status)
{
int fd;
printf("reconnect\n");
printf("reconnect: %s\n", status->ident);
fd = tcp_connect(status->host, status->port);
if (fd >= 0) {
poll_add(fd, POLLIN | POLLERR);
......
......@@ -17,8 +17,6 @@
*/
#define _GNU_SOURCE
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
......
......@@ -15,8 +15,6 @@
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#define _GNU_SOURCE
#include <stdlib.h>
#include <stdio.h>
#include <pthread.h>
......
......@@ -22,3 +22,4 @@ screen -S console -X screen -t console_azel console_azel
screen -S console -X screen -t console_manual console_manual
screen -S console -X screen -t console_sattracker console_sattracker
screen -S console -X screen -t console_weather console_weather
screen -S console -X screen -t console_httpd console_httpd
frequency 250
trigger {
{ "immediate" }
}
blocks {
{ "random", "noise" }
{ "filter_iir", "iir" }
......
frequency 100
trigger {
{ "immediate" }
}
blocks {
{ "gain", "gain" }
......
frequency 10
trigger {
{ "immediate" }
}
blocks {
{ "limit", "limit" }
......
frequency 10
trigger {
{ "immediate" }
}
blocks {
{ "matrix_2x2", "matrix" }
......
frequency 100
trigger {
{ "immediate" }
}
blocks {
{ "not", "not" }
......
frequency 100
trigger {
{ "immediate" }
}
blocks {
{ "pid_aw", "pid" }
......
frequency 10
trigger {
{ "immediate" }
}
blocks {
{ "quantize", "quantize" }
......
frequency 10
trigger {
{ "immediate" }
}
blocks {
{ "rangecheck", "rangecheck" }
......
frequency 10
trigger {
{ "immediate" }
}
blocks {
{ "servo_state", "servo_state" }
......
......@@ -101,6 +101,8 @@ static void setpoint_generator_1d_calculate(struct controller_block *spg)
cur_v = priv->cur_v;
if (*priv->reset) {
struct command_entry entry;
priv->cmd_x = *priv->reset_x;
priv->cur_x = priv->cmd_x;
priv->cur_done = true;
......@@ -108,6 +110,9 @@ static void setpoint_generator_1d_calculate(struct controller_block *spg)
priv->cmd_v = 0.0;
priv->cur_v = 0.0;
priv->id = COMMAND_ID_NONE;
controller_command_queue_read(priv->command, &entry);
return;
}
......
frequency 10
trigger {
{ "immediate" }
}
blocks {
{ "setpoint_generator_1d", "spg", "spg", "na" }
......
......@@ -233,6 +233,8 @@ static void setpoint_generator_3d_calculate(struct controller_block *spg)
t_max_a = priv->t_max_a;
if (*priv->reset) {
struct command_entry entry;
priv->cmd_x = *priv->reset_x;
cur_x = priv->cmd_x;
priv->cur_done = true;
......@@ -248,6 +250,8 @@ static void setpoint_generator_3d_calculate(struct controller_block *spg)
priv->start_t = 0;
priv->id = COMMAND_ID_NONE;
controller_command_queue_read(priv->command, &entry);
goto set_output;
}
......
frequency 10
trigger {
{ "immediate" }
}
blocks {
{ "setpoint_generator_3d", "spg", "spg", "na" }
......
Markdown is supported
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