Fixes for big-endian hosts
parent
29df9ba013
commit
537145f6bf
|
@ -741,8 +741,8 @@ static int ecx_map_sm(ecx_contextt *context, uint16 slave)
|
||||||
sizeof(ec_smt), &(context->slavelist[slave].SM[0]), EC_TIMEOUTRET3);
|
sizeof(ec_smt), &(context->slavelist[slave].SM[0]), EC_TIMEOUTRET3);
|
||||||
EC_PRINT(" SM0 Type:%d StartAddr:%4.4x Flags:%8.8x\n",
|
EC_PRINT(" SM0 Type:%d StartAddr:%4.4x Flags:%8.8x\n",
|
||||||
context->slavelist[slave].SMtype[0],
|
context->slavelist[slave].SMtype[0],
|
||||||
context->slavelist[slave].SM[0].StartAddr,
|
etohs(context->slavelist[slave].SM[0].StartAddr),
|
||||||
context->slavelist[slave].SM[0].SMflags);
|
etohl(context->slavelist[slave].SM[0].SMflags));
|
||||||
}
|
}
|
||||||
if (!context->slavelist[slave].mbx_l && context->slavelist[slave].SM[1].StartAddr)
|
if (!context->slavelist[slave].mbx_l && context->slavelist[slave].SM[1].StartAddr)
|
||||||
{
|
{
|
||||||
|
@ -750,8 +750,8 @@ static int ecx_map_sm(ecx_contextt *context, uint16 slave)
|
||||||
sizeof(ec_smt), &context->slavelist[slave].SM[1], EC_TIMEOUTRET3);
|
sizeof(ec_smt), &context->slavelist[slave].SM[1], EC_TIMEOUTRET3);
|
||||||
EC_PRINT(" SM1 Type:%d StartAddr:%4.4x Flags:%8.8x\n",
|
EC_PRINT(" SM1 Type:%d StartAddr:%4.4x Flags:%8.8x\n",
|
||||||
context->slavelist[slave].SMtype[1],
|
context->slavelist[slave].SMtype[1],
|
||||||
context->slavelist[slave].SM[1].StartAddr,
|
etohs(context->slavelist[slave].SM[1].StartAddr),
|
||||||
context->slavelist[slave].SM[1].SMflags);
|
etohl(context->slavelist[slave].SM[1].SMflags));
|
||||||
}
|
}
|
||||||
/* program SM2 to SMx */
|
/* program SM2 to SMx */
|
||||||
for( nSM = 2 ; nSM < EC_MAXSM ; nSM++ )
|
for( nSM = 2 ; nSM < EC_MAXSM ; nSM++ )
|
||||||
|
@ -774,8 +774,8 @@ static int ecx_map_sm(ecx_contextt *context, uint16 slave)
|
||||||
sizeof(ec_smt), &context->slavelist[slave].SM[nSM], EC_TIMEOUTRET3);
|
sizeof(ec_smt), &context->slavelist[slave].SM[nSM], EC_TIMEOUTRET3);
|
||||||
EC_PRINT(" SM%d Type:%d StartAddr:%4.4x Flags:%8.8x\n", nSM,
|
EC_PRINT(" SM%d Type:%d StartAddr:%4.4x Flags:%8.8x\n", nSM,
|
||||||
context->slavelist[slave].SMtype[nSM],
|
context->slavelist[slave].SMtype[nSM],
|
||||||
context->slavelist[slave].SM[nSM].StartAddr,
|
etohs(context->slavelist[slave].SM[nSM].StartAddr),
|
||||||
context->slavelist[slave].SM[nSM].SMflags);
|
etohl(context->slavelist[slave].SM[nSM].SMflags));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (context->slavelist[slave].Ibits > 7)
|
if (context->slavelist[slave].Ibits > 7)
|
||||||
|
|
|
@ -233,7 +233,7 @@ int si_PDOassign(uint16 slave, uint16 PDOassign, int mapoffset, int bitoffset)
|
||||||
/* read PDO assign */
|
/* read PDO assign */
|
||||||
wkc = ec_SDOread(slave, PDOassign, (uint8)idxloop, FALSE, &rdl, &rdat, EC_TIMEOUTRXM);
|
wkc = ec_SDOread(slave, PDOassign, (uint8)idxloop, FALSE, &rdl, &rdat, EC_TIMEOUTRXM);
|
||||||
/* result is index of PDO */
|
/* result is index of PDO */
|
||||||
idx = etohl(rdat);
|
idx = etohs(rdat);
|
||||||
if (idx > 0)
|
if (idx > 0)
|
||||||
{
|
{
|
||||||
rdl = sizeof(subcnt); subcnt = 0;
|
rdl = sizeof(subcnt); subcnt = 0;
|
||||||
|
@ -558,14 +558,14 @@ void slaveinfo(char *ifname)
|
||||||
for(nSM = 0 ; nSM < EC_MAXSM ; nSM++)
|
for(nSM = 0 ; nSM < EC_MAXSM ; nSM++)
|
||||||
{
|
{
|
||||||
if(ec_slave[cnt].SM[nSM].StartAddr > 0)
|
if(ec_slave[cnt].SM[nSM].StartAddr > 0)
|
||||||
printf(" SM%1d A:%4.4x L:%4d F:%8.8x Type:%d\n",nSM, ec_slave[cnt].SM[nSM].StartAddr, ec_slave[cnt].SM[nSM].SMlength,
|
printf(" SM%1d A:%4.4x L:%4d F:%8.8x Type:%d\n",nSM, etohs(ec_slave[cnt].SM[nSM].StartAddr), etohs(ec_slave[cnt].SM[nSM].SMlength),
|
||||||
(int)ec_slave[cnt].SM[nSM].SMflags, ec_slave[cnt].SMtype[nSM]);
|
etohl(ec_slave[cnt].SM[nSM].SMflags), ec_slave[cnt].SMtype[nSM]);
|
||||||
}
|
}
|
||||||
for(j = 0 ; j < ec_slave[cnt].FMMUunused ; j++)
|
for(j = 0 ; j < ec_slave[cnt].FMMUunused ; j++)
|
||||||
{
|
{
|
||||||
printf(" FMMU%1d Ls:%8.8x Ll:%4d Lsb:%d Leb:%d Ps:%4.4x Psb:%d Ty:%2.2x Act:%2.2x\n", j,
|
printf(" FMMU%1d Ls:%8.8x Ll:%4d Lsb:%d Leb:%d Ps:%4.4x Psb:%d Ty:%2.2x Act:%2.2x\n", j,
|
||||||
(int)ec_slave[cnt].FMMU[j].LogStart, ec_slave[cnt].FMMU[j].LogLength, ec_slave[cnt].FMMU[j].LogStartbit,
|
etohl(ec_slave[cnt].FMMU[j].LogStart), etohs(ec_slave[cnt].FMMU[j].LogLength), ec_slave[cnt].FMMU[j].LogStartbit,
|
||||||
ec_slave[cnt].FMMU[j].LogEndbit, ec_slave[cnt].FMMU[j].PhysStart, ec_slave[cnt].FMMU[j].PhysStartBit,
|
ec_slave[cnt].FMMU[j].LogEndbit, etohs(ec_slave[cnt].FMMU[j].PhysStart), ec_slave[cnt].FMMU[j].PhysStartBit,
|
||||||
ec_slave[cnt].FMMU[j].FMMUtype, ec_slave[cnt].FMMU[j].FMMUactive);
|
ec_slave[cnt].FMMU[j].FMMUtype, ec_slave[cnt].FMMU[j].FMMUactive);
|
||||||
}
|
}
|
||||||
printf(" FMMUfunc 0:%d 1:%d 2:%d 3:%d\n",
|
printf(" FMMUfunc 0:%d 1:%d 2:%d 3:%d\n",
|
||||||
|
|
Loading…
Reference in New Issue