Index: firmware/App/Tasks/TaskGeneral.c =================================================================== diff -u -r3f22d883958a14b6193d6cd59c9acdbbd359b69e -r7f68a672cbc13227f557ec7ddeecd4cc5b706a99 --- firmware/App/Tasks/TaskGeneral.c (.../TaskGeneral.c) (revision 3f22d883958a14b6193d6cd59c9acdbbd359b69e) +++ firmware/App/Tasks/TaskGeneral.c (.../TaskGeneral.c) (revision 7f68a672cbc13227f557ec7ddeecd4cc5b706a99) @@ -19,14 +19,19 @@ #include "lin.h" #include "ConcentratePumps.h" -#include "DrainPump.h" -#include "Heaters.h" +#include "DrainPump.h" +#include "Fans.h" +#include "Heaters.h" +#include "NVDataMgmt.h" #include "OperationModes.h" #include "Reservoirs.h" -#include "ROPump.h" +#include "ROPump.h" +#include "RTC.h" #include "SystemComm.h" #include "SystemCommMessages.h" -#include "TaskGeneral.h" +#include "TaskGeneral.h" +#include "Thermistors.h" +#include "UVReactors.h" #include "WatchdogMgmt.h" /** @@ -51,7 +56,15 @@ * @return none *************************************************************************/ void taskGeneral( void ) -{ +{ + /* Order of exec functions + * 1. Comm Rx + * 2. Monitors + * 3. Op modes + * 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 @@ -60,10 +73,17 @@ checkInWithWatchdogMgmt( TASK_GENERAL ); // do this first to keep timing consistent with watchdog management // manage data received from other sub-systems - execSystemCommRx(); + execSystemCommRx(); + // Control and monitor RTC + execRTC(); + +#ifndef BOARD_WITH_NO_HARDWARE // monitor concentrate pumps - execConcentratePumpMonitor(); + execConcentratePumpMonitor(); + + // Monitor thermistors state machine + execThermistors(); // manage RO pump execROPumpController(); @@ -73,9 +93,16 @@ // manage concentrate pumps execConcentratePumpController(); + + // Manage fans controller + execFans(); // manage time-based reservoir tasks - execReservoirs(); + execReservoirs(); + + // Manage UV reactors controller + execUVReactors(); +#endif #ifndef DISABLE_HEATERS_AND_TEMPS // Primary heaters state machine @@ -85,7 +112,11 @@ execTrimmerHeater(); #endif // run operation mode state machine - execOperationModes(); + execOperationModes(); + + // Run non-volatile data management state machine that sends the data record + // to Dialin + execNVDataMgmtProcessRecord(); // manage data to be transmitted to other sub-systems execSystemCommTx();