Use error checking function of config parser in settings module

This commit is contained in:
Mario Hüttel 2020-11-29 19:03:17 +01:00
parent ed4c18f2be
commit a474111f36

View File

@ -149,10 +149,7 @@ int sd_card_settings_try_load_calibration(float *sens_deviation, float *offset)
} }
} }
} while (res != CONFIG_PARSER_END_REACHED && } while (!config_parser_ret_is_abort_condition(res));
res != CONFIG_PARSER_GENERIC_ERR &&
res != CONFIG_PARSER_IOERR &&
res != CONFIG_PARSER_PARAM_ERR);
config_parser_close_file(p); config_parser_close_file(p);
@ -202,10 +199,7 @@ enum settings_load_result sd_card_settings_load_pid_oven_parameters(struct oven_
} }
} }
} while (parse_result != CONFIG_PARSER_END_REACHED && } while (!config_parser_ret_is_abort_condition(parse_result));
parse_result != CONFIG_PARSER_GENERIC_ERR &&
parse_result != CONFIG_PARSER_IOERR &&
parse_result != CONFIG_PARSER_PARAM_ERR);
if (kp_loaded && kd_loaded && ki_loaded && t_sample && int_max_loaded) if (kp_loaded && kd_loaded && ki_loaded && t_sample && int_max_loaded)