X-Git-Url: http://rtime.felk.cvut.cz/gitweb/lincan.git/blobdiff_plain/626f7414aee3ecd51ab35d093314919528f67b12..3a2bb63f0bb8de2aafb346b53b945c59b3f87a41:/lincan/src/sja1000p.c diff --git a/lincan/src/sja1000p.c b/lincan/src/sja1000p.c index 74dae55..3087db5 100644 --- a/lincan/src/sja1000p.c +++ b/lincan/src/sja1000p.c @@ -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" @@ -267,6 +267,9 @@ void sja1000p_read(struct chip_t *chip, struct msgobj_t *obj) { obj->rx_msg.data[i]=can_read_reg(chip,datastart+i); } + /* fill CAN message timestamp */ + can_filltimestamp(&obj->rx_msg.timestamp); + canque_filter_msg2edges(obj->qends, &obj->rx_msg); can_write_reg(chip, sjaCMR_RRB, SJACMR); @@ -559,6 +562,9 @@ void sja1000p_irq_write_handler(struct chip_t *chip, struct msgobj_t *obj) if(obj->tx_slot){ /* Do local transmitted message distribution if enabled */ if (processlocal){ + /* fill CAN message timestamp */ + can_filltimestamp(&obj->tx_slot->msg.timestamp); + obj->tx_slot->msg.flags |= MSG_LOCAL; canque_filter_msg2edges(obj->qends, &obj->tx_slot->msg); } @@ -738,3 +744,19 @@ int sja1000p_register(struct chipspecops_t *chipspecops) chipspecops->irq_handler=sja1000p_irq_handler; return 0; } + +/** + * sja1000p_fill_chipspecops - fills chip specific operations + * @chip: pointer to chip representation structure + * + * The function fills chip specific operations for sja1000 (PeliCAN) chip. + * + * Return Value: returns negative number in the case of fail + */ +int sja1000p_fill_chipspecops(struct chip_t *chip) +{ + chip->chip_type="sja1000p"; + chip->max_objects=1; + sja1000p_register(chip->chipspecops); + return 0; +}