Index: firmware/App/Modes/ModeInitPOST.c =================================================================== diff -u -r0ca939ac0e3ad7d432152a89135075bfd67246df -rfdbb919248858aeffe5d23c2b6c57181e821f929 --- firmware/App/Modes/ModeInitPOST.c (.../ModeInitPOST.c) (revision 0ca939ac0e3ad7d432152a89135075bfd67246df) +++ firmware/App/Modes/ModeInitPOST.c (.../ModeInitPOST.c) (revision fdbb919248858aeffe5d23c2b6c57181e821f929) @@ -42,7 +42,6 @@ #include "SystemCommMessages.h" #include "TaskGeneral.h" #include "Temperatures.h" -#include "Timers.h" #include "Valves.h" #include "WatchdogMgmt.h" @@ -80,7 +79,7 @@ static UI_VERSIONS_T uiVersion = { 0, 0, 0, 0, 0 }; ///< Version and compatibility information reported by UI. static DG_VERSIONS_T dgVersion = { 0, 0, 0, 0, 0, 0, 0, 0, 0 }; ///< Version and compatibility information reported by DG. static U32 startPOSTDelayCounter = 0; ///< Start POST delay counter. -static U32 SNAndInstConfigSendStartTimeMS; ///< serial number and institutional configuration send start time milliseconds. +static BOOL hasSNAndInstBeenSent; ///< Boolean flag to check whether serial number and institutional record been sent. extern U32 savedResetReasonCode; ///< Saved reset reason code from sys_startup.c. @@ -102,18 +101,18 @@ *************************************************************************/ void initInitAndPOSTMode( void ) { - postState = POST_STATE_START; - postCompleted = FALSE; - postPassed = FALSE; - tempPOSTPassed = TRUE; - uiPOSTPassed = FALSE; - dgPOSTPassed = FALSE; - uiPOSTResultReceived = FALSE; - dgPOSTResultReceived = FALSE; - waitForUIPostTimerCtr = 0; - postCompleteDelayTimerCtr = 0; - startPOSTDelayCounter = 0; - SNAndInstConfigSendStartTimeMS = getMSTimerCount(); + postState = POST_STATE_START; + postCompleted = FALSE; + postPassed = FALSE; + tempPOSTPassed = TRUE; + uiPOSTPassed = FALSE; + dgPOSTPassed = FALSE; + uiPOSTResultReceived = FALSE; + dgPOSTResultReceived = FALSE; + waitForUIPostTimerCtr = 0; + postCompleteDelayTimerCtr = 0; + startPOSTDelayCounter = 0; + hasSNAndInstBeenSent = FALSE; } /*********************************************************************//** @@ -628,7 +627,7 @@ *************************************************************************/ static void sendSerialNumberAndInstitutionalToUI( void ) { - if ( ( TRUE == didTimeout( SNAndInstConfigSendStartTimeMS, SN_INST_SEND_TO_UI_TIME_INTERVAL_MS ) ) && ( postState > POST_STATE_NVDATAMGMT ) ) + if ( ( FALSE == hasSNAndInstBeenSent ) && ( postState > POST_STATE_NVDATAMGMT ) ) { MESSAGE_T message; @@ -639,7 +638,7 @@ handleHDSerialNumberRequest(); handleSendInstitutionalRecordToUI( &message ); - SNAndInstConfigSendStartTimeMS = getMSTimerCount(); + hasSNAndInstBeenSent = TRUE; } } Index: firmware/App/Services/SystemCommMessages.c =================================================================== diff -u -r0ca939ac0e3ad7d432152a89135075bfd67246df -rfdbb919248858aeffe5d23c2b6c57181e821f929 --- firmware/App/Services/SystemCommMessages.c (.../SystemCommMessages.c) (revision 0ca939ac0e3ad7d432152a89135075bfd67246df) +++ firmware/App/Services/SystemCommMessages.c (.../SystemCommMessages.c) (revision fdbb919248858aeffe5d23c2b6c57181e821f929) @@ -94,6 +94,11 @@ U32 enableChemicalDisinfect; ///< Enable/disable chemical disinfect. } HD_INSTITUTIONAL_LOCAL_RECORD_T; +typedef struct +{ + U08 topLevelSN[ MAX_TOP_LEVEL_SN_CHARS ]; +} LOCAL_TOP_SN_T; + // ********** private data ********** #ifndef CARTRIDGE_TEST_BUILD @@ -3335,10 +3340,6 @@ *************************************************************************/ void handleHDSerialNumberRequest( void ) { - typedef struct - { - U08 topLevelSN[ MAX_TOP_LEVEL_SN_CHARS ]; - } LOCAL_TOP_SN_T; MESSAGE_T msg; HD_SYSTEM_RECORD_T system; U08 i; @@ -3354,28 +3355,23 @@ blankMessage( &msg ); msg.hdr.msgID = MSG_ID_HD_SERIAL_NUMBER_RESPONSE; - // Check if the first element of the serial number is not 0 meaning that we are not sending empty serial number - // to the UI - if ( system.topLevelSN[0] != 0 ) + // Add 1 byte for null terminator + msg.hdr.payloadLen = MAX_TOP_LEVEL_SN_CHARS + 1; + + for ( i = 0; i < MAX_TOP_LEVEL_SN_CHARS; i++ ) { - // Add 1 byte for null terminator - msg.hdr.payloadLen = MAX_TOP_LEVEL_SN_CHARS + 1; + // NOTE: A local variable was created to avoid system.topLevelSN in the messages list + // NOTE: For loop was used instead of memory copy to ensure it is not parsed in the messages list script + localTopLevelSN.topLevelSN[ i ] = system.topLevelSN[ i ]; + } - for ( i = 0; i < MAX_TOP_LEVEL_SN_CHARS; i++ ) - { - // NOTE: A local variable was created to avoid system.topLevelSN in the messages list - // NOTE: For loop was used instead of memory copy to ensure it is not parsed in the messages list script - localTopLevelSN.topLevelSN[ i ] = system.topLevelSN[ i ]; - } + // Fill message payload + memcpy( payloadPtr, &localTopLevelSN, sizeof( LOCAL_TOP_SN_T ) ); + payloadPtr += MAX_TOP_LEVEL_SN_CHARS; + *payloadPtr = 0; - // Fill message payload - memcpy( payloadPtr, &localTopLevelSN, sizeof( LOCAL_TOP_SN_T ) ); - payloadPtr += MAX_TOP_LEVEL_SN_CHARS; - *payloadPtr = 0; - - // Serialize the message (w/ sync, CRC, and appropriate CAN padding) and add serialized message data to appropriate comm buffer - serializeMessage( msg, COMM_BUFFER_OUT_CAN_HD_2_UI, ACK_REQUIRED ); - } + // Serialize the message (w/ sync, CRC, and appropriate CAN padding) and add serialized message data to appropriate comm buffer + serializeMessage( msg, COMM_BUFFER_OUT_CAN_HD_2_UI, ACK_REQUIRED ); } /*********************************************************************//** @@ -3713,7 +3709,7 @@ memcpy( payloadPtr, instit, sizeof( HD_INSTITUTIONAL_LOCAL_RECORD_T ) ); // Serialize the message (w/ sync, CRC, and appropriate CAN padding) and add serialized message data to appropriate comm buffer - serializeMessage( msg, COMM_BUFFER_OUT_CAN_HD_2_UI, ACK_NOT_REQUIRED ); + serializeMessage( msg, COMM_BUFFER_OUT_CAN_HD_2_UI, ACK_REQUIRED ); } /*********************************************************************//**