Index: firmware/App/Controllers/Valves.c =================================================================== diff -u -rc539499ea2dee6d62194d573ac93b313d9e2936d -r6b870cd0699bb3ee22b93981d51373a6c2d56162 --- firmware/App/Controllers/Valves.c (.../Valves.c) (revision c539499ea2dee6d62194d573ac93b313d9e2936d) +++ firmware/App/Controllers/Valves.c (.../Valves.c) (revision 6b870cd0699bb3ee22b93981d51373a6c2d56162) @@ -86,13 +86,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