OS_PutMail, OS_GetMail question

This site uses cookies. By continuing to browse this site, you are agreeing to our Cookie Policy.

  • 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.
  • Hello,

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

    Regards,
    Til
    Please read the forum rules before posting.

    Keep in mind, this is *not* a support forum.
    Our engineers will try to answer your questions between their projects if possible but this can be delayed by longer periods of time.
    Should you be entitled to support you can contact us via our support system: segger.com/ticket/

    Or you can contact us via e-mail.