Index: Accel.c =================================================================== diff -u -r82404deaa5450f7195f03befeaa1d3c6becf4b0f -r734b5f384cd03e52f0ad1a631bb5fb8207a79a20 --- Accel.c (.../Accel.c) (revision 82404deaa5450f7195f03befeaa1d3c6becf4b0f) +++ Accel.c (.../Accel.c) (revision 734b5f384cd03e52f0ad1a631bb5fb8207a79a20) @@ -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; }