Output watchdog configuration in ethercat config.
authorFlorian Pose <fp@igh-essen.com>
Tue, 04 Aug 2009 12:52:12 +0000
changeset 1518 ab5694a51826
parent 1517 b99f2f9cb73f
child 1519 75629ad02ca9
Output watchdog configuration in ethercat config.
master/cdev.c
tool/CommandConfig.cpp
--- a/master/cdev.c	Tue Aug 04 09:10:16 2009 +0000
+++ b/master/cdev.c	Tue Aug 04 12:52:12 2009 +0000
@@ -1258,9 +1258,12 @@
     data.product_code = sc->product_code;
     for (i = 0; i < EC_MAX_SYNC_MANAGERS; i++) {
         data.syncs[i].dir = sc->sync_configs[i].dir;
+        data.syncs[i].watchdog_mode = sc->sync_configs[i].watchdog_mode;
         data.syncs[i].pdo_count =
             ec_pdo_list_count(&sc->sync_configs[i].pdos);
     }
+    data.watchdog_divider = sc->watchdog_divider;
+    data.watchdog_intervals = sc->watchdog_intervals;
     data.sdo_count = ec_slave_config_sdo_count(sc);
     data.slave_position = sc->slave ? sc->slave->ring_position : -1;
     data.dc_assign_activate = sc->dc_assign_activate;
--- a/tool/CommandConfig.cpp	Tue Aug 04 09:10:16 2009 +0000
+++ b/tool/CommandConfig.cpp	Tue Aug 04 12:52:12 2009 +0000
@@ -159,11 +159,34 @@
             cout << "none" << endl;
         }
 
+        cout << "Watchdog Divider: ";
+        if (configIter->watchdog_divider) {
+            cout << dec << configIter->watchdog_divider;
+        } else {
+            cout << "default";
+        }
+        cout << endl
+            << "Watchdog Intervals: ";
+        if (configIter->watchdog_intervals) {
+            cout << dec << configIter->watchdog_intervals;
+        } else {
+            cout << "default";
+        }
+        cout << endl;
+
         for (j = 0; j < EC_MAX_SYNC_MANAGERS; j++) {
             if (configIter->syncs[j].pdo_count) {
-                cout << "SM" << dec << j << " ("
+                cout << "SM" << dec << j << ", Dir: "
                     << (configIter->syncs[j].dir == EC_DIR_INPUT
-                            ? "Input" : "Output") << ")" << endl;
+                            ? "Input" : "Output") << ", Watchdog: ";
+                switch (configIter->syncs[j].watchdog_mode) {
+                    case EC_WD_DEFAULT: cout << "Default"; break;
+                    case EC_WD_ENABLE: cout << "Enable"; break;
+                    case EC_WD_DISABLE: cout << "Disable"; break;
+                    default: cout << "???"; break;
+                }
+                cout << endl;
+
                 for (k = 0; k < configIter->syncs[j].pdo_count; k++) {
                     m.getConfigPdo(&pdo, configIter->config_index, j, k);