Index: firmware/App/Modes/ConsumableSelfTest.c =================================================================== diff -u -r0bd1acff7222327c97897b4f9ab91bcc1d9d5816 -rbea9ae2daffd8f939d22037df07ccaa56653cb19 --- firmware/App/Modes/ConsumableSelfTest.c (.../ConsumableSelfTest.c) (revision 0bd1acff7222327c97897b4f9ab91bcc1d9d5816) +++ firmware/App/Modes/ConsumableSelfTest.c (.../ConsumableSelfTest.c) (revision bea9ae2daffd8f939d22037df07ccaa56653cb19) @@ -1,14 +1,14 @@ /************************************************************************** * -* Copyright (c) 2021-2022 Diality Inc. - All Rights Reserved. +* Copyright (c) 2021-2023 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 ConsumableSelfTest.c * -* @author (last) Dara Navaei -* @date (last) 31-Mar-2022 +* @author (last) Michael Garthwaite +* @date (last) 19-Jan-2023 * * @author (original) Quang Nguyen * @date (original) 06-Mar-2021 @@ -25,6 +25,7 @@ #include "Reservoirs.h" #include "SelfTests.h" #include "SyringePump.h" +#include "SystemCommMessages.h" #include "Valves.h" /** @@ -91,6 +92,8 @@ *************************************************************************/ void execConsumableSelfTest( void ) { + CONSUMABLE_SELF_TESTS_STATE_T priorSubState = currentConsumableSelfTestState; + switch( currentConsumableSelfTestState ) { case CONSUMABLE_SELF_TESTS_INSTALL_STATE: @@ -107,14 +110,14 @@ { consumableInstallConfirmed = FALSE; #ifndef _RELEASE_ - if ( getSoftwareConfigStatus( SW_CONFIG_DISABLE_CONSUMABLES_TESTS ) != SW_CONFIG_ENABLE_VALUE ) + if ( SW_CONFIG_ENABLE_VALUE == getSoftwareConfigStatus( SW_CONFIG_DISABLE_CONSUMABLES_TESTS ) ) { - currentConsumableSelfTestState = CONSUMABLE_SELF_TESTS_FILL_CMD_STATE; + currentConsumableSelfTestState = CONSUMABLE_SELF_TESTS_COMPLETE_STATE; } else #endif { - currentConsumableSelfTestState = CONSUMABLE_SELF_TESTS_COMPLETE_STATE; + currentConsumableSelfTestState = CONSUMABLE_SELF_TESTS_FILL_CMD_STATE; } } break; @@ -157,6 +160,10 @@ break; } + if ( priorSubState != currentConsumableSelfTestState ) + { + SEND_EVENT_WITH_2_U32_DATA( HD_EVENT_SUB_STATE_CHANGE, priorSubState, currentConsumableSelfTestState ); + } // Handle triggered alarm with stop property handleConsumableSelfTestStopRequest(); }