diff options
| -rw-r--r-- | os/hal/include/hal_can.h | 36 | ||||
| -rw-r--r-- | os/hal/src/hal_can.c | 20 | 
2 files changed, 36 insertions, 20 deletions
diff --git a/os/hal/include/hal_can.h b/os/hal/include/hal_can.h index 7a94827fd..e91d8bd8b 100644 --- a/os/hal/include/hal_can.h +++ b/os/hal/include/hal_can.h @@ -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);
 diff --git a/os/hal/src/hal_can.c b/os/hal/src/hal_can.c index 08cf7cc5e..014d59c70 100644 --- a/os/hal/src/hal_can.c +++ b/os/hal/src/hal_can.c @@ -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));
  | 
