equal
deleted
inserted
replaced
805 } |
805 } |
806 domain_offset += domain->data_size; |
806 domain_offset += domain->data_size; |
807 } |
807 } |
808 |
808 |
809 // Slaves aktivieren |
809 // Slaves aktivieren |
810 for (i = 0; i < master->slave_count; i++) |
810 for (i = 0; i < master->slave_count; i++) { |
811 { |
|
812 slave = master->slaves + i; |
811 slave = master->slaves + i; |
813 |
812 |
814 // Change state to INIT |
813 // Change state to INIT |
815 if (unlikely(ec_slave_state_change(slave, EC_SLAVE_STATE_INIT))) |
814 if (unlikely(ec_slave_state_change(slave, EC_SLAVE_STATE_INIT))) |
816 return -1; |
815 return -1; |
850 |
849 |
851 // Set Sync Managers |
850 // Set Sync Managers |
852 |
851 |
853 // Known slave type, take type's SM information |
852 // Known slave type, take type's SM information |
854 if (type) { |
853 if (type) { |
855 for (j = 0; type->sync_managers[j] && j < EC_MAX_SYNC; j++) |
854 for (j = 0; type->sync_managers[j] && j < EC_MAX_SYNC; j++) { |
856 { |
|
857 sync = type->sync_managers[j]; |
855 sync = type->sync_managers[j]; |
858 if (ec_command_npwr(command, slave->station_address, |
856 if (ec_command_npwr(command, slave->station_address, |
859 0x0800 + j * EC_SYNC_SIZE, EC_SYNC_SIZE)) |
857 0x0800 + j * EC_SYNC_SIZE, EC_SYNC_SIZE)) |
860 return -1; |
858 return -1; |
861 ec_sync_config(sync, command->data); |
859 ec_sync_config(sync, command->data); |
934 EC_WARN("Slave %i was not registered!\n", slave->ring_position); |
932 EC_WARN("Slave %i was not registered!\n", slave->ring_position); |
935 continue; |
933 continue; |
936 } |
934 } |
937 |
935 |
938 // Set FMMUs |
936 // Set FMMUs |
939 for (j = 0; j < slave->fmmu_count; j++) |
937 for (j = 0; j < slave->fmmu_count; j++) { |
940 { |
|
941 fmmu = &slave->fmmus[j]; |
938 fmmu = &slave->fmmus[j]; |
942 if (ec_command_npwr(command, slave->station_address, |
939 if (ec_command_npwr(command, slave->station_address, |
943 0x0600 + j * EC_FMMU_SIZE, EC_FMMU_SIZE)) |
940 0x0600 + j * EC_FMMU_SIZE, EC_FMMU_SIZE)) |
944 return -1; |
941 return -1; |
945 ec_fmmu_config(fmmu, command->data); |
942 ec_fmmu_config(fmmu, command->data); |