]> rtime.felk.cvut.cz Git - lincan.git/blobdiff - lincan/src/c_can_irq.c
CPC-PCI second chip IRQ corrected. Message timestamp code added.
[lincan.git] / lincan / src / c_can_irq.c
index bf98d750270342362ed35461526b693700f9f6fd..d114336c68a1cca8b7606ce5ce194b8b2c909026 100644 (file)
@@ -6,7 +6,7 @@
  * Rewritten for new CAN queues by Pavel Pisa - OCERA team member
  * email:pisa@cmp.felk.cvut.cz
  * This software is released under the GPL-License.
- * Version lincan-0.2  9 Jul 2003
+ * Version lincan-0.3  17 Jun 2004
  */
  
 #include "../include/can.h"
@@ -52,6 +52,9 @@ inline void c_can_irq_write_handler( struct chip_t *pchip, int idxobj)
        if(pmsgobj->tx_slot){
                /* Do local transmitted message distribution if enabled */
                if (processlocal){
+                       /* fill CAN message timestamp */
+                       can_filltimestamp(&pmsgobj->tx_slot->msg.timestamp);
+
                        pmsgobj->tx_slot->msg.flags |= MSG_LOCAL;
                        canque_filter_msg2edges(pmsgobj->qends, &pmsgobj->tx_slot->msg);
                }
@@ -147,6 +150,9 @@ inline void c_can_irq_read_handler( struct chip_t *pchip,
                for ( i=0; i < pmsgobj->rx_msg.length; i++ )
                        DEBUGMSG(" data[%d] = 0x%.2x\n", i, pmsgobj->rx_msg.data[i]);
                
+               /* fill CAN message timestamp */
+               can_filltimestamp(&pmsgobj->rx_msg.timestamp);
+
                canque_filter_msg2edges(pmsgobj->qends, &pmsgobj->rx_msg);
            
            #ifdef CAN_WITH_STATISTICS