diff --git a/master/pdo_list.c b/master/pdo_list.c index 22694b02cac4f6e75f34796f9ed4ed25198a0814..28fa1b520e4d6f8abd9a3ff083725a41cc529899 100644 --- a/master/pdo_list.c +++ b/master/pdo_list.c @@ -318,3 +318,20 @@ unsigned int ec_pdo_list_count( } /*****************************************************************************/ + +/** Outputs the Pdos in the list. + */ +void ec_pdo_list_print( + const ec_pdo_list_t *pl /**< Pdo list. */ + ) +{ + const ec_pdo_t *pdo; + + list_for_each_entry(pdo, &pl->list, list) { + printk("0x%04X", pdo->index); + if (pdo->list.next != &pl->list) + printk(" "); + } +} + +/*****************************************************************************/ diff --git a/master/pdo_list.h b/master/pdo_list.h index 99154c76cba394dcc4f489639352ae39f5702cc9..e050051f0f0d57bf227ff3bd3a1219f2fa41117b 100644 --- a/master/pdo_list.h +++ b/master/pdo_list.h @@ -79,6 +79,8 @@ const ec_pdo_t *ec_pdo_list_find_pdo_by_pos_const( const ec_pdo_list_t *, unsigned int); unsigned int ec_pdo_list_count(const ec_pdo_list_t *); +void ec_pdo_list_print(const ec_pdo_list_t *); + /*****************************************************************************/ #endif