Fixed Pdo configuration information providing.

This commit is contained in:
Florian Pose 2008-02-19 09:21:13 +00:00
parent 6189092aed
commit b955b2d529
3 changed files with 16 additions and 4 deletions

View File

@ -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

View File

@ -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;
/*****************************************************************************/

View File

@ -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");