Index: firmware/App/Tasks/TaskPriority.c =================================================================== diff -u -r30f049651877229042e3f8700c8596e5b9a1e0f4 -r37a9fd8f15e413db5337371a7d1a1cb65567af7c --- firmware/App/Tasks/TaskPriority.c (.../TaskPriority.c) (revision 30f049651877229042e3f8700c8596e5b9a1e0f4) +++ firmware/App/Tasks/TaskPriority.c (.../TaskPriority.c) (revision 37a9fd8f15e413db5337371a7d1a1cb65567af7c) @@ -1,33 +1,38 @@ /************************************************************************** * -* Copyright (c) 2019-2020 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 TaskPriority.c +* @file TaskPriority.c * -* @author (last) Sean Nash -* @date (last) 14-Oct-2020 +* @author (last) Darren Cox +* @date (last) 10-Mar-2022 * -* @author (original) Dara Navaei -* @date (original) 05-Nov-2019 +* @author (original) Dara Navaei +* @date (original) 05-Nov-2019 * ***************************************************************************/ #include "Accel.h" #include "AirTrap.h" -#include "BloodFlow.h" +#include "BloodFlow.h" +#include "BloodLeak.h" +#include "Bubble.h" #include "Buttons.h" #include "CPLD.h" #include "DialInFlow.h" -#include "DialOutFlow.h" -#include "FPGA.h" +#include "DialOutFlow.h" +#include "FluidLeak.h" +#include "FPGA.h" +#include "NVDataMgmt.h" #include "InternalADC.h" +#include "SyringePump.h" #include "SystemComm.h" #include "Valves.h" #include "WatchdogMgmt.h" -#include "TaskPriority.h" +#include "TaskPriority.h" /** * @addtogroup TaskPriority @@ -39,7 +44,7 @@ * The taskPriority function handles the scheduled Priority Task interrupt. * Calls the executive functions for FPGA, pumps, valves, and buttons. * @details Inputs: none - * @details Outputs: Executive for the FPGA, pumps, valves, and buttons called. + * @details Outputs: Executives running in priority task are called. * @return none *************************************************************************/ void taskPriority( void ) @@ -53,10 +58,14 @@ #ifndef SIMULATE_UI if ( TRUE == uiCommunicated() ) #endif - { + { // 1st pass for FPGA - execFPGAIn(); + execFPGAIn(); +#ifndef BOARD_WITH_NO_HARDWARE + // Verify processor clock speed against FPGA clock + execFPGAClockSpeedTest(); + #ifndef CAN_TEST // Monitor and process buttons execButtons(); @@ -65,7 +74,13 @@ execInternalADC(); // Monitor air trap level sensors - execAirTrapMonitor(); + execAirTrapMonitor(); + + if ( getSoftwareConfigStatus( SW_CONFIG_DISABLE_SYRINGE_PUMP ) != SW_CONFIG_ENABLE_VALUE ) + { + // Control/Monitor syringe pump + execSyringePump(); + } // Monitor blood pump and flow execBloodFlowMonitor(); @@ -76,17 +91,29 @@ // Monitor dialysate outlet pump and load cells execDialOutFlowMonitor(); -#ifndef DISABLE_ACCELS - // Monitor accelerometer - execAccel(); + // Monitor fluid leak detector + execFluidLeak(); + + // Monitor blood leak detector + execBloodLeak(); + + // Monitor air bubble detectors + execBubbles(); + +#ifndef _RELEASE_ + if ( getSoftwareConfigStatus( SW_CONFIG_DISABLE_ACCELEROMETERS ) != SW_CONFIG_ENABLE_VALUE ) #endif -#ifndef DISABLE_3WAY_VALVES + { + // Monitor accelerometer + execAccel(); + } + // Exec and monitor valves execValves(); #endif -#endif +#endif // 2nd pass for FPGA - execFPGAOut(); + execFPGAOut(); } // Check in with watchdog manager