Browse Source

Some changes from corso 2015

jeroen
Jeroen Vreeken 5 years ago
parent
commit
0135f3f164
3 changed files with 17 additions and 0 deletions
  1. +15
    -0
      common/command/command.c
  2. +1
    -0
      common/command/command.h
  3. +1
    -0
      controller/block/block_pid_aw.c

+ 15
- 0
common/command/command.c View File

@ -299,6 +299,21 @@ bool command_fd_set(struct command *command, fd_set *set, int *high)
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)
{
if (FD_ISSET(command->fd, set)) {


+ 1
- 0
common/command/command.h View File

@ -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);
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);
void command_autorecover(struct command *command, bool value);


+ 1
- 0
controller/block/block_pid_aw.c View File

@ -102,6 +102,7 @@ static void pid_aw_calculate(struct controller_block *pid)
outp = 0;
outi = 0;
outd = 0;
priv->previous = 0;
}
priv->outp = outp;


Loading…
Cancel
Save