Index: firmware/App/Tasks/TaskPriority.c =================================================================== diff -u -r3a8cf075eb6f0d255f516ac26bac7fbaacfde14a -r395522dffef1348e176564925656012f529c1910 --- firmware/App/Tasks/TaskPriority.c (.../TaskPriority.c) (revision 3a8cf075eb6f0d255f516ac26bac7fbaacfde14a) +++ firmware/App/Tasks/TaskPriority.c (.../TaskPriority.c) (revision 395522dffef1348e176564925656012f529c1910) @@ -1,83 +1,100 @@ /************************************************************************** * -* Copyright (c) 2024-2024 Diality Inc. - All Rights Reserved. +* Copyright (c) 2024-2026 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) 31-Jul-2024 +* @author (last) Sean Nash +* @date (last) 28-May-2025 * -* @author (original) Sean -* @date (original) 31-Jul-2024 +* @author (original) Sean Nash +* @date (original) 01-Aug-2024 * ***************************************************************************/ +#include "AirTrap.h" #include "Bubbles.h" #include "Buttons.h" +#include "EjectorMotor.h" #include "FPGA.h" #include "InternalADC.h" #include "SystemCommTD.h" #include "TaskPriority.h" -#include "WatchdogMgmt.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 \b Inputs: none +/*********************************************************************//** + * @brief + * The taskPriority function handles the scheduled Priority Task interrupt. + * Calls the executive functions for FPGA, pumps, valves, and buttons. + * @details \b Inputs: none * @details \b Outputs: Executive functions running in priority task are called. - * @return none - *************************************************************************/ -void taskPriority( void ) + * @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() ) +#ifdef TEST_AIR_TRAP_ALPHA_TESTING + execFPGA( TRUE ); + execEjectorMotorRamping(); +#endif +#ifdef TEST_PINCH_VALVES + execFPGA( TRUE ); +#endif + + // Prevent most processing until UI has started communicating + if ( TRUE == uiCommunicated() ) { - // 1st pass for FPGA + // 1st pass for FPGA execFPGA( TRUE ); - + // Verify processor clock speed against FPGA clock // execFPGAClockSpeedTest(); - - // Monitor and process buttons - execButtons(); - - // Monitor internal ADC channels + + // Monitor and process buttons + execButtons(); + + // Monitor internal ADC channels execInternalADC(); // Monitor air trap level sensors -// execAirTrapMonitor(); + execAirTrapMonitor(); - // Monitor blood pump and flow -// execBloodFlowMonitor(); - // Monitor air bubble detectors execBubbles(); - // 2nd pass for FPGA + // Control ejector motor ramping + execEjectorMotorRamping(); + + // 2nd pass for FPGA execFPGA( FALSE ); - } - - // Check in with watchdog manager - checkInWithWatchdogMgmt( TASK_PRIORITY ); + } +#ifdef TEST_AIR_TRAP_ALPHA_TESTING + execFPGA( FALSE ); +#endif +#ifdef TEST_PINCH_VALVES + execFPGA( FALSE ); +#endif + + // 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 -} +} -/**@}*/ +/**@}*/