aboutsummaryrefslogtreecommitdiffstats
path: root/os/hal/src
diff options
context:
space:
mode:
authorgdisirio <gdisirio@35acf78f-673a-0410-8e92-d51de3d6d3f4>2009-12-03 16:26:54 +0000
committergdisirio <gdisirio@35acf78f-673a-0410-8e92-d51de3d6d3f4>2009-12-03 16:26:54 +0000
commit980f0b675138676b1e977ca456dc73c3b2502596 (patch)
treebdb8b986847edcd572d080f522a68d03f7480625 /os/hal/src
parent20bf146ed82de1415d7a2de5dc60442c5405a850 (diff)
downloadChibiOS-980f0b675138676b1e977ca456dc73c3b2502596.tar.gz
ChibiOS-980f0b675138676b1e977ca456dc73c3b2502596.tar.bz2
ChibiOS-980f0b675138676b1e977ca456dc73c3b2502596.zip
git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@1373 35acf78f-673a-0410-8e92-d51de3d6d3f4
Diffstat (limited to 'os/hal/src')
-rw-r--r--os/hal/src/can.c24
1 files changed, 11 insertions, 13 deletions
diff --git a/os/hal/src/can.c b/os/hal/src/can.c
index e4258050e..3cd10126d 100644
--- a/os/hal/src/can.c
+++ b/os/hal/src/can.c
@@ -110,7 +110,7 @@ void canStop(CANDriver *canp) {
* @note Trying to transmit while in sleep mode simply enqueues the thread.
*
* @param[in] canp pointer to the @p CANDriver object
- * @param[in] cfp pointer to the CAN frame to be transmitted
+ * @param[in] ctfp pointer to the CAN frame to be transmitted
* @param[in] timeout the number of ticks before the operation timeouts,
* the following special values are allowed:
* - @a TIME_IMMEDIATE immediate timeout.
@@ -121,25 +121,24 @@ void canStop(CANDriver *canp) {
* @retval RDY_TIMEOUT operation not finished within the specified time.
* @retval RDY_RESET driver stopped while waiting.
*/
-msg_t canTransmit(CANDriver *canp, const CANFrame *cfp, systime_t timeout) {
- msg_t msg;
+msg_t canTransmit(CANDriver *canp, const CANTxFrame *ctfp, systime_t timeout) {
- chDbgCheck((canp != NULL) && (cfp != NULL), "canTransmit");
+ chDbgCheck((canp != NULL) && (ctfp != NULL), "canTransmit");
chSysLock();
chDbgAssert((canp->cd_state == CAN_READY) || (canp->cd_state == CAN_SLEEP),
"canTransmit(), #1",
"invalid state");
if ((canp->cd_state == CAN_SLEEP) || !can_lld_can_transmit(canp)) {
- msg = chSemWaitTimeoutS(&canp->cd_txsem, timeout);
+ msg_t msg = chSemWaitTimeoutS(&canp->cd_txsem, timeout);
if (msg != RDY_OK) {
chSysUnlock();
return msg;
}
}
- msg = can_lld_transmit(canp, cfp);
+ can_lld_transmit(canp, ctfp);
chSysUnlock();
- return msg;
+ return RDY_OK;
}
/**
@@ -162,25 +161,24 @@ msg_t canTransmit(CANDriver *canp, const CANFrame *cfp, systime_t timeout) {
* frame not immediately available if invoked using @p TIME_IMMEDIATE.
* @retval RDY_RESET driver stopped while waiting.
*/
-msg_t canReceive(CANDriver *canp, CANFrame *cfp, systime_t timeout) {
- msg_t msg;
+msg_t canReceive(CANDriver *canp, CANRxFrame *crfp, systime_t timeout) {
- chDbgCheck((canp != NULL) && (cfp != NULL), "canReceive");
+ chDbgCheck((canp != NULL) && (crfp != NULL), "canReceive");
chSysLock();
chDbgAssert((canp->cd_state == CAN_READY) || (canp->cd_state == CAN_SLEEP),
"canReceive(), #1",
"invalid state");
if ((canp->cd_state == CAN_SLEEP) || !can_lld_can_receive(canp)) {
- msg = chSemWaitTimeoutS(&canp->cd_rxsem, timeout);
+ msg_t msg = chSemWaitTimeoutS(&canp->cd_rxsem, timeout);
if (msg != RDY_OK) {
chSysUnlock();
return msg;
}
}
- msg = can_lld_receive(canp, cfp);
+ can_lld_receive(canp, crfp);
chSysUnlock();
- return msg;
+ return RDY_OK;
}
/**