Fixed skipped datagrams when not in FSM idle phase.
authorFlorian Pose <fp@igh-essen.com>
Mon, 12 Mar 2007 13:59:06 +0000
changeset 651 8c11399cc911
parent 650 c68995623e94
child 652 15cff76b66c7
Fixed skipped datagrams when not in FSM idle phase.
master/master.c
--- a/master/master.c	Mon Mar 12 12:11:43 2007 +0000
+++ b/master/master.c	Mon Mar 12 13:59:06 2007 +0000
@@ -821,6 +821,9 @@
             spin_unlock_bh(&master->internal_lock);
         }
 
+        if (master->fsm_datagram.state == EC_DATAGRAM_SENT)
+            goto schedule;
+
         // execute master state machine
         if (ec_fsm_master_exec(&master->fsm)) {
             // queue and send
@@ -836,6 +839,7 @@
         master->idle_cycle_time_pos++;
         master->idle_cycle_time_pos %= HZ;
 
+schedule:
         if (ec_fsm_master_idle(&master->fsm)) {
             set_current_state(TASK_INTERRUPTIBLE);
             schedule_timeout(1);