diff options
author | patacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3> | 2012-01-11 05:03:51 +0000 |
---|---|---|
committer | patacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3> | 2012-01-11 05:03:51 +0000 |
commit | 297039ce52f88f041ad2111bc04ec5559ac185af (patch) | |
tree | 158a05d5cc83449c29199620e872f4f6a4a2b9ab /nuttx/include | |
parent | dadcb8540ae070f09279d9dcebb7ed7b3ce55a6f (diff) | |
download | px4-nuttx-297039ce52f88f041ad2111bc04ec5559ac185af.tar.gz px4-nuttx-297039ce52f88f041ad2111bc04ec5559ac185af.tar.bz2 px4-nuttx-297039ce52f88f041ad2111bc04ec5559ac185af.zip |
Fix last change; the change was good but will prevent queuing multiple outgoing CAN packets
git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@4293 42af7a65-404d-4744-a932-0658087f49c3
Diffstat (limited to 'nuttx/include')
-rw-r--r-- | nuttx/include/nuttx/can.h | 24 |
1 files changed, 17 insertions, 7 deletions
diff --git a/nuttx/include/nuttx/can.h b/nuttx/include/nuttx/can.h index ba060cf5e..cd8016c81 100644 --- a/nuttx/include/nuttx/can.h +++ b/nuttx/include/nuttx/can.h @@ -140,13 +140,23 @@ struct can_msg_s /* This structure defines a CAN message FIFO. */ -struct can_fifo_s +struct can_rxfifo_s { - sem_t cf_sem; /* Counting semaphore */ - uint8_t cf_head; /* Index to the head [IN] index in the circular buffer */ - uint8_t cf_tail; /* Index to the tail [OUT] index in the circular buffer */ + sem_t rx_sem; /* Counting semaphore */ + uint8_t rx_head; /* Index to the head [IN] in the circular buffer */ + uint8_t rx_tail; /* Index to the tail [OUT] in the circular buffer */ /* Circular buffer of CAN messages */ - struct can_msg_s cf_buffer[CONFIG_CAN_FIFOSIZE]; + struct can_msg_s rx_buffer[CONFIG_CAN_FIFOSIZE]; +}; + +struct can_txfifo_s +{ + sem_t tx_sem; /* Counting semaphore */ + uint8_t tx_head; /* Index to the head [IN] in the circular buffer */ + uint8_t tx_queue; /* Index to next message to send */ + uint8_t tx_tail; /* Index to the tail [OUT] in the circular buffer */ + /* Circular buffer of CAN messages */ + struct can_msg_s tx_buffer[CONFIG_CAN_FIFOSIZE]; }; /* The following structure define the logic to handle one RTR message transaction */ @@ -235,8 +245,8 @@ struct can_dev_s uint8_t cd_ntxwaiters; /* Number of threads waiting to enqueue a message */ sem_t cd_closesem; /* Locks out new opens while close is in progress */ sem_t cd_recvsem; /* Used to wakeup user waiting for space in cd_recv.buffer */ - struct can_fifo_s cd_xmit; /* Describes transmit FIFO */ - struct can_fifo_s cd_recv; /* Describes receive FIFO */ + struct can_txfifo_s cd_xmit; /* Describes transmit FIFO */ + struct can_rxfifo_s cd_recv; /* Describes receive FIFO */ /* List of pending RTR requests */ struct can_rtrwait_s cd_rtr[CONFIG_CAN_NPENDINGRTR]; FAR const struct can_ops_s *cd_ops; /* Arch-specific operations */ |