Index: firmware/App/Services/NVMsgQ.c =================================================================== diff -u -r45b03b9f23005c05fc75f69416595a155e250cbe -r43e60a63eae841e599ff9106f43177a8f63d22be --- firmware/App/Services/NVMsgQ.c (.../NVMsgQ.c) (revision 45b03b9f23005c05fc75f69416595a155e250cbe) +++ firmware/App/Services/NVMsgQ.c (.../NVMsgQ.c) (revision 43e60a63eae841e599ff9106f43177a8f63d22be) @@ -14,14 +14,20 @@ #include // For memcpy #include // For ceilf function - #include "Common.h" #include "NVMsgQ.h" #include "NVRecordsDD.h" #include "TaskGeneral.h" #include "Timers.h" #include "Utilities.h" // For crc calculation +/** + * @addtogroup NVMsgQ + * @{ + */ + +// ********** private definitions ********** + #define QUEUE_MAX_SIZE 20U ///< Max queue size. #define QUEUE_START_INDEX 0U ///< Queue start index. #define MAX_JOB_DATA_SIZE_BYTES 32U ///< Max bytes per job (32 bytes). @@ -33,14 +39,6 @@ // Once a new calibration data is available the driver, sets a signal for the defined time. Once the time is out, it turns the signal off. #define NEW_CAL_AVAILABLE_SIGNAL_TIMEOUT_MS (1 * MS_PER_SECOND) ///< New calibration available signal timeout in milliseconds. -/// Memory operations structure. -typedef struct -{ - NVDATAMGMT_OPERATION_STATE_T memoryOperation; ///< Memory operation. - U32 startAddress; ///< Operation start address. - U08 buffer[ MAX_JOB_DATA_SIZE_BYTES ]; ///< Buffer. - U32 length; ///< Length of a buffer. -} MEMORY_OPS_T; /// NVDataMgmt process records states typedef enum NVDataMgmt_Process_Records_States @@ -50,6 +48,15 @@ NUM_OF_NVDATAMGMT_PROCESS_RECORD_STATES ///< Number of NVDataMgmt process records state. } PROCESS_RECORD_STATE_T; +/// Memory operations structure. +typedef struct +{ + NVDATAMGMT_OPERATION_STATE_T memoryOperation; ///< Memory operation. + U32 startAddress; ///< Operation start address. + U08 buffer[ MAX_JOB_DATA_SIZE_BYTES ]; ///< Buffer. + U32 length; ///< Length of a buffer. +} MEMORY_OPS_T; + /// NVDataMgmt receive records states typedef enum NVDataMgmt_Receive_Records_States { @@ -58,6 +65,8 @@ NUM_OF_NVDATAMGMT_RECEIVE_RECORD_STATES ///< Number of NVDataMgmt receive record. } RECEIVE_RECORD_STATE_T; +// ********** private data ********** + static PROCESS_RECORD_JOB_T recordJobQueue[ QUEUE_MAX_SIZE ]; ///< Record queue jobs. static U08 recordQueueRearIndex; ///< Record queue rear index. static U08 recordQueueFrontIndex; ///< Record queue front index. @@ -79,10 +88,11 @@ static U32 recordReceiveStartTime; ///< Time stamp the calibration/service was received. static U32 newCalStartTimer; ///< New calibration availability start timer. +// ********** private function prototypes ********** + // Process record functions static PROCESS_RECORD_STATE_T handleExecProcessRecordIdleState( void ); static PROCESS_RECORD_STATE_T handleExecProcessRecordSendRecordState( void ); - static void monitorNewCalSignal( void ); void initNVMsgQ ( void ) @@ -594,3 +604,5 @@ { return recordCurrentJob; } + +/**@}*/