Use callback also when data is NULL
Change-Id: Id75f52772dfb80fc6802a7a9e252e9f3fc2f33f0pull/80/head
parent
bdea958dd5
commit
6eedcb7cdf
|
@ -296,26 +296,28 @@ void SDO_upload (void)
|
||||||
/* expedited response i.e. length<=4 bytes */
|
/* expedited response i.e. length<=4 bytes */
|
||||||
coeres->command = COE_COMMAND_UPLOADRESPONSE +
|
coeres->command = COE_COMMAND_UPLOADRESPONSE +
|
||||||
COE_SIZE_INDICATOR + COE_EXPEDITED_INDICATOR + dss;
|
COE_SIZE_INDICATOR + COE_EXPEDITED_INDICATOR + dss;
|
||||||
if ((objd + nsub)->data == NULL)
|
/* convert bits to bytes */
|
||||||
|
size = BITS2BYTES(size);
|
||||||
|
void *dataptr = ((objd + nsub)->data) ?
|
||||||
|
(objd + nsub)->data : (void *)&((objd + nsub)->value);
|
||||||
|
abort = ESC_upload_pre_objecthandler (index, subindex,
|
||||||
|
dataptr, size, (objd + nsub)->flags);
|
||||||
|
if (abort == 0)
|
||||||
{
|
{
|
||||||
/* use constant value */
|
if ((objd + nsub)->data == NULL)
|
||||||
coeres->size = htoel ((objd + nsub)->value);
|
{
|
||||||
}
|
/* use constant value */
|
||||||
else
|
coeres->size = htoel ((objd + nsub)->value);
|
||||||
{
|
}
|
||||||
/* convert bits to bytes */
|
else
|
||||||
size = BITS2BYTES(size);
|
|
||||||
abort = ESC_upload_pre_objecthandler (index, subindex,
|
|
||||||
(objd + nsub)->data, size, (objd + nsub)->flags);
|
|
||||||
if (abort == 0)
|
|
||||||
{
|
{
|
||||||
/* use dynamic data */
|
/* use dynamic data */
|
||||||
copy2mbx ((objd + nsub)->data, &(coeres->size), size);
|
copy2mbx ((objd + nsub)->data, &(coeres->size), size);
|
||||||
}
|
}
|
||||||
else
|
}
|
||||||
{
|
else
|
||||||
SDO_abort (index, subindex, abort);
|
{
|
||||||
}
|
SDO_abort (index, subindex, abort);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
|
Loading…
Reference in New Issue