Index: firmware/App/Tasks/TaskPriority.c =================================================================== diff -u -rd5b87d7dab8613f3963fb66f8833d210f127fa1f -rc07917caced76b53a0ed8f35167fac6f9d8310a4 --- firmware/App/Tasks/TaskPriority.c (.../TaskPriority.c) (revision d5b87d7dab8613f3963fb66f8833d210f127fa1f) +++ firmware/App/Tasks/TaskPriority.c (.../TaskPriority.c) (revision c07917caced76b53a0ed8f35167fac6f9d8310a4) @@ -1,34 +1,36 @@ /************************************************************************** * -* Copyright (c) 2024-2024 Diality Inc. - All Rights Reserved. +* Copyright (c) 2024-2025 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) Vinayakam Mani -* @date (last) 05-Aug-2024 +* @author (last) Michael Garthwaite +* @date (last) 09-Sep-2025 * * @author (original) Vinayakam Mani -* @date (original) 05-Aug-2024 +* @date (original) 07-Aug-2024 * ***************************************************************************/ -#include "gio.h" - +#include "gio.h" + +#include "BloodLeak.h" #include "Conductivity.h" -#include "DialysatePumps.h" -#include "FPGA.h" -#include "Heaters.h" +#include "DialysatePumps.h" +#include "FPGA.h" +#include "Flow.h" +#include "Heaters.h" #include "InternalADC.h" #include "Level.h" #include "ModeGenDialysate.h" -#include "Pressure.h" -#include "TaskPriority.h" -#include "Temperature.h" -#include "Valves.h" -#include "WatchdogMgmt.h" +#include "Pressure.h" +#include "TaskPriority.h" +#include "Temperature.h" +#include "Valves.h" +#include "WatchdogMgmt.h" /** * @addtogroup TaskPriority @@ -42,65 +44,74 @@ #define SET_TASK_OFF() { mibspiREG3->PC3 &= ~TASK_TIMING_TEST_PIN_SPI1_PORT_MASK; } #endif -/*********************************************************************//** - * @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 for the FPGA, pumps, valves, and buttons called. - * @note This task runs every 10 ms interval. - *************************************************************************/ -void taskPriority( void ) -{ + * @note This task runs every 10 ms interval. + *************************************************************************/ +void taskPriority( void ) +{ #ifdef TASK_TIMING_OUTPUT_ENABLED // SET_TASK_ON(); // TODO - uncomment and define TASK_TIMING_OUTPUT_ENABLED to monitor this tasks timing #endif #ifndef BOARD_WITH_NO_HARDWARE - // First pass for FPGA + // First pass for FPGA execFPGA( TRUE ); - //TODO : Enable later Temperature, Conductivity, Heaters, Internal ADC and FPGA clock speed - // Monitor internal ADC channels + //TODO : Enable later Temperature, Conductivity, Heaters, Internal ADC and FPGA clock speed + // Monitor internal ADC channels //execInternalADC(); //Monitor Level sensor - execLevels(); - - // Monitor pressures - execPressureSensor(); + execLevels(); - // Monitor temperatures - execTemperatureSensors(); + // Monitor pressures + execPressureSensor(); + // Monitor temperatures + execTemperatureSensors(); + // Verify the processor clock speed against the FPGA clock //execFPGAClockSpeedTest(); // Read/write Conductivity sensors - //execConductivity(); - - // Control valves - execValves(); + execConductivity(); - // Monitor dialysate pump - execDialysatePumpMonitor(); - - // Heaters monitor + // Control valves + execValves(); + + // Monitor dialysate pump + execDialysatePumpMonitor(); + + // Heaters monitor execHeatersMonitor(); // Dialysate generation monitor execGenDialysateMonitor(); - // Second pass for FPGA + // Exec blood leak embedded mode + execBloodLeakEmbModeCommand(); + + // Blood leak sensor + execBloodLeak(); + + // Flow Sensor + execFlowMonitor(); + + // Second pass for FPGA execFPGA( FALSE ); -#endif - - // Check in with watchdog manager - checkInWithWatchdogMgmt( TASK_PRIORITY ); - +#endif + + // Check in with watchdog manager + checkInWithWatchdogMgmt( TASK_PRIORITY ); + #ifdef TASK_TIMING_OUTPUT_ENABLED // SET_TASK_OFF(); // TODO - uncomment and define TASK_TIMING_OUTPUT_ENABLED to monitor this tasks timing #endif -} +} -/**@}*/ +/**@}*/