]> rtime.felk.cvut.cz Git - lincan.git/blobdiff - lincan/src/virtual.c
CPC-PCI second chip IRQ corrected. Message timestamp code added.
[lincan.git] / lincan / src / virtual.c
index 05a12f9d5026e69ca65f12702fcb4c9484a1f719..b7e5f37a55c091628bff07d0d74139636ae1284f 100644 (file)
@@ -3,7 +3,7 @@
  * Written for new CAN driver version 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"
@@ -320,6 +320,9 @@ void virtual_do_tx_timeout(unsigned long data)
        struct msgobj_t *obj=(struct msgobj_t *)data;
        
        if(obj->tx_slot) {
+               /* fill CAN message timestamp */
+               can_filltimestamp(&obj->tx_slot->msg.timestamp);
+
                /* Deliver message to edges */
                canque_filter_msg2edges(obj->qends, &obj->tx_slot->msg);
                /* Free transmitted slot */
@@ -359,6 +362,9 @@ int virtual_wakeup_tx(struct chip_t *chip, struct msgobj_t *obj)
                /* Ensure delivery of all ready slots */
                while((cmd=canque_test_outslot(obj->qends, &qedge, &slot)) >= 0){
                        if(cmd==0) {
+                               /* fill CAN message timestamp */
+                               can_filltimestamp(&slot->msg.timestamp);
+                               
                                canque_filter_msg2edges(obj->qends, &slot->msg);
                                DEBUGMSG("virtual: direct delivery\n");
                        }