Limit expected working counter per ESC
Add one to the expected working counter per ESC/Slave, not for every syncmanager/fmmu. Use case, if the slave define more input/output syncmanager/fmmus it still only generate maximum working counter of 3 for a RW command. fixes 374pull/393/head
parent
7fe05b5b4b
commit
093311561c
|
@ -900,6 +900,7 @@ static void ecx_config_create_input_mappings(ecx_contextt *context, void *pIOmap
|
||||||
int ByteCount = 0;
|
int ByteCount = 0;
|
||||||
int FMMUsize = 0;
|
int FMMUsize = 0;
|
||||||
int FMMUdone = 0;
|
int FMMUdone = 0;
|
||||||
|
int AddToInputsWKC = 0;
|
||||||
uint8 SMc = 0;
|
uint8 SMc = 0;
|
||||||
uint16 EndAddr;
|
uint16 EndAddr;
|
||||||
uint16 SMlength;
|
uint16 SMlength;
|
||||||
|
@ -1002,8 +1003,9 @@ static void ecx_config_create_input_mappings(ecx_contextt *context, void *pIOmap
|
||||||
/* program FMMU for input */
|
/* program FMMU for input */
|
||||||
ecx_FPWR(context->port, configadr, ECT_REG_FMMU0 + (sizeof(ec_fmmut) * FMMUc),
|
ecx_FPWR(context->port, configadr, ECT_REG_FMMU0 + (sizeof(ec_fmmut) * FMMUc),
|
||||||
sizeof(ec_fmmut), &(context->slavelist[slave].FMMU[FMMUc]), EC_TIMEOUTRET3);
|
sizeof(ec_fmmut), &(context->slavelist[slave].FMMU[FMMUc]), EC_TIMEOUTRET3);
|
||||||
/* add one for an input FMMU */
|
/* Set flag to add one for an input FMMU,
|
||||||
context->grouplist[group].inputsWKC++;
|
a single ESC can only contribute once */
|
||||||
|
AddToInputsWKC = 1;
|
||||||
}
|
}
|
||||||
if (!context->slavelist[slave].inputs)
|
if (!context->slavelist[slave].inputs)
|
||||||
{
|
{
|
||||||
|
@ -1029,6 +1031,10 @@ static void ecx_config_create_input_mappings(ecx_contextt *context, void *pIOmap
|
||||||
FMMUc++;
|
FMMUc++;
|
||||||
}
|
}
|
||||||
context->slavelist[slave].FMMUunused = FMMUc;
|
context->slavelist[slave].FMMUunused = FMMUc;
|
||||||
|
|
||||||
|
/* Add one WKC for an input if flag is true */
|
||||||
|
if (AddToInputsWKC)
|
||||||
|
context->grouplist[group].inputsWKC++;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void ecx_config_create_output_mappings(ecx_contextt *context, void *pIOmap,
|
static void ecx_config_create_output_mappings(ecx_contextt *context, void *pIOmap,
|
||||||
|
@ -1038,6 +1044,7 @@ static void ecx_config_create_output_mappings(ecx_contextt *context, void *pIOma
|
||||||
int ByteCount = 0;
|
int ByteCount = 0;
|
||||||
int FMMUsize = 0;
|
int FMMUsize = 0;
|
||||||
int FMMUdone = 0;
|
int FMMUdone = 0;
|
||||||
|
int AddToOutputsWKC = 0;
|
||||||
uint8 SMc = 0;
|
uint8 SMc = 0;
|
||||||
uint16 EndAddr;
|
uint16 EndAddr;
|
||||||
uint16 SMlength;
|
uint16 SMlength;
|
||||||
|
@ -1126,13 +1133,18 @@ static void ecx_config_create_output_mappings(ecx_contextt *context, void *pIOma
|
||||||
*BitPos = 0;
|
*BitPos = 0;
|
||||||
}
|
}
|
||||||
FMMUdone += FMMUsize;
|
FMMUdone += FMMUsize;
|
||||||
context->slavelist[slave].FMMU[FMMUc].PhysStartBit = 0;
|
if (context->slavelist[slave].FMMU[FMMUc].LogLength)
|
||||||
context->slavelist[slave].FMMU[FMMUc].FMMUtype = 2;
|
{
|
||||||
context->slavelist[slave].FMMU[FMMUc].FMMUactive = 1;
|
context->slavelist[slave].FMMU[FMMUc].PhysStartBit = 0;
|
||||||
/* program FMMU for output */
|
context->slavelist[slave].FMMU[FMMUc].FMMUtype = 2;
|
||||||
ecx_FPWR(context->port, configadr, ECT_REG_FMMU0 + (sizeof(ec_fmmut) * FMMUc),
|
context->slavelist[slave].FMMU[FMMUc].FMMUactive = 1;
|
||||||
sizeof(ec_fmmut), &(context->slavelist[slave].FMMU[FMMUc]), EC_TIMEOUTRET3);
|
/* program FMMU for output */
|
||||||
context->grouplist[group].outputsWKC++;
|
ecx_FPWR(context->port, configadr, ECT_REG_FMMU0 + (sizeof(ec_fmmut) * FMMUc),
|
||||||
|
sizeof(ec_fmmut), &(context->slavelist[slave].FMMU[FMMUc]), EC_TIMEOUTRET3);
|
||||||
|
/* Set flag to add one for an output FMMU,
|
||||||
|
a single ESC can only contribute once */
|
||||||
|
AddToOutputsWKC = 1;
|
||||||
|
}
|
||||||
if (!context->slavelist[slave].outputs)
|
if (!context->slavelist[slave].outputs)
|
||||||
{
|
{
|
||||||
if (group)
|
if (group)
|
||||||
|
@ -1158,6 +1170,9 @@ static void ecx_config_create_output_mappings(ecx_contextt *context, void *pIOma
|
||||||
FMMUc++;
|
FMMUc++;
|
||||||
}
|
}
|
||||||
context->slavelist[slave].FMMUunused = FMMUc;
|
context->slavelist[slave].FMMUunused = FMMUc;
|
||||||
|
/* Add one WKC for an output if flag is true */
|
||||||
|
if (AddToOutputsWKC)
|
||||||
|
context->grouplist[group].outputsWKC++;
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Map all PDOs in one group of slaves to IOmap with Outputs/Inputs
|
/** Map all PDOs in one group of slaves to IOmap with Outputs/Inputs
|
||||||
|
|
Loading…
Reference in New Issue