Index: Accel.c =================================================================== diff -u -rfb8624ceee3a122412c9fc18811ce927001d727f -rc52be7e1c57818955bf17fea2f5d7c861703cdbd --- Accel.c (.../Accel.c) (revision fb8624ceee3a122412c9fc18811ce927001d727f) +++ Accel.c (.../Accel.c) (revision c52be7e1c57818955bf17fea2f5d7c861703cdbd) @@ -150,7 +150,7 @@ /*********************************************************************//** * @brief * The execAccel function executes the accelerometer monitor state machine. - * @details Inputs: accelState, accelSelfTestState + * @details Inputs: accelState * @details Outputs: accelState, alarm if software fault happened * @return none *************************************************************************/ @@ -165,14 +165,7 @@ switch ( accelState ) { case ACCELEROMETER_START_STATE: - /* Once accelerometer self test completed as part of InitandPost Mode, begin accelerometer monitor state. - * This helps to makes sure that the calibration records has been read from Non Volatile memory - * during power up and applied in to accelerometer readings. - */ - if ( ACCELEROMETER_SELF_TEST_STATE_COMPLETE == accelSelfTestState ) - { - accelState = ACCELEROMETER_MONITOR_STATE; - } + accelState = ACCELEROMETER_MONITOR_STATE; break; case ACCELEROMETER_MONITOR_STATE: @@ -197,7 +190,7 @@ * The handleAccelMonitorState function handles the accelerometer monitor * state of the accelerometer monitor state machine. * @details Inputs: accelNoNewSampleTimerCounter, accelFPGASampleCtr, - * accelAxes, accelFPGAFaultReg, accelSensorCalRecord + * accelAxes, accelFPGAFaultReg, accelSensorCalRecord, accelSelfTestState * @details Outputs: accelNoNewSampleTimerCounter, accelFPGASampleCtr, * accelAxes * alarm if accelerometer failed @@ -257,9 +250,14 @@ // filter readings to get a stable vector for tilt filterAccelReadings(); - // check tilt and shock - checkForTiltError(); - checkForShockError(); + /* check tilt and shock once accelerometer self test completed that indicates + * calibration records read from Non volatile memory during power up. + */ + if ( ACCELEROMETER_SELF_TEST_STATE_COMPLETE == accelSelfTestState ) + { + checkForTiltError(); + checkForShockError(); + } return result; }