Thursday, May 23rd 2013, 2:33am UTC+2

You are not logged in.

  • Login
  • Register

Dear visitor, welcome to SEGGER Forum. If this is your first visit here, please read the Help. It explains how this page works. You must be registered before you can use all the page's features. Please use the registration form, to register here or read more information about the registration process. If you are already registered, please login here.

Mnksh

Beginner

Date of registration: Oct 27th 2011

Posts: 6

1

Monday, November 14th 2011, 1:13pm

OS_PutMail, OS_GetMail question

Hello,

If I write
void aStore (int i) {
OS_PutMail (&aMB, &i);
}
What is actually stored in the mailbox? Whether the value of i or the address of i? If the value of i is stored, then
int aRetrieve (void) {
int i;
char c = OS_GetMailTimed (&aMB, &i, 200);
if (c == 0)
return i;
}
Will this aRetrieve function will return me the value of i, that was actually stored in the mailbox? Please clarify.

Thanks.

SEGGER - Til

Super Moderator

Date of registration: Nov 14th 2007

Posts: 176

2

Monday, November 14th 2011, 5:40pm

Hello,

the value of i is stored.
Yes, your aRetrieve() function will return the value of i.

Regards,
Til