#define EC_NODEOFFSET 0x1000
#define EC_TEMPNODE 0xffff
-int ecx_config_init(ecx_contextt *context, uint8 usetable);
+int ecx_config_init(ecx_contextt *context);
int ecx_config_map_group(ecx_contextt *context, void *pIOmap, uint8 group);
int ecx_recover_slave(ecx_contextt *context, uint16 slave, int timeout);
int ecx_reconfig_slave(ecx_contextt *context, uint16 slave, int timeout);
if (rv)
{
adapterisbound = 1;
- ecx_config_init(&ctx, FALSE);
+ ecx_config_init(&ctx);
if (ec_slavecount > 0)
{
conf_io_size = ecx_config_map_group(&ctx, &IOmap, 0);
printf("ecx_init on %s succeeded.\n", ifname);
/* find and auto-config slaves */
- if (ecx_config_init(&ctx, FALSE) > 0)
+ if (ecx_config_init(&ctx) > 0)
{
ecx_config_map_group(&ctx, &IOmap, 0);
printf("ecx_init on %s succeeded.\n", ifname);
/* find and auto-config slaves */
- if (ecx_config_init(&ctx, FALSE) > 0)
+ if (ecx_config_init(&ctx) > 0)
{
ecx_config_map_group(&ctx, &IOmap, 0);
printf("ecx_init on %s succeeded.\n", ifname);
/* find and auto-config slaves */
- if (ecx_config_init(&ctx, FALSE) > 0)
+ if (ecx_config_init(&ctx) > 0)
{
printf("%d slaves found and configured.\n", ec_slavecount);
printf("ecx_init on %s succeeded.\n", ifname);
/* find and auto-config slaves */
- if (ecx_config_init(&ctx, FALSE) > 0)
+ if (ecx_config_init(&ctx) > 0)
{
ecx_config_map_group(&ctx, &IOmap, 0);
printf("done\n");
printf("Finding autoconfig slaves... ");
- if (ecx_config_init(context, FALSE) <= 0)
+ if (ecx_config_init(context) <= 0)
{
printf("no slaves found\n");
return FALSE;
printf("ecx_init on %s succeeded.\n", ifname);
/* find and auto-config slaves */
- if (ecx_config_init(&ctx, FALSE) > 0)
+ if (ecx_config_init(&ctx) > 0)
{
ecx_config_map_group(&ctx, &IOmap, 0);
printf("ecx_init on %s succeeded.\n", ifname);
/* find and auto-config slaves */
- if (ecx_config_init(&ctx, FALSE) > 0)
+ if (ecx_config_init(&ctx) > 0)
{
ecx_config_map_group(&ctx, &IOmap, 0);
ecx_BWR(context->port, 0x0000, ECT_REG_EEPCFG, sizeof(b), &b, EC_TIMEOUTRET3); /* set Eeprom to master */
}
-static int ecx_config_from_table(ecx_contextt *context, uint16 slave)
-{
- (void)context;
- (void)slave;
- return 0;
-}
-
/* If slave has SII and same slave ID done before, use previous data.
* This is safe because SII is constant for same slave ID.
*/
/** Enumerate and init all slaves.
*
* @param[in] context = context struct
- * @param[in] usetable = TRUE when using configtable to init slaves, FALSE otherwise
* @return Workcounter of slave discover datagram = number of slaves found
*/
-int ecx_config_init(ecx_contextt *context, uint8 usetable)
+int ecx_config_init(ecx_contextt *context)
{
uint16 slave, ADPh, configadr, ssigen;
uint16 topology, estat;
uint8 b, h;
uint8 SMc;
uint32 eedat;
- int wkc, cindex, nSM;
+ int wkc, nSM;
uint16 val16;
- EC_PRINT("ec_config_init %d\n", usetable);
+ EC_PRINT("ec_config_init\n");
ecx_init_context(context);
wkc = ecx_detect_slaves(context);
if (wkc > 0)
eedat = ecx_readeeprom2(context, slave, EC_TIMEOUTEEP);
context->slavelist[slave].mbx_proto = (uint16)etohl(eedat);
}
- cindex = 0;
- /* use configuration table ? */
- if (usetable == 1)
- {
- cindex = ecx_config_from_table(context, slave);
- }
- /* slave not in configuration table, find out via SII */
- if (!cindex && !ecx_lookup_prev_sii(context, slave))
+ /* find configuration via SII */
+ if (!ecx_lookup_prev_sii(context, slave))
{
ssigen = ecx_siifind(context, slave, ECT_SII_GENERAL);
/* SII general section */