Index: firmware/App/Services/NVMgmtDD.c =================================================================== diff -u -r45b03b9f23005c05fc75f69416595a155e250cbe -r43e60a63eae841e599ff9106f43177a8f63d22be --- firmware/App/Services/NVMgmtDD.c (.../NVMgmtDD.c) (revision 45b03b9f23005c05fc75f69416595a155e250cbe) +++ firmware/App/Services/NVMgmtDD.c (.../NVMgmtDD.c) (revision 43e60a63eae841e599ff9106f43177a8f63d22be) @@ -11,6 +11,7 @@ * @date (original) 31-Mar-2026 * ***************************************************************************/ + #include // For memcpy #include "Common.h" #include "NVDriver.h" @@ -19,6 +20,17 @@ #include "NVRecordsDD.h" #include "Timers.h" +/** + * @addtogroup NVMgmtDD + * @{ + */ + +// ********** private definitions ********** + +#define COMMAND_TIME_OUT (1 * MS_PER_SECOND) ///< Timeout for an EEPROM or RTC command in ms. +/// EEPROM functions use the buffer length as the size of U32. So before send the length to any of FAPI functions, it should be divided by 4. +#define EEPROM_OPS_SIZE_OF_CONVERTER 4 + /// NVDataMgmt Exec states enumeration. typedef enum NVDataMgmt_Exec_State { @@ -39,9 +51,7 @@ NUM_OF_NVDATAMGMT_RECORD_VALIDITY_CHECK ///< Number of NVDataMgmt validity check states. } RECORD_VALIDITY_CHECK_T; -#define COMMAND_TIME_OUT (1 * MS_PER_SECOND) ///< Timeout for an EEPROM or RTC command in ms. -/// EEPROM functions use the buffer length as the size of U32. So before send the length to any of FAPI functions, it should be divided by 4. -#define EEPROM_OPS_SIZE_OF_CONVERTER 4 +// ********** private data ********** static NVDATAMGMT_EXEC_STATE_T nvDataMgmtExecState; ///< NVDataMgmt exec state variable. static volatile BOOL powerOffIsImminent; ///< Power off warning has been signaled. Non-volatile memory operations should be completed ASAP and then ceased. @@ -50,6 +60,8 @@ static U32 currentTime; ///< Current time. static U32 recordAddressOffset; ///< Record address offset. +// ********** private function prototypes ********** + // Exec functions static NVDATAMGMT_EXEC_STATE_T handleExecIdleState( void ); static NVDATAMGMT_EXEC_STATE_T handleExecEraseState( void ); @@ -71,6 +83,7 @@ initNVDriver(); initNVMsgQ(); + initNVRecordsDD(); enqueuePOSTReadRecords(); } @@ -193,6 +206,16 @@ } + // Update Self Test Read Records Flag + if ( ( TRUE == isRecordQueueEmpty() ) && ( state == NVDATAMGMT_EXEC_STATE_IDLE ) ) + { + updateSelfTestReadRecordsFlag( TRUE ); + } + else + { + updateSelfTestReadRecordsFlag( FALSE ); + } + return state; } @@ -375,11 +398,6 @@ updateNVSelfTestState( NVDATAMGMT_SELF_TEST_STATE_READ_RECORDS ); } -BOOL isNVExecStateIdle ( void ) -{ - return ( NVDATAMGMT_EXEC_STATE_IDLE == nvDataMgmtExecState ); -} - /*********************************************************************//** * @brief * The didCommandTimedout checks whether the a command whether RTC RAM or @@ -403,6 +421,4 @@ return status; } - - - +/**@}*/