- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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 */
}
}
- Labels:
-
PSoC Creator Software
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Is there an other way to report bugs in components?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
You can read CSR_BUF_SR register to check which RxMailbox had received data.
You can refer to registers TRM. We have created an internal enhancement request, to pass the rxMailbox parameter to Callback function.
Thanks,
Shanmathi
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
To read CSR_BUF_SR might not return the same buffer.
Thank you for creating the enhancement request.
BR
Marc
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
CSR_BUF_SR register could be used to retrieve the RxMailbox number.
You can refer to CAN_Full code example (ISR_CAN) for the usage of CSR_BUF_SR register.
Thanks,
Shanmathi
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Problems when using the Callback CAN_ReceiveMsg_Callback() and again check for CSR_BUF_SR:
- As you can still receive CAN messages while CAN_MsgRXIsr() is managing the current messages register CSR_BUF_SR can change.
- While CAN_MsgRXIsr() is managing the buffers, it will not clear CSR_BUF_SR. If several buffers are "active" a second search will not necessarily find the same mailbox like the callback would indicate in rxMailbox (worse if combined with 1.).
- It is much easier to add a manual callback in CAN_ReceiveMsg(uint8 rxMailbox)
For sure there is a solution but would like to see it work like it's meant to work.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
How about the release date for the improvement?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Sorry to insist, but how about this fix?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Friendly reminder 🙂