Index: Accel.c =================================================================== diff -u -rf80035c59dba7664f86a83c98f46d8e0c9a92d59 -r59871c9964559b5137781af9c2eeed6bab18ef73 --- Accel.c (.../Accel.c) (revision f80035c59dba7664f86a83c98f46d8e0c9a92d59) +++ Accel.c (.../Accel.c) (revision 59871c9964559b5137781af9c2eeed6bab18ef73) @@ -1,14 +1,14 @@ /************************************************************************** * -* Copyright (c) 2020-2023 Diality Inc. - All Rights Reserved. +* Copyright (c) 2020-2024 Diality Inc. - All Rights Reserved. * * THIS CODE MAY NOT BE COPIED OR REPRODUCED IN ANY FORM, IN PART OR IN * WHOLE, WITHOUT THE EXPLICIT PERMISSION OF THE COPYRIGHT OWNER. * * @file Accel.c * -* @author (last) Darren Cox -* @date (last) 22-Jun-2023 +* @author (last) Vinayakam Mani +* @date (last) 31-Aug-2023 * * @author (original) Sean Nash * @date (original) 29-Jul-2020 @@ -164,8 +164,8 @@ switch ( accelState ) { - case ACCELEROMETER_START_STATE: - accelState = ACCELEROMETER_MONITOR_STATE; + case ACCELEROMETER_START_STATE: + accelState = ACCELEROMETER_MONITOR_STATE; break; case ACCELEROMETER_MONITOR_STATE: @@ -190,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 @@ -250,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; }