Index: firmware/App/Controllers/Valves.c =================================================================== diff -u -r2f1cd6becf82299dd06be00ec9881e4a64d817a6 -r27f3db92495948d4c1192421c1b0c20338c4a034 --- firmware/App/Controllers/Valves.c (.../Valves.c) (revision 2f1cd6becf82299dd06be00ec9881e4a64d817a6) +++ firmware/App/Controllers/Valves.c (.../Valves.c) (revision 27f3db92495948d4c1192421c1b0c20338c4a034) @@ -87,13 +87,17 @@ #define MAX_DEVIATION_FROM_TARGET_IN_COUNTS 150 ///< Maximum deviation from target in counts #define MAX_DEVIATION_FROM_TRAGET_IN_POS_B 1000 ///< Maximum allowed deviation from position B in counts #define MAX_ALLOWED_FAILED_HOMINGS 3U ///< Maximum allowed failed homings -#define HOMING_EDGE_DETECTION_TIME_INTERVAL ( MS_PER_SECOND / ( 2 * TASK_PRIORITY_INTERVAL ) ) ///< The time that the valve must be at the edge to be considered for edge detection +/// The time that the valve must be at the edge to be considered for edge detection +static const U32 HOMING_EDGE_DETECTION_TIME_INTERVAL = ( MS_PER_SECOND / ( 2 * TASK_PRIORITY_INTERVAL ) ); #define VALVES_CURRENT_THRESHOLD_AMPS 1.0 ///< Valves current threshold -#define MAX_OVER_CURRENT_TIME_INTERVAL_COUNTER ( MS_PER_SECOND / ( TASK_PRIORITY_INTERVAL ) ) ///< Valves over current time interval counter -#define MAX_POS_DEVIATION_TIME_INTERVAL_COUNTER ( MS_PER_SECOND / ( TASK_PRIORITY_INTERVAL ) ) ///< Valves out of range time interval counter +/// Valves over current time interval counter +static const U32 MAX_OVER_CURRENT_TIME_INTERVAL_COUNTER = ( MS_PER_SECOND / ( TASK_PRIORITY_INTERVAL ) ); +/// Valves out of range time interval counter +static const U32 MAX_POS_DEVIATION_TIME_INTERVAL_COUNTER = ( MS_PER_SECOND / ( TASK_PRIORITY_INTERVAL ) ); #define VALVE_TRANSITION_TIMEOUT_MS 3000U ///< Valves transition time out in ms -#define VALVES_DATA_PUB_INTERVAL ( MS_PER_SECOND / TASK_PRIORITY_INTERVAL ) ///< Valve data publication time interval +/// Valve data publication time interval +#define VALVES_DATA_PUB_INTERVAL ( MS_PER_SECOND / TASK_PRIORITY_INTERVAL ) #define VALVE_MAX_ALLOWED_PWM_PERCENT 100U ///< Valve maximum allowed PWM in percent #define VALVE_CW_PWM_TO_CNT_CONVERSION( pwm ) ( ( 20 * pwm ) + 2500 ) ///< Valve clockwise PWM to count conversion @@ -964,6 +968,7 @@ BOOL result = TRUE; #ifndef DISABLE_3WAY_VALVES +#ifndef DISABLE_VALVE_ALARMS // Get the status of the valves from FPGA U16 status = getFPGAValvesStatus(); @@ -1009,6 +1014,7 @@ } } #endif +#endif return result; }