summaryrefslogtreecommitdiff
path: root/components/drivers/include
diff options
context:
space:
mode:
authorBernard Xiong <[email protected]>2015-07-07 14:15:06 +0800
committerBernard Xiong <[email protected]>2015-07-07 14:15:06 +0800
commitc41751672e71c358fb35531c5182a8487da92820 (patch)
tree877bd33cde4f33006d6424d3edea44e1fcbff9d1 /components/drivers/include
parent7de47e029b49df3c8e85b19f6c2152d617354d95 (diff)
parent7051f01f48268e55f30a5cdf939b1a378d72a209 (diff)
Merge pull request #515 from AubrCool/master
fix some can driver problems
Diffstat (limited to 'components/drivers/include')
-rw-r--r--components/drivers/include/drivers/can.h7
1 files changed, 5 insertions, 2 deletions
diff --git a/components/drivers/include/drivers/can.h b/components/drivers/include/drivers/can.h
index ec0f597f1c..9323443c15 100644
--- a/components/drivers/include/drivers/can.h
+++ b/components/drivers/include/drivers/can.h
@@ -139,6 +139,7 @@ struct rt_can_ops;
#define RT_CAN_CMD_SET_PRIV 0x16
#define RT_CAN_CMD_GET_STATUS 0x17
#define RT_CAN_CMD_SET_STATUS_IND 0x18
+#define RT_CAN_CMD_SET_BUS_HOOK 0x19
#define RT_DEVICE_CAN_INT_ERR 0x1000
@@ -195,7 +196,7 @@ typedef struct rt_can_status_ind_type
rt_canstatus_ind ind;
void *args;
} *rt_can_status_ind_type_t;
-
+typedef void (*rt_can_bus_hook)(struct rt_can_device *);
struct rt_can_device
{
struct rt_device parent;
@@ -211,7 +212,9 @@ struct rt_can_device
#ifdef RT_CAN_USING_HDR
struct rt_can_hdr *hdr;
#endif
-
+#ifdef RT_CAN_USING_BUS_HOOK
+ rt_can_bus_hook bus_hook;
+#endif /*RT_CAN_USING_BUS_HOOK*/
struct rt_mutex lock;
void *can_rx;
void *can_tx;