MailBox: Different between chMBPostAheadS and chMBPostAheadI

ChibiOS public support forum for all topics not covered by a specific support forum.

Moderators: RoccoMarco, lbednarz, tfAteba

Post Reply
oattao
Posts: 9
Joined: Mon Dec 03, 2012 5:04 am

MailBox: Different between chMBPostAheadS and chMBPostAheadI

Post by oattao »

Hi all. I have a problem with MailBox. I don't know what is the different between two functions of MaiBox:

Code: Select all

chMBPostAheadS (Mailbox *mbp, msg_t msg, systime_t time)
    //Posts an high priority message into a mailbox.

Code: Select all

chMBPostAheadI (Mailbox *mbp, msg_t msg)
    //Posts an high priority message into a mailbox.


Please help me. Thanks in advance.
User avatar
Giovanni
Site Admin
Posts: 14892
Joined: Wed May 27, 2009 8:48 am
Has thanked: 1202 times
Been thanked: 996 times

Re: MailBox: Different between chMBPostAheadS and chMBPostAh

Post by Giovanni »

Hi,

Read the "Kernel Concepts" in the kernel manual, the difference is all in the final letter:

I) Is meant to be used from ISRs. within a lock, and does not reschedule internally.
S) Is meant to be used from a thread. within a lock, and reschedules internally.

Note that the "I" version does not wait if the mailbox is full, it is not possible to wait from within an ISR.

Giovanni
Post Reply