Renamed canReceive() and canTransmit() by adding the Timeout postfix for consistency. Old names still are available as macros and deprecated.

git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@10112 35acf78f-673a-0410-8e92-d51de3d6d3f4
This commit is contained in:
Giovanni Di Sirio 2017-02-24 12:28:49 +00:00
parent 3c720a3327
commit 552a01b5d9
2 changed files with 36 additions and 20 deletions

View File

@ -114,6 +114,22 @@ typedef enum {
* @brief Converts a mailbox index to a bit mask.
*/
#define CAN_MAILBOX_TO_MASK(mbx) (1U << ((mbx) - 1U))
/**
* @brief Legacy name for @p canTransmitTimeout().
*
* @deprecated
*/
#define canTransmit(canp, mailbox, ctfp, timeout) \
canTransmitTimeout(canp, mailbox, ctfp, timeout)
/**
* @brief Legacy name for @p canReceiveTimeout().
*
* @deprecated
*/
#define canReceive(canp, mailbox, crfp, timeout) \
canReceiveTimeout(canp, mailbox, crfp, timeout)
/** @} */
/*===========================================================================*/
@ -131,16 +147,16 @@ extern "C" {
canmbx_t mailbox,
const CANTxFrame *ctfp);
bool canTryReceiveI(CANDriver *canp,
canmbx_t mailbox,
CANRxFrame *crfp);
msg_t canTransmit(CANDriver *canp,
canmbx_t mailbox,
const CANTxFrame *ctfp,
systime_t timeout);
msg_t canReceive(CANDriver *canp,
canmbx_t mailbox,
CANRxFrame *crfp,
systime_t timeout);
canmbx_t mailbox,
CANRxFrame *crfp);
msg_t canTransmitTimeout(CANDriver *canp,
canmbx_t mailbox,
const CANTxFrame *ctfp,
systime_t timeout);
msg_t canReceiveTimeout(CANDriver *canp,
canmbx_t mailbox,
CANRxFrame *crfp,
systime_t timeout);
#if CAN_USE_SLEEP_MODE
void canSleep(CANDriver *canp);
void canWakeup(CANDriver *canp);

View File

@ -189,8 +189,8 @@ bool canTryTransmitI(CANDriver *canp,
* @iclass
*/
bool canTryReceiveI(CANDriver *canp,
canmbx_t mailbox,
CANRxFrame *crfp) {
canmbx_t mailbox,
CANRxFrame *crfp) {
osalDbgCheckClassI();
osalDbgCheck((canp != NULL) && (crfp != NULL) &&
@ -230,10 +230,10 @@ bool canTryReceiveI(CANDriver *canp,
*
* @api
*/
msg_t canTransmit(CANDriver *canp,
canmbx_t mailbox,
const CANTxFrame *ctfp,
systime_t timeout) {
msg_t canTransmitTimeout(CANDriver *canp,
canmbx_t mailbox,
const CANTxFrame *ctfp,
systime_t timeout) {
osalDbgCheck((canp != NULL) && (ctfp != NULL) &&
(mailbox <= (canmbx_t)CAN_TX_MAILBOXES));
@ -278,10 +278,10 @@ msg_t canTransmit(CANDriver *canp,
*
* @api
*/
msg_t canReceive(CANDriver *canp,
canmbx_t mailbox,
CANRxFrame *crfp,
systime_t timeout) {
msg_t canReceiveTimeout(CANDriver *canp,
canmbx_t mailbox,
CANRxFrame *crfp,
systime_t timeout) {
osalDbgCheck((canp != NULL) && (crfp != NULL) &&
(mailbox <= (canmbx_t)CAN_RX_MAILBOXES));