This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

TI-RTOS-MCU: Arm-based microcontrollers forum

Part Number: TI-RTOS-MCU

Hello,

I have a task that I'm using for some communication scheduling, and I was wondering if it was possible to do a Mailbox_post() and a Mailbox_pend() in the same task for an initialization. I was trying something like the code listed below and I've been getting errors in the data listed in the Mailbox pointer:

typedef struct 
{
	int id;
	char firstname[25];
	char lastname[25];
} MY_MAILBOX_STRUCT;

/*---------------------------------------------------------------------------*/
/** @brief A Task for Scheduling Messages
 * This task pends on messages being posted into it's mailbox
 *//*------------------------------------------------------------------------*/
void someTask(void)
{
	void* msgPtr;
	MY_MAILBOX_STRUCT *MbxPtr;
	
    MY_MAILBOX_STRUCT mbx = 
	{
		10, "HELLO", "WORLD"
	}
		
    Mailbox_post(someMailbox, (void*)&mbx, BIOS_NO_WAIT);

    while(true)
    {
		Mailbox_pend(i2cManagerMailbox, msgPtr, BIOS_WAIT_FOREVER);
		newMbxPtr = (MY_MAILBOX_STRUCT*)msgPtr;
		
		//Do whatever work with the newMbxPtr I have
    }
}

Thank you for any help!