/************************************************************************** * * Copyright (c) 2024-2024 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 * * @author (last) Sean * @date (last) 30-Jul-2024 * * @author (original) Sean * @date (original) 30-Jul-2024 * ***************************************************************************/ #include "FPGA.h" #include "SystemCommTD.h" #include "TaskPriority.h" #include "WatchdogMgmt.h" /** * @addtogroup TaskPriority * @{ */ /*********************************************************************//** * @brief * The taskPriority function handles the scheduled Priority Task interrupt. * Calls the executive functions for FPGA, pumps, valves, and buttons. * @details Inputs: none * @details Outputs: Executives running in priority task are called. * @return none *************************************************************************/ void taskPriority( void ) { #ifdef TASK_TIMING_OUTPUT_ENABLED // Set GPIO high to indicate priority task has begun executing setCPLDLampRed( PIN_SIGNAL_HIGH ); #endif // Prevent most processing until UI has started communicating if ( TRUE == uiCommunicated() ) { // 1st pass for FPGA execFPGAIn(); // Verify processor clock speed against FPGA clock // execFPGAClockSpeedTest(); // Monitor and process buttons // execButtons(); // Monitor internal ADC channels // execInternalADC(); // Monitor air trap level sensors // execAirTrapMonitor(); #ifndef _RELEASE_ // if ( getSoftwareConfigStatus( SW_CONFIG_DISABLE_SYRINGE_PUMP ) != SW_CONFIG_ENABLE_VALUE ) #endif { // Control/Monitor syringe pump // execSyringePump(); } // Monitor blood pump and flow // execBloodFlowMonitor(); // Monitor fluid leak detector // execFluidLeak(); // Monitor air bubble detector // execBubble(); // 2nd pass for FPGA execFPGAOut(); } // Check in with watchdog manager checkInWithWatchdogMgmt( TASK_PRIORITY ); #ifdef TASK_TIMING_OUTPUT_ENABLED // Set GPIO low to indicate priority task has finished executing setCPLDLampRed( PIN_SIGNAL_LOW ); #endif } /**@}*/