Index: firmware/App/Controllers/Heaters.c =================================================================== diff -u -r3b3833a0b1aed89f1ff66104519f658f5a41fa99 -ra14bc308c72272ce0275d263cf010c90d8a37355 --- firmware/App/Controllers/Heaters.c (.../Heaters.c) (revision 3b3833a0b1aed89f1ff66104519f658f5a41fa99) +++ firmware/App/Controllers/Heaters.c (.../Heaters.c) (revision a14bc308c72272ce0275d263cf010c90d8a37355) @@ -20,6 +20,7 @@ //#include "DDDefs.h" #include "FpgaDD.h" #include "Heaters.h" +#include "Level.h" #include "MessageSupport.h" #include "Messaging.h" //#include "NVDataMgmt.h" @@ -358,12 +359,12 @@ if ( DD_PRIMARY_HEATER == heater ) { alarm = ALARM_ID_DD_FLUID_TOO_LOW_WHILE_PRIMARY_HEATER_IS_ON; - //isLevelLow = getFloaterLevelStatus(); + isLevelLow = ( ( getLevelStatus( FLOATER_1 ) != 0 )? FALSE : TRUE ); } else { alarm = ALARM_ID_DD_FLUID_TOO_LOW_WHILE_TRIMMER_HEATER_IS_ON; - //isLevelLow = getBalanceAirSeparationLevelStatus(); + isLevelLow = ( ( getLevelStatus( SPENT_DIALYSATE_LEVEL ) != 0 )? FALSE : TRUE ); } checkPersistentAlarm( alarm, isLevelLow, 0.0F, 0.0F ); Index: firmware/App/Modes/ModeStandby.c =================================================================== diff -u -rf7c714a1a09b10d85a8b013712532d37b4d7b97a -ra14bc308c72272ce0275d263cf010c90d8a37355 --- firmware/App/Modes/ModeStandby.c (.../ModeStandby.c) (revision f7c714a1a09b10d85a8b013712532d37b4d7b97a) +++ firmware/App/Modes/ModeStandby.c (.../ModeStandby.c) (revision a14bc308c72272ce0275d263cf010c90d8a37355) @@ -394,67 +394,6 @@ /*********************************************************************//** * @brief - * The requestWaterSample function handles an TD request to sample water. - * @details \b Inputs: standbyState - * @details \b Outputs: pendingSampleWaterRequest - * @return TRUE if request accepted, FALSE if not. - *************************************************************************/ -void waterSampleCommandHandler( SAMPLE_WATER_CMD_T sampleWaterCmd ) -{ -// DD_CMD_RESPONSE_T cmdResponse; -// -// cmdResponse.commandID = DD_CMD_SAMPLE_WATER; -// cmdResponse.rejected = TRUE; -// cmdResponse.rejectCode = DD_CMD_REQUEST_REJECT_REASON_INVALID_MODE; -// -// switch ( sampleWaterCmd ) -// { -// case SAMPLE_WATER_CMD_STOP: -// if ( ( DD_MODE_STAN == getCurrentOperationMode() ) && ( DD_STANDBY_MODE_STATE_SAMPLE_WATER == standbyState ) ) -// { -// stopSampleWaterRequest = TRUE; -// cmdResponse.rejected = FALSE; -// cmdResponse.rejectCode = DD_CMD_REQUEST_REJECT_REASON_NONE; -// } -// break; -// -// case SAMPLE_WATER_CMD_START: -// if ( ( DD_MODE_STAN == getCurrentOperationMode() ) && ( DD_STANDBY_MODE_STATE_FLUSH_FILTER_IDLE == standbyState ) ) -// { -// startSampleWaterRequest = TRUE; -// cmdResponse.rejected = FALSE; -// cmdResponse.rejectCode = DD_CMD_REQUEST_REJECT_REASON_NONE; -// } -// break; -// -// case SAMPLE_WATER_CMD_FLUSH: -// if ( ( DD_MODE_STAN == getCurrentOperationMode() ) && ( DD_STANDBY_MODE_STATE_IDLE == standbyState ) ) -// { -// flushFilterRequest = TRUE; -// cmdResponse.rejected = FALSE; -// cmdResponse.rejectCode = DD_CMD_REQUEST_REJECT_REASON_NONE; -// } -// break; -// -// case SAMPLE_WATER_CMD_END: -// if ( DD_MODE_STAN == getCurrentOperationMode() ) -// { -// endSampleWaterRequest = TRUE; -// cmdResponse.rejected = FALSE; -// cmdResponse.rejectCode = DD_CMD_REQUEST_REJECT_REASON_NONE; -// } -// break; -// -// default: -// cmdResponse.rejectCode = DD_CMD_REQUEST_REJECT_REASON_INVALID_PARAMETER; -// break; -// } -// -// sendCommandResponseMsg( &cmdResponse ); -} - -/*********************************************************************//** - * @brief * The requestDDStart function handles an TD request to start (go to generation idle mode). * @details \b Inputs: standbyState * @details \b Outputs: pendingSampleWaterRequest Index: firmware/App/Modes/ModeStandby.h =================================================================== diff -u -rf7c714a1a09b10d85a8b013712532d37b4d7b97a -ra14bc308c72272ce0275d263cf010c90d8a37355 --- firmware/App/Modes/ModeStandby.h (.../ModeStandby.h) (revision f7c714a1a09b10d85a8b013712532d37b4d7b97a) +++ firmware/App/Modes/ModeStandby.h (.../ModeStandby.h) (revision a14bc308c72272ce0275d263cf010c90d8a37355) @@ -44,7 +44,6 @@ U32 transitionToStandbyMode( void ); // prepares for transition to standby mode U32 execStandbyMode( void ); // execute the standby mode state machine (call from OperationModes) -void waterSampleCommandHandler( SAMPLE_WATER_CMD_T sampleWaterCmd ); // handle water sample command BOOL requestDDStart( void ); // TD requests DD start (go to generation idle mode) BOOL signalAbortWaterSampling( void ); // TD signal to abort water sampling. Index: firmware/App/Monitors/Level.c =================================================================== diff -u --- firmware/App/Monitors/Level.c (revision 0) +++ firmware/App/Monitors/Level.c (revision a14bc308c72272ce0275d263cf010c90d8a37355) @@ -0,0 +1,271 @@ +/************************************************************************** +* +* 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 Level.c +* +* @author (last) Vinayakam Mani +* @date (last) 11-Oct-2024 +* +* @author (original) Vinayakam Mani +* @date (original) 11-Oct-2024 +* +***************************************************************************/ + +#include "FpgaDD.h" +#include "Level.h" +#include "MessageSupport.h" +#include "Messaging.h" +#include "TaskPriority.h" +#include "Timers.h" + +/** + * @addtogroup Level + * @{ + */ + +// ********** private definitions ********** + +#define LEVEL_DATA_PUB_INTERVAL ( MS_PER_SECOND / TASK_PRIORITY_INTERVAL ) ///< Interval (ms/task time) at which the level data is published on the CAN bus. +#define LEVEL_DEBOUNCE_TIME_MS ( MS_PER_SECOND / 10 ) ///< Level debounce time in milliseconds. +#define DATA_PUBLISH_COUNTER_START_COUNT 7 ///< Data publish counter start count. + +/// Level status structure +typedef struct +{ + OVERRIDE_U32_T status; ///< Level status. + U32 debounceStartTime; ///< Debounce start time. + U32 debounceTime; ///< Debounce time +} LEVEL_STATUS_T; + +// ********** private data ********** + +static U32 levelsDataPublicationCounter; ///< Level data publication counter. +static OVERRIDE_U32_T levelsDataPublishInterval = { LEVEL_DATA_PUB_INTERVAL, + LEVEL_DATA_PUB_INTERVAL, 0, 0 }; ///< Interval (in ms) at which to publish Level data to CAN bus. +static LEVEL_STATUS_T levelsStatus[ NUM_OF_LEVELS ]; ///< Level status array. + +// ********** private function prototypes ********** + +static void publishLevelsData( void ); + +/*********************************************************************//** + * @brief + * The initLevels function initializes the level module. + * @details \b Inputs: none + * @details \b Outputs: Level unit variables initialized. + * @return none + *************************************************************************/ +void initLevels( void ) +{ + U08 i; + + levelsDataPublicationCounter = DATA_PUBLISH_COUNTER_START_COUNT; + + // Initialize all the Level + for ( i = 0; i < NUM_OF_LEVELS; i++ ) + { + levelsStatus[ i ].status.data = (U32)STATE_HIGH; + levelsStatus[ i ].status.ovData = (U32)STATE_HIGH; + levelsStatus[ i ].status.ovInitData = (U32)STATE_HIGH; + levelsStatus[ i ].status.override = OVERRIDE_RESET; + levelsStatus[ i ].debounceStartTime = 0; + levelsStatus[ i ].debounceTime = LEVEL_DEBOUNCE_TIME_MS; + } +} + +/*********************************************************************//** + * @brief + * The execLevels function executes the floater and level sensor states. + * @details \b Inputs: level sensor and floater reading from FPGA + * @details \b Outputs: levelStatus + * @details \b Alarms: ALARM_ID_DD_SOFTWARE_FAULT when invalid level sensor + * executed. + * @return none + *************************************************************************/ +void execLevels( void ) +{ + U08 i; + U08 currentLevelStatus = 0; + + for ( i = 0; i < NUM_OF_LEVELS; i++ ) + { + // Get the current level status + switch ( i ) + { + // Process the status of the Level + case FLOATER_1: + currentLevelStatus = ( getFPGAFloater1Status() != 0 ? STATE_LOW : STATE_MEDIUM ); + break; + + case FLOATER_2: + currentLevelStatus = ( getFPGAFloater2Status() != 0 ? STATE_MEDIUM : STATE_HIGH ); + break; + + case BICARB_LEVEL: + currentLevelStatus = ( getFPGALevelSensor1() != 0 ? STATE_LOW : STATE_HIGH ); + break; + + case SPENT_DIALYSATE_LEVEL: + currentLevelStatus = ( getFPGALevelSensor2() != 0 ? STATE_LOW : STATE_HIGH ); + break; + +#ifndef _VECTORCAST_ + default: + SET_ALARM_WITH_2_U32_DATA( ALARM_ID_DD_SOFTWARE_FAULT, SW_FAULT_ID_INVALID_LEVEL_SELECTED, i ); + break; +#endif + } + + // Check if the current level status is not the same as the recorded data + if ( currentLevelStatus != levelsStatus[ i ].status.data ) + { + // If the debounce time is 0, start the timer + if ( 0 == levelsStatus[ i ].debounceStartTime ) + { + levelsStatus[ i ].debounceStartTime = getMSTimerCount(); + } + // If the debounce time has been elapsed, update the level sensor status to the new status + else if ( TRUE == didTimeout( levelsStatus[ i ].debounceStartTime, levelsStatus[ i ].debounceTime ) ) + { + switch ( i ) + { + case FLOATER_1: + SEND_EVENT_WITH_2_U32_DATA( DD_EVENT_FLOATER_1_LEVEL_CHANGE, (U32)levelsStatus[ i ].status.data, (U32)currentLevelStatus ); + break; + + case FLOATER_2: + SEND_EVENT_WITH_2_U32_DATA( DD_EVENT_FLOATER_2_LEVEL_CHANGE, (U32)levelsStatus[ i ].status.data, (U32)currentLevelStatus ); + break; + + case BICARB_LEVEL: + SEND_EVENT_WITH_2_U32_DATA( DD_EVENT_BICARB_LEVEL_CHANGE, (U32)levelsStatus[ i ].status.data, (U32)currentLevelStatus ); + break; + + case SPENT_DIALYSATE_LEVEL: + SEND_EVENT_WITH_2_U32_DATA( DD_EVENT_SPENT_DIALYSATE_LEVEL_CHANGE, (U32)levelsStatus[ i ].status.data, (U32)currentLevelStatus ); + break; + +#ifndef _VECTORCAST_ + default: + SET_ALARM_WITH_2_U32_DATA( ALARM_ID_DD_SOFTWARE_FAULT, SW_FAULT_ID_INVALID_LEVEL_SELECTED, i ); + break; +#endif + } + + levelsStatus[ i ].debounceStartTime = 0; + levelsStatus[ i ].status.data = currentLevelStatus; + } + } + else + { + levelsStatus[ i ].debounceStartTime = 0; + } + } + + publishLevelsData(); +} + +/*********************************************************************//** + * @brief + * The getLevelStatus function returns the status of the called level sensor. + * @details \b Inputs: levelStatus + * @details \b Outputs: levelStatus + * @details \b Alarms: ALARM_ID_DD_SOFTWARE_FAULT when invalid level sensor + * passed. + * @param levelId which is the sensor that its status is requested + * @return level status + *************************************************************************/ +LEVEL_STATE_T getLevelStatus( LELVEL_T levelId ) +{ + U32 status = 0; + + if ( levelId < NUM_OF_LEVELS ) + { + // Assume there is no override + status = levelsStatus[ levelId ].status.data; + + if ( OVERRIDE_KEY == levelsStatus[ levelId ].status.override ) + { + status = levelsStatus[ levelId ].status.ovData; + } + } + else + { + SET_ALARM_WITH_2_U32_DATA( ALARM_ID_DD_SOFTWARE_FAULT, SW_FAULT_ID_DD_INVALID_LEVEL_ID, (U32)levelId ) + } + + return (LEVEL_STATE_T)status; +} + +/*********************************************************************//** + * @brief + * The publishLevelsData function broadcasts the level data at the + * publication interval. + * @details \b Inputs: levelsDataPublicationCounter + * @details \b Outputs: levelsDataPublicationCounter + * @details \b Message \b Sent: MSG_ID_DD_LEVEL_DATA to publish level + * sensors data. + * @return none + *************************************************************************/ +static void publishLevelsData( void ) +{ + if ( ++levelsDataPublicationCounter >= getU32OverrideValue( &levelsDataPublishInterval ) ) + { + LEVEL_DATA_T data; + + data.floater1Level = (U32)getLevelStatus( FLOATER_1 ); + data.floater2Level = (U32)getLevelStatus( FLOATER_2 ); + data.bicarbLevel = (U32)getLevelStatus( BICARB_LEVEL ); + data.spentDialysateLevel = (U32)getLevelStatus( SPENT_DIALYSATE_LEVEL ); + + levelsDataPublicationCounter = 0; + + broadcastData( MSG_ID_DD_LEVEL_DATA, COMM_BUFFER_OUT_CAN_DD_BROADCAST, (U08*)&data, sizeof( LEVEL_DATA_T ) ); + } +} + + +/************************************************************************* + * TEST SUPPORT FUNCTIONS + *************************************************************************/ + + +/*********************************************************************//** + * @brief + * The testLevelsDataPublishIntervalOverride function overrides + * the Level publish data interval. + * @details \b Inputs: levelsDataPublishInterval + * @details \b Outputs: levelsDataPublishInterval + * @param Override message from Dialin which includes the interval + * (in ms) to override the level data broadcast interval to. + * @return TRUE if override successful, FALSE if not + *************************************************************************/ +BOOL testLevelsDataPublishIntervalOverride( MESSAGE_T *message ) +{ + BOOL result = u32BroadcastIntervalOverride( message, &levelsDataPublishInterval, TASK_PRIORITY_INTERVAL ); + + return result; +} + +/*********************************************************************//** + * @brief + * The testLevelStatusOverride function sets the override status + * for a specific level sensor. + * @details \b Inputs: none + * @details \b Outputs: levelStatus + * @param message Override message from Dialin which includes an ID of + * the level sensor to override and the state to override the level sensor to. + * @return TRUE if override successful, FALSE if not + *************************************************************************/ +BOOL testLevelStatusOverride( MESSAGE_T *message ) +{ + BOOL result = u32ArrayOverride( message, &levelsStatus[0].status, NUM_OF_LEVELS - 1, 0, NUM_OF_LEVELS_STATES -1 ); + + return result; +} + +/**@}*/ Index: firmware/App/Monitors/Level.h =================================================================== diff -u --- firmware/App/Monitors/Level.h (revision 0) +++ firmware/App/Monitors/Level.h (revision a14bc308c72272ce0275d263cf010c90d8a37355) @@ -0,0 +1,75 @@ +/************************************************************************** +* +* 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 Level.h +* +* @author (last) Vinayakam Mani +* @date (last) 11-Oct-2024 +* +* @author (original) Vinayakam Mani +* @date (original) 11-Oct-2024 +* +***************************************************************************/ + +#ifndef LEVEL_H_ +#define LEVEL_H_ + +#include "DDCommon.h" + + +/** + * @defgroup Level Level + * @brief Level module monitors the floater levels, Bicarb gas separation level and Spent + * dialsate balance air separation level. + * Level manufacturer: Custom built modules. + * + * @addtogroup Level + * @{ + */ + +// ********** public definitions ********** + +/// DD floater and level sensor enumeration +typedef enum level_names +{ + FLOATER_1 = 0, ///< floater switch low to medium status + FLOATER_2, ///< floater switch medium to high status + BICARB_LEVEL, ///< bicarb level low or high status + SPENT_DIALYSATE_LEVEL, ///< Spent dialysate air separation chamber level low or high status + NUM_OF_LEVELS ///< Number of levels +} LELVEL_T; + +/// floater and level sensor states. +typedef enum level_States +{ + STATE_LOW = 0, ///< Low level + STATE_HIGH, ///< High level + STATE_MEDIUM, ///< Medium level + NUM_OF_LEVELS_STATES ///< Number of level states +} LEVEL_STATE_T; + +/// DD floater and level sensor data publish structure +typedef struct +{ + U32 floater1Level; ///< Floater 1 level + U32 floater2Level; ///< Floater 2 level + U32 bicarbLevel; ///< Bicarb level + U32 spentDialysateLevel; ///< Spent dialysate level +} LEVEL_DATA_T; + +// ********** public function prototypes ********** + +void initLevels( void ); +void execLevels( void ); +LEVEL_STATE_T getLevelStatus( LELVEL_T levelId ); + +BOOL testLevelsDataPublishIntervalOverride( MESSAGE_T *message ); +BOOL testLevelStatusOverride( MESSAGE_T *message ); + +/**@}*/ + +#endif Index: firmware/App/Services/AlarmMgmtSWFaults.h =================================================================== diff -u -r3b3833a0b1aed89f1ff66104519f658f5a41fa99 -ra14bc308c72272ce0275d263cf010c90d8a37355 --- firmware/App/Services/AlarmMgmtSWFaults.h (.../AlarmMgmtSWFaults.h) (revision 3b3833a0b1aed89f1ff66104519f658f5a41fa99) +++ firmware/App/Services/AlarmMgmtSWFaults.h (.../AlarmMgmtSWFaults.h) (revision a14bc308c72272ce0275d263cf010c90d8a37355) @@ -126,6 +126,8 @@ SW_FAULT_ID_DIALYSATE_PUMP_INVALID_PUMP_ID = 95, SW_FAULT_ID_HEATERS_INVALID_HEATER_ID_SELECTED = 96, SW_FAULT_ID_HEATERS_INVALID_EXEC_STATE = 97, + SW_FAULT_ID_INVALID_LEVEL_SELECTED = 98, + SW_FAULT_ID_DD_INVALID_LEVEL_ID = 99, NUM_OF_SW_FAULT_IDS } SW_FAULT_ID_T; Index: firmware/App/Services/FpgaDD.c =================================================================== diff -u -r3b3833a0b1aed89f1ff66104519f658f5a41fa99 -ra14bc308c72272ce0275d263cf010c90d8a37355 --- firmware/App/Services/FpgaDD.c (.../FpgaDD.c) (revision 3b3833a0b1aed89f1ff66104519f658f5a41fa99) +++ firmware/App/Services/FpgaDD.c (.../FpgaDD.c) (revision a14bc308c72272ce0275d263cf010c90d8a37355) @@ -215,6 +215,8 @@ U16 fpgaSDPCurrentFeedback; ///< Reg 411. Spent dialysate pump current feedback U08 fpgaDGPHallStatus; ///< Reg 413. Fresh dialysate pump hall sensor direction status U08 fpgaSDPHallStatus; ///< Reg 414. Spent dialysate pump hall sensor direction status + U08 fpgaFloater1Status; ///< Reg 415. Floater 1 level sensor status + U08 fpgaFloater2Status; ///< Reg 416. Floater 2 level sensor status } DD_FPGA_SENSORS_T; typedef struct @@ -2131,6 +2133,32 @@ /*********************************************************************//** * @brief + * The getFPGAFloater1Status function gets the latest FPGA floater 1 level + * reading. + * @details \b Inputs: fpgaSensorReadings.fpgaFloater1Status + * @details \b Outputs: none + * @return last FPGA floater 1 level reading + *************************************************************************/ +U08 getFPGAFloater1Status( void ) +{ + return fpgaSensorReadings.fpgaFloater1Status; +} + +/*********************************************************************//** + * @brief + * The getFPGAFloater2Status function gets the latest FPGA floater 2 level + * reading. + * @details \b Inputs: fpgaSensorReadings.fpgaFloater2Status + * @details \b Outputs: none + * @return last FPGA floater 2 level reading + *************************************************************************/ +U08 getFPGAFloater2Status( void ) +{ + return fpgaSensorReadings.fpgaFloater2Status; +} + +/*********************************************************************//** + * @brief * The getFPGATimerCount function gets the latest FPGA timer millisecond count. * @details \b Inputs: fpgaSensorReadings * @details \b Outputs: none Index: firmware/App/Services/FpgaDD.h =================================================================== diff -u -r3b3833a0b1aed89f1ff66104519f658f5a41fa99 -ra14bc308c72272ce0275d263cf010c90d8a37355 --- firmware/App/Services/FpgaDD.h (.../FpgaDD.h) (revision 3b3833a0b1aed89f1ff66104519f658f5a41fa99) +++ firmware/App/Services/FpgaDD.h (.../FpgaDD.h) (revision a14bc308c72272ce0275d263cf010c90d8a37355) @@ -182,6 +182,8 @@ //Level sensor U16 getFPGALevelSensor1( void ); U16 getFPGALevelSensor2( void ); +U08 getFPGAFloater1Status( void ); +U08 getFPGAFloater2Status( void ); //Temperature sensors U32 getFPGAInletHeatExchangerTemp( void ); Index: firmware/App/Tasks/TaskGeneral.c =================================================================== diff -u -rbbcdba8850dd6f6a53044eca6a5ece611654653a -ra14bc308c72272ce0275d263cf010c90d8a37355 --- firmware/App/Tasks/TaskGeneral.c (.../TaskGeneral.c) (revision bbcdba8850dd6f6a53044eca6a5ece611654653a) +++ firmware/App/Tasks/TaskGeneral.c (.../TaskGeneral.c) (revision a14bc308c72272ce0275d263cf010c90d8a37355) @@ -20,6 +20,7 @@ #include "ConcentratePumps.h" #include "DialysatePumps.h" +#include "Heaters.h" #include "Messaging.h" #include "OperationModes.h" #include "SystemCommDD.h" @@ -68,18 +69,15 @@ // manage data received from other sub-systems execSystemCommRx(); -#ifndef BOARD_WITH_NO_HARDWARE // monitor concentrate pumps execConcentratePumpMonitor(); // Monitor DG voltages ///execVoltagesMonitor(); -#endif // run operation mode state machine execOperationModes(); -#ifndef BOARD_WITH_NO_HARDWARE // Monitor thermistors state machine //execThermistors(); @@ -93,11 +91,10 @@ //execSwitches(); // Heaters controller - //execHeaters(); + execHeaters(); // Monitor RAM error status - //execRAMMonitor(); -#endif + //execRAMMonitor(); // Run non-volatile data management state machine that sends the data record // to Dialin Index: firmware/App/Tasks/TaskPriority.c =================================================================== diff -u -rbbcdba8850dd6f6a53044eca6a5ece611654653a -ra14bc308c72272ce0275d263cf010c90d8a37355 --- firmware/App/Tasks/TaskPriority.c (.../TaskPriority.c) (revision bbcdba8850dd6f6a53044eca6a5ece611654653a) +++ firmware/App/Tasks/TaskPriority.c (.../TaskPriority.c) (revision a14bc308c72272ce0275d263cf010c90d8a37355) @@ -20,8 +20,9 @@ #include "Conductivity.h" #include "DialysatePumps.h" #include "FPGA.h" -//#include "Heaters.h" +#include "Heaters.h" #include "InternalADC.h" +#include "Level.h" #include "Pressure.h" #include "TaskPriority.h" #include "Temperature.h" @@ -59,7 +60,10 @@ execFPGA( TRUE ); // Monitor internal ADC channels - execInternalADC(); + execInternalADC(); + + //Monitor Level sensor + execLevels(); // Monitor pressures execPressureSensor(); @@ -80,7 +84,7 @@ execDialysatePumpMonitor(); // Heaters monitor - //execHeatersMonitor(); + execHeatersMonitor(); // Second pass for FPGA execFPGA( FALSE ); Index: firmware/source/sys_main.c =================================================================== diff -u -rbbcdba8850dd6f6a53044eca6a5ece611654653a -ra14bc308c72272ce0275d263cf010c90d8a37355 --- firmware/source/sys_main.c (.../sys_main.c) (revision bbcdba8850dd6f6a53044eca6a5ece611654653a) +++ firmware/source/sys_main.c (.../sys_main.c) (revision a14bc308c72272ce0275d263cf010c90d8a37355) @@ -67,7 +67,9 @@ #include "DDCommon.h" #include "DialysatePumps.h" #include "FpgaDD.h" +#include "Heaters.h" #include "Interrupts.h" +#include "Level.h" #include "MsgQueues.h" #include "OperationModes.h" #include "Pressure.h" @@ -163,9 +165,11 @@ initPressure(); initConductivity(); initValves(); + initHeaters(); initTemperature(); initConcentratePump(); initDialysatePump(); + initLevels(); initCommBuffers(); initMsgQueues(); initSystemComm();