Index: firmware/App/Tasks/TaskGeneral.c =================================================================== diff -u -r2ef70ec14fb47bee35cb241a927582f7ccd1bb22 -rc07917caced76b53a0ed8f35167fac6f9d8310a4 --- firmware/App/Tasks/TaskGeneral.c (.../TaskGeneral.c) (revision 2ef70ec14fb47bee35cb241a927582f7ccd1bb22) +++ firmware/App/Tasks/TaskGeneral.c (.../TaskGeneral.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 TaskGeneral.c * * @author (last) Vinayakam Mani -* @date (last) 05-Aug-2024 +* @date (last) 02-Oct-2025 * * @author (original) Vinayakam Mani -* @date (original) 05-Aug-2024 +* @date (original) 07-Aug-2024 * ***************************************************************************/ - -#include "gio.h" -#include "lin.h" +#include "gio.h" +#include "lin.h" + +#include "BoostPump.h" #include "ConcentratePumps.h" #include "DialysatePumps.h" #include "Heaters.h" +#include "FPOperationModes.h" #include "Messaging.h" #include "OperationModes.h" -#ifdef __PUMPTEST__ -#include "PistonPumpControl.h" -#endif -#include "SystemCommDD.h" +#include "PermeateTank.h" +#include "RinsePump.h" +#include "ROPump.h" +#include "SystemCommDD.h" #include "TaskGeneral.h" -#include "WatchdogMgmt.h" +#include "WatchdogMgmt.h" /** * @addtogroup TaskGeneral @@ -41,18 +43,18 @@ #define SET_TASK_ON() { mibspiREG3->PC3 |= TASK_TIMING_TEST_PIN_SPI1_PORT_MASK; } #define SET_TASK_OFF() { mibspiREG3->PC3 &= ~TASK_TIMING_TEST_PIN_SPI1_PORT_MASK; } #endif - -/*********************************************************************//** - * @brief - * The taskGeneral function handles the scheduled general task interrupt. - * Calls the executive functions for most monitors and controllers, the - * operation modes, the system communications, and alarms. - * @details \b Inputs: none - * @details \b Outputs: Executed all general task functions. + +/*********************************************************************//** + * @brief + * The taskGeneral function handles the scheduled general task interrupt. + * Calls the executive functions for most monitors and controllers, the + * operation modes, the system communications, and alarms. + * @details \b Inputs: none + * @details \b Outputs: Executed all general task functions. * @return none - * @note This task runs every 50 ms interval. - *************************************************************************/ -void taskGeneral( void ) + * @note This task runs every 50 ms interval. + *************************************************************************/ +void taskGeneral( void ) { /* Order of exec functions * 1. Comm Rx @@ -61,15 +63,15 @@ * 4. Controllers * 5. Comm Tx * */ - + #ifdef TASK_TIMING_OUTPUT_ENABLED // SET_TASK_ON(); // TODO - uncomment and define TASK_TIMING_OUTPUT_ENABLED to monitor this tasks timing #endif - // check in with watchdog manager - checkInWithWatchdogMgmt( TASK_GENERAL ); // do this first to keep timing consistent with watchdog management - - // manage data received from other sub-systems + // check in with watchdog manager + checkInWithWatchdogMgmt( TASK_GENERAL ); // do this first to keep timing consistent with watchdog management + + // manage data received from other sub-systems execSystemCommRx(); //TODO : Enable later Concentratepump and Heaters @@ -79,42 +81,52 @@ // Monitor DD voltages ///execVoltagesMonitor(); - // run operation mode state machine - execOperationModes(); + // run DD operation mode state machine + execDDOperationModes(); - // manage dialysate pump + // run FP operation mode state machine + execFPOperationModes(); + + // manage dialysate pump execDialysatePumpController(); // manage concentrate pumps execConcentratePumpController(); -#ifdef __PUMPTEST__ - // manage piston pumps - execPistonPumpController(); -#endif + // Control RO pump + execROPumpController(); + // Control Permeate Tank + execPermeateTankController(); + + // Control Boost pump + execBoostPumpController(); + // Manage switches monitor //execSwitches(); - + // Heaters controller execHeatersControl(); + // manage rinse pump + execRinsePumpController(); + // Monitor RAM error status //execRAMMonitor(); // Run non-volatile data management state machine that sends the data record // to Dialin - //execNVDataMgmtProcessRecord(); + //execNVDataMgmtProcessRecord(); - // Run alarm management + // Run alarm management execAlarmMgmt(); - // manage data to be transmitted to other sub-systems - execSystemCommTx(); - + // manage data to be transmitted to other sub-systems + execSystemCommTx(); + #ifdef TASK_TIMING_OUTPUT_ENABLED // SET_TASK_OFF(); // TODO - uncomment and define TASK_TIMING_OUTPUT_ENABLED to monitor this tasks timing #endif -} +} /**@}*/