Cut off category data on exceeding eeprom size limit.
--- a/master/fsm_slave.c Fri Dec 21 16:12:30 2007 +0000
+++ b/master/fsm_slave.c Tue Jan 08 15:18:30 2008 +0000
@@ -408,6 +408,7 @@
EC_WARN("EEPROM size of slave %i exceeds"
" %u words (0xffff limiter missing?).\n",
slave->ring_position, EC_MAX_EEPROM_SIZE);
+ // cut off category data...
slave->eeprom_size = EC_FIRST_EEPROM_CATEGORY_OFFSET * 2;
goto alloc_eeprom;
}
@@ -509,6 +510,12 @@
slave->sii_mailbox_protocols =
EC_READ_U16(slave->eeprom_data + 2 * 0x001C);
+ if (eeprom_word_size == EC_FIRST_EEPROM_CATEGORY_OFFSET) {
+ // eeprom does not contain category data
+ fsm->state = ec_fsm_slave_state_end;
+ return;
+ }
+
if (eeprom_word_size < EC_FIRST_EEPROM_CATEGORY_OFFSET + 1) {
EC_ERR("Unexpected end of EEPROM data in slave %u:"
" First category header missing.\n",