Add reference to objectlist in SM mappings
Rationale, users might need more info on what object it is that is mapped. Having a reference to objectlist enable the user to know what index it is and got a reference to the entire object. The obj only know what subindex it is. fixes #137pull/138/head
parent
a7a017c26f
commit
4968a49ceb
|
@ -202,6 +202,15 @@ uint16_t sizeOfPDO (uint16_t index, int * nmappings, _SMmap * mappings,
|
|||
}
|
||||
|
||||
mappings[mapIx].obj = mapping;
|
||||
/* Save object list reference */
|
||||
if(mapping != NULL)
|
||||
{
|
||||
mappings[mapIx].objectlistitem = &SDOobjects[nidx];
|
||||
}
|
||||
else
|
||||
{
|
||||
mappings[mapIx].objectlistitem = NULL;
|
||||
}
|
||||
mappings[mapIx++].offset = offset;
|
||||
}
|
||||
|
||||
|
|
|
@ -41,6 +41,7 @@ CC_PACKED_END
|
|||
typedef struct
|
||||
{
|
||||
const _objd * obj;
|
||||
const _objectlist * objectlistitem;
|
||||
uint16_t offset;
|
||||
} _SMmap;
|
||||
|
||||
|
|
Loading…
Reference in New Issue