Compare commits

...

2 Commits

3 changed files with 5 additions and 6 deletions

View File

@ -135,12 +135,10 @@ enum config_parser_ret config_parser_get_line(config_parser_handle_t handle, str
return CONFIG_PARSER_LINE_MALFORM;
}
token_round++;
strtok(NULL, token_delim);
}
return CONFIG_PARSER_OK;
}

View File

@ -139,7 +139,8 @@ static int sdio_switch_appmode_cmd55()
return -1;
}
enum acmd41_ret sdio_init_card_acmd41(uint8_t HCS){
enum acmd41_ret sdio_init_card_acmd41(uint8_t HCS)
{
uint32_t response;
int retry = 0x20;
if (sdio_switch_appmode_cmd55())

View File

@ -73,13 +73,13 @@ float pid_sample(struct pid_controller *pid, float deviation)
float output;
if (!pid)
return 0.0;
return 0.0f;
output = deviation * pid->k_p;
/* PID runaway compensation */
if (!(deviation > 0.0f && pid->control_output > pid->output_sat_max - 0.5) &&
!(deviation < 0.0f && pid->control_output < pid->output_sat_min + 0.5)) {
if (!(deviation > 0.0f && pid->control_output > pid->output_sat_max - 0.5f) &&
!(deviation < 0.0f && pid->control_output < pid->output_sat_min + 0.5f)) {
calculate_integral(pid, deviation);
}