Fixed FoE timeout calculation bug.
This commit is contained in:
parent
b8d541fd33
commit
a0e44766ec
6
NEWS
6
NEWS
|
|
@ -6,7 +6,11 @@ vim: spelllang=en spell tw=78
|
|||
|
||||
-------------------------------------------------------------------------------
|
||||
|
||||
Changes since 1.5.1:
|
||||
Changes since 1.5.2:
|
||||
|
||||
* Fixed FoE timeout calculation bug.
|
||||
|
||||
Changes in 1.5.2:
|
||||
|
||||
* API extensions (find the complete description in include/ecrt.h)
|
||||
* Added redundancy features; enable using --with-devices.
|
||||
|
|
|
|||
|
|
@ -370,8 +370,8 @@ void ec_fsm_foe_state_ack_check(
|
|||
|
||||
if (!ec_slave_mbox_check(fsm->datagram)) {
|
||||
// slave did not put anything in the mailbox yet
|
||||
unsigned long diff_ms =
|
||||
(datagram->jiffies_received - fsm->jiffies_start) * 1000 / HZ;
|
||||
unsigned long diff_ms = (fsm->datagram->jiffies_received -
|
||||
fsm->jiffies_start) * 1000 / HZ;
|
||||
if (diff_ms >= EC_FSM_FOE_TIMEOUT) {
|
||||
ec_foe_set_tx_error(fsm, FOE_TIMEOUT_ERROR);
|
||||
EC_SLAVE_ERR(slave, "Timeout while waiting for ack response.\n");
|
||||
|
|
@ -709,9 +709,8 @@ void ec_fsm_foe_state_data_check(
|
|||
}
|
||||
|
||||
if (!ec_slave_mbox_check(fsm->datagram)) {
|
||||
unsigned long diff_ms =
|
||||
(fsm->datagram->jiffies_received - fsm->jiffies_start) *
|
||||
1000 / HZ;
|
||||
unsigned long diff_ms = (fsm->datagram->jiffies_received -
|
||||
fsm->jiffies_start) * 1000 / HZ;
|
||||
if (diff_ms >= EC_FSM_FOE_TIMEOUT) {
|
||||
ec_foe_set_tx_error(fsm, FOE_TIMEOUT_ERROR);
|
||||
EC_SLAVE_ERR(slave, "Timeout while waiting for ack response.\n");
|
||||
|
|
|
|||
Loading…
Reference in New Issue