better state validation

This commit is contained in:
rusefi 2017-12-02 18:58:40 -05:00
parent adf6b99b38
commit 3232d0d59d
1 changed files with 6 additions and 2 deletions

View File

@ -32,6 +32,10 @@ void setFlatInjectorLag(float value DECLARE_ENGINE_PARAMETER_SUFFIX);
*/ */
#define fixAngle(angle, msg) \ #define fixAngle(angle, msg) \
{ \ { \
if (cisnan(angle)) { \
firmwareError(CUSTOM_ERR_6516, "angle NaN %s", msg); \
angle = 0; \
} \
assertAngleRange(angle, msg); \ assertAngleRange(angle, msg); \
float engineCycleDurationLocalCopy = ENGINE(engineCycle); \ float engineCycleDurationLocalCopy = ENGINE(engineCycle); \
/* todo: split this method into 'fixAngleUp' and 'fixAngleDown'*/ \ /* todo: split this method into 'fixAngleUp' and 'fixAngleDown'*/ \