Commit 0135f3f1 authored by Jeroen Vreeken's avatar Jeroen Vreeken
Browse files

Some changes from corso 2015

parent b66125b9
...@@ -299,6 +299,21 @@ bool command_fd_set(struct command *command, fd_set *set, int *high) ...@@ -299,6 +299,21 @@ bool command_fd_set(struct command *command, fd_set *set, int *high)
return true; return true;
} }
int command_handle_err(struct command *command, fd_set *set)
{
if (FD_ISSET(command->fd, set)) {
log_send(LOG_T_DEBUG, "Error, closing %d", command->fd);
if (command->fd >= 0)
close(command->fd);
command->fd = -1;
if (command->handler_close)
command->handler_close(command);
}
return 0;
}
int command_handle(struct command *command, fd_set *set) int command_handle(struct command *command, fd_set *set)
{ {
if (FD_ISSET(command->fd, set)) { if (FD_ISSET(command->fd, set)) {
......
...@@ -138,6 +138,7 @@ int command_id_set(struct command *command, char *id); ...@@ -138,6 +138,7 @@ int command_id_set(struct command *command, char *id);
bool command_fd_set(struct command *command, fd_set *set, int *high); bool command_fd_set(struct command *command, fd_set *set, int *high);
int command_handle(struct command *command, fd_set *set); int command_handle(struct command *command, fd_set *set);
int command_handle_err(struct command *command, fd_set *set);
enum command_state command_state_get(struct command *command); enum command_state command_state_get(struct command *command);
void command_autorecover(struct command *command, bool value); void command_autorecover(struct command *command, bool value);
......
...@@ -102,6 +102,7 @@ static void pid_aw_calculate(struct controller_block *pid) ...@@ -102,6 +102,7 @@ static void pid_aw_calculate(struct controller_block *pid)
outp = 0; outp = 0;
outi = 0; outi = 0;
outd = 0; outd = 0;
priv->previous = 0;
} }
priv->outp = outp; priv->outp = outp;
......
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