Bugfix: ecrt_domain_state() always returned -1.
This commit is contained in:
parent
08dabebba4
commit
b662560ff2
|
|
@ -515,10 +515,14 @@ void ecrt_domain_process(ec_domain_t *domain /**< EtherCAT domain */)
|
|||
ec_datagram_t *datagram;
|
||||
|
||||
working_counter_sum = 0;
|
||||
domain->state = 0;
|
||||
list_for_each_entry(datagram, &domain->datagrams, list) {
|
||||
if (datagram->state == EC_DATAGRAM_RECEIVED) {
|
||||
working_counter_sum += datagram->working_counter;
|
||||
}
|
||||
else {
|
||||
domain->state = -1;
|
||||
}
|
||||
}
|
||||
|
||||
if (working_counter_sum != domain->response_count) {
|
||||
|
|
@ -554,13 +558,7 @@ void ecrt_domain_process(ec_domain_t *domain /**< EtherCAT domain */)
|
|||
|
||||
int ecrt_domain_state(const ec_domain_t *domain /**< EtherCAT domain */)
|
||||
{
|
||||
ec_datagram_t *datagram;
|
||||
|
||||
list_for_each_entry(datagram, &domain->datagrams, list) {
|
||||
if (datagram->state != EC_DATAGRAM_RECEIVED) return -1;
|
||||
}
|
||||
|
||||
return 0;
|
||||
return domain->state;
|
||||
}
|
||||
|
||||
/*****************************************************************************/
|
||||
|
|
|
|||
|
|
@ -66,6 +66,7 @@ struct ec_domain
|
|||
struct list_head datagrams; /**< process data datagrams */
|
||||
uint32_t base_address; /**< logical offset address of the process data */
|
||||
unsigned int response_count; /**< number of responding slaves */
|
||||
unsigned int state; /**< domain error state */
|
||||
struct list_head data_regs; /**< PDO data registrations */
|
||||
unsigned int working_counter_changes; /**< working counter changes
|
||||
since last notification */
|
||||
|
|
|
|||
Loading…
Reference in New Issue