FoE: fix state transition when busy during read. Not working.
author"Dave Page <dave.page@gleeble.com>"
Wed, 22 Jan 2014 13:00:52 +1300
changeset 2602 66a4df6c9ffa
parent 2601 9b36a16271e6
child 2603 d366b909b486
FoE: fix state transition when busy during read. Not working.
master/fsm_foe.c
--- a/master/fsm_foe.c	Mon Dec 16 14:18:30 2013 -0500
+++ b/master/fsm_foe.c	Wed Jan 22 13:00:52 2014 +1300
@@ -54,7 +54,7 @@
 // uint8_t  reserved
 // uint32_t PacketNo, Password, ErrorCode
 
-//#define DEBUG_FOE
+#define DEBUG_FOE
 
 /*****************************************************************************/
 
@@ -774,6 +774,7 @@
         if (ec_foe_prepare_send_ack(fsm, datagram)) {
             ec_foe_set_rx_error(fsm, FOE_PROT_ERROR);
         }
+        fsm->state = ec_fsm_foe_state_sent_ack;
         return;
     }
 
@@ -886,7 +887,7 @@
         fsm->state = ec_fsm_foe_end;
     }
     else {
-        fsm->rx_expected_packet_no++;
+        fsm->rx_expected_packet_no++; // this should not be incremented when BUSY
         fsm->retries = EC_FSM_RETRIES;
         fsm->state = ec_fsm_foe_state_data_check;
     }