mirror of https://github.com/FOME-Tech/fome-fw.git
fix apparent CopyPaste error assigning OBD fault (#194)
This commit is contained in:
parent
a8cbf0e2d6
commit
0975c783bd
|
@ -1,6 +1,6 @@
|
|||
/**
|
||||
* @file obd_error_codes.h
|
||||
* @brief Standart and custom 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
|
||||
*
|
||||
|
@ -1714,10 +1714,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,
|
||||
|
|
|
@ -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;
|
||||
|
|
Loading…
Reference in New Issue