Fixed AL status code lookup.
This commit is contained in:
parent
0aab87469e
commit
3fe3f0b987
|
|
@ -1,6 +1,6 @@
|
|||
/******************************************************************************
|
||||
*
|
||||
* $Id$
|
||||
* $Id: fsm_change.c,v 37a25c76987b 2011/12/16 10:42:55 fp $
|
||||
*
|
||||
* Copyright (C) 2006-2008 Florian Pose, Ingenieurgemeinschaft IgH
|
||||
*
|
||||
|
|
@ -428,14 +428,18 @@ void ec_fsm_change_state_code(ec_fsm_change_t *fsm
|
|||
} else {
|
||||
code = EC_READ_U16(datagram->data);
|
||||
for (al_msg = al_status_messages; al_msg->code != 0xffff; al_msg++) {
|
||||
if (al_msg->code != code) continue;
|
||||
if (al_msg->code != code) {
|
||||
continue;
|
||||
}
|
||||
|
||||
EC_SLAVE_ERR(fsm->slave, "AL status message 0x%04X: \"%s\".\n",
|
||||
al_msg->code, al_msg->message);
|
||||
break;
|
||||
}
|
||||
if (!al_msg->code)
|
||||
if (al_msg->code == 0xffff) { /* not found in our list. */
|
||||
EC_SLAVE_ERR(fsm->slave, "Unknown AL status code 0x%04X.\n",
|
||||
code);
|
||||
}
|
||||
}
|
||||
|
||||
// acknowledge "old" slave state
|
||||
|
|
|
|||
Loading…
Reference in New Issue