From 66a3631434c77798a8ac760d0b0af656e2401e02 Mon Sep 17 00:00:00 2001 From: Florian Pose <fp@igh-essen.com> Date: Mon, 23 Jun 2008 10:27:40 +0000 Subject: [PATCH] Added ec_pdo_list_print(). --- master/pdo_list.c | 17 +++++++++++++++++ master/pdo_list.h | 2 ++ 2 files changed, 19 insertions(+) diff --git a/master/pdo_list.c b/master/pdo_list.c index 22694b02..28fa1b52 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 99154c76..e050051f 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 -- GitLab