lib/slave_config.c
branchstable-1.5
changeset 2665 2de506e60b21
parent 2655 a5c9005fe7a8
--- a/lib/slave_config.c	Thu Jun 09 13:52:22 2016 +0200
+++ b/lib/slave_config.c	Fri Jan 13 16:47:27 2017 +0100
@@ -232,8 +232,9 @@
         if (ret)
             return ret;
 
+        ecrt_slave_config_pdo_assign_clear(sc, sync_info->index);
+
         if (sync_info->n_pdos && sync_info->pdos) {
-            ecrt_slave_config_pdo_assign_clear(sc, sync_info->index);
 
             for (j = 0; j < sync_info->n_pdos; j++) {
                 pdo_info = &sync_info->pdos[j];
@@ -243,9 +244,9 @@
                 if (ret)
                     return ret;
 
+                ecrt_slave_config_pdo_mapping_clear(sc, pdo_info->index);
+
                 if (pdo_info->n_entries && pdo_info->entries) {
-                    ecrt_slave_config_pdo_mapping_clear(sc, pdo_info->index);
-
                     for (k = 0; k < pdo_info->n_entries; k++) {
                         entry_info = &pdo_info->entries[k];