master/domain.c
branchstable-1.1
changeset 1719 42ed27ae6785
parent 1717 cc1ee18207d3
child 1724 07c82e520ddd
--- a/master/domain.c	Wed Aug 09 15:14:29 2006 +0000
+++ b/master/domain.c	Fri Sep 01 12:35:41 2006 +0000
@@ -106,7 +106,7 @@
     domain->data_size = 0;
     domain->base_address = 0;
     domain->response_count = 0xFFFFFFFF;
-    domain->t_last = 0;
+    domain->notify_jiffies = 0;
     domain->working_counter_changes = 0;
 
     INIT_LIST_HEAD(&domain->data_regs);
@@ -193,7 +193,7 @@
     list_for_each_entry(other_pdo, &slave->sii_pdos, list) {
         if (other_pdo->sync_index != sync->index) continue;
 
-        list_for_each_entry(other_entry, &pdo->entries, list) {
+        list_for_each_entry(other_entry, &other_pdo->entries, list) {
             if (other_entry == entry) {
                 byte_offset = bit_offset / 8;
                 break;
@@ -513,7 +513,6 @@
 {
     unsigned int working_counter_sum;
     ec_datagram_t *datagram;
-    cycles_t t_now = get_cycles();
 
     working_counter_sum = 0;
     list_for_each_entry(datagram, &domain->datagrams, list) {
@@ -528,8 +527,8 @@
     }
 
     if (domain->working_counter_changes &&
-        (u32) (t_now - domain->t_last) / cpu_khz > 1000) {
-        domain->t_last = t_now;
+        jiffies - domain->notify_jiffies > HZ) {
+        domain->notify_jiffies = jiffies;
         if (domain->working_counter_changes == 1) {
             EC_INFO("Domain %i working counter change: %i\n", domain->index,
                     domain->response_count);