Index: NVDataMgmt.c =================================================================== diff -u -r7ff7e715f7a15da5f4055b33e186d58cf96fe909 -rb28e0e05a9632cc46fc12378f2993a69d861a4cb --- NVDataMgmt.c (.../NVDataMgmt.c) (revision 7ff7e715f7a15da5f4055b33e186d58cf96fe909) +++ NVDataMgmt.c (.../NVDataMgmt.c) (revision b28e0e05a9632cc46fc12378f2993a69d861a4cb) @@ -270,10 +270,9 @@ /*********************************************************************//** * @brief * The initNVDataMgmt function initializes the module. - * @details - * Inputs: NVDataMgmtSelfTestState, NVDataMgmtExecState, NVDataMgmtSelfTestResult, + * @details Inputs: NVDataMgmtSelfTestState, NVDataMgmtExecState, NVDataMgmtSelfTestResult, * queueRearIndex, queueFrontIndex, queueCount - * Outputs: NVDataMgmtSelfTestState, NVDataMgmtExecState, NVDataMgmtSelfTestResult, + * @details Outputs: NVDataMgmtSelfTestState, NVDataMgmtExecState, NVDataMgmtSelfTestResult, * queueRearIndex, queueFrontIndex, queueCount * @return none *************************************************************************/ @@ -294,9 +293,8 @@ * The signalPowerOffWarning signals this module that system power off is * imminent and any non-volatile data writes in progress should be wrapped up * quickly and any pending non-volatile data writes should not be started. - * @details - * Inputs: none - * Outputs: powerOffIsImminent + * @details Inputs: none + * @details Outputs: powerOffIsImminent * @return none *************************************************************************/ void signalPowerOffWarning( void ) @@ -310,9 +308,8 @@ * calls another function to calculate the CRC for the provided data and * calls another function to erase sector 0 and write the new manufacturing * data. - * @details - * Inputs: mfgRecord - * Outputs: mfgRecord + * @details Inputs: mfgRecord + * @details Outputs: mfgRecord * @return TRUE is the enqueue was successfully scheduled *************************************************************************/ BOOL setMfgData ( MFG_DATA_T data ) @@ -327,9 +324,8 @@ * @brief * The getMfgData returns the data in the structure that holds manufacturing * record to buffer that the caller has provided. - * @details - * Inputs: mfgRecord - * Outputs: none + * @details Inputs: mfgRecord + * @details Outputs: none * @param buffer address of manufacturing data buffer * @return TRUE if the buffer pointer was not null and the copy was successful *************************************************************************/ @@ -352,9 +348,8 @@ * calls another function to calculate the CRC for the provided data and * calls another function to erase sector 0 and write the new manufacturing * data. - * @details - * Inputs: calibrationRecord - * Outputs: calibrationRecord + * @details Inputs: calibrationRecord + * @details Outputs: calibrationRecord * @param data calibration data structure * @return TRUE if updating was successfully scheduled *************************************************************************/ @@ -374,9 +369,8 @@ * @brief * The getCalibrationData returns the data in the structure that hold * calibration record to buffer that the caller has provided. - * @details - * Inputs: calibrationRecord - * Outputs: none + * @details Inputs: calibrationRecord + * @details Outputs: none * @param buffer address of calibration data buffer * @return TRUE if calibration record valid *************************************************************************/ @@ -398,9 +392,8 @@ * The setServiceDate updates the structure that holds the calibration data, * calls another function to calculate the CRC for the provided data if * there is enough queues available, it schedules a write to RTC RAM. - * @details - * Inputs: serviceRecord - * Outputs: serviceRecord + * @details Inputs: serviceRecord + * @details Outputs: serviceRecord * @param data service data buffer * @return TRUE if the queue had enough space to schedule the job *************************************************************************/ @@ -424,9 +417,8 @@ * @brief * The getServiceDate returns the data in the structure that holds service * date to buffer that the caller has provided. - * @details - * Inputs: serviceRecord - * Outputs: none + * @details Inputs: serviceRecord + * @details Outputs: none * @param buffer address of service data buffer * @return TRUE if the buffer address was not null *************************************************************************/ @@ -447,9 +439,8 @@ * @brief * The writeLogData checks if the queue is not full and if it is not, it calls * enqueue to schedule a job for writing the log data. - * @details - * Inputs: logRecord - * Outputs: none + * @details Inputs: logRecord + * @details Outputs: none * @param data address of log data buffer * @return TRUE if the queue is not full and if the log header is not corrupted *************************************************************************/ @@ -471,9 +462,8 @@ * @brief * The readLogData checks if the queue is not full and if it is not, it calls * enqueue to schedule a job for writing the log data. - * @details - * Inputs: none - * Outputs: none + * @details Inputs: none + * @details Outputs: none * @param buffer address of read data buffer * @param length length of the data log * @return TRUE if there are enough queues available for the job @@ -496,9 +486,8 @@ * @brief * The setTreatmentTime sets a queue job to write the treatment time in * the specified RAM address. - * @details - * Inputs: treatmentTimeRecord - * Outputs: treatmentTimeRecord + * @details Inputs: treatmentTimeRecord + * @details Outputs: treatmentTimeRecord * @param hours treatmet time in hours * @return TRUE if the queue was not full so the job was scheduled successfully *************************************************************************/ @@ -522,8 +511,7 @@ * @brief * The getTreatmentTime returns the total number treatment hours of the * HD device. - * @details - * Inputs: none + * @details Inputs: none * Output: none * @return treatment time as U32 *************************************************************************/ @@ -536,9 +524,8 @@ * @brief * The setWaterConsumption sets a queue job to write the amount of water * that has been consumed in DG. - * @details - * Inputs: waterConsumptionRecord - * Outputs: waterConsumptionRecord + * @details Inputs: waterConsumptionRecord + * @details Outputs: waterConsumptionRecord * @param liters consumed water is liters * @return TRUE if queue is not full *************************************************************************/ @@ -561,9 +548,8 @@ /*********************************************************************//** * @brief * The getWaterConsumption returns the amount of consumed water. - * @details - * Inputs: none - * Outputs: none + * @details Inputs: none + * @details Outputs: none * @return water consumption as a U32 *************************************************************************/ U32 getWaterConsumption ( void ) @@ -576,9 +562,8 @@ * The setDisinfectionDate gets the last disinfection date, calculates the * CRC for it and if the queue is not full, it schedules a write to RTC RAM * to store the last date. - * @details - * Inputs: lastDisinfectionRecord - * Outputs: lastDisinfectionRecord + * @details Inputs: lastDisinfectionRecord + * @details Outputs: lastDisinfectionRecord * @param date disinfection date buffer * @return TRUE if the queue was not full *************************************************************************/ @@ -602,9 +587,8 @@ * @brief * The getDisinfectionDate populates the provided buffer with the last * disinfection date. - * @details - * Inputs: lastDisinfectionRecord - * Outputs: none + * @details Inputs: lastDisinfectionRecord + * @details Outputs: none * @param buffer address of disinfection date buffer * @return TRUE if the buffer address was not null *************************************************************************/ @@ -624,9 +608,8 @@ /*********************************************************************//** * @brief * The execNVDataMgmtSelfTest runs the NVDataMgmt POST during the self-test. - * @details - * Inputs: NVDataMgmtSelfTestState - * Outputs: NVDataMgmtSelfTestState, alarm if there was a software fault + * @details Inputs: NVDataMgmtSelfTestState + * @details Outputs: NVDataMgmtSelfTestState, alarm if there was a software fault * @return NVDataMgmtSelfTestResult the result of self-test *************************************************************************/ SELF_TEST_STATUS_T execNVDataMgmtSelfTest ( void ) @@ -712,9 +695,8 @@ /*********************************************************************//** * @brief * The setBootloaderFlag sets the bootloader flag to RTC RAM. - * @details - * Inputs: none - * Outputs: none + * @details Inputs: none + * @details Outputs: none * @param flag the bootloader flag * @return TRUE if the queue was not full *************************************************************************/ @@ -735,9 +717,8 @@ /*********************************************************************//** * @brief * The getBootloaderFlag gets the bootloader flag from RTC RAM. - * @details - * Inputs: none - * Outputs: none + * @details Inputs: none + * @details Outputs: none * @return bootloader flag as a U32 *************************************************************************/ U32 getBootloaderFlag( void ) @@ -748,9 +729,8 @@ /*********************************************************************//** * @brief * The execNVDataMgmt runs the NVDataMgmt main tasks. - * @details - * Inputs: NVDataMgmtExecState - * Outputs: NVDataMgmtExecState, alarm if exec state was invalid + * @details Inputs: NVDataMgmtExecState + * @details Outputs: NVDataMgmtExecState, alarm if exec state was invalid * @return none *************************************************************************/ void execNVDataMgmt( void ) @@ -810,9 +790,8 @@ /*********************************************************************//** * @brief * The handleSelfTestStart enables the EEPROM bank sectors. - * @details - * Inputs: currentTime - * Outputs: currentTime + * @details Inputs: currentTime + * @details Outputs: currentTime * @return next state *************************************************************************/ static NVDATAMGMT_SELF_TEST_STATE_T handleSelfTestStart ( void ) @@ -831,9 +810,8 @@ * @brief * The handleSelfTestEnableEEPROM waits for EEPROM to return with ready from * enabling the EEPROM command. - * @details - * Inputs: currentTime - * Outputs: currentTime + * @details Inputs: currentTime + * @details Outputs: currentTime * @return next state *************************************************************************/ static NVDATAMGMT_SELF_TEST_STATE_T handleSelfTestEnableEEPROM ( void ) @@ -860,9 +838,8 @@ * @brief * The handleSelfTestReadBootloaderFlag reads the bootloader flag * from RTC RAM. - * @details - * Inputs: currentTime, bootloaderFlag - * Outputs: currentTime + * @details Inputs: currentTime, bootloaderFlag + * @details Outputs: currentTime * @return next state *************************************************************************/ static NVDATAMGMT_SELF_TEST_STATE_T handleSelfTestReadBootloaderFlag ( void ) @@ -900,9 +877,8 @@ * @brief * The handleSelfTestReadHDTreatmentTime reads the HD treatment time * from RTC RAM. - * @details - * Inputs: currentTime, treatmentTimeRecord - * Outputs: currentTime + * @details Inputs: currentTime, treatmentTimeRecord + * @details Outputs: currentTime * @return next state *************************************************************************/ static NVDATAMGMT_SELF_TEST_STATE_T handleSelfTestReadHDTreatmentTime ( void ) @@ -930,9 +906,8 @@ * @brief * The handleSelfTestReadDGWaterConsumption reads the DG water consumption * from RTC RAM. - * @details - * Inputs: currentTime, waterConsumptionRecord - * Outputs: currentTime + * @details Inputs: currentTime, waterConsumptionRecord + * @details Outputs: currentTime * @return next state *************************************************************************/ static NVDATAMGMT_SELF_TEST_STATE_T handleSelfTestReadDGWaterConsumption ( void ) @@ -958,9 +933,8 @@ /*********************************************************************//** * @brief * The handleSelfTestReadLogRecord reads the log record from RTC RAM. - * @details - * Inputs: currentTime, logRecord, mfgRecord - * Outputs: currentTime + * @details Inputs: currentTime, logRecord, mfgRecord + * @details Outputs: currentTime * @return next state *************************************************************************/ static NVDATAMGMT_SELF_TEST_STATE_T handleSelfTestReadLogRecord ( void ) @@ -989,9 +963,8 @@ * @brief * The handleSelfTestReadMfgRecords reads the manufacturing record from * EEPROM. - * @details - * Inputs: currentTime, calibrationRecord - * Outputs: currentTime + * @details Inputs: currentTime, calibrationRecord + * @details Outputs: currentTime * @return next state *************************************************************************/ static NVDATAMGMT_SELF_TEST_STATE_T handleSelfTestReadMfgRecord ( void ) @@ -1016,9 +989,8 @@ * @brief * The handleSelfTestReadCalibrationRecord reads the calibration record * from EEPROM. - * @details - * Inputs: currentTime - * Outputs: currentTime + * @details Inputs: currentTime + * @details Outputs: currentTime * @return next state *************************************************************************/ static NVDATAMGMT_SELF_TEST_STATE_T handleSelfTestReadCalibrationRecord ( void ) @@ -1045,9 +1017,8 @@ * @brief * The handleSelfTestReadServiceRecord reads the service dates from RTC * RAM. - * @details - * Inputs: currentTime, serviceRecord - * Outputs: currentTime + * @details Inputs: currentTime, serviceRecord + * @details Outputs: currentTime * @return next state *************************************************************************/ static NVDATAMGMT_SELF_TEST_STATE_T handleSelfTestReadServiceRecord ( void ) @@ -1073,9 +1044,8 @@ * @brief * The handleSelfTestReadLastDisinfectionDate reads the last disinfection date * from RTC RAM. - * @details - * Inputs: lastDisinfectionRecord - * Outputs: none + * @details Inputs: lastDisinfectionRecord + * @details Outputs: none * @return next state *************************************************************************/ static NVDATAMGMT_SELF_TEST_STATE_T handleSelfTestReadLastDisinfectionDate ( void ) @@ -1097,11 +1067,10 @@ * @brief * The handleSelfTestCheckCRC calculates the CRC of the records and compares * them to the CRC that was read. If they don't match, it will fail POST. - * @details - * Inputs: treatmentTimeRecord, waterConsumptionRecord, lastDisinfectionRecord, + * @details Inputs: treatmentTimeRecord, waterConsumptionRecord, lastDisinfectionRecord, * logRecord, mfgRecord, calibrationRecord, calibrationRecord, serviceRecord, * NVDataMgmtSelfTestResult - * Outputs: NVDataMgmtSelfTestResult, alarm if any of the CRC checks failed + * @details Outputs: NVDataMgmtSelfTestResult, alarm if any of the CRC checks failed * @return next state *************************************************************************/ static NVDATAMGMT_SELF_TEST_STATE_T handleSelfTestCheckCRC ( void ) @@ -1200,9 +1169,8 @@ /*********************************************************************//** * @brief * The handleExecWaitForPostState waits for POST to be completed. - * @details - * Inputs: NVDataMgmtSelfTestState - * Outputs: none + * @details Inputs: NVDataMgmtSelfTestState + * @details Outputs: none * @return next state *************************************************************************/ static NVDATAMGMT_EXEC_STATE_T handleExecWaitForPostState ( void ) @@ -1221,9 +1189,8 @@ * @brief * The handleExecIdleState checks if the queue is empty and if it is not * empty, it sets the state of the job. - * @details - * Inputs: currentJob, currentTime - * Outputs: currentJob + * @details Inputs: currentJob, currentTime + * @details Outputs: currentJob * @return next state *************************************************************************/ static NVDATAMGMT_EXEC_STATE_T handleExecIdleState ( void ) @@ -1289,9 +1256,8 @@ * @brief * The handleExecWriteToEEPROMState issues a write command to EEPROM on entry * and if the write was successful, it sets the state to Idle. - * @details - * Inputs: none - * Outputs: none + * @details Inputs: none + * @details Outputs: none * @return next state *************************************************************************/ static NVDATAMGMT_EXEC_STATE_T handleExecWriteToEEPROMState ( void ) @@ -1311,9 +1277,8 @@ * @brief handleExecReadFromEEPROMState * The handleExecReadFromEEPROMState issues a read command to EEPROM on entry * and if the read was successful, it sets the state to Idle. - * @details - * Inputs: currentJob - * Outputs: currentJob + * @details Inputs: currentJob + * @details Outputs: currentJob * @return next state *************************************************************************/ static NVDATAMGMT_EXEC_STATE_T handleExecReadFromEEPROMState ( void ) @@ -1334,9 +1299,8 @@ * @brief * The handleExecEraseState issues an erase command to EEPROM on entry * and if the erase was successful, it sets the state to Idle. - * @details - * Inputs: none - * Outputs: none + * @details Inputs: none + * @details Outputs: none * @return next state *************************************************************************/ static NVDATAMGMT_EXEC_STATE_T handleExecEraseState ( void ) @@ -1357,9 +1321,8 @@ * The handleExecWriteToRAMState issues a write command to RTC RAM if the * RAM was ready, and if the RAM got back to Idle after the write command, * it sets the state to Idle. - * @details - * Inputs: none - * Outputs: none + * @details Inputs: none + * @details Outputs: none * @return next state *************************************************************************/ static NVDATAMGMT_EXEC_STATE_T handleExecWriteToRAMState ( void ) @@ -1381,9 +1344,8 @@ * RAM was ready, and if the RAM got back to Idle after the read command, * it calls another function to read the data back from RTC RAM and * it sets the state to Idle. - * @details - * Inputs: currentJob - * Outputs: currentJob + * @details Inputs: currentJob + * @details Outputs: currentJob * @return next state *************************************************************************/ static NVDATAMGMT_EXEC_STATE_T handleExecReadFromRAMState ( void ) @@ -1409,9 +1371,8 @@ * read or write. The function then checks for the length of the buffer and if * it is greater than the specified max buffer, it breaks the operation into * multiple jobs. - * @details - * Inputs: jobQueue, queueCount, queueRearIndex - * Outputs: jobQueue, queueCount, queueRearIndex + * @details Inputs: jobQueue, queueCount, queueRearIndex + * @details Outputs: jobQueue, queueCount, queueRearIndex * @param ops type of operation (i.e. write to EEPROM) * @param location location of operation (i.e. RTC RAM) * @param startAddress start address of operation @@ -1453,9 +1414,8 @@ * is at edge of the any of the sectors and if yes, it will update the log * header accordingly. If the write is not at the edge, it will prepare a * normal write to EEPROM job. - * @details - * Inputs: logRecord - * Outputs: logRecord + * @details Inputs: logRecord + * @details Outputs: logRecord * @param data address of data buffer * @return address of the next write as a U32 *************************************************************************/ @@ -1506,9 +1466,8 @@ * @brief * The prepareReadLogJobAndGetStartAddress prepares a read from the specified * address of the EEPROM. - * @details - * Inputs: logRecord - * Outputs: logRecord + * @details Inputs: logRecord + * @details Outputs: logRecord * @return address of the next read as a U32 *************************************************************************/ static U32 prepareReadLogJobAndGetStartAddress ( void ) @@ -1550,9 +1509,8 @@ * is at the beginning of the next sector, it schedules and erase first and then * it schedules the write jobs. The function breaks the write to EEPROM jobs to * 16 bytes at the time. - * @details - * Inputs: none - * Outputs: none + * @details Inputs: none + * @details Outputs: none * @param ops type of operation (i.e. write to EEPROM) * @param location location of operation (i.e. RTC RAM) * @param startAddress start address of operation @@ -1623,9 +1581,8 @@ * @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. - * @details - * Inputs: queueFrontIndex, queueCount - * Outputs: queueFrontIndex, queueCount + * @details Inputs: queueFrontIndex, queueCount + * @details Outputs: queueFrontIndex, queueCount * @return none *************************************************************************/ static void dequeue ( void ) @@ -1650,9 +1607,8 @@ * @brief * The isQueueEmpty checks whether the queue is empty and if it is empty, * it will return a false. - * @details - * Inputs: queueCount - * Outputs: none + * @details Inputs: queueCount + * @details Outputs: none * @return TRUE if queue is not empty *************************************************************************/ static BOOL isQueueEmpty ( void ) @@ -1671,9 +1627,8 @@ * @brief * The isQueueFull checks whether the queue is full and if it is full, * it will return a true. - * @details - * Inputs: queueCount - * Outputs: none + * @details Inputs: queueCount + * @details Outputs: none * @return TRUE is queue is full *************************************************************************/ static BOOL isQueueFull ( void ) @@ -1691,9 +1646,8 @@ /*********************************************************************//** * @brief * The getAvailableQueueCount returns the number of available queues left. - * @details - * Inputs: queueCount - * Outputs: none + * @details Inputs: queueCount + * @details Outputs: none * @return available queue counts as a U32 *************************************************************************/ static U32 getAvailableQueueCount ( void ) @@ -1707,9 +1661,8 @@ * queues for erasing and setting the records. If there are enough queues, * it schedules an erase job and then schdules jobs to write all the records * back to Bank 7 Sector 0. - * @details - * Inputs: mfgRecord, calibrationRecord - * Outputs: none + * @details Inputs: mfgRecord, calibrationRecord + * @details Outputs: none * @return TRUE if there are enough queue jobs available *************************************************************************/ static BOOL enqueueBank7Sector0Records( void ) @@ -1734,9 +1687,8 @@ * The didCommandTimedout checks whether the a command whether RTC RAM or * EEPROM has timedout. If it has timedout, it sets the alarm and turns * flag to TRUE. - * @details - * Inputs: none - * Outputs: alarm if command timed out + * @details Inputs: none + * @details Outputs: alarm if command timed out * @param alarm alarm ID * @param state the state that the command timed out * @return TRUE if a command timed out @@ -1763,9 +1715,8 @@ * @brief * The eraseDataLogSectors checks whether there are enough queues available * and if there are, it schedules 3 erases to erase sectors 1,2, and 3. - * @details - * Inputs: none - * Outputs: non + * @details Inputs: none + * @details Outputs: non * @return TRUE if there are enough queues available *************************************************************************/ static BOOL eraseDataLogSectors ( void )