implemnted el6900 support and fsoe transport
This commit is contained in:
@@ -165,8 +165,7 @@ static const lcec_typelist_t types[] = {
|
||||
{ lcecSlaveTypeEL9515, LCEC_EL95xx_VID, LCEC_EL9515_PID, LCEC_EL95xx_PDOS, lcec_el95xx_init},
|
||||
|
||||
// FSoE devices
|
||||
// TODO: PDO count
|
||||
{ lcecSlaveTypeEL6900, LCEC_EL6900_VID, LCEC_EL6900_PID, -1, lcec_el6900_init},
|
||||
{ lcecSlaveTypeEL6900, LCEC_EL6900_VID, LCEC_EL6900_PID, LCEC_EL6900_PDOS, lcec_el6900_init},
|
||||
{ lcecSlaveTypeEL1904, LCEC_EL1904_VID, LCEC_EL1904_PID, LCEC_EL1904_PDOS, lcec_el1904_init},
|
||||
{ lcecSlaveTypeEL2904, LCEC_EL2904_VID, LCEC_EL2904_PID, LCEC_EL2904_PDOS, lcec_el2904_init},
|
||||
|
||||
@@ -619,11 +618,7 @@ int lcec_parse_config(void) {
|
||||
// normal slave
|
||||
slave->vid = type->vid;
|
||||
slave->pid = type->pid;
|
||||
if (type->pdo_entry_count >= 0) {
|
||||
slave->pdo_entry_count = type->pdo_entry_count;
|
||||
} else {
|
||||
slave->pdo_entry_count = slave_conf->pdoMappingCount;
|
||||
}
|
||||
slave->pdo_entry_count = type->pdo_entry_count + slave_conf->pdoMappingCount;
|
||||
slave->proc_init = type->proc_init;
|
||||
} else {
|
||||
// generic slave
|
||||
@@ -702,8 +697,6 @@ int lcec_parse_config(void) {
|
||||
slave->modparams = modparams;
|
||||
slave->dc_conf = NULL;
|
||||
slave->wd_conf = NULL;
|
||||
slave->fsoe_slave_offset = -1;
|
||||
slave->fsoe_master_offset = -1;
|
||||
|
||||
// update master's POD entry count
|
||||
master->pdo_entry_count += slave->pdo_entry_count;
|
||||
@@ -1544,3 +1537,28 @@ LCEC_CONF_MODPARAM_VAL_T *lcec_modparam_get(struct lcec_slave *slave, int id) {
|
||||
return NULL;
|
||||
}
|
||||
|
||||
lcec_slave_t *lcec_slave_by_index(struct lcec_master *master, int index) {
|
||||
lcec_slave_t *slave;
|
||||
|
||||
for (slave = master->first_slave; slave != NULL; slave = slave->next) {
|
||||
if (slave->index == index) {
|
||||
return slave;
|
||||
}
|
||||
}
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
||||
void copy_fsoe_data(struct lcec_slave *slave, unsigned int slave_offset, unsigned int master_offset) {
|
||||
lcec_master_t *master = slave->master;
|
||||
uint8_t *pd = master->process_data;
|
||||
|
||||
if (slave->fsoe_slave_offset != NULL) {
|
||||
memcpy(&pd[*(slave->fsoe_slave_offset)], &pd[slave_offset], LCEC_FSOE_MSG_LEN);
|
||||
}
|
||||
|
||||
if (slave->fsoe_master_offset != NULL) {
|
||||
memcpy(&pd[master_offset], &pd[*(slave->fsoe_master_offset)], LCEC_FSOE_MSG_LEN);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user