Index: Accel.c =================================================================== diff -u -rc1881f60c442c55ec04b54b8ee9000d2ac9dca8d -r5010eb0fe6fb79f67dfa73ae40331d61cd80f17b --- Accel.c (.../Accel.c) (revision c1881f60c442c55ec04b54b8ee9000d2ac9dca8d) +++ Accel.c (.../Accel.c) (revision 5010eb0fe6fb79f67dfa73ae40331d61cd80f17b) @@ -572,16 +572,14 @@ accelCalOffsets[ ACCEL_AXIS_Y ] = cal.accelYOffset; accelCalOffsets[ ACCEL_AXIS_Z ] = cal.accelZOffset; accelSelfTestState = ACCELEROMETER_SELF_TEST_STATE_IN_PROGRESS; - //else TODO what to do with this statement? - { // shouldn't get here - should have failed NV-Data POST prior - result = SELF_TEST_STATUS_FAILED; - accelSelfTestState = ACCELEROMETER_SELF_TEST_STATE_COMPLETE; + + result = SELF_TEST_STATUS_FAILED; + accelSelfTestState = ACCELEROMETER_SELF_TEST_STATE_COMPLETE; #ifdef _DG_ - SET_ALARM_WITH_1_U32_DATA( ALARM_ID_DG_ACCELEROMETER_SELF_TEST_FAILURE, 0 ) + SET_ALARM_WITH_1_U32_DATA( ALARM_ID_DG_ACCELEROMETER_SELF_TEST_FAILURE, 0 ) #else - SET_ALARM_WITH_1_U32_DATA( ALARM_ID_HD_ACCELEROMETER_SELF_TEST_FAILURE, 0 ) + SET_ALARM_WITH_1_U32_DATA( ALARM_ID_HD_ACCELEROMETER_SELF_TEST_FAILURE, 0 ) #endif - } break; case ACCELEROMETER_SELF_TEST_STATE_IN_PROGRESS: Index: NVDataMgmt.c =================================================================== diff -u -r63224e051e2c46221bd5fa8505da344d4294b307 -r5010eb0fe6fb79f67dfa73ae40331d61cd80f17b --- NVDataMgmt.c (.../NVDataMgmt.c) (revision 63224e051e2c46221bd5fa8505da344d4294b307) +++ NVDataMgmt.c (.../NVDataMgmt.c) (revision 5010eb0fe6fb79f67dfa73ae40331d61cd80f17b) @@ -233,10 +233,10 @@ /// Log header structure. typedef struct { - U16 recordCount; ///< Record count - U16 nextWriteIndex; ///< Next write index - U16 nextReadIndex; ///< Next read index - BOOL isHdrCorrupted; ///< Log header corruption flag + U16 recordCount; ///< Record count. + U16 nextWriteIndex; ///< Next write index. + U16 nextReadIndex; ///< Next read index. + BOOL isHdrCorrupted; ///< Log header corruption flag. } LOG_HEADER_T; /// Log record structure. @@ -725,7 +725,7 @@ { // Check if the data receiving process has timed out. The exec receive record // state machine is asynchronous so it is checked in this state machine - if ( didTimeout( recordReceiveStartTime, RECORD_DATA_RECEIVE_TIMEOUT_MS ) ) + if ( TRUE == didTimeout( recordReceiveStartTime, RECORD_DATA_RECEIVE_TIMEOUT_MS ) ) { // Exec receive state machine timed out. Schedule a read to update the structure enqueueRecordJob( NVDATAMGMT_READ, NVDATAMGMT_EEPROM, NVDATAMGMT_CALIBRATION_RECORD ); @@ -788,7 +788,7 @@ } // Check if there is still a message left to be received - if ( nvDataMgmtExecReceiveRecordState == NVDATAMGMT_RECEIVE_RECORD_RECEIVE && currentMessage <= totalMessages ) + if ( ( nvDataMgmtExecReceiveRecordState == NVDATAMGMT_RECEIVE_RECORD_RECEIVE ) && ( currentMessage <= totalMessages ) ) { // Check if the current message is different from the previous message by 1 if ( RECORD_DATA_MAX_MESSAGE_DFFIRENCE == ( currentMessage - previousCalMessageNum ) ) @@ -1881,7 +1881,7 @@ // If the RAM is in Idle, read the log records if ( getRTCRAMStatus() == RTC_RAM_STATUS_IDLE || timeoutStatus == TRUE ) { - // TODO enable the logs + // TODO enable the logs once we get back to logging //U32 len = sizeof(MFG_RECORD_T) / sizeof(U32); //U32 *addr = (U32*)&mfgRecord; @@ -3878,8 +3878,7 @@ /*********************************************************************//** * @brief - * The dequeue increments the front index counter and if it is equal to - * rear index, it sets it to -1, meaning that the queue is empty. + * The enqueueRecordJob function enqueues a new record job. * @details Inputs: queueFrontIndex, queueCount, recordJobQueue * @details Outputs: queueFrontIndex, queueCount, recordJobQueue * @param ops: memory operation (i.e write, read) Index: NVDataMgmtDGRecords.h =================================================================== diff -u -r5d12a10f75c6655992acb911af4bf339b2eb955b -r5010eb0fe6fb79f67dfa73ae40331d61cd80f17b --- NVDataMgmtDGRecords.h (.../NVDataMgmtDGRecords.h) (revision 5d12a10f75c6655992acb911af4bf339b2eb955b) +++ NVDataMgmtDGRecords.h (.../NVDataMgmtDGRecords.h) (revision 5010eb0fe6fb79f67dfa73ae40331d61cd80f17b) @@ -5,11 +5,11 @@ #include "Common.h" /** - * @defgroup NVDataMgmtDGRecords NVDataMgmtDGRecords + * @defgroup NVDataMgmt NVDataMgmt * @brief Non-volatile DG data records including calibration records, system records, * service records, and the scheduled runs record. * - * @addtogroup NVDataMgmtDGRecords + * @addtogroup NVDataMgmt * @{ */ Index: NVDataMgmtHDRecords.h =================================================================== diff -u -r5d12a10f75c6655992acb911af4bf339b2eb955b -r5010eb0fe6fb79f67dfa73ae40331d61cd80f17b --- NVDataMgmtHDRecords.h (.../NVDataMgmtHDRecords.h) (revision 5d12a10f75c6655992acb911af4bf339b2eb955b) +++ NVDataMgmtHDRecords.h (.../NVDataMgmtHDRecords.h) (revision 5010eb0fe6fb79f67dfa73ae40331d61cd80f17b) @@ -6,11 +6,11 @@ #include "Common.h" /** - * @defgroup NVDataMgmtHDRecords NVDataMgmtHDRecords + * @defgroup NVDataMgmt NVDataMgmt * @brief Non-volatile HD data records including calibration records, system records, * service records, and the scheduled runs record. * - * @addtogroup NVDataMgmtHDRecords + * @addtogroup NVDataMgmt * @{ */ Index: RTC.c =================================================================== diff -u -r0ee608e8de70aef91f5bdf7ebfa1f1cccf2e43dd -r5010eb0fe6fb79f67dfa73ae40331d61cd80f17b --- RTC.c (.../RTC.c) (revision 0ee608e8de70aef91f5bdf7ebfa1f1cccf2e43dd) +++ RTC.c (.../RTC.c) (revision 5010eb0fe6fb79f67dfa73ae40331d61cd80f17b) @@ -310,32 +310,26 @@ switch ( RTCSelfTestState ) { case RTC_SELF_TEST_STATE_START: - RTCSelfTestState = handleSelfTestStart(); break; case RTC_SELF_TEST_STATE_CHECK_CTRL_REGS: - RTCSelfTestState = handleSelfTestCheckCtrlRegs(); break; case RTC_SELF_TEST_STATE_WAIT_FOR_FIRST_SECOND: - RTCSelfTestState = handleSelfTestWaitForFirstSecond(); break; case RTC_SELF_TEST_STATE_WAIT_FOR_SECOND_SECOND: - RTCSelfTestState = handleSelfTestWaitForSecondSecond(); break; case RTC_SELF_TEST_STATE_CHECK_ACCURACY: - RTCSelfTestState = handleSelfTestCheckAccuracy(); break; case RTC_SELF_TEST_STATE_COMPLETE: - // Done with POST regardless of the results break; @@ -366,37 +360,30 @@ switch ( RTCExecState ) { case RTC_EXEC_STATE_WAIT_FOR_POST: - RTCExecState = handleExecWaitForPostState(); break; case RTC_EXEC_STATE_IDLE: - RTCExecState = handleExecIdleState(); break; case RTC_EXEC_STATE_PREP_RAM: - RTCExecState = handleExecPrepRAMState(); break; case RTC_EXEC_STATE_WRITE_TO_RAM: - RTCExecState = handleExecWriteToRAMState(); break; case RTC_EXEC_STATE_READ_FROM_RAM: - RTCExecState = handleExecReadFromRAMState(); break; case RTC_EXEC_STATE_WRITE: - RTCExecState = handleExecWriteState(); break; case RTC_EXEC_STATE_READ: - RTCExecState = handleExecReadState(); break; @@ -954,7 +941,7 @@ { RTC_EXEC_STATE_T result = RTC_EXEC_STATE_WAIT_FOR_POST; - //if ( RTCSelfTestState == RTC_SELF_TEST_STATE_COMPLETE ) + if ( RTCSelfTestState == RTC_SELF_TEST_STATE_COMPLETE ) { result = RTC_EXEC_STATE_IDLE; }