cisnan -> std::isnan
This commit is contained in:
parent
e2bc1cbade
commit
2682fcec2a
|
@ -59,7 +59,7 @@ GppwmResult GppwmChannel::getOutput() const {
|
||||||
|
|
||||||
float resultVal = m_table->getValue(xAxisValue.Value, yAxisValue.Value);
|
float resultVal = m_table->getValue(xAxisValue.Value, yAxisValue.Value);
|
||||||
|
|
||||||
if (cisnan(result.Result)) {
|
if (std::isnan(result.Result)) {
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -44,7 +44,7 @@ angle_t getRunningAdvance(int rpm, float engineLoad) {
|
||||||
return engineConfiguration->fixedTiming;
|
return engineConfiguration->fixedTiming;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (cisnan(engineLoad)) {
|
if (std::isnan(engineLoad)) {
|
||||||
warning(ObdCode::CUSTOM_NAN_ENGINE_LOAD, "NaN engine load");
|
warning(ObdCode::CUSTOM_NAN_ENGINE_LOAD, "NaN engine load");
|
||||||
return NAN;
|
return NAN;
|
||||||
}
|
}
|
||||||
|
@ -175,7 +175,7 @@ angle_t getCrankingAdvance(int rpm, float engineLoad) {
|
||||||
|
|
||||||
angle_t getAdvance(int rpm, float engineLoad) {
|
angle_t getAdvance(int rpm, float engineLoad) {
|
||||||
#if EFI_ENGINE_CONTROL && EFI_SHAFT_POSITION_INPUT
|
#if EFI_ENGINE_CONTROL && EFI_SHAFT_POSITION_INPUT
|
||||||
if (cisnan(engineLoad)) {
|
if (std::isnan(engineLoad)) {
|
||||||
return 0; // any error should already be reported
|
return 0; // any error should already be reported
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -185,11 +185,11 @@ angle_t getAdvance(int rpm, float engineLoad) {
|
||||||
if (isCranking) {
|
if (isCranking) {
|
||||||
angle = getCrankingAdvance(rpm, engineLoad);
|
angle = getCrankingAdvance(rpm, engineLoad);
|
||||||
assertAngleRange(angle, "crAngle", ObdCode::CUSTOM_ERR_ANGLE_CR);
|
assertAngleRange(angle, "crAngle", ObdCode::CUSTOM_ERR_ANGLE_CR);
|
||||||
efiAssert(ObdCode::CUSTOM_ERR_ASSERT, !cisnan(angle), "cr_AngleN", 0);
|
efiAssert(ObdCode::CUSTOM_ERR_ASSERT, !std::isnan(angle), "cr_AngleN", 0);
|
||||||
} else {
|
} else {
|
||||||
angle = getRunningAdvance(rpm, engineLoad);
|
angle = getRunningAdvance(rpm, engineLoad);
|
||||||
|
|
||||||
if (cisnan(angle)) {
|
if (std::isnan(angle)) {
|
||||||
warning(ObdCode::CUSTOM_ERR_6610, "NaN angle from table");
|
warning(ObdCode::CUSTOM_ERR_6610, "NaN angle from table");
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
@ -202,12 +202,12 @@ angle_t getAdvance(int rpm, float engineLoad) {
|
||||||
|
|
||||||
if (allowCorrections) {
|
if (allowCorrections) {
|
||||||
angle_t correction = getAdvanceCorrections(engineLoad);
|
angle_t correction = getAdvanceCorrections(engineLoad);
|
||||||
if (!cisnan(correction)) { // correction could be NaN during settings update
|
if (!std::isnan(correction)) { // correction could be NaN during settings update
|
||||||
angle += correction;
|
angle += correction;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
efiAssert(ObdCode::CUSTOM_ERR_ASSERT, !cisnan(angle), "_AngleN5", 0);
|
efiAssert(ObdCode::CUSTOM_ERR_ASSERT, !std::isnan(angle), "_AngleN5", 0);
|
||||||
wrapAngle(angle, "getAdvance", ObdCode::CUSTOM_ERR_ADCANCE_CALC_ANGLE);
|
wrapAngle(angle, "getAdvance", ObdCode::CUSTOM_ERR_ADCANCE_CALC_ANGLE);
|
||||||
return angle;
|
return angle;
|
||||||
#else
|
#else
|
||||||
|
|
|
@ -13,7 +13,7 @@ void WallFuel::resetWF() {
|
||||||
|
|
||||||
float WallFuel::adjust(float desiredMassGrams) {
|
float WallFuel::adjust(float desiredMassGrams) {
|
||||||
invocationCounter++;
|
invocationCounter++;
|
||||||
if (cisnan(desiredMassGrams)) {
|
if (std::isnan(desiredMassGrams)) {
|
||||||
return desiredMassGrams;
|
return desiredMassGrams;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -26,11 +26,11 @@
|
||||||
* @see interpolateClamped
|
* @see interpolateClamped
|
||||||
*/
|
*/
|
||||||
float interpolateMsg(const char *msg, float x1, float y1, float x2, float y2, float x) {
|
float interpolateMsg(const char *msg, float x1, float y1, float x2, float y2, float x) {
|
||||||
if (cisnan(x1) || cisnan(x2) || cisnan(y1) || cisnan(y2)) {
|
if (std::isnan(x1) || std::isnan(x2) || std::isnan(y1) || std::isnan(y2)) {
|
||||||
warning(ObdCode::CUSTOM_ERR_INTERPOLATE_1, "interpolate%s: why param", msg);
|
warning(ObdCode::CUSTOM_ERR_INTERPOLATE_1, "interpolate%s: why param", msg);
|
||||||
return NAN;
|
return NAN;
|
||||||
}
|
}
|
||||||
if (cisnan(x)) {
|
if (std::isnan(x)) {
|
||||||
warning(ObdCode::CUSTOM_ERR_INTERPOLATE_2, "interpolate%s: why X", msg);
|
warning(ObdCode::CUSTOM_ERR_INTERPOLATE_2, "interpolate%s: why X", msg);
|
||||||
return NAN;
|
return NAN;
|
||||||
}
|
}
|
||||||
|
@ -47,7 +47,7 @@ float interpolateMsg(const char *msg, float x1, float y1, float x2, float y2, fl
|
||||||
// a*x2 + b = y2
|
// a*x2 + b = y2
|
||||||
// efiAssertVoid(ObdCode::CUSTOM_ERR_ASSERT_VOID, x1 != x2, "no way we can interpolate");
|
// efiAssertVoid(ObdCode::CUSTOM_ERR_ASSERT_VOID, x1 != x2, "no way we can interpolate");
|
||||||
float a = INTERPOLATION_A(x1, y1, x2, y2);
|
float a = INTERPOLATION_A(x1, y1, x2, y2);
|
||||||
if (cisnan(a)) {
|
if (std::isnan(a)) {
|
||||||
warning(ObdCode::CUSTOM_ERR_INTERPOLATE_4, "interpolate%s: why a", msg);
|
warning(ObdCode::CUSTOM_ERR_INTERPOLATE_4, "interpolate%s: why a", msg);
|
||||||
return NAN;
|
return NAN;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue