Index: firmware/App/Controllers/Valves.c =================================================================== diff -u -r9725baecc8bf9720e4c27a4564b8aee3d62813e5 -rd9d085cdca67200ecddbdfbc75c489e704b23081 --- firmware/App/Controllers/Valves.c (.../Valves.c) (revision 9725baecc8bf9720e4c27a4564b8aee3d62813e5) +++ firmware/App/Controllers/Valves.c (.../Valves.c) (revision d9d085cdca67200ecddbdfbc75c489e704b23081) @@ -383,13 +383,8 @@ execMonitorValves(); - // TODO un-comment the for loop - //for ( valve = VDI; valve < NUM_OF_VALVES; valve++ ) + for ( valve = VDI; valve < NUM_OF_VALVES; valve++ ) { - //TODO FOR TESTING ONLY REMOVE - valve = VBA; - //TODO FOR TESTING ONLY REMOVE - switch ( valvesStatus[ valve ].execState ) { case VALVE_STATE_WAIT_FOR_POST: @@ -585,7 +580,7 @@ } else if ( deltaPosition < MAX_DEVIATION_FROM_TARGET_IN_COUNTS ) { - if ( valvesStatus[ valve ].restCounter >= 0 )//TODO add a #define for the rest time. Do we need the rest? + if ( valvesStatus[ valve ].restCounter >= 0 ) // TODO add a #define for the rest time. Do we need the rest? { valvesStatus[ valve ].homingEdgeDetectionCounter = 0; valvesStatus[ valve ].targetPositionInCounts = currentPosition + HOMING_STEP_CHANGE_IN_COUNTS; @@ -660,7 +655,7 @@ } else if ( abs(deltaPosition) < MAX_DEVIATION_FROM_TARGET_IN_COUNTS ) { - if ( valvesStatus[ valve ].restCounter >= 0 ) //TODO add a #define for the rest time. Do we need the rest? + if ( valvesStatus[ valve ].restCounter >= 0 ) // TODO add a #define for the rest time. Do we need the rest? { valvesStatus[ valve ].homingEdgeDetectionCounter = 0; valvesStatus[ valve ].targetPositionInCounts = currentPosition - HOMING_STEP_CHANGE_IN_COUNTS; @@ -852,12 +847,15 @@ *************************************************************************/ static void execMonitorValves( void ) { +#ifndef DISABLE_3WAY_VALVES // Check if the valves are still enabled areValvesFunctional(); +#endif // Get the current position of the valves in counts and store them getAndMonitorValvesCurrentPosition(); +#ifndef DISABLE_3WAY_VALVES // Get the current in ADC and convert them to amps // Check whether any of the valves are over current convertAndMonitorValvesCurrent(); @@ -867,6 +865,7 @@ #ifdef DEBUG_ENABLED getValvesCurrentPWM(); #endif +#endif } /*********************************************************************//** @@ -1050,6 +1049,7 @@ valvesStatus[ VBA ].currentPositionInCounts = getFPGAValveBloodArterialPosition(); valvesStatus[ VBV ].currentPositionInCounts = getFPGAValveBloodVenousPosition(); +#ifndef DISABLE_3WAY_VALVES // Check the position of each valve for ( valve = VDI; valve < NUM_OF_VALVES; valve++ ) { @@ -1079,6 +1079,7 @@ } } } +#endif } /*********************************************************************//** @@ -1133,13 +1134,6 @@ valvesStatus[ valve ].dataPublishCounter = 0; } - - // TODO REMOVE Fast 10ms publish - fastDataRemoveLater.currentPos = valvesStatus[ valve ].currentPositionInCounts; - fastDataRemoveLater.current = valvesStatus[ valve ].current; - fastDataRemoveLater.cmdPosition = valvesStatus[ valve ].targetPositionInCounts; - broadcastFastTempHDValves(); - // TODO REMOVE } /*********************************************************************//**