Fixed AL status code lookup.
--- a/master/fsm_change.c Tue Sep 04 14:19:06 2012 +0200
+++ b/master/fsm_change.c Mon Aug 06 14:18:05 2012 +0200
@@ -428,14 +428,18 @@
} 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