5 Replies Latest reply on May 10, 2018 6:01 AM by user_475952480

    CAN component bug: CAN_ReceiveMsg_Callback() has no parameter for the related mailbox?

    user_475952480

      The CAN receive call back for basic mailboxes doesn't tell the related mailbox.

      I can add my own code to fix the problem but wouldn't it make sense to add the parameter to the call back?

      Without the parameter rxMailbox you need to search for the mailbox again.

       

      /*******************************************************************************

      * FUNCTION NAME:   CAN_LS_ReceiveMsg

      ********************************************************************************

      *

      * Summary:

      *  This function is the entry point to Receive Message Interrupt for Basic

      *  mailboxes. Clears the Receive particular Message interrupt flag. Generated

      *  only if one of the Receive mailboxes is designed as Basic.

      *

      * Parameters:

      *  rxMailbox: The mailbox number that trig Receive Message Interrupt.

      *

      * Return:

      *  None.

      *

      * Reentrant:

      *  Depends on the Customer code.

      *

      *******************************************************************************/

      void CAN_LS_ReceiveMsg(uint8 rxMailbox)

      {

          #if (CY_PSOC3 || CY_PSOC5)

              if ((CAN_LS_RX[rxMailbox].rxcmd.byte[0u] & CAN_LS_RX_ACK_MSG) != 0u)

          #else  /* CY_PSOC4 */

              if ((CAN_LS_RX_CMD_REG(rxMailbox) & CAN_LS_RX_ACK_MSG) != 0u)

          #endif /* CY_PSOC3 || CY_PSOC5 */

              {

                  /* `#START MESSAGE_BASIC_RECEIVED` */

                     

                  /* `#END` */

       

       

                  #ifdef CAN_LS_RECEIVE_MSG_CALLBACK

                      CAN_LS_ReceiveMsg_Callback();        // here the parameter "rxMailbox" is missing

                  #endif /* CAN_LS_RECEIVE_MSG_CALLBACK */

       

       

                  #if (CY_PSOC3 || CY_PSOC5)

                      CAN_LS_RX[rxMailbox].rxcmd.byte[0u] |= CAN_LS_RX_ACK_MSG;

                  #else  /* CY_PSOC4 */

                      CAN_LS_RX_CMD_REG(rxMailbox) |= CAN_LS_RX_ACK_MSG;

                  #endif /* CY_PSOC3 || CY_PSOC5 */

              }

      }