Hello,
I would like to pass pointers from one task to other with mailboxes. Here is a super simple example but doesn't work.
typedef struct mailboxelement { uint8_t *buffPointer; }MBElement_t; void A_Task() { uint8_t Buffer[5] = {5,4,3,2,1}; MBElement_t mbe; mbe.buffPointer = Buffer; while(1) { Mailbox_post(A_Mailbox,&mbe,BIOS_WAIT_FOREVER); } } void B_Task() { MBElement_t elemet; uint8_t i; while(1) { Mailbox_pend(A_Mailbox,&elemet,BIOS_WAIT_FOREVER); for(i = 0;i<5;i++) { System_printf("%d, ",elemet.buffPointer[i]); } System_printf("\n"); System_flush(); } }
Could you show me an example how to pass pointers?
Thank you!