diff --git a/examples/mini/mini.c b/examples/mini/mini.c index ce1ba9cb5176258b7d9bbb4732f543ebb9b8f76e..93373a22955afbdc1e5230f78a8e6cb97c112391 100644 --- a/examples/mini/mini.c +++ b/examples/mini/mini.c @@ -64,9 +64,19 @@ static void *r_outputs; #endif #ifdef MAPPING +const ec_pdo_entry_info_t el3162_channel1[] = { + {0x3101, 1, 8}, // status + {0x3101, 2, 16} // value +}; + +const ec_pdo_entry_info_t el3162_channel2[] = { + {0x3102, 1, 8}, // status + {0x3102, 2, 16} // value +}; + const ec_pdo_info_t mapping[] = { - {EC_DIR_INPUT, 0x1A00}, // channel 1 - {EC_DIR_INPUT, 0x1A01} // channel 2 + {EC_DIR_INPUT, 0x1A00, 2, el3162_channel1}, + {EC_DIR_INPUT, 0x1A01, 2, el3162_channel2}, }; #endif diff --git a/include/ecrt.h b/include/ecrt.h index 8344fcba5153a54630649eb8904f607204787218..e761ba010c191e8e3284b453e98d959c43f5d339 100644 --- a/include/ecrt.h +++ b/include/ecrt.h @@ -221,7 +221,9 @@ typedef struct { unsigned int n_entries; /**< Number of Pdo entries for the Pdo configuration. Zero means, that the default Pdo configuration shall be used. */ - const ec_pdo_entry_info_t entries[]; /**< Pdo configuration list. */ + const ec_pdo_entry_info_t *entries; /**< Pdo configuration array. This + array must contain at least \a + n_entries values. */ } ec_pdo_info_t; /*****************************************************************************/ diff --git a/master/pdo_mapping.c b/master/pdo_mapping.c index 7c6f383a07d54a36f4c0e9ac1b560cca2304b7ff..c0ae6dee52fee0fd331792f8857635c26e2a7d82 100644 --- a/master/pdo_mapping.c +++ b/master/pdo_mapping.c @@ -185,7 +185,7 @@ int ec_pdo_mapping_add_pdo_info( if (config->master->debug_level) EC_INFO("Adding Pdo 0x%04X to mapping.\n", pdo->index); - if (pdo_info->n_entries) { // Pdo configuration provided + if (pdo_info->n_entries && pdo_info->entries) { // configuration provided if (config->master->debug_level) EC_INFO(" Pdo configuration provided.\n");