Skip to content
Snippets Groups Projects
Commit 5d72fe22 authored by Florian Pose's avatar Florian Pose
Browse files

Cut off category data on exceeding eeprom size limit.

parent 66e25936
No related branches found
No related tags found
No related merge requests found
......@@ -408,6 +408,7 @@ void ec_fsm_slave_scan_state_eeprom_size(ec_fsm_slave_t *fsm /**< slave state ma
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 @@ void ec_fsm_slave_scan_state_eeprom_data(ec_fsm_slave_t *fsm /**< slave state ma
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",
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment