Index: firmware/App/Modes/ModeInitPOST.c =================================================================== diff -u -rf013ac5e5de456c4fa4367884cda6515f2a51642 -r7499a42cc0f906f9a4a947c82c5b4615217ce7e5 --- firmware/App/Modes/ModeInitPOST.c (.../ModeInitPOST.c) (revision f013ac5e5de456c4fa4367884cda6515f2a51642) +++ firmware/App/Modes/ModeInitPOST.c (.../ModeInitPOST.c) (revision 7499a42cc0f906f9a4a947c82c5b4615217ce7e5) @@ -8,7 +8,7 @@ * @file ModeInitPOST.c * * @author (last) Dara Navaei -* @date (last) 04-Jan-2022 +* @date (last) 13-Jul-2022 * * @author (original) Dara Navaei * @date (original) 05-Nov-2019 @@ -37,6 +37,7 @@ #include "RTC.h" #include "SafetyShutdown.h" #include "SyringePump.h" +#include "system.h" #include "SystemCommMessages.h" #include "TaskGeneral.h" #include "Temperatures.h" @@ -155,14 +156,6 @@ postState = handlePOSTStatus( testStatus ); break; - case POST_STATE_AC: - if ( getMonitoredLineLevel( MONITORED_LINE_24V ) < MIN_24V_MEASURED_FOR_AC ) - { - initiatePowerOff(); - } - postState = POST_STATE_WATCHDOG; - break; - case POST_STATE_WATCHDOG: testStatus = execWatchdogTest(); postState = handlePOSTStatus( testStatus ); @@ -223,11 +216,18 @@ break; case POST_STATE_ALARM_AUDIO: -#ifndef DISABLE_ALARM_AUDIO - testStatus = execAlarmAudioSelfTest(); -#else - testStatus = SELF_TEST_STATUS_PASSED; +#ifndef _RELEASE_ + if ( getSoftwareConfigStatus( SW_CONFIG_DISABLE_ALARM_AUDIO ) != SW_CONFIG_ENABLE_VALUE ) #endif + { + testStatus = execAlarmAudioSelfTest(); + } +#ifndef _RELEASE_ + else + { + testStatus = SELF_TEST_STATUS_PASSED; + } +#endif postState = handlePOSTStatus( testStatus ); break; @@ -237,11 +237,19 @@ break; case POST_STATE_ACCELEROMETER: -#ifndef DISABLE_ACCELS - testStatus = execAccelTest(); -#else - testStatus = SELF_TEST_STATUS_PASSED; + +#ifndef _RELEASE_ + if ( getSoftwareConfigStatus( SW_CONFIG_DISABLE_ACCELEROMETERS ) != SW_CONFIG_ENABLE_VALUE ) #endif + { + testStatus = execAccelTest(); + } +#ifndef _RELEASE_ + else + { + testStatus = SELF_TEST_STATUS_PASSED; + } +#endif postState = handlePOSTStatus( testStatus ); break; @@ -472,15 +480,13 @@ sendUIVersionRequest(); // Send the startup event - SEND_EVENT_WITH_2_U32_DATA( HD_EVENT_STARTUP, resetReason, systemREG1->GBLSTAT ) // log startup event w/ reset reason(s) bits SEND_EVENT_WITH_2_U32_DATA( HD_EVENT_STARTUP, systemREG1->DEV, 0x12345678 ) // log startup event w/ device ID bits + SEND_EVENT_WITH_2_U32_DATA( HD_EVENT_STARTUP, resetReason, systemREG1->GBLSTAT ) // log startup event w/ reset reason(s) bits + // Send the first submode change event. It is the mode Init and it does not start from a previous // mode previous and current are both published as Init SEND_EVENT_WITH_2_U32_DATA( HD_EVENT_OP_MODE_CHANGE, MODE_INIT, MODE_INIT ) state = POST_STATE_FW_INTEGRITY; -#ifdef SKIP_POST - state = DG_POST_STATE_COMPLETED; -#endif startPOSTDelayCounter = 0; }