Index: firmware/App/Modes/ModeInitPOST.c =================================================================== diff -u -rf760ffc4b10556e5186e9ceb90294262063440ca -r77392c1537f02650413087b86b946370a6289dcd --- firmware/App/Modes/ModeInitPOST.c (.../ModeInitPOST.c) (revision f760ffc4b10556e5186e9ceb90294262063440ca) +++ firmware/App/Modes/ModeInitPOST.c (.../ModeInitPOST.c) (revision 77392c1537f02650413087b86b946370a6289dcd) @@ -7,8 +7,8 @@ * * @file ModeInitPOST.c * -* @author (last) Sean Nash -* @date (last) 02-Feb-2023 +* @author (last) Michael Garthwaite +* @date (last) 01-Mar-2023 * * @author (original) Dara Navaei * @date (original) 05-Nov-2019 @@ -17,6 +17,7 @@ #include "reg_crc.h" // Used to hold reset reason code at startup before bits get cleared #include "reg_system.h" // Used to access exception status registers for reset reason code at startup +#include "system.h" #include "Accel.h" #include "AlarmLamp.h" @@ -37,7 +38,7 @@ #include "RTC.h" #include "SafetyShutdown.h" #include "SyringePump.h" -#include "system.h" +#include "SystemComm.h" #include "SystemCommMessages.h" #include "TaskGeneral.h" #include "Temperatures.h" @@ -309,12 +310,16 @@ break; case POST_STATE_COMPLETED: - // Set overall HD POST status to "passed" - postPassed = TRUE; + // Set overall HD POST completed status to TRUE postCompleted = TRUE; - // Broadcast final POST passed - sendPOSTFinalResult( TRUE ); + // Broadcast final POST passed once. We stay in this state for POST_COMPLETED_DELAY. + if ( FALSE == postPassed ) + { + sendPOSTFinalResult( TRUE ); + } + // Set overall HD POST status to "passed" + postPassed = TRUE; // Delay before going to standby mode if ( ++postCompleteDelayTimerCtr > POST_COMPLETED_DELAY ) { @@ -504,7 +509,10 @@ sendUIVersionRequest(); // request UI to send us its version - needed for compatibility check - sendRequestForDGResendAlarms(); // request DG to re-send any active alarms that may have been triggered before we came up + if ( TRUE == isDGCommunicating() ) + { + sendRequestForDGResendAlarms(); // request DG to re-send any active alarms that may have been triggered before we came up + } // Send the startup event SEND_EVENT_WITH_2_U32_DATA( HD_EVENT_STARTUP, systemREG1->DEV, 0x12345678 ) // log startup event w/ device ID bits