fix apparent CopyPaste error assigning OBD fault

This commit is contained in:
mi-hol 2023-07-17 05:35:35 -04:00 committed by rusefillc
parent deb4c6c435
commit 27ff399e2d
2 changed files with 9 additions and 9 deletions

View File

@ -1,6 +1,6 @@
/**
* @file obd_error_codes.h
* @brief Standart OBD-II error codes
* @brief Standard and custom OBD-II error codes
*
* More info at http://www.obd-codes.com/faq/obd2-codes-explained.php
*
@ -1724,10 +1724,10 @@ enum class ObdCode : uint16_t {
CUSTOM_6010 = 6010,
CUSTOM_6011 = 6011,
CUSTOM_INTEPOLATE_ERROR = 6012,
CUSTOM_INTEPOLATE_ERROR_2 = 6013,
CUSTOM_INTEPOLATE_ERROR_3 = 6014,
CUSTOM_INTEPOLATE_ERROR_4 = 6015,
CUSTOM_ERR_INTERPOLATE_1 = 6012,
CUSTOM_ERR_INTERPOLATE_2 = 6013,
CUSTOM_ERR_INTERPOLATE_3 = 6014,
CUSTOM_ERR_INTERPOLATE_4 = 6015,
CUSTOM_PARAM_RANGE = 6016,
CUSTOM_MAF_NEEDED = 6017,
CUSTOM_UNKNOWN_ALGORITHM = 6018,

View File

@ -73,11 +73,11 @@ static void testBinary() {
*/
float interpolateMsg(const char *msg, float x1, float y1, float x2, float y2, float x) {
if (cisnan(x1) || cisnan(x2) || cisnan(y1) || cisnan(y2)) {
warning(ObdCode::CUSTOM_INTEPOLATE_ERROR, "interpolate%s: why param", msg);
warning(ObdCode::CUSTOM_ERR_INTERPOLATE_1, "interpolate%s: why param", msg);
return NAN;
}
if (cisnan(x)) {
warning(ObdCode::CUSTOM_INTEPOLATE_ERROR, "interpolate%s: why X", msg);
warning(ObdCode::CUSTOM_ERR_INTERPOLATE_2, "interpolate%s: why X", msg);
return NAN;
}
// todo: double comparison using EPS
@ -85,7 +85,7 @@ float interpolateMsg(const char *msg, float x1, float y1, float x2, float y2, fl
/**
* we could end up here for example while resetting bins while changing engine type
*/
warning(ObdCode::CUSTOM_INTEPOLATE_ERROR, "interpolate%s: Same x1 and x2 in interpolate: %.2f/%.2f", msg, x1, x2);
warning(ObdCode::CUSTOM_ERR_INTERPOLATE_3, "interpolate%s: Same x1 and x2 in interpolate: %.2f/%.2f", msg, x1, x2);
return NAN;
}
@ -94,7 +94,7 @@ float interpolateMsg(const char *msg, float x1, float y1, float x2, float y2, fl
// efiAssertVoid(ObdCode::CUSTOM_ERR_ASSERT_VOID, x1 != x2, "no way we can interpolate");
float a = INTERPOLATION_A(x1, y1, x2, y2);
if (cisnan(a)) {
warning(ObdCode::CUSTOM_INTEPOLATE_ERROR, "interpolate%s: why a", msg);
warning(ObdCode::CUSTOM_ERR_INTERPOLATE_4, "interpolate%s: why a", msg);
return NAN;
}
float b = y1 - a * x1;