Index: firmware/App/Modes/ModeInitPOST.c =================================================================== diff -u -rb9bbcef1e828cf6537b41790d9871c3f25741494 -raa4db7d76566ad7473f896e543f71fdbbc921ea9 --- firmware/App/Modes/ModeInitPOST.c (.../ModeInitPOST.c) (revision b9bbcef1e828cf6537b41790d9871c3f25741494) +++ firmware/App/Modes/ModeInitPOST.c (.../ModeInitPOST.c) (revision aa4db7d76566ad7473f896e543f71fdbbc921ea9) @@ -1,23 +1,26 @@ /************************************************************************** * -* Copyright (c) 2019-2021 Diality Inc. - All Rights Reserved. +* Copyright (c) 2019-2022 Diality Inc. - All Rights Reserved. * * THIS CODE MAY NOT BE COPIED OR REPRODUCED IN ANY FORM, IN PART OR IN * WHOLE, WITHOUT THE EXPLICIT PERMISSION OF THE COPYRIGHT OWNER. * * @file ModeInitPOST.c * * @author (last) Dara Navaei -* @date (last) 12-Nov-2021 +* @date (last) 04-Jan-2022 * * @author (original) Dara Navaei * @date (original) 05-Nov-2019 * ***************************************************************************/ +#include "reg_system.h" // Used to access exception status registers for reset reason code at startup + #include "Accel.h" #include "AlarmLamp.h" #include "BloodFlow.h" +#include "BloodLeak.h" #include "Buttons.h" #include "Compatible.h" #include "CPLD.h" @@ -152,10 +155,7 @@ { initiatePowerOff(); } - else - { - postState = POST_STATE_WATCHDOG; - } + postState = POST_STATE_WATCHDOG; break; case POST_STATE_WATCHDOG: @@ -192,6 +192,11 @@ postState = handlePOSTStatus( testStatus ); break; + case POST_STATE_BLOOD_LEAK: + testStatus = execBloodLeakSelfTest(); + postState = handlePOSTStatus( testStatus ); + break; + case POST_STATE_VALVES: testStatus = execValvesSelfTest(); postState = handlePOSTStatus( testStatus ); @@ -437,6 +442,7 @@ // 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 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 )