]> 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 29a85a4b4fa86c099cc95bba623516e7dbeb788d..d114336c68a1cca8b7606ce5ce194b8b2c909026 100644 (file)
@@ -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