rtlabs-com/c-open

Standard RPDO padding not possible

nattgris opened this issue · 2 comments

It seems standard RPDO padding between mappings as per CiA 301 §7.4.7.1 is not implemented.

For static mappings I guess you could work around it by defining objects like

	{0x0005, OTYPE_DEFTYPE,0,               OD0005, NULL},

with

static uint8_t dummy;

/* Entry descriptor for UNSIGNED8 (0005h) */
static const co_entry_t OD0005[] = {
	{0x00, OD_WO | OD_TRANSIENT | OD_RPDO, DTYPE_UNSIGNED8, 8, 0, &dummy},
};

However to support dynamic mappings you'd basically have to do this for all integer types for all slaves, because you don't know what mapping the master may set up. Seems better if that was built into the stack.

Agreed, padding using the static data types should be possible.

This PR adds support for padding. The CiA spec mentions padding for RPDO:s only, this PR would make it possible add padding into TPDO:s as well. It also doesn't validate the bitlength against the datatypes, as it seems useful to be able to e.g. pad 7 bits using a BOOLEAN datatype.