FoE: fix state transition when busy during read. Not working.
--- 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;
}