Index: firmware/App/Controllers/Valves.c =================================================================== diff -u -r5a04a1445b684aedd199e0294311db468635c152 -r79a5884a9d7d6123dab6504940ec92f72093665c --- firmware/App/Controllers/Valves.c (.../Valves.c) (revision 5a04a1445b684aedd199e0294311db468635c152) +++ firmware/App/Controllers/Valves.c (.../Valves.c) (revision 79a5884a9d7d6123dab6504940ec92f72093665c) @@ -683,7 +683,9 @@ valvesStatus[ valve ].hasValveBeenHomed = FALSE; valvesStatus[ valve ].hasHomingFailed = TRUE; state = VALVE_STATE_HOMING_NOT_STARTED; +#ifndef DISABLE_VALVE_ALARMS SET_ALARM_WITH_1_U32_DATA( ALARM_ID_HD_VALVE_HOMING_FAILED, (U32)valve ); +#endif } else { @@ -802,7 +804,9 @@ valvesStatus[ valve ].hasTransitionBeenRequested = FALSE; // Go back to Idle state state = VALVE_STATE_IDLE; +#ifndef DISABLE_VALVE_ALARMS SET_ALARM_WITH_1_U32_DATA( ALARM_ID_HD_VALVE_TRANSITION_TIMEOUT, (U32)valve ); +#endif } // Check if the valve is close to the temporary target position and if it is, assign the next target position else if ( abs( currentPosition - targetPosition ) < MAX_DEVIATION_FROM_TARGET_IN_COUNTS ) @@ -1049,7 +1053,9 @@ // Check if the current is over the threshold for the defined amount of time if ( valvesStatus[ valve ].overCurrentCounter > MAX_OVER_CURRENT_TIME_INTERVAL_COUNTER ) { +#ifndef DISABLE_VALVE_ALARMS SET_ALARM_WITH_2_F32_DATA( ALARM_ID_HD_VALVE_CURRENT_OUT_OF_RANGE, (F32)valve, current ); +#endif } // If the current is below the threshold again and the counter for the time is greater than else if ( current < VALVES_CURRENT_THRESHOLD_AMPS && @@ -1112,7 +1118,9 @@ if ( valvesStatus[ valve ].positionOutOfRangeCounter > MAX_POS_DEVIATION_TIME_INTERVAL_COUNTER ) { +#ifndef DISABLE_VALVE_ALARMS SET_ALARM_WITH_2_U32_DATA( ALARM_ID_HD_VALVE_POSITION_OUT_OF_RANGE, (U32)valve, currentPostion ); +#endif } else if ( abs( currentPostion - commandedPoistion ) < MAX_DEVIATION_FROM_TARGET_IN_COUNTS && valvesStatus[ valve ].positionOutOfRangeCounter > 0 )