* 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"
id = can_read_reg(chip, SJARXID0) | (can_read_reg(chip, SJARXID1)<<8);
obj->rx_msg.length = len = id & 0x0f;
obj->rx_msg.flags = id&sjaID0_RTR ? MSG_RTR : 0;
- #ifdef CAN_MSG_VERSION_2
- obj->rx_msg.timestamp.tv_sec = 0;
- obj->rx_msg.timestamp.tv_usec = 0;
- #else /* CAN_MSG_VERSION_2 */
- obj->rx_msg.timestamp = 0;
- #endif /* CAN_MSG_VERSION_2 */
obj->rx_msg.cob = 0;
obj->rx_msg.id = id>>5;
can_write_reg(chip, sjaCMR_RRB, SJACMR);
+ /* fill CAN message timestamp */
+ can_filltimestamp(&obj->rx_msg.timestamp);
+
canque_filter_msg2edges(obj->qends, &obj->rx_msg);
} while(can_read_reg(chip, SJASR) & sjaSR_RBS);
}
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);
}
chipspecops->irq_handler = sja1000_irq_handler;
return 0;
}
+
+int sja1000_fill_chipspecops(struct chip_t *chip)
+{
+ chip->chip_type="sja1000";
+ chip->max_objects=1;
+ sja1000_register(chip->chipspecops);
+ return 0;
+}
+