Introduced EC_AL_STATE_CHANGE_TIMEOUT and set it to 2 s.
authorFlorian Pose <fp@igh-essen.com>
Tue, 05 May 2009 09:50:04 +0000
changeset 1445 45c5f5560274
parent 1444 45d64e8e3675
child 1446 85ea5af50175
Introduced EC_AL_STATE_CHANGE_TIMEOUT and set it to 2 s.
master/fsm_change.c
--- a/master/fsm_change.c	Tue May 05 09:45:31 2009 +0000
+++ b/master/fsm_change.c	Tue May 05 09:50:04 2009 +0000
@@ -40,6 +40,12 @@
 
 /*****************************************************************************/
 
+/** Timeout while waiting for AL state change [s].
+ */
+#define EC_AL_STATE_CHANGE_TIMEOUT 2
+
+/*****************************************************************************/
+
 void ec_fsm_change_state_start(ec_fsm_change_t *);
 void ec_fsm_change_state_check(ec_fsm_change_t *);
 void ec_fsm_change_state_status(ec_fsm_change_t *);
@@ -304,7 +310,8 @@
 
     // still old state
 
-    if (datagram->jiffies_received - fsm->jiffies_start >= HZ) { // 1s
+    if (datagram->jiffies_received - fsm->jiffies_start >=
+            EC_AL_STATE_CHANGE_TIMEOUT * HZ) {
         // timeout while checking
         char state_str[EC_STATE_STRING_SIZE];
         ec_state_string(fsm->requested_state, state_str, 0);
@@ -513,7 +520,8 @@
         return;
     }
 
-    if (datagram->jiffies_received - fsm->jiffies_start >= HZ) { // 1s
+    if (datagram->jiffies_received - fsm->jiffies_start >=
+            EC_AL_STATE_CHANGE_TIMEOUT * HZ) {
         // timeout while checking
         char state_str[EC_STATE_STRING_SIZE];
         ec_state_string(slave->current_state, state_str, 0);